• 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,787
Solutions
581
Reaction score
5,354
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
This was my original configuration.
I was able to enter the server with the client, however nobody else could.



Then try that:​


Server
As you are in same computer of the mentioned IP, try put in config.lua the following: ip = "99.248.100.70"

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.
 
Check the use the following DNS server addresses:
in the prefered DNS server write 127.0.0.1
in the alternate write 8.8.8.8
save it then again:

ipconfig /flushdns
ping 99.248.100.70
and post the result of ping
 
Check the use the following DNS server addresses:
in the prefered DNS server write 127.0.0.1
in the alternate write 8.8.8.8
save it then again:

ipconfig /flushdns
ping 99.248.100.70
and post the result of ping
ipv4newsettings.png

Then try that:​


Server
As you are in same computer of the mentioned IP, try put in config.lua the following: ip = "99.248.100.70"

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.

Right, this is what we're trying to solve.

Server
config.lua -> ip = "127.0.0.1"

OTClient
Xikini -> 127.0.0.1 -> CAN connect.
Friends -> 99.248.100.70 -> CANNOT connect

--

Server
config.lua -> ip = "99.248.100.70"

OTClient
Xikini -> 127.0.0.1 -> CANNOT connect.
Friends -> 99.248.100.70 -> CAN connect
 
Okay, maybe there is something wrong with the hosts file?
1. Right click hosts file
2. Properties
3. Go to security tab
4. Post the screenshot of this window
 
Oh it seems you've added your user to the security page of this file, click on Xikini (XIKINI-DESKTOP\Xikini) and then post a screenshot of it.
 

What about the website?

1. Can you access your, for example, your phpMyAdmin by the link localhost/phpmyadmin?

2. Can your friends access 99.248.100.70?

3. Do you use an Antivirus?

---

Also, try change this:

1611823574040.png

As the following:

Code:
Preferred DNS server: 8.8.8.8
Alternate DNS server: 8.8.4.4

Both are Google DNS servers.

---

Try also disabling Windows Defender (just for a try):

1611824084414.png

And disabling Real-time protection:

1611824175908.png

---

Then try always make these tests:

1611824352888.png
 
Last edited:
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
 
Solution
Solution is posted in this Comment. (read below)
What about the website?

1. Can you access your, for example, your phpMyAdmin by the link localhost/phpmyadmin?

2. Can your friends access 99.248.100.70?

3. Do you use an Antivirus?

---

Also, try change this:

View attachment 54288

As the following:

Code:
Preferred DNS server: 8.8.8.8
Alternate DNS server: 8.8.4.4

Both are Google DNS servers.

---

Try also disabling Windows Defender (just for a try):

View attachment 54289

And disabling Real-time protection:

View attachment 54290

---

Then try always make these tests:

View attachment 54291
Tried all of this with a @Azakelis .
Has the same result as above.

However, there is a weird 'bug' we found.

If I login to the game server while config.lua is set to 127.0.0.1
Then, close server, change to global-ip... now I can login with 127.0.0.1

So.. the dns cache of the client is remaining somehow.. allowing me to login.. as long as I don't close the client.

--
So after figuring that out, @Azakelis did a work-around in otclient-master\modules\gamelib/protocollogin.lua

Which forced my client to always use 127.0.0.1 to login.

For anyone who needs to change it in the future, here's the difference checker.
Saved diff laX5cRI3 - Diff Checker

---
So in the end, there is an issue somewhere on my network, but still have no idea what it is.

If anyone has more idea's to try, let me know so I can test them.
(so maybe we can fully resolve this issue, instead of having the work-around. xP)

--------------------
Secondary Edit.

After a lot more digging around, this appears to be a NAT loopback / NAT hairpin issue with my router.

Basically, if your router doesn't support NAT loopback, you're going to have the same issue as me.

The 3 solutions you have is..

--> Get a router that accepts NAT loopbacks
--> Contact ISP and hope the gods smile on you, and they can change some setting to help you.
--> Use the work-around from above, that forces your OTClient to connect to 127.0.0.1
Saved diff laX5cRI3 - Diff Checker
------> This means the HOST (you) will have a different client then anyone else who wants to connect to you.

So yeah.. find this file
Code:
otclient-master\modules\gamelib\protocollogin.lua
inside of that file, find this function
Code:
function ProtocolLogin:parseCharacterList(msg)
Inside that function, complete these steps..

Find this line
Code:
world.worldIp = msg:getString()
paste this underneath
Code:
world.worldIp = "127.0.0.1"
Find this line
Code:
character.worldIp = worlds[worldId].worldIp
paste this underneath
Code:
character.worldIp = "127.0.0.1"
Find this line
Code:
character.worldIp = iptostring(msg:getU32())
paste this underneath
Code:
character.worldIp = "127.0.0.1"
 
Last edited:
For those wondering in the future what the issue was:
As you can see there the resolution order is:
1. The client checks to see if the name queried is its own.
2. The client then searches a local Hosts file, a list of IP address and names stored on the local computer.
So it doesn't consider the hosts file in this case because it is it's own address and it just stops on the step one.

The network change you need to do in this case is doing a NAT Loopback Hairpinning - Wikipedia (https://en.wikipedia.org/wiki/Hairpinning)
You need to know if your router is even able to do it, try googling: your router brand and model + NAT loopback, there should be some info how to do it exactly
If your router doesnt support it then you might try to contact your ISP about it.
If everything else fails just use the otclient workaround provided here.
 
There are two issues that prevent people from accessing their own server either via localhost or their own globalIP / created domain.
One is that you haven't forwarded your ports 7171 and 7172 for both tcp and udp. If you have done this, and you're sure they're opened (you've used port checker) then the issue is most likely that your router doesn't offer nat loopback. Routers that don't offer nat loopback as a security feature generally don't have a setting in their admin panel to enable it. I would suggest you download microsoft's nat loopback, you can do this by right clicking "My Computer" and clicking "Manage". Once you've done that you want to click Device Manager and you'll see a list come up. On the top of that list is your computer name (its the one above audio inputs and outputs) right click on that and click Install Legacy Hardware. Click on next and push install MANUALLY. Another list will pop up, scroll down to network adapters, click that and click next. On the left panel you want to select Microsoft and on the right side scroll down until you find Microsofts KM-Test Loopback and install that. Once that is finished, open your networks and right click on the newly created "Ethernet 2" and click on properties. Scroll down until you find the IP4V setting and open that. You want to switch it from automatic to manual and for the IP input your GLOBAL IP from www.whatismyip.com. The next spot should fill in automatically (255.255.255.0) and leave the lost slot empty. For your DNS manually change that to 192.168.1.1 and select OK and then you can close out of everything, reset your server and log in with your global / domain rerouted IP :)
@Xikini I know you've solved your issue, but could you see if this also works? If it works can you let me know here please, i'm trying to give this solution some light.

It's absolutely mad that issues like this still persist despite there being literally 100s of reports of it in these forums that get absolutely no attention and the few that get any attention they say "you set something up wrong" and no more help is offered, yet from following up with most of these reports where possible, that is not the case and there is an underlying issue.

I spent a good few hours troubleshooting with otland guys a few years ago because i had this exact issue and had no resolution, no one could figure it out and we did some crazy shit. and it's literally just the most simplest thing for many users, nat loopback is disabled on our routers so we just need to turn it on in windows. Checking otland posts this issue seems to be incredibly common and i don't know how many of these issues are because of loopback.

This significantly reduces the amount of users willing to dabble in ot.
 
Back
Top