Some tweaks for server admin (bot management, map rotation)

Get support for Unvanquished.
User avatar
illwieckz
Project Head
Posts: 438
Joined: Sat Aug 11, 2012 7:22 pm UTC
Location: France
Contact:

Some tweaks for server admin (bot management, map rotation)

Postby illwieckz » Wed Feb 11, 2015 9:45 am UTC

Hi, I share here some tweaks I wrote to others in private messages

This is the config I use for bots:

On ".unvanquished/config/server.cfg":

Code: Select all

set g_mapConfigs "map"


On ".unvanquished/config/map/default.cfg":

Code: Select all

bot del all
delay 1000 exec addbots.cfg


On ".unvanquished/config/addbots.cfg":

Code: Select all

bot names clear
bot names humans "^9[bot]^4 Clodomir" "^9[bot]^4 Alaric" "^9[bot]^4 Baudry" "^9[bot]^4 Adelin" "^9[bot]^4 Ferdinand" "^9[bot]^4 Brieux" "^9[bot]^4 Audran" "^9[bot]^4 Alistair" "^9[bot]^4 Renan" "^9[bot]^4 Malo"
bot names aliens "^9[bot]^1 Nolwen" "^9[bot]^1 Uriel" "^9[bot]^1 Morgan" "^9[bot]^1 Lena" "^9[bot]^1 Soizic" "^9[bot]^1 Aroa" "^9[bot]^1 Belem" "^9[bot]^1 Itsaso" "^9[bot]^1 Muxika" "^9[bot]^1 Urrotz"
bot add * humans
bot add * humans
bot add * humans
bot add * aliens
bot add * aliens
bot add * aliens


How it works:

  • "server.cfg" defines that map config is on "map" subdirectory.
  • "map/default.cfg" is the default config file for every map, loaded each map starts (yes you can have specific config file per map).
  • This default config kicks all bots and calls another config file that will spawn bots.
  • I use the delay trick to workaround a bug while a bot takes too long time to die (so for some time there is both dying bot and new bot alive, so this workaround allows to have "sv_maxclients" < 2 * bot count). And I kick and spawn bots every map start so names changes.
  • "bot names" code is to define some name list, so "bot add *" command will create a bot with a random one from this list.

You don't have to redefine names each time, but this example shows you how to redefine names, so you can build different scripts to redefine different names for the map or layout you want (layout management is not described here). Also, instead of delaying an addbot.cfg script, you can just delay each bot add commands in the per map config file or in the default.cfg config file.

Feel free to use names you want, as you see I used blue ("^4") for humans and red ("^1") for aliens, with some ancient germanic-ish and celtic french male names for humans, and some ancient basque and celtic female names for aliens.
:tongue:

By writing "[bot]" (with minuscule letters), it will show a bot icon.

If you look for that too, this is how I wrote the rotation list and load the first map:

On ".unvanquished/config/server.cfg":

Code: Select all

set g_initialMapRotation "rotation1"
map forlorn


On ".unvanquished/game/maprotation.cfg":

Code: Select all

rotation1 {
 chasm // first “nextmap”, so this is the second map loaded after the one loaded by the server.cfg script
 vega
 station15
 antares
 perseus
 plat23
 spacetracks
 parpax
 forlorn // first loaded by server.cfg, so the last here
}


On last more thing, you can launch a server with a specific script, with "+exec server.cfg" for the current example.
If "server.cfg" file is in "config/" directory, do not type "+exec config/server.cfg" but "+exec server.cfg", exec reads files from "config/" by default.
Last edited by illwieckz on Tue Nov 07, 2017 8:21 pm UTC, edited 8 times in total.
User avatar
illwieckz
Project Head
Posts: 438
Joined: Sat Aug 11, 2012 7:22 pm UTC
Location: France
Contact:

