Cannot set versions_accepted in wesnothd

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
wombit
Posts: 3
Joined: March 28th, 2020, 6:10 pm

Cannot set versions_accepted in wesnothd

Post by wombit »

I am trying to have a server hosted (on debian linux) which accepts several versions of wesnoth, but it seems as if the servers does not care about the content of its config file. The setup is as follows:

The init script of the server (which came with the package)

Code: Select all

/etc/init.d/wesnoth-1.14-server
seems to read in a "defaults" file

Code: Select all

---snip---
NAME=wesnoth-1.14-server
DESC="Wesnoth server (1.14)"
PIDFILE=/var/run/$NAME.pid
test -x $DAEMON || exit 5
. /lib/lsb/init-functions
# Include wesnothd defaults if available
if [ -f /etc/default/$NAME ] ; then
        . /etc/default/$NAME
fi
---snip---
with name

Code: Select all

/etc/default/wesnoth-1.14-server
the content of which I have modified by uncommenting the last line,

Code: Select all

# sourced by /etc/init.d/wesnoth-1.14-server
# installed at /etc/default/wesnoth-1.14-server
# This is a POSIX shell fragment
# Additional options that are passed to the Daemon.
# You will have to create the config file if you want to change the
# default options that the server runs with.
# See wesnothd-1.14(6) for the syntax of the configuration file.
DAEMON_OPTS="-c /etc/wesnothd-1.14.cfg"
in order to hopefully read the actual user's configuration file

Code: Select all

/etc/wesnothd-1.14.cfg
For the content of this file I have tried a multitude of single line entries of type

Code: Select all

versions_accepted="*"
versions_accepted="1.14.3,1.15.3"
versions_accepted="1.14.3","1.15.3"
versions_accepted="1.14.*","1.15.*"
versions_accepted="1.14.*,1.15.*,test"
(Certainly, only one of them at a time.)
I have no problem in starting/stopping/checking the service with

Code: Select all

sudo systemctl start|stop|status wesnoth-1.14-server.service
Also I can log onto the server on the machine where its been started.

However none of these actions leads to the server accepting any other version then its compiled-in default, which seems to be 1.14.3,test.
Logging in from a machine with a different version of wesnoth I'm begin told that the games and the servers version are different and the servers version is '1.14.3,test'.

What am I doing wrong?
Thx. for your help.
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Cannot set versions_accepted in wesnothd

Post by Ravana »

I tried it out, versions_accepted="1.14.3,1.15.3" works for me. I changed default config at userdata/lan_server.cfg though.
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Cannot set versions_accepted in wesnothd

Post by Pentarctagon »

We don't create the Debian package ourselves, so you'd need to contact them about that not working. I can say that for example ./wesnothd --port 11111 --config wesnothd.cfg works, as I've used that myself locally.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
wombit
Posts: 3
Joined: March 28th, 2020, 6:10 pm

Re: Cannot set versions_accepted in wesnothd

Post by wombit »

userdata/lan_server.cfg

What is the full path of this file for you?
Which part of the server init scripts reads this file in?
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Cannot set versions_accepted in wesnothd

Post by Ravana »

C:\Users\Ravana\Documents\My Games\Wesnoth1.14\lan_server.cfg and https://github.com/wesnoth/wesnoth/blob ... r.cpp#L822 I guess.
wombit
Posts: 3
Joined: March 28th, 2020, 6:10 pm

Re: Cannot set versions_accepted in wesnothd

Post by wombit »

Pentarctagon wrote: March 28th, 2020, 7:17 pm./wesnothd --port 11111 --config wesnothd.cfg works
@Pentarctagon: You are right. This way it reads the .cfg and also acts according to its content. I've just checked.

Now certainly that's not how they guys from Debian want me to start a service. So I'll need to ask them, why it doesn't work 'their' way. Thx. anyway.
Soliton
Site Administrator
Posts: 1685
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Re: Cannot set versions_accepted in wesnothd

Post by Soliton »

https://salsa.debian.org/games-team/wes ... init.d#L33
Assuming this is what the init script looks like for you then DAEMON_OPTS is used when starting wesnothd so your setup should work. Check the server output, it tells you what config file it loaded or logs an error if it couldn’t read the file. Since the server seems to get started as user nobody perhaps that user is not allowed to read the config file.
"If gameplay requires it, they can be made to live on Venus." -- scott
Post Reply