From c0cc0ba57f4b0e566b3daf1459786cc5056eaba5 Mon Sep 17 00:00:00 2001 From: esteel Date: Mon, 13 Feb 2006 22:17:23 +0000 Subject: [PATCH] disabled votemaster of a single player. Else you could become votemaster if you are the first to connect to the server after mapchange. git-svn-id: svn://svn.icculus.org/nexuiz/trunk@1041 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/gamec/clientcommands.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/data/qcsrc/server/gamec/clientcommands.c b/data/qcsrc/server/gamec/clientcommands.c index 679755298..3ef98fe55 100644 --- a/data/qcsrc/server/gamec/clientcommands.c +++ b/data/qcsrc/server/gamec/clientcommands.c @@ -117,7 +117,7 @@ void SV_ParseClientCommand(string s) { votefinished = time + cvar("sv_vote_timeout"); votecaller.vote_vote = 1; // of course you vote yes votecaller.vote_next = time + cvar("sv_vote_wait"); - bprint(strcat("\"^7", votecaller.netname, "^3\" called a vote to become ^3master^3.\n")); + bprint(strcat("\"^3", votecaller.netname, "^3\" called a vote to become ^3master^3.\n")); VoteCount(); // needed if you are the only one } } else { @@ -382,7 +382,17 @@ void VoteCount() { } } - if((playercount / 2) < yescount) { // vote accepted + if((playercount == 1) && votecalledmaster) { + // if only one player is on the server becoming vote + // master is not allowed. This could be used for + // trolling or worse. 'self' is the user who has + // called the vote because this function is called + // by SV_ParseClientCommand. Maybe all voting should + // be disabled for a single player? + sprint(self, "^1You are the only player on this server so you can not become vote master.\n"); + votecaller.vote_next = 0; + VoteReset(); + } else if((playercount / 2) < yescount) { // vote accepted VoteAccept(); } else if((playercount / 2) < nocount) { // vote rejected VoteReject(); -- 2.39.2