1

Topic: Startparameters for the server

Hi,

is there currently any possibility to forward some of the parameters set in the .cfg directly as startparameter (while starting the proccess)

I'm trying to use my webinterface for teeworlds and want to set the parameters in my webinterface and not in each config:
sv_bindaddr
sv_port
sv_max_clients

should look something like this afterwards:
./teeworlds_srv -f server.cfg +sv_bindaddr 127.0.0.1 +sv_port 8383 +sv_max_clients 16

If this is currently not working in any way (other then setting in the .cfg file), is there any place to get this through as feature request?

Waiting for your reply.

Greetings
Michael

2

Re: Startparameters for the server

I'm not sure, because I am not very familiar with the teeworlds start up code. The server takes the arguments and looks for either the -f option or tries to execute the the command line in the server console. So you may be able to pass the arguments via the command line. Give it a try. But when you specify a file it executes it and ignores the rest.

3 (edited by Dune 2011-09-08 11:16:30)

Re: Startparameters for the server

Try with ./teeworlds_srv -f "config.cfg" -f "sv_max_clients 16;sv_bindaddr blahblah".
I'm not sure if it works though, would be good if someone could confirm.

Not Luck, Just Magic.

4

Re: Startparameters for the server

Like i already said, i'm trying to enable this game for my webinterface. For the use with my webinterface (and i think also every other webinterface that supports clients with restrited rights) im needing the possibilty to set at least options like:

server ip
server port
maximum players

For me as the servers administrator, the webinterface needs to set ip addresses and ports automatically as it is controlling a few dedicated servers and there will also be running more teeworlds servers on one host. This automatism is only working when using the start parameters, always editing the server.cfg manually is not possible. However, i also want to define that some servers are only allowed to provide 6 players and some up to 16, therefor this command must also be set in the startparameters.

All those guys using my servers and my webinterface should also have the possibilty to edit the config on their own, expect the settings im using in the start parameters.

So yeah, is here anyone who knows about this? I really like this game and want to make this accessible for all my users yikes

5

Re: Startparameters for the server

Why not directly generating a .cfg file?

Not Luck, Just Magic.

6

Re: Startparameters for the server

It think this is the easier and more stable way. You can enable the user to specify more options for his server because you pass the config file anyway.

7 (edited by myreaper 2011-09-07 18:41:19)

Re: Startparameters for the server

So i just gave this option a try, seems that it didnt work.

@Armagetron: Letting the users change this option by theirselfs in the config is not an option. I need to have control over the ports that are used, if the users can define any port they want it will not work o_O. Also if you are running more than one servers per hardware you maybe want to make limits to the maximum of players that are used on these machines, so you can make some servers with only 4 players, some with 16, some with 8.

Also, if it is not possible to get these settings set by the start parameters directly, there will not be many hosting providers offering this game (and i think this is a way to gain good marketing? xD)

@Dune: I cannot generate a server.cfg everytime the customer starts his server, also im currently using teklab / tekbase webinterface which is closed source so it is not possible to implement this function on my own.

[4e679c60][engine]: running on unix-linux-amd64
[4e679c60][engine]: arch is little endian
[4e679c60][storage]: added path '$USERDIR' ('/home/0001/.teeworlds')
[4e679c60][storage]: added path '$DATADIR' ('data')
[4e679c60][storage]: added path '$CURRENTDIR' ('/home/0001/server/tee-2')
[4e679c60][console]: failed to open 'autoexec.cfg'
[4e679c60][console]: failed to open '"server.cfg"'
[4e679c60][console]: failed to open '"sv_bindaddr'
[4e679c60][Console]: No such command: 178.238.237.10.
[4e679c60][Console]: Value: 8303
[4e679c60][Console]: No such command: 8304.
[4e679c60][Console]: Value: 8
[4e679c60][Console]: No such command: 12s".
[4e679c60][server]: starting...
[4e679c60][datafile]: loading. filename='maps/dm1.map'
[4e679c60][datafile]: allocsize=2684
[4e679c60][datafile]: readsize=2396
[4e679c60][datafile]: swaplen=2416
[4e679c60][datafile]: item_size=2012
[4e679c60][datafile]: loading done. datafile='maps/dm1.map'
[4e679c60][server]: maps/dm1.map crc is f2159e6e
[4e679c60][net]: failed to bind socket with domain 2 and type 2 (98 'Address already in use')
[4e679c60][server]: server name is 'unnamed server'
[4e679c60][datafile]: loading data index=17 size=325 uncompressed=12000
[4e679c60][server]: version 0.6 626fce9a778df4d4
[4e679c60][engine/mastersrv]: refreshing master server addresses
[4e679c60][register]: refreshing ip addresses
[4e679c60][engine/mastersrv]: saving addresses
[4e679c60][register]: fetching server counts
[4e679c60][register]: WARNING: No master servers. Retrying in 60 seconds

8

Re: Startparameters for the server

Looks like Dune's suggestion doesn't work.

You can override these settings easily when saving the config file or provide just some specific settings via your web interface. Like map rotation or start map.

When you save the config file you override the important fields like ip address and port. That should be too difficult.

9 (edited by Dune 2011-09-08 11:16:44)

Re: Startparameters for the server

You can use:

teeworlds_srv -f "exec config.cfg;sv_max_clients 16;sv_name MyServer;blahblah"
Not Luck, Just Magic.

10

Re: Startparameters for the server

I recall it working that way:
teeworlds_srv -f config.cfg "sv_max_clients 16" "sv_name MyServer"

11

Re: Startparameters for the server

Hi,

thanks for your help.

@Armagetron: Startparameter:

./teeworlds_srv -f server.cfg "sv_bindaddr 178.238.237.10" "sv_port 8304" "sv_max_clients 16"

Startuplog:

[4e688259][engine]: running on unix-linux-amd64
[4e688259][engine]: arch is little endian
[4e688259][storage]: added path '$USERDIR' ('/home/0001/.teeworlds')
[4e688259][storage]: added path '$DATADIR' ('data')
[4e688259][storage]: added path '$CURRENTDIR' ('/home/0001/server/tee-2')
[4e688259][console]: failed to open 'autoexec.cfg'
[4e688259][console]: executing 'server.cfg'
[4e688259][Console]: No such command: sv_rcon_ban_time.
[4e688259][Console]: No such command: "sv_bindaddr.
[4e688259][Console]: No such command: 178.238.237.10".
[4e688259][Console]: No such command: "sv_port.
[4e688259][Console]: No such command: 8304".
[4e688259][Console]: No such command: "sv_max_clients.
[4e688259][Console]: No such command: 16".
[4e688259][server]: starting...
[4e688259][datafile]: loading. filename='maps/dm1.map'
[4e688259][datafile]: allocsize=2684
[4e688259][datafile]: readsize=2396
[4e688259][datafile]: swaplen=2416
[4e688259][datafile]: item_size=2012
[4e688259][datafile]: loading done. datafile='maps/dm1.map'

@Dune:

Startparameter

./teeworlds_srv -f "exec server.cfg;sv_bindaddr 178.238.237.10;sv_port 8304;sv_max_clients 16"

Startuplog:

[4e6881ca][engine]: running on unix-linux-amd64
[4e6881ca][engine]: arch is little endian
[4e6881ca][storage]: added path '$USERDIR' ('/home/0001/.teeworlds')
[4e6881ca][storage]: added path '$DATADIR' ('data')
[4e6881ca][storage]: added path '$CURRENTDIR' ('/home/0001/server/tee-2')
[4e6881ca][console]: failed to open 'autoexec.cfg'
[4e6881ca][console]: failed to open '"exec'
[4e6881ca][Console]: No such command: server.cfg.
[4e6881ca][Console]: Value: 
[4e6881ca][Console]: No such command: 178.238.237.10.
[4e6881ca][Console]: Value: 8303
[4e6881ca][Console]: No such command: 8304.
[4e6881ca][Console]: Value: 8
[4e6881ca][Console]: No such command: 16".
[4e6881ca][server]: starting...
[4e6881ca][datafile]: loading. filename='maps/dm1.map'
[4e6881ca][datafile]: allocsize=2684
[4e6881ca][datafile]: readsize=2396
[4e6881ca][datafile]: swaplen=2416
[4e6881ca][datafile]: item_size=2012
[4e6881ca][datafile]: loading done. datafile='maps/dm1.map'

If you are having more ideas to do this, this would be great. Otherwise i just would please to add this feature into the next teeworlds version yikes

12

Re: Startparameters for the server

For me, Armagetron's version works, Dunedune's version works if you remove the '-f'.

13

Re: Startparameters for the server

Thanks for your help guys, i just made some further tests right now.

It seems that these options are all working without any problems:

./teeworlds_srv -f server.cfg "sv_bindaddr 178.238.237.10" "sv_port 8304" "sv_max_clients 16"
./teeworlds_srv "exec server.cfg" "sv_bindaddr 178.238.237.10" "sv_port 8304" "sv_max_clients 16"
./teeworlds_srv "exec server.cfg;sv_bindaddr 178.238.237.10;sv_port 8304;sv_max_clients 16"

However, it seems that the errors i encoutered are occuring using Teklab Webinterface. It seems that the "" will get removed while starting the server. But, If I run a ps -ef | grep teeworlds i can see that those parameters are being delivered correctly with the "". Teeworlds is just recognizing them without "", but I don't know why right now.

I will do further investigating in this issue with the teklab support to check why it is working manually but not when using the webinterface.

Also, I have chosen to use this way of startparameter style right now as i think it is the cleanest method:

./teeworlds_srv -f server.cfg "sv_bindaddr 178.238.237.10" "sv_port 8304" "sv_max_clients 16"

Thank you for your help and i will let you know if there are any news.

14

Re: Startparameters for the server

try to use \" instead of ". or maybe try '