Re: Some tweaks for server admin (bot management, map rotati

Postby illwieckz » Wed Jul 08, 2015 6:34 pm UTC

Some more useful tricks to help cu-kai, This my current server.cfg, part to part. (except the passwords)

Advertising my server:

Code: Select all

set sv_hostname "^9gg.^4ill^7wie^1ckz^9.net^< [^HCommunity game ^2Sun 20:00^H UTC^<]"
set g_motd "^9gg.^4ill^7wie^1ckz^9.net^6 { ^5le frag courtois^6 }^0 ―^D Ici on frag avec panache !"
set sv_dedicated "2"


Enabling some debug log (optionnal, but it's better if you can help the dev team if you have a bug):

Code: Select all

logs.logLevel.common.commands "debug"


User management, this setup means the server advertises it can only accept 30 players, but there is an extra player that can connect with a password even if the server is full, because 31 clients - 1 private client = 30 public clients:

Code: Select all

set sv_maxclients "31"            // number of players including private slots
set g_password ""                  // set to password protect the server
set sv_privateclients "1"               // if set > 0, then this number of client slots will be reserved for connections
set sv_privatePassword "YouWillNeverKnow"   // that have "password" set to the value of "sv_privatePassword"


Managing the server (but a safer way can be to use ssh and daemon-tty to send commands to the current server):

Code: Select all

set rconpassword "ThisIsMyPreciousSecret"   // remote console access password


Force teams to be balanced:

Code: Select all

set g_teamForceBalance "1"


Map management (see above how to write a rotation list):

Code: Select all

set g_mapConfigs "map"
set g_initialMapRotation "rotation1"


Assets sharing, enable the built-in sharing because you can't enable http sharing without that. It does not need a high rate, just the rate needed for the negotiation, (if too low, you can wait a long time before the http download start):

Code: Select all

set sv_allowDownload "1"
set sv_dl_maxRate "1000"


Advertizing my HTTP server for map download, use official one as fallback (so, personalized map will be downloaded from my server, official maps will be downloaded from the official server if my http server does not host them):

Code: Select all

set sv_wwwBaseURL "gg.illwieckz.net/dl/unvanquished/pkg"
set sv_wwwDlDisconnected "0"
set sv_wwwDownload "1"
set sv_wwwFallbackURL "dl.unvanquished.net/pkg"


Starting the server, the server needs to start a map, unless that it shutdowns itself. Put as first map (here) the last map of your rotation list, because the next map after this one will be the first map of the rotation list:

Code: Select all

map "forlorn"


So above is my whole ~/.unvanquished/config/server.cfg file.

This is how I run the unvanquished server (unvanquished.sh shell script):

Code: Select all

#! /bin/sh
cd ~/unvanquished
./daemonded -pakpath /var/www/dl/unvanquished/pkg +exec server.cfg


You can add -homepath /some/dir to be able to run multiple unvanquished server by the same unix user or if you don't want to use the ~/.unvanquished/ path.
You can add -set net_port 27960 to force the port number.
You can add -set logs.logFile.overwrite 0 to not lose the ~/.unvanquished/daemon.log file each time the server starts. But you know, ~/.unvanquished/game/games.log is never overwritten.

There is a trick here, the -pakpath /var/www/dl/unvanquished/pkg.
I put here my third-party maps.

I configured my web server to serves files from /var/www/dl/unvanquished/pkg when users ask files from http://gg.illwieckz.net.dl/unvanquished/pkg. Since unvanquished use exactly the same directory, I'm sure that my web server serves exactly the file for map I'm running.

I've not configured my web server to read my unvanquished maps, I've configured unvanquished to read my web server maps.

For security reason it's better, my web server (which is publicly available) is running as an unix user who is not allowed to read files from unvanquished (there is passwords), but my unvanquished server is running as a unix user who can read (and only read) files from my webserver.

If someone cracks my web server he will only have files that are already public, not the unvanquished files. If someone cracks my unvanquished server, he will have access to unvanquished files (normal) but no more files than files that are already publicly available, and he will not be able to modify the one shared via HTTP.

Edit: beware, the unvanquished client does not support HTTP redirect, be sure the maps are served as-is.

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 2 guests