r5443 - in trunk/data: . qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Jan 8 02:25:45 EST 2009


Author: div0
Date: 2009-01-08 02:25:45 -0500 (Thu, 08 Jan 2009)
New Revision: 5443

Modified:
   trunk/data/defaultNexuiz.cfg
   trunk/data/qcsrc/server/extensions.qh
   trunk/data/qcsrc/server/scores.qc
Log:
new cvar g_full_getstatus_responses to annoy qstat with full status info ;)


Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg	2009-01-08 01:46:14 UTC (rev 5442)
+++ trunk/data/defaultNexuiz.cfg	2009-01-08 07:25:45 UTC (rev 5443)
@@ -1288,3 +1288,6 @@
 set g_ballistics_force_shotgun_bulletconstant 75 // 3.8qu
 
 set cl_stripcolorcodes 0 // experimental feature (notes: strips ALL color codes from messages!)
+
+sv_status_show_qcstatus 1 // Nexuiz uses this field instead of frags
+set g_full_getstatus_responses 0 // this currently breaks qstat

Modified: trunk/data/qcsrc/server/extensions.qh
===================================================================
--- trunk/data/qcsrc/server/extensions.qh	2009-01-08 01:46:14 UTC (rev 5442)
+++ trunk/data/qcsrc/server/extensions.qh	2009-01-08 07:25:45 UTC (rev 5443)
@@ -1275,7 +1275,12 @@
 //idea: div0
 //darkplaces implementation: div0
 //Fields whose contents are used instead of frags, or set as "qcstatus" field
-//in the getstatus/getinfo response.
+//in the getstatus/getinfo response (limited to 255 characters).
+//Note: qstat currently can't cope with clientstatus being any other than a
+//ftos'ed integer value.
+//Also, when you put the frags in clientstatus, you may want to set the cvar
+//sv_status_use_qcstatus to 1 so this value, converted to an integer, is
+//displayed as frags in "status" replies instead of the "frags" float field.
 string worldstatus;
 .string clientstatus;
 

Modified: trunk/data/qcsrc/server/scores.qc
===================================================================
--- trunk/data/qcsrc/server/scores.qc	2009-01-08 01:46:14 UTC (rev 5442)
+++ trunk/data/qcsrc/server/scores.qc	2009-01-08 07:25:45 UTC (rev 5443)
@@ -323,10 +323,14 @@
 	float c;
 	string s;
 	entity p;
+	float fullstatus;
+
 	s = GetGametype();
 	s = strcat(s, ":", cvar_string("g_nexuizversion"));
 	s = strcat(s, "::", GetPlayerScoreString(world, 2)); // make this 1 once we can
 
+	fullstatus = cvar("g_full_getstatus_responses");
+
 	if(teamscores_entities_count)
 	{
 		float t;
@@ -427,21 +431,25 @@
 
 	FOR_EACH_CLIENT(p)
 	{
-		/* this breaks qstat :( find a way to make qstat parse this at least as an int first
-		s = GetPlayerScoreString(p, 1);
-		if(clienttype(p) == CLIENTTYPE_REAL)
-			s = strcat(s, ":human");
+		if(fullstatus)
+		{
+			s = GetPlayerScoreString(p, 1);
+			if(clienttype(p) == CLIENTTYPE_REAL)
+				s = strcat(s, ":human");
+			else
+				s = strcat(s, ":bot");
+			if(p.classname == "player" || g_arena || g_lms)
+				s = strcat(s, ":", ftos(p.team));
+			else
+				s = strcat(s, ":spectator");
+		}
 		else
-			s = strcat(s, ":bot");
-		if(p.classname == "player" || g_arena || g_lms)
-			s = strcat(s, ":", ftos(p.team));
-		else
-			s = strcat(s, ":spectator");
-		*/
-		if(p.classname == "player" || g_arena || g_lms)
-			s = GetPlayerScoreString(p, 2);
-		else
-			s = "-666";
+		{
+			if(p.classname == "player" || g_arena || g_lms)
+				s = GetPlayerScoreString(p, 2);
+			else
+				s = "-666";
+		}
 
 		if(p.clientstatus)
 			strunzone(p.clientstatus);




More information about the nexuiz-commits mailing list