• 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
Senator
Premium User
Joined
Nov 17, 2010
Messages
6,756
Solutions
578
Reaction score
5,305
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.
 
Solution
So we couldn't resolve this issue on discord but we did it via a workaround -> we set the worldIp in the otclient for it always to be 127.0.0.1 lol
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:
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
 
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.
 
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?

 
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:
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:
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.
 
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.
 
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
 
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
 
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
 
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.
 
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
 
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
 
Back
Top