17 Dec 11, 01:42AM
(This post was last modified: 07 Feb 12, 10:47PM by MasterKaen.)
Here's a super short patch to add mode restrictions to your server. I use this for my T/OSOK server to keep hooligans from voting up LSS or something.
Simply find (in source/src/serveractions.h) the part that says:
And add these three lines:
To make:
This will allow you to add something like
to your servercmdline.txt file, which would disallow CTF games on any map. Of course, an admin can still set the mode to CTF.
Simply find (in source/src/serveractions.h) the part that says:
[SELECT ALL] Code:
loopv(scl.adminonlymaps)
{
const char *s = scl.adminonlymaps[i], *h = strchr(s, '#'), *m = behindpath(map);
size_t sl = strlen(s);
if(h && h != s)
{
sl = h - s;
if(mode != atoi(h + 1)) continue;
}
if(sl == strlen(m) && !strncmp(m, scl.adminonlymaps[i], sl)) role = CR_ADMIN;
}
And add these three lines:
[SELECT ALL] Code:
if(h && h == s) {
if(mode == atoi(h + 1)) role = CR_ADMIN;
}
To make:
[SELECT ALL] Code:
loopv(scl.adminonlymaps)
{
const char *s = scl.adminonlymaps[i], *h = strchr(s, '#'), *m = behindpath(map);
size_t sl = strlen(s);
if(h && h == s) {
if(mode == atoi(h + 1)) role = CR_ADMIN;
}
if(h && h != s)
{
sl = h - s;
if(mode != atoi(h + 1)) continue;
}
if(sl == strlen(m) && !strncmp(m, scl.adminonlymaps[i], sl)) role = CR_ADMIN;
}
This will allow you to add something like
[SELECT ALL] Code:
-A#5