r2095 - in branches/nexuiz-2.0/data: . qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Jan 11 04:01:28 EST 2007


Author: div0
Date: 2007-01-11 04:01:27 -0500 (Thu, 11 Jan 2007)
New Revision: 2095

Modified:
   branches/nexuiz-2.0/data/default.cfg
   branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc
Log:
vdo login command


Modified: branches/nexuiz-2.0/data/default.cfg
===================================================================
--- branches/nexuiz-2.0/data/default.cfg	2007-01-11 08:59:56 UTC (rev 2094)
+++ branches/nexuiz-2.0/data/default.cfg	2007-01-11 09:01:27 UTC (rev 2095)
@@ -676,6 +676,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: branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc	2007-01-11 08:59:56 UTC (rev 2094)
+++ branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc	2007-01-11 09:01:27 UTC (rev 2095)
@@ -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