[cod] COD2 / Blocking sv_maxclients ?

Rüdiger Meier sweet_f_a at gmx.de
Thu May 4 22:39:45 EDT 2006


On Thursday 04 May 2006 12:55, Apiserv SupTek wrote:
> Thx all for your answers.
>
> I'm going to create a thread in order to check the cvar of the server
> every minutes, and if cvar is not good, stop it.

use qstat - console server browser!

example:
$ qstat -raw '§' -q3s 85.14.217.160:28960
Q3S§85.14.217.160:28960§SkyL!nE War$erver!§mp_toujane§16§0§33§0

The 5th field of output (value 16)  shows the current slot count (if the 
server is not down!)
Note: "§" is the field separator (you need for "cut") - choose a char 
which is not available in a cod2 server name!)

so use something like this one liner (1) as cron job or endless loop
and he is not allowed to have more that 16 slots:

test ! "`qstat -raw "§" -q3s 85.14.217.160:28960 |head -n 1|\
head -n 1|cut -f5 -d§`" -le "16" 2>/dev/null && KILL_SERVER

where KILL_SERVER is your command to kill (restart) the server.
I suggest you to grep all his *.cfg files for "sv_maxclient" lines  and 
removing them automatically before restarting his server!
(maybe also writing him a warning email (using "nail" ;)

cu,
rudi

(1) my line is not very well tested but should work even if the server 
doesnt responds at the moment!



More information about the Cod mailing list