r3289 - in trunk/data: . qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jan 26 16:22:53 EST 2008


Author: div0
Date: 2008-01-26 16:22:53 -0500 (Sat, 26 Jan 2008)
New Revision: 3289

Modified:
   trunk/data/default.cfg
   trunk/data/qcsrc/server/gamecommand.qc
Log:
new command "gametype" to switch gametype, and notify server QC of it... for changing it at runtime to make stuff like chmap votes, suggestmap immediately work


Modified: trunk/data/default.cfg
===================================================================
--- trunk/data/default.cfg	2008-01-26 21:18:44 UTC (rev 3288)
+++ trunk/data/default.cfg	2008-01-26 21:22:53 UTC (rev 3289)
@@ -760,6 +760,7 @@
 alias g_maplist_remove     "qc_cmd maplist remove $*"
 alias g_maplist_putfirst   "qc_cmd maplist remove $* ; qc_cmd maplist add $*"
 alias g_maplist_shufflenow "qc_cmd maplist shuffle"
+alias gametype             "sv_cmd gametype $*"
 
 // key hunt
 set g_keyhunt 0

Modified: trunk/data/qcsrc/server/gamecommand.qc
===================================================================
--- trunk/data/qcsrc/server/gamecommand.qc	2008-01-26 21:18:44 UTC (rev 3288)
+++ trunk/data/qcsrc/server/gamecommand.qc	2008-01-26 21:22:53 UTC (rev 3289)
@@ -5,6 +5,7 @@
 	if(MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 1))
 	{
 		print("Done rebuiling mapinfos.\n");
+		MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0);
 		remove(self);
 	}
 	else
@@ -26,6 +27,7 @@
 		print("  teamstatus\n");
 		print("  printstats\n");
 		print("  make_mapinfo\n");
+		print("  gametype dm|ctf|...\n");
 		print("  savedb filename\n");
 		print("  dumpdb filename\n");
 		print("  loaddb filename\n");
@@ -75,6 +77,25 @@
 		return;
 	}
 
+#ifdef MAPINFO
+	if(argv(0) == "gametype") if(argc == 2)
+	{
+		float t;
+		string s;
+		s = argv(1);
+		t = MapInfo_Type_FromString(s);
+		if(t)
+		{
+			MapInfo_SwitchGameType(t);
+			MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0);
+			bprint("Game type successfully switched to ", s, "\n");
+		}
+		else
+			bprint("Game type switch to ", s, " failed: this type does not exist!\n");
+		return;
+	}
+#endif
+
 	if(argv(0) == "adminmsg") if(argc == 3)
 	{
 		entity client;




More information about the nexuiz-commits mailing list