Skip to content

Commit

Permalink
"publicserver 2" for public coop servers which allow setmaster but di…
Browse files Browse the repository at this point in the history
…sallow private

git-svn-id: https://sauerbraten.svn.sourceforge.net/svnroot/sauerbraten@1733 ac1f7847-fce6-4368-a212-70e9bdee79d4
  • Loading branch information
qreeves committed May 7, 2009
1 parent 2bedf1d commit a56687d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions server-init.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ serverbotlimit 8
// controls whether or not the server is intended for "public" use
// when set to 0, allows "setmaster 1" and locked/private mastermodes (for coop-editing and such)
// when set to 1, can only gain master by "auth" or admin, and doesn't allow locked/private mastermodes
// when set to 2, allows "setmaster 1" but disallows private mastermode (for public coop-editing)
publicserver 0

// description server shows for the server browser
Expand Down
10 changes: 9 additions & 1 deletion src/fpsgame/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ namespace server
#define MM_AUTOAPPROVE 0x1000
#define MM_PRIVSERV (MM_MODE | MM_AUTOAPPROVE)
#define MM_PUBSERV ((1<<MM_OPEN) | (1<<MM_VETO))
#define MM_COOPSERV (MM_AUTOAPPROVE | MM_PUBSERV | (1<<MM_LOCKED))

bool notgotitems = true; // true when map has changed and waiting for clients to send item
int gamemode = 0;
Expand Down Expand Up @@ -386,7 +387,14 @@ namespace server
SVAR(serverdesc, "");
SVAR(serverpass, "");
SVAR(adminpass, "");
VARF(publicserver, 0, 0, 1, { mastermask = publicserver ? MM_PUBSERV : MM_PRIVSERV; });
VARF(publicserver, 0, 0, 2, {
switch(publicserver)
{
case 0: default: mastermask = MM_PRIVSERV; break;
case 1: mastermask = MM_PUBSERV; break;
case 2: mastermask = MM_COOPSERV; break;
}
});
SVAR(servermotd, "");

void *newclientinfo() { return new clientinfo; }
Expand Down

0 comments on commit a56687d

Please sign in to comment.