• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Unable to connect to own server, but others can.

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,612
Solutions
395
Reaction score
3,729
When using my ipv4 / localhost / 127.0.0.1 in config.lua, I can join into my server no problem.
canloginwithoutglobalip.png

Problem starts when using my global ip in config.lua, which allows other people can connect, but I cannot.

I've read just about every thread, and cannot find a solution.

Below is my setup / testing with global-ip in config.lua

Using 127.0.0.1
-> Shows character list
-> connecting to game server...
-> timeout, connection error 10060
127.0.0.1.png

Using 192.168.0.13
-> Shows character list
-> connecting to game server...
-> timeout, connection error 10060
192.168.0.13.png

Using Global Ip 99.248.100.70
-> Connecting to login server...
-> timeout, connection error 10060
99.248.100.70.png

What else can I try?

I've put my globalip into config.lua
configip.png
I've confirmed my ipv4 address.
ipv4.png
I've Port Forwarded.
portforward.png
I've confirmed that the ports work. Open Port Check Tool -- Verify Port Forwarding on Your Router (canyouseeme.org)
portforward2.png
I've added both uniserver and forgottenserver into firewall
firewall.png
I've also tried adding my information into windows hosts file, but it changed nothing.
hostsfile.png

For kicks and giggles, I turned off my anti-virus and firewall completely, and was also unable to login.

I should probably also mention that the website can be accessed by anyone using the global-ip.
I can never access it with the global-ip, only with 127.0.0.1 - even after editing the hosts file.

--
But yeah, that's where I currently stand.. and not sure what to do to allow myself & others to join.
 

Azakelis

Advanced OT User
Joined
Feb 17, 2014
Messages
158
Solutions
15
Reaction score
224
Weird issue indeed, try disabling IPv6.

#edit
Enable telnet (you can do that in cmd with command: dism /online /Enable-Feature /FeatureName:TelnetClient )
And post the screenshots of results here.
Usage:
in cmd write:
telnet ip port
for ip use 127.0.0.1, your local one (192.x) and global one, for port use 7171 and 7172, check all of the combinations.
 
Last edited:
OP
OP
Xikini

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,612
Solutions
395
Reaction score
3,729
Weird issue indeed, try disabling IPv6.
ipv4 only.png
ipv4only.png

Unfortunately no luck when doing this.
Same as before.

127.0.0.1 - character list - error to game server
192.168.0.13 - character list - error to game server
99.248.100.70 - error to character list
 

Azakelis

Advanced OT User
Joined
Feb 17, 2014
Messages
158
Solutions
15
Reaction score
224
Try the telnet from my edit,
with bindOnlyGlobalAddress = false in config.lua it should bind it to every ipv4 address but check the bindOnlyGlobalAddress = true option if it changes anything, my reasoning is that the ip value you put in your config is basically ignored when bindOnlyGlobalAddress is set to false.
 
OP
OP
Xikini

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,612
Solutions
395
Reaction score
3,729
Try the telnet from my edit,
with bindOnlyGlobalAddress = false in config.lua it should bind it to every ipv4 address but check the bindOnlyGlobalAddress = true option if it changes anything, my reasoning is that the ip value you put in your config is basically ignored when bindOnlyGlobalAddress is set to false.
line 175?
boost::asio::ip::address(boost::asio::ip::address_v4(INADDR_ANY)), serverPort)));

In my server.cpp, it has this exact line.
I must not be seeing the edit?

 

Azakelis

Advanced OT User
Joined
Feb 17, 2014
Messages
158
Solutions
15
Reaction score
224
There isn't any edit that's why you aren't seeing any difference.
I was just pointing out the stuff I saw.
#edit
Also I would remove this line from hosts:
192.168.0.13 99.248..100.70
it redirects 99.248.100.70 straight to 192.168.0.13 not exactly helping us with testing it.
 
Last edited:
OP
OP
Xikini

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,612
Solutions
395
Reaction score
3,729
There isn't any edit that's why you aren't seeing any difference.
I was just pointing out the stuff I saw.
#edit
Also I would remove this line from hosts:
192.168.0.13 99.248..100.70
it redirects 99.248.100.70 straight to 192.168.0.13 not exactly helping us with testing it.
Sorry, didn't realize it was in your other reply.

(and yes, I removed the edit from hosts file, after confirming it didn't do anything.)

Alright, so enabled telnet.. and then tried every combination.

telnet 127.0.0.1 80
telnet 127.0.0.1 7171
telnet 127.0.0.1 7172

(changing from ipv6 to ipv4 changed my internal ip is 12 instead of 13)
telnet 192.168.0.12 80
telnet 192.168.0.12 7171
telnet 192.168.0.12 7172

telnet 99.248.100.70 80
telnet 99.248.100.70 7171
telnet 99.248.100.70 7172

--
Every combination with global-ip gave me an error
telnet.png

However, every one of the 127.0.0.1 or 192.168.0.12 brought me to this blank page (but with a title difference)
telnet1.png
 
Last edited:

Azakelis

Advanced OT User
Joined
Feb 17, 2014
Messages
158
Solutions
15
Reaction score
224
Ok I've analyzed some stuff and let me explain your issue:
As you can see there otland/forgottenserver (https://github.com/otland/forgottenserver/blob/master/src/protocollogin.cpp#L102)
after you connect to login server with any ip (127.0.0.1, 192.x, global one) it sends you back whatever ip you set in the config. If you are for some reason unable to connect to this ip (global at the moment) then you won't be able to login to the game.
So to fix this issue we need to let you use your global ip locally which for some reason doesn't work lmao.
I guess the fastest fix I can think of would be adding this to hosts:
127.0.0.1 99.248.100.70

So let me shorten it a bit if you will be able to use ip: 99.248.100.70 for your website then you will be able to use it for logging in to the game, so we can instead be checking if it works on the website lmao.
 
OP
OP
Xikini

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,612
Solutions
395
Reaction score
3,729
Ok I've analyzed some stuff and let me explain your issue:
As you can see there otland/forgottenserver (https://github.com/otland/forgottenserver/blob/master/src/protocollogin.cpp#L102)
after you connect to login server with any ip (127.0.0.1, 192.x, global one) it sends you back whatever ip you set in the config. If you are for some reason unable to connect to this ip (global at the moment) then you won't be able to login to the game.
So to fix this issue we need to let you use your global ip locally which for some reason doesn't work lmao.
I guess the fastest fix I can think of would be adding this to hosts:
127.0.0.1 99.248.100.70

So let me shorten it a bit if you will be able to use ip: 99.248.100.70 for your website then you will be able to use it for logging in to the game, so we can instead be checking if it works on the website lmao.
I'll stop with the screenshots. xD

I'm editing the hosts file from C:\Windows\System32\drivers\etc

Putting it
127.0.0.1 99.248.100.70

Then attempting to load the website

99.248.100.70
gives me
Code:
Hmmm… can't reach this page
99.248.100.70 took too long to respond

ERR_CONNECTION_TIMED_OUT

while 127.0.0.1 still let's me connect normally.

--edit
Everytime I change something I am stopping apache and mysql, and restarting them.
So it should be a fresh load each time.
 
OP
OP
Xikini

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,612
Solutions
395
Reaction score
3,729
Are you trying to log in the same computer of IP 99.248.100.70?
Correct.
I'm hosting off my personal computer, and trying to connect to the server using that same computer, whilst using the global-ip in config.lua

Post screenshot of these two commands in cmd:
ping 99.248.100.70
tracert 99.248.100.70
I did an additional test in hosts file

Code:
127.0.0.1 www.lakjhsdlkjasbdlkjahlskjdhaksjd.com
and that 'website' allows me to connect to the website.

However in the OT client, it only let's me get to the character select screen, and errors when entering the game. (same as if I used 127.0.0.1)

--
Tried with and without hosts file changes. Both got the same result.
pingtrace.png
 

Azakelis

Advanced OT User
Joined
Feb 17, 2014
Messages
158
Solutions
15
Reaction score
224
It seems that either you are editing hosts file incorrectly or the windows doesn't refresh it.
So for it to be foolproof you should:
1. In menu start search for notepad
2. Right click it and open it as administrator
3. In top menu File>Open
4. Go to C:\Windows\System32\drivers\etc (assuming your windows is on C:\)
5. Change the extensions from .txt to any (.)
6. Choose your hosts file
7. Add at the end of it: 127.0.0.1 99.248.100.70
8. Restart system
9. Try again
 
OP
OP
Xikini

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,612
Solutions
395
Reaction score
3,729
It seems that either you are editing hosts file incorrectly or the windows doesn't refresh it.
So for it to be foolproof you should:
1. In menu start search for notepad
2. Right click it and open it as administrator
3. In top menu File>Open
4. Go to C:\Windows\System32\drivers\etc (assuming your windows is on C:\)
5. Change the extensions from .txt to any (.)
6. Choose your hosts file
7. Add at the end of it: 127.0.0.1 99.248.100.70
8. Restart system
9. Try again
Alright. Did above.

Edited hosts file as you explained.
Restarted computer.

After restarting computer, confirmed that ipv4 and global-ip had not changed.

Started up uniserver
-> started apache
-> started MySQL

Attempted to connect to website with 99.248.100.70
-> timed out

Attempted to connect to server with client
-> could not load character page.

-> took screenshot of hosts file
updatedhostsfile.png
 

River KA

Veteran OT User
Joined
Feb 1, 2010
Messages
477
Solutions
21
Reaction score
274
Server
As you are in same computer of the mentioned IP, try put in config.lua the following: ip = "127.0.0.1"

OTClient
Then, for your friends, they should log in using your IP 99.248.100.70.
And about you, you should log in using IP 127.0.0.1.
 

Azakelis

Advanced OT User
Joined
Feb 17, 2014
Messages
158
Solutions
15
Reaction score
224
Looks like hosts file is ignored lol.
1. Menu start type: ncpa.cpl
2. Open it
3. Right click on your on your connection (probably called ethernet/wifi depending how you connect) and select properties
4. Select the IPv4 from the list and go to the settings
5. Screenshot the window that opened with the settings
 
OP
OP
Xikini

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,612
Solutions
395
Reaction score
3,729
Server
As you are in same computer of the mentioned IP, try put in config.lua the following: ip = "127.0.0.1"

OTClient
Then, for your friends, they should log in using your IP 99.248.100.70.
And about you, you should log in using IP 127.0.0.1.
This was my original configuration.
I was able to enter the server with the client, however nobody else could.

Looks like hosts file is ignored lol.
1. Menu start type: ncpa.cpl
2. Open it
3. Right click on your on your connection (probably called ethernet/wifi depending how you connect) and select properties
4. Select the IPv4 from the list and go to the settings
5. Screenshot the window that opened with the settings
networkconnections.png
 
Top