r2988 - in trunk/data: maps qcsrc/common qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Nov 22 09:39:58 EST 2007


Author: div0
Date: 2007-11-22 09:39:57 -0500 (Thu, 22 Nov 2007)
New Revision: 2988

Modified:
   trunk/data/maps/runningman_1on1remix.mapinfo
   trunk/data/qcsrc/common/mapinfo.qc
   trunk/data/qcsrc/server/g_world.qc
Log:
search for map name right; fix runningman_1on1remix.mapinfo; put game type in log files


Modified: trunk/data/maps/runningman_1on1remix.mapinfo
===================================================================
--- trunk/data/maps/runningman_1on1remix.mapinfo	2007-11-21 19:31:37 UTC (rev 2987)
+++ trunk/data/maps/runningman_1on1remix.mapinfo	2007-11-22 14:39:57 UTC (rev 2988)
@@ -9,3 +9,4 @@
 type rune 200 20
 type lms 9 20
 type arena 10 20
+type kh 1000 20 3

Modified: trunk/data/qcsrc/common/mapinfo.qc
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qc	2007-11-21 19:31:37 UTC (rev 2987)
+++ trunk/data/qcsrc/common/mapinfo.qc	2007-11-22 14:39:57 UTC (rev 2988)
@@ -471,12 +471,12 @@
 	float l, r, m, cmp;
 	l = 0;
 	r = MapInfo_count;
-	_MapInfo_FindName_match = string_null;
 	// invariants: r is behind s, l-1 is equal or before
 	while(l != r)
 	{
 		m = floor((l + r) / 2);
-		cmp = strcasecmp(_MapInfo_GlobItem(HugeSetOfIntegers_get(_MapInfo_filtered, m)), s);
+		_MapInfo_FindName_match = _MapInfo_GlobItem(HugeSetOfIntegers_get(_MapInfo_filtered, m));
+		cmp = strcasecmp(_MapInfo_FindName_match, s);
 		if(cmp == 0)
 			return m; // found and good
 		if(cmp < 0)
@@ -484,18 +484,27 @@
 		else
 			r = m; // behind s
 	}
+	_MapInfo_FindName_match = _MapInfo_GlobItem(HugeSetOfIntegers_get(_MapInfo_filtered, l));
 	// r == l, so: l is behind s, l-1 is before
 	// SO: if there is any, l is the one with the right prefix
 	//     and l+1 may be one too
 	if(l == MapInfo_count)
+	{
+		_MapInfo_FindName_match = string_null;
 		return -1; // no _MapInfo_FindName_match, behind last item
-	_MapInfo_FindName_match = _MapInfo_GlobItem(HugeSetOfIntegers_get(_MapInfo_filtered, l));
+	}
 	if(!startsWith(_MapInfo_FindName_match, s))
+	{
+		_MapInfo_FindName_match = string_null;
 		return -1; // wrong prefix
+	}
 	if(l == MapInfo_count - 1)
 		return l; // last one, nothing can follow => unique
 	if(startsWith(_MapInfo_GlobItem(HugeSetOfIntegers_get(_MapInfo_filtered, l + 1)), s))
+	{
+		_MapInfo_FindName_match = string_null;
 		return -1; // ambigous _MapInfo_FindName_match
+	}
 	return l;
 }
 

Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2007-11-21 19:31:37 UTC (rev 2987)
+++ trunk/data/qcsrc/server/g_world.qc	2007-11-22 14:39:57 UTC (rev 2988)
@@ -2,6 +2,7 @@
 string redirection_target;
 
 string GetMapname();
+string GetGametype();
 void GotoNextMap();
 void ShuffleMaplist()
 float() DoNextMapOverride;
@@ -319,7 +320,11 @@
 		GameLogEcho(":logversion:2", FALSE);
 		s = strcat(cvar_string("sv_eventlog_files_counter"), ".");
 		s = strcat(s, ftos(random()));
+#ifdef MAPINFO
+		GameLogEcho(strcat(":gamestart:", GetGametype(), "_", GetMapname(), ":", s, ":"), FALSE);
+#else
 		GameLogEcho(strcat(":gamestart:", GetMapname(), ":", s), FALSE);
+#endif
 		s = ":gameinfo:mutators:LIST";
 		if(g_grappling_hook)
 			s = strcat(s, ":grappling_hook");
@@ -969,7 +974,11 @@
 		s = ":scores:";
 	else
 		s = ":status:";
+#ifdef MAPINFO
+	s = strcat(s, GetGametype(), "_", GetMapname(), ":", ftos(rint(time)));
+#else
 	s = strcat(s, GetMapname(), ":", ftos(rint(time)));
+#endif
 
 	if(to_console)
 		ServerConsoleEcho(s, FALSE);




More information about the nexuiz-commits mailing list