Can you set the ip address for the server to listen on? [Solved not possible]

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
stoothman
Posts: 2
Joined: February 14th, 2023, 6:19 pm

Can you set the ip address for the server to listen on? [Solved not possible]

Post by stoothman »

I have looked through the documentation and the man pages, but cannot seem to find the answer to this.

Is it possible to set the ip address that the Wesnoth daemon listens on either as a command line option or in the config file. Most servers have an option to allow this to be set, like Minecraft or Apache. The reason I ask is, I have multiple network cards on my Linux server and want to force the traffic out on a particular one rather than all of them.

If there is not a way to do so, then I will open an issue in Github for this.
Last edited by stoothman on February 14th, 2023, 10:04 pm, edited 1 time in total.
stoothman
Posts: 2
Joined: February 14th, 2023, 6:19 pm

Re: Can you set the ip address for the server to listen on?

Post by stoothman »

Solved:
I found the answer after digging through the code.

These two constructors if I understand it correctly use "in6addr_any" and "INADDR_ANY", respectively. So there is not the ability to specify a particular ip address to listen on. So I will open up a Github issue asking for that functionality to be added.
./server/common/server_base.cpp:84: boost::asio::ip::tcp::endpoint endpoint_v6(boost::asio::ip::tcp::v6(), port_);
./server/common/server_base.cpp:87: boost::asio::ip::tcp::endpoint endpoint_v4(boost::asio::ip::tcp::v4(), port_);
Soliton
Site Administrator
Posts: 1689
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Re: Can you set the ip address for the server to listen on? [Solved not possible]

Post by Soliton »

Note that on Linux you can also accomplish this using a network namespace.
"If gameplay requires it, they can be made to live on Venus." -- scott
Post Reply