Skip to content
This repository has been archived by the owner on Mar 14, 2020. It is now read-only.

(FreeBSD) IP parameter in config and worlds sql table is ignored #2

Closed
stolendata opened this issue Aug 3, 2012 · 4 comments
Closed
Labels

Comments

@stolendata
Copy link

Regardless of what you set the IP parameter in config.lua to, and regardless of what you set it to in the worlds sql table, OTServ changes the value in the sql table to 16777343 (0x100007F) when starting up, and then ignores the IPs supplied and instead chooses to do a reverse lookup on... something... and then tries binding to whatever the DNS responds with.

I'm curious, which IP setting does it even try to use? The one in the config or the one in the worlds table?

(ps. despite the project being CMake'd there are a few things that I had to fix in order for it to configure and build properly under FreeBSD 8.3 / GCC 4.2.2 - I'll get back with the details in another issue ticket when I have time, in hopes that you will adapt so that people can host on more platforms.)

@hampusborgos
Copy link
Member

The worlds table IP is set by the server on startup to the value in config.lua. If the value in config.lua is "auto", it will do a reverse ip lookup and use that value.

The words table is intended to be read by login servers only to get the location & ports of different gameservers.

@stolendata
Copy link
Author

Just in case it wasn't obvious... 0x100007F which the server always binds to regardless of what you specify in config.lua is the little-endian host byte order of localhost: 1.0.0.127.

I'm curious about the idea behind updating the IP in the worlds table each time the server starts up. If the IP the server binds to is gathered from config.lua anyway, what is the rationale behind storing it and keeping it updated in the worlds table as well? Future plans of multi-homed hosting?

@stolendata
Copy link
Author

Found the issue after poking around in the source code: configmanager.cpp looks for parameter "server_ip", while the stock config.lua defines the parameter as just "ip".

@ghost
Copy link

ghost commented Aug 12, 2012

Setting the property as "server_ip" solves the issue?

ghost pushed a commit that referenced this issue Aug 12, 2012
The configuration manager looks up for the "server_ip" property, instead the "ip" one declared on the config.lua.dist file. Fixes #2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants