Page 1 of 1

Local Host Connecting

Posted: Wed Jan 24, 2018 6:00 pm
by happyhad
I am using Windows and am developing a map.
With 2.4.12 client I cannot connect to localhost.
With 2.4.10 client I have no problem connecting.

Is there a problem with 2.4.12?

I also tried doing this just by using the client to start a server and then connect to it, with the same results.

Re: Local Host Connecting

Posted: Wed Jan 24, 2018 7:09 pm
by Zehra
Hi happyhad,

I made some testing and it seems that starting a server from the game client fails in 2.4.12
I also tested BZFS with default, random and -world options and they did not have any issues.(Server not started from game client.)

Something I've found useful over time is to use a script to start a server up.

Here's a Batch script which works on Windows, but you will need to edit it to suit your map.

Code: Select all

ECHO Finding BZFlag
cd C:\Program Files\[bzflag version]
ECHO Testing
ECHO If everything works properly we'll likely see BZFS give a message
bzfs.exe -password abc -world "C:\Users\[username]\Desktop\mapname.bzw"
Change '[username]' with the username you use on Windows.
'mapname' will be needed to be changed to the map name you are using as well.


Re: Local Host Connecting

Posted: Wed Jan 24, 2018 8:00 pm
by happyhad
Thank you for you response. But my problem is not in the starting of the server.
I can start it with the .12 client or I can do it with a bat file.

I cannot connect to the locally running server with a .12 client (localhost).
I take the same batch file and put it on a server and can connect to the server.

So to me it looks like the bug is .12 cannot connect to localhost.

Sorry if I wasn't clear.


Re: Local Host Connecting

Posted: Thu Jan 25, 2018 4:39 am
by blast
I'm not seeing any differing behavior between 2.4.10 and 2.4.12. We use c-ares for DNS resolution. On Windows 7, at least, and probably anything since, the 'localhost' hostname does not appear in the Windows hosts file and is instead handled special inside Window's name resolution code. Because c-ares does it's own DNS lookups (and uses the hosts file), localhost will only work if your DNS servers specifically resolve it.

The quick fix is to just use instead of localhost.