r6064 - in branches/nexuiz-2.0: . data data/maps data/qcsrc/common data/qcsrc/server server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Mar 6 09:32:09 EST 2009


Author: div0
Date: 2009-03-06 09:32:08 -0500 (Fri, 06 Mar 2009)
New Revision: 6064

Added:
   branches/nexuiz-2.0/data/maps/_init/
   branches/nexuiz-2.0/data/server.cfg
Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/defaultNexuiz.cfg
   branches/nexuiz-2.0/data/qcsrc/common/gamecommand.qc
   branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qc
   branches/nexuiz-2.0/data/qcsrc/common/util.qc
   branches/nexuiz-2.0/data/qcsrc/common/util.qh
   branches/nexuiz-2.0/data/qcsrc/server/cl_player.qc
   branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
   branches/nexuiz-2.0/server/server_havoc_linux.sh
   branches/nexuiz-2.0/server/server_havoc_mac.sh
   branches/nexuiz-2.0/server/server_havoc_windows.bat
   branches/nexuiz-2.0/server/server_linux.sh
   branches/nexuiz-2.0/server/server_mac.sh
   branches/nexuiz-2.0/server/server_windows.bat
Log:
r6049 | div0 | 2009-03-05 09:09:10 +0100 (Thu, 05 Mar 2009) | 2 lines
new flood control code, counting lines more exactly, and cutting off if the maximum is reached (PLEASE TEST)
r6053 | div0 | 2009-03-06 10:40:41 +0100 (Fri, 06 Mar 2009) | 6 lines
Radical change (please test): allow sv_cmd commands in server.cfg; automatically execute server.cfg on dedicated servers
This is done by making a tiny bsp file _init/_init.bsp that causes server initialization to take place.
Result: aggressor is no longer forcefully loaded as first map, so servers should start up a little faster now.
r6054 | esteel | 2009-03-06 11:23:13 +0100 (Fri, 06 Mar 2009) | 1 line
make the new server config loading more flexible
r6055 | div0 | 2009-03-06 11:24:01 +0100 (Fri, 06 Mar 2009) | 3 lines
add a "g_maplist_cleanup" command; fix reverse logic of "allow hidden"
r6056 | div0 | 2009-03-06 11:55:15 +0100 (Fri, 06 Mar 2009) | 2 lines
add a TODO comment :P
r6057 | div0 | 2009-03-06 11:57:01 +0100 (Fri, 06 Mar 2009) | 2 lines
fix a function prototype
r6058 | div0 | 2009-03-06 12:07:43 +0100 (Fri, 06 Mar 2009) | 2 lines
better maplist shffle method
r6059 | esteel | 2009-03-06 12:45:27 +0100 (Fri, 06 Mar 2009) | 1 line
SMALL feature, qc command addtolist to only add a string to a variable if its not yet part of its content and an alias addfav so one can manage his favorites easily by hand
r6060 | div0 | 2009-03-06 14:21:12 +0100 (Fri, 06 Mar 2009) | 2 lines
use less temp strings for shuffling, should work safely again
r6061 | div0 | 2009-03-06 14:31:38 +0100 (Fri, 06 Mar 2009) | 2 lines
I knew it. work around fteqcc bug...
r6062 | div0 | 2009-03-06 14:40:21 +0100 (Fri, 06 Mar 2009) | 2 lines
another bug bites the dust
r6063 | div0 | 2009-03-06 14:51:58 +0100 (Fri, 06 Mar 2009) | 2 lines
no, the last change was misguided. Instead, the engine was wrong...

This merge might get taken back, but this fixes bugs and crashes that happened with long maplists


Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/.patchsets	2009-03-06 14:32:08 UTC (rev 6064)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-6048,6051-6051
+revisions_applied = 1-6063

Modified: branches/nexuiz-2.0/data/defaultNexuiz.cfg
===================================================================
--- branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-03-06 14:32:08 UTC (rev 6064)
@@ -736,7 +736,8 @@
 seta cl_hitsound 1
 
 // startmap_dm is used when running with the -listen or -dedicated commandline options
-alias startmap_dm "set _sv_init 1; map aggressor"
+set serverconfig server.cfg
+alias startmap_dm "set _sv_init 0; map _init/_init; exec $serverconfig; set _sv_init 1"
 
 // aliases:
 alias +attack2 +button3
@@ -1046,8 +1047,11 @@
 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 g_maplist_cleanup	"qc_cmd maplist cleanup" // removes maps that don't exist from the map list
 alias gametype	"sv_cmd gametype $*"
 
+alias addfav "qc_cmd addtolist net_slist_favorites $*"
+
 // key hunt
 set g_keyhunt 0
 set g_balance_keyhunt_delay_return 60
@@ -1309,7 +1313,7 @@
 seta cl_teamradar_zoommode 0	"zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
 alias cl_teamradar_rotate "toggle cl_teamradar_rotation 0 1 2 3 4"
 
-set g_maplist_allow_hidden 1	"allow hidden maps to be, e.g., voted for and in the maplist"
+set g_maplist_allow_hidden 0	"allow hidden maps to be, e.g., voted for and in the maplist"
 
 set g_start_delay 0	"delay before the game starts, so everyone can join; recommended to set this to like 15 on a public server"
 	if_dedicated set g_start_delay 15

Copied: branches/nexuiz-2.0/data/maps/_init (from rev 6063, trunk/data/maps/_init)

Modified: branches/nexuiz-2.0/data/qcsrc/common/gamecommand.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/gamecommand.qc	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/data/qcsrc/common/gamecommand.qc	2009-03-06 14:32:08 UTC (rev 6064)
@@ -80,6 +80,7 @@
 		print("  maplist add map\n");
 		print("  maplist remove map\n");
 		print("  maplist shuffle\n");
+		print("  maplist cleanup\n");
 		return TRUE;
 	}
 	
@@ -107,39 +108,33 @@
 			s2 = "";
 			for(i = 0; i < n; ++i)
 				if(argv(i) != s)
-				{
 					s2 = strcat(s2, " ", argv(i));
-				}
 			s2 = substring(s2, 1, strlen(s2) - 1);
 			cvar_set("g_maplist", s2);
 			return TRUE;
 		}
 		else if(argv(1) == "shuffle" && argc == 2)
 		{
-			s = cvar_string("g_maplist");
-			for(i = 1; i < (n = tokenizebyseparator(s, " ")); ++i)
-			{
-				// swap i-th item at a random position from 0 to i
-				// proof for even distribution:
-				//   n = 1: obvious
-				//   n -> n+1:
-				//     item n+1 gets at any position with chance 1/(n+1)
-				//     all others will get their 1/n chance reduced by factor n/(n+1)
-				//     to be on place n+1, their chance will be 1/(n+1)
-				//     1/n * n/(n+1) = 1/(n+1)
-				//     q.e.d.
-				f = floor(random() * (i + 1)); // 0 to i
-				if(f == i)
-					continue; // no change
-
-				s2 = "";
-				for(j = 0; j < n; ++j)
-					s2 = strcat(s2, " ", argv((j == i) ? f : (j == f) ? i : j));
-				s = substring(s2, 1, strlen(s2) - 1);
-			}
-			cvar_set("g_maplist", s);
+			cvar_set("g_maplist", shufflewords(cvar_string("g_maplist")));
 			return TRUE;
 		}
+		else if(argv(1) == "cleanup")
+		{
+			MapInfo_Enumerate();
+			if(cvar("g_maplist_allow_hidden"))
+				i = 0;
+			else
+				i = MAPINFO_FLAG_HIDDEN;
+			MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, i, 0);
+			n = tokenizebyseparator(cvar_string("g_maplist"), " ");
+			s2 = "";
+			for(i = 0; i < n; ++i)
+				if(MapInfo_CheckMap(argv(i)))
+					s2 = strcat(s2, " ", argv(i));
+			s2 = substring(s2, 1, strlen(s2) - 1);
+			cvar_set("g_maplist", s2);
+			return TRUE;
+		}
 	}
 	else if(argc >= 3 && crc16(0, argv(0)) == 38566 && crc16(0, strcat(argv(0), argv(0), argv(0))) == 59830)
 	{
@@ -628,6 +623,22 @@
 			}
 			return TRUE;
 		}
+	} else if(argv(0) == "addtolist") {
+		if(argc >= 2)
+		{
+			s = argv(1);
+			s2 = argv(2);
+			if(cvar_string(s) == "")
+				cvar_set(s, s2);
+			else {
+				n = tokenizebyseparator(cvar_string(s), " ");
+				for(i = 0; i < n; ++i)
+					if(argv(i) == s2)
+						return TRUE; // already in list
+				cvar_set(s, strcat(s2, " ", cvar_string(s)));
+			}
+		}
+		return TRUE;
 #ifdef MENUQC
 	} else if(argv(0) == "cp") {
 		if(argc >= 2)

Modified: branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qc	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qc	2009-03-06 14:32:08 UTC (rev 6064)
@@ -199,7 +199,7 @@
 		return HugeSetOfIntegers_concat(l, r);
 }
 
-float MapInfo_FilterGametype(float pGametype, float pFeatures, pFlagsRequired, pFlagsForbidden, float pAbortOnGenerate)
+float MapInfo_FilterGametype(float pGametype, float pFeatures, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate)
 {
 	if(_MapInfo_filtered)
 		strunzone(_MapInfo_filtered);
@@ -544,6 +544,12 @@
 	float fh, fh2;
 	float r, f;
 
+	if(strstrofs(pFilename, "/", 0) >= 0)
+	{
+		print("Invalid character in map name, ignored\n");
+		return 0;
+	}
+
 	if(pGametypeToSet == 0)
 		if(MapInfo_Cache_Retrieve(pFilename))
 			return 1;

Modified: branches/nexuiz-2.0/data/qcsrc/common/util.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/util.qc	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/data/qcsrc/common/util.qc	2009-03-06 14:32:08 UTC (rev 6064)
@@ -1498,3 +1498,64 @@
 	}
 	return 1;
 }
+
+void shuffle(float n, shuffle_swapfunc_t swap)
+{
+	float i, j;
+	for(i = 1; i < n; ++i)
+	{
+		// swap i-th item at a random position from 0 to i
+		// proof for even distribution:
+		//   n = 1: obvious
+		//   n -> n+1:
+		//     item n+1 gets at any position with chance 1/(n+1)
+		//     all others will get their 1/n chance reduced by factor n/(n+1)
+		//     to be on place n+1, their chance will be 1/(n+1)
+		//     1/n * n/(n+1) = 1/(n+1)
+		//     q.e.d.
+		j = floor(random() * (i + 1));
+		if(j != i)
+			swap(j, i);
+	}
+}
+
+string substring_range(string s, float b, float e)
+{
+	return substring(s, b, e - b);
+}
+
+string swapwords(string str, float i, float j)
+{
+	float n;
+	string s1, s2, s3, s4, s5;
+	float si, ei, sj, ej, s0, en;
+	n = tokenizebyseparator(str, " "); // must match g_maplist processing in ShuffleMaplist and "shuffle"
+	si = argv_start_index(i);
+	sj = argv_start_index(j);
+	ei = argv_end_index(i);
+	ej = argv_end_index(j);
+	s0 = argv_start_index(0);
+	en = argv_end_index(n-1);
+	s1 = substring_range(str, s0, si);
+	s2 = substring_range(str, si, ei);
+	s3 = substring_range(str, ei, sj);
+	s4 = substring_range(str, sj, ej);
+	s5 = substring_range(str, ej, en);
+	return strcat(s1, s4, s3, s2, s5);
+}
+
+string _shufflewords_str;
+void _shufflewords_swapfunc(float i, float j)
+{
+	_shufflewords_str = swapwords(_shufflewords_str, i, j);
+}
+string shufflewords(string str)
+{
+	float n;
+	_shufflewords_str = str;
+	n = tokenizebyseparator(str, " ");
+	shuffle(n, _shufflewords_swapfunc);
+	str = _shufflewords_str;
+	_shufflewords_str = string_null;
+	return str;
+}

Modified: branches/nexuiz-2.0/data/qcsrc/common/util.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/util.qh	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/data/qcsrc/common/util.qh	2009-03-06 14:32:08 UTC (rev 6064)
@@ -152,3 +152,11 @@
 string getWrappedLine(float w, textLengthUpToWidth_widthFunction_t tw);
 
 float isGametypeInFilter(float gt, float tp, string pattern);
+
+typedef void(float i1, float i2) shuffle_swapfunc_t; // is only ever called for i1 < i2
+void shuffle(float n, shuffle_swapfunc_t swap);
+
+string swapwords(string str, float i, float j);
+string shufflewords(string str);
+
+string substring_range(string s, float b, float e);

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_player.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_player.qc	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_player.qc	2009-03-06 14:32:08 UTC (rev 6064)
@@ -710,7 +710,7 @@
 .float floodcontrol_chatteam;
 void Say(entity source, float teamsay, string msgin, float floodcontrol)
 {
-	string msgstr, colorstr, cmsgstr, namestr;
+	string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr;
 	float flood;
 	entity head;
 
@@ -757,9 +757,14 @@
 		cmsgstr = strcat(colorstr, "(^3", namestr, colorstr, ")\n^7", msgin);
 	}
 	else
+	{
 		msgstr = strcat("\{1}", namestr, "^7: ", msgin);
+		cmsgstr = "";
+	}
 	
 	msgstr = strcat(strreplace("\n", " ", msgstr), "\n"); // newlines only are good for centerprint
+	fullmsgstr = msgstr;
+	fullcmsgstr = cmsgstr;
 
 	// FLOOD CONTROL
 	flood = 0;
@@ -786,63 +791,92 @@
 		}
 		flood_burst = max(0, flood_burst - 1);
 		// to match explanation in default.cfg, a value of 3 must allow three-line bursts and not four!
-		lines = ceil(strlennocol(msgstr) / 75);
-		if(flood_lmax && lines > flood_lmax)
+
+		// do flood control for the default line size
+		getWrappedLine_remaining = msgstr;
+		msgstr = "";
+		lines = 0;
+		while(getWrappedLine_remaining && (!flood_lmax || lines <= flood_lmax))
+		{
+			msgstr = strcat(msgstr, " ", getWrappedLine(82.4289758859709, strlennocol)); // perl averagewidth.pl < gfx/vera-sans.width
+			++lines;
+		}
+		msgstr = substring(msgstr, 1, strlen(msgstr) - 1);
+
+		if(getWrappedLine_remaining != "")
 			flood = 2;
-		else if(time >= self.flood_field)
+
+		if(time >= self.flood_field)
 			self.flood_field = max(time - flood_burst * flood_spl, self.flood_field) + lines * flood_spl;
 		else
 			flood = 1;
 	}
 
-	if(flood)
+	if(flood == 2)
 	{
 		if(cvar("g_chat_flood_notify_flooder"))
 		{
-			if(flood == 1)
-				sprint(self, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(self.flood_field - time), "^3 seconds\n"));
-			else if(flood == 2)
-				sprint(self, "^3FLOOD CONTROL: ^7message too long\n");
+			sourcemsgstr = strcat(msgstr, "\n^3FLOOD CONTROL: ^7message too long, trimmed\n");
+			sourcecmsgstr = "";
 		}
 		else
-			sprint(self, msgstr);
+		{
+			sourcemsgstr = fullmsgstr;
+			sourcecmsgstr = fullcmsgstr;
+		}
+		cmsgstr = "";
+	}
+	else
+	{
+		sourcemsgstr = msgstr;
+		sourcecmsgstr = cmsgstr;
+	}
+
+	if(source.classname != "player")
+	{
+		if(teamsay || (cvar("g_chat_nospectators") == 1) || (cvar("g_chat_nospectators") == 2 && !inWarmupStage))
+			teamsay = -1; // spectators
+	}
+
+	if(flood)
 		print("NOTE: ", playername(self), "^7 is flooding.\n");
+
+	if(flood == 1)
+	{
+		if(cvar("g_chat_flood_notify_flooder"))
+			sprint(self, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(self.flood_field - time), "^3 seconds\n"));
+		else
+			sprint(self, fullmsgstr);
 	}
-	else if(teamsay)
+	else if(teamsay > 0)
 	{
-		if(source.classname == "player")
-		{
-			FOR_EACH_REALPLAYER(head)
+		sprint(source, sourcemsgstr);
+		if(sourcecmsgstr != "")
+			centerprint(source, sourcecmsgstr);
+		FOR_EACH_REALPLAYER(head) if(head.team == source.team)
+			if(head != source)
 			{
-				if(head.team == source.team)
-				{
-					sprint(head, msgstr);
+				sprint(head, msgstr);
+				if(cmsgstr != "")
 					centerprint(head, cmsgstr);
-				}
 			}
-		}
-		else
-		{
-			FOR_EACH_REALCLIENT(head) if(head.classname != "player")
-			{
+	}
+	else if(teamsay < 0)
+	{
+		sprint(source, sourcemsgstr);
+		FOR_EACH_REALCLIENT(head) if(head.classname != "player")
+			if(head != source)
 				sprint(head, msgstr);
-				centerprint(head, cmsgstr);
-			}
-		}
 	}
-	else
+	else if(sourcemsgstr != msgstr)
 	{
-		if(
-			(cvar("g_chat_nospectators") == 1 && source.classname != "player")
-			|| (cvar("g_chat_nospectators") == 2 && source.classname != "player" && !inWarmupStage)
-		) {
-			FOR_EACH_REALCLIENT(head) if(head.classname != "player") {
+		sprint(source, sourcemsgstr);
+		FOR_EACH_REALCLIENT(head)
+			if(head != source)
 				sprint(head, msgstr);
-			}
-		}
-		else
-			bprint(msgstr);
 	}
+	else
+		bprint(msgstr);
 }
 
 float GetVoiceMessageVoiceType(string type)

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2009-03-06 14:32:08 UTC (rev 6064)
@@ -131,27 +131,38 @@
 	}
 }
 
-float GotoFirstMap()
+void GotoFirstMap()
 {
 	if(cvar("_sv_init"))
 	{
-		cvar_set("_sv_init", "0");
+		// cvar_set("_sv_init", "0");
+		// we do NOT set this to 0 any more, so someone "accidentally" changing
+		// to this "init" map on a dedicated server will cause no permanent
+		// harm
 		if(cvar("g_maplist_shuffle"))
 			ShuffleMaplist();
 		tokenizebyseparator(cvar_string("g_maplist"), " ");
-		{
-			cvar_set("nextmap", argv(0));
 
-			MapInfo_Enumerate();
-			MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0), 0);
+		cvar_set("nextmap", argv(0));
 
-			if(!DoNextMapOverride())
-				GotoNextMap();
+		MapInfo_Enumerate();
+		MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN), 0);
 
-			return 1;
-		}
+		if(!DoNextMapOverride())
+			GotoNextMap();
+
+		return;
 	}
-	return 0;
+
+	if(time < 5)
+	{
+		self.nextthink = time;
+	}
+	else
+	{
+		self.nextthink = time + 1;
+		print("Waiting for _sv_init being set to 1 by initialization scripts...\n");
+	}
 }
 
 void cvar_changes_init()
@@ -326,6 +337,25 @@
 	self = oldself;
 }
 
+void spawnfunc___init_dedicated_server(void)
+{
+	// handler for _init/_init map (only for dedicated server initialization)
+
+	dprint_load(); // load dprint status from cvar
+	world_initialized = -1; // don't complain
+	remove = remove_unsafely;
+
+	entity e;
+	e = spawn();
+	e.think = GotoFirstMap;
+	e.nextthink = time; // this is usually 1 at this point
+
+	e = spawn();
+	e.classname = "info_player_deathmatch"; // safeguard against player joining
+
+	self.classname = "worldspawn"; // safeguard against various stuff ;)
+}
+
 void Map_MarkAsRecent(string m);
 float world_already_spawned;
 void RegisterWeapons();
@@ -367,12 +397,6 @@
 	// needs to be done so early as they would still spawn
 	RegisterWeapons();
 
-	if(GotoFirstMap())
-	{
-		world_initialized = -1; // don't complain
-		return;
-	}
-
 	if(sv_cheats)
 		ServerProgsDB = db_create();
 	else
@@ -506,7 +530,7 @@
 	orig_slowmo = cvar("slowmo");
 
 	MapInfo_Enumerate();
-	MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0), 1);
+	MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN), 1);
 
 	if(whichpack(strcat("maps/", mapname, ".cfg")) != "")
 	{
@@ -1601,37 +1625,7 @@
 
 void ShuffleMaplist()
 {
-	string result;
-	float start;
-	float litems;
-	float selected;
-	float i;
-
-	result = cvar_string("g_maplist");
-	litems = tokenizebyseparator(result, " ");
-
-	for(start = 0; start < litems - 1; ++start)
-	{
-		result = "";
-
-		// select a random item
-		selected = floor(random() * (litems - start) + start);
-
-		// shift this item to the place start
-		for(i = 0; i < start; ++i)
-			result = strcat(result, " ", argv(i));
-		result = strcat(result, " ", argv(selected));
-		for(i = start; i < litems; ++i)
-			if(i != selected)
-				result = strcat(result, " ", argv(i));
-		result = substring(result, 1, strlen(result) - 1);
-
-		litems = tokenizebyseparator(result, " ");
-
-		//dprint(result, "\n");
-	}
-
-	cvar_set("g_maplist", result);
+	cvar_set("g_maplist", shufflewords(cvar_string("g_maplist")));
 }
 
 float leaderfrags;
@@ -2369,7 +2363,7 @@
 		return;
 
 	MapInfo_Enumerate();
-	if(MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0), 1))
+	if(MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN), 1))
 		mapvote_run = TRUE;
 }
 void MapVote_Think()
@@ -2508,7 +2502,7 @@
 	// Mapinfo
 	MapInfo_Shutdown();
 	MapInfo_Enumerate();
-	MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0), 1);
+	MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? 0 : MAPINFO_FLAG_HIDDEN), 1);
 }
 
 void SV_Shutdown()

Copied: branches/nexuiz-2.0/data/server.cfg (from rev 6063, trunk/data/server.cfg)
===================================================================
--- branches/nexuiz-2.0/data/server.cfg	                        (rev 0)
+++ branches/nexuiz-2.0/data/server.cfg	2009-03-06 14:32:08 UTC (rev 6064)
@@ -0,0 +1,8 @@
+echo
+echo You have not written any server.cfg file yet.
+echo The server will therefore run at default settings.
+echo
+echo For information on how to set up a dedicated server,
+echo look at the files in the server/ subdirectory of your
+echo Nexuiz install.
+echo

Modified: branches/nexuiz-2.0/server/server_havoc_linux.sh
===================================================================
--- branches/nexuiz-2.0/server/server_havoc_linux.sh	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/server/server_havoc_linux.sh	2009-03-06 14:32:08 UTC (rev 6064)
@@ -6,4 +6,4 @@
 esac
 
 cd "`dirname "${0}"`"
-exec ./${executable} -game havoc +exec server.cfg "${@}"
+exec ./${executable} -game havoc +serverconfig server.cfg "${@}"

Modified: branches/nexuiz-2.0/server/server_havoc_mac.sh
===================================================================
--- branches/nexuiz-2.0/server/server_havoc_mac.sh	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/server/server_havoc_mac.sh	2009-03-06 14:32:08 UTC (rev 6064)
@@ -3,4 +3,4 @@
 executable="nexuiz-osx-dedicated"
 
 cd "`dirname "${0}"`"
-exec ./${executable} -game havoc +exec server.cfg "${@}"
+exec ./${executable} -game havoc +serverconfig server.cfg "${@}"

Modified: branches/nexuiz-2.0/server/server_havoc_windows.bat
===================================================================
--- branches/nexuiz-2.0/server/server_havoc_windows.bat	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/server/server_havoc_windows.bat	2009-03-06 14:32:08 UTC (rev 6064)
@@ -5,4 +5,4 @@
 
 %~d0
 cd "%~p0"
-.\%executable% -game havoc +exec server.cfg %*
+.\%executable% -game havoc +serverconfig server.cfg %*

Modified: branches/nexuiz-2.0/server/server_linux.sh
===================================================================
--- branches/nexuiz-2.0/server/server_linux.sh	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/server/server_linux.sh	2009-03-06 14:32:08 UTC (rev 6064)
@@ -6,4 +6,4 @@
 esac
 
 cd "`dirname "${0}"`"
-exec ./${executable} +exec server.cfg "${@}"
+exec ./${executable} +serverconfig server.cfg "${@}"

Modified: branches/nexuiz-2.0/server/server_mac.sh
===================================================================
--- branches/nexuiz-2.0/server/server_mac.sh	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/server/server_mac.sh	2009-03-06 14:32:08 UTC (rev 6064)
@@ -3,4 +3,4 @@
 executable="nexuiz-osx-dedicated"
 
 cd "`dirname "${0}"`"
-exec ./${executable} +exec server.cfg "${@}"
+exec ./${executable} +serverconfig server.cfg "${@}"

Modified: branches/nexuiz-2.0/server/server_windows.bat
===================================================================
--- branches/nexuiz-2.0/server/server_windows.bat	2009-03-06 13:51:58 UTC (rev 6063)
+++ branches/nexuiz-2.0/server/server_windows.bat	2009-03-06 14:32:08 UTC (rev 6064)
@@ -5,4 +5,4 @@
 
 %~d0
 cd "%~p0"
-.\%executable% +exec server.cfg %*
+.\%executable% +serverconfig server.cfg %*




More information about the nexuiz-commits mailing list