r2094 - in trunk/data: . qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Jan 11 03:59:56 EST 2007


Author: div0
Date: 2007-01-11 03:59:56 -0500 (Thu, 11 Jan 2007)
New Revision: 2094

Modified:
   trunk/data/default.cfg
   trunk/data/qcsrc/server/clientcommands.qc
Log:
new command: vdo login (password) - if password matches sv_vote_master_password and the latter cvar is actually set, the issuer becomes master and can run votable commands directly


Modified: trunk/data/default.cfg
===================================================================
--- trunk/data/default.cfg	2007-01-09 16:27:27 UTC (rev 2093)
+++ trunk/data/default.cfg	2007-01-11 08:59:56 UTC (rev 2094)
@@ -693,6 +693,8 @@
 set sv_vote_call 1
 // users can call a vote to become master
 set sv_vote_master 1
+// when set, users can use "vdo master (password)" to log in as master
+set sv_vote_master_password ""
 // set to 1 to allow to change you vote/mind
 set sv_vote_change 0
 // set to 1 to count votes once after timeout or to 0 to count with every vote

Modified: trunk/data/qcsrc/server/clientcommands.qc
===================================================================
--- trunk/data/qcsrc/server/clientcommands.qc	2007-01-09 16:27:27 UTC (rev 2093)
+++ trunk/data/qcsrc/server/clientcommands.qc	2007-01-11 08:59:56 UTC (rev 2094)
@@ -170,7 +170,7 @@
 							return;
 						votecalled = TRUE;
 						votecalledmaster = FALSE;
-						// remap chmap to gomap (forces intermission)
+						// remap chmap to gotomap (forces intermission)
 						if(strlen(vote) >= 6)
 							if(substring(vote, 0, 6) == "chmap ")
 								vote = strcat("gotomap ", substring(vote, 6, strlen(vote) - 6));
@@ -216,12 +216,30 @@
 				sprint(self, "^1Vote to become master is NOT allowed.\n");
 			}
 		} else if(argv(1) == "do") {
-			if(self.vote_master) {
+			if(argv(2) == "login") {
+				local string masterpwd;
+				masterpwd = cvar_string("sv_vote_master_password");
+				if(masterpwd != "") {
+					self.vote_master = (masterpwd == argv(3));
+					if(self.vote_master) {
+						ServerConsoleEcho(strcat("Accepted master login from ", self.netname), TRUE);
+						bprint(strcat("\{1}^2* ^3", self.netname, "^2 logged in as ^3master^2\n"));
+					}
+					else
+						ServerConsoleEcho(strcat("REJECTED master login from ", self.netname), TRUE);
+				}
+				else
+					sprint(self, "^1You are NOT a master.\n");
+			} else if(self.vote_master) {
 				local string dovote;
 				dovote = VoteParse();
 				if(dovote == "") {
 					sprint(self, "^1Your command was empty. See help for more info.\n");
 				} else if(VoteAllowed(strcat(argv(2)))) { // strcat seems to be necessary
+					// remap chmap to gotomap (forces intermission)
+					if(strlen(dovote) >= 6)
+						if(substring(dovote, 0, 6) == "chmap ")
+							vote = strcat("gotomap ", substring(dovote, 6, strlen(dovote) - 6));
 					bprint("\"^7", strcat(self.netname, "^2 used his ^3master^2 status to do \"^2", dovote, "^2\".\n"));
 					localcmd(strcat(dovote, "\n"));
 				} else {




More information about the nexuiz-commits mailing list