r5766 - in trunk/data: . gfx qcsrc/client qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Feb 6 01:43:47 EST 2009


Author: div0
Date: 2009-02-06 01:43:47 -0500 (Fri, 06 Feb 2009)
New Revision: 5766

Added:
   trunk/data/gfx/sb_player_ready.tga
Modified:
   trunk/data/build-compat-pack.sh
   trunk/data/qcsrc/client/Main.qc
   trunk/data/qcsrc/client/main.qh
   trunk/data/qcsrc/client/sbar.qc
   trunk/data/qcsrc/server/clientcommands.qc
Log:
ready status indicator in scoreboard


Modified: trunk/data/build-compat-pack.sh
===================================================================
--- trunk/data/build-compat-pack.sh	2009-02-06 01:19:58 UTC (rev 5765)
+++ trunk/data/build-compat-pack.sh	2009-02-06 06:43:47 UTC (rev 5766)
@@ -28,6 +28,7 @@
 	gfx/sb_flag_red_shielded.tga
 	gfx/sb_kh_full.tga
 	gfx/sb_kh_outline.tga
+	gfx/sb_player_ready.tga
 	gfx/sb_playercolor_base.tga
 	gfx/sb_playercolor_pants.tga
 	gfx/sb_playercolor_shirt.tga

Added: trunk/data/gfx/sb_player_ready.tga
===================================================================
(Binary files differ)


Property changes on: trunk/data/gfx/sb_player_ready.tga
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc	2009-02-06 01:19:58 UTC (rev 5765)
+++ trunk/data/qcsrc/client/Main.qc	2009-02-06 06:43:47 UTC (rev 5766)
@@ -69,7 +69,12 @@
 	menu_visible = FALSE;
 	menu_show = menu_show_error;
 	menu_action = menu_sub_null;
-	maxclients = 255; // we later get the real maxclients to speed up stuff
+
+	for(i = 0; i < 255; ++i)
+		if(getplayerkey(i, "viewentity") == "")
+			break;
+	maxclients = i;
+
 	//ctf_temp_1 = "";
 	// localcmd("alias order \"cmd order $*\""); enable if ctf-command thingy is used
 	//registercmd("ctf_menu");
@@ -663,7 +668,7 @@
 
 void Ent_Nagger()
 {
-	float nags;
+	float nags, i, j, b, f;
 
 	nags = ReadByte();
 
@@ -674,6 +679,21 @@
 		vote_called_vote = strzone(ColorTranslateRGB(ReadString()));
 	}
 
+	if(nags & 1)
+	{
+		for(j = 0; j < maxclients; ++j)
+			if(playerslots[j])
+				playerslots[j].ready = 1;
+		for(i = 1; i <= maxclients; i += 8)
+		{
+			f = ReadByte();
+			for(j = i-1, b = 1; b < 256; b *= 2, ++j)
+				if not(f & b)
+					if(playerslots[j])
+						playerslots[j].ready = 0;
+		}
+	}
+
 	ready_waiting = (nags & 1);
 	ready_waiting_for_me = (nags & 2);
 	vote_waiting = (nags & 4);
@@ -830,7 +850,9 @@
 
 	csqc_revision = ReadShort();
 
+	print("prev maxclients = ", ftos(maxclients), "\n");
 	maxclients = ReadByte();
+	print("new maxclients = ", ftos(maxclients), "\n");
 	for(i = 0; i < 24; ++i)
 		weaponimpulse[i] = ReadByte() - 1;
 	hook_shotorigin_x = ReadCoord();

Modified: trunk/data/qcsrc/client/main.qh
===================================================================
--- trunk/data/qcsrc/client/main.qh	2009-02-06 01:19:58 UTC (rev 5765)
+++ trunk/data/qcsrc/client/main.qh	2009-02-06 06:43:47 UTC (rev 5766)
@@ -107,6 +107,7 @@
 entity teamslots[17];    // 17 teams (including "spectator team")
 .float gotscores;
 .entity owner;
+.float ready;
 
 .void(void) draw;
 .void(void) draw2d;

Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc	2009-02-06 01:19:58 UTC (rev 5765)
+++ trunk/data/qcsrc/client/sbar.qc	2009-02-06 06:43:47 UTC (rev 5766)
@@ -609,11 +609,18 @@
 			if(!teamplay)
 			{
 				f = stof(getplayerkey(pl.sv_entnum, "colors"));
-				sbar_field_icon0 = "gfx/sb_playercolor_base";
-				sbar_field_icon1 = "gfx/sb_playercolor_shirt";
-				sbar_field_icon1_rgb = colormapPaletteColor(floor(f / 16), 0);
-				sbar_field_icon2 = "gfx/sb_playercolor_pants";
-				sbar_field_icon2_rgb = colormapPaletteColor(mod(f, 16), 1);
+				if(ready_waiting && pl.ready)
+				{
+					sbar_field_icon0 = "gfx/sb_player_ready";
+				}
+				else
+				{
+					sbar_field_icon0 = "gfx/sb_playercolor_base";
+					sbar_field_icon1 = "gfx/sb_playercolor_shirt";
+					sbar_field_icon1_rgb = colormapPaletteColor(floor(f / 16), 0);
+					sbar_field_icon2 = "gfx/sb_playercolor_pants";
+					sbar_field_icon2_rgb = colormapPaletteColor(mod(f, 16), 1);
+				}
 			}
 			return GetPlayerName(pl.sv_entnum);
 

Modified: trunk/data/qcsrc/server/clientcommands.qc
===================================================================
--- trunk/data/qcsrc/server/clientcommands.qc	2009-02-06 01:19:58 UTC (rev 5765)
+++ trunk/data/qcsrc/server/clientcommands.qc	2009-02-06 06:43:47 UTC (rev 5766)
@@ -2,7 +2,8 @@
 float readycount;
 float Nagger_SendEntity(entity to, float sendflags)
 {
-	float nags;
+	float nags, i, f, b;
+	entity e;
 	WriteByte(MSG_ENTITY, ENT_CLIENT_NAGGER);
 
 	nags = 0;
@@ -22,15 +23,28 @@
 		nags |= 16;
 
 	if(sendflags & 128)
+		nags |= 128;
+
+	WriteByte(MSG_ENTITY, nags);
+
+	if(nags & 128)
 	{
-		WriteByte(MSG_ENTITY, nags | 128);
 		if(votecalled)
 			WriteString(MSG_ENTITY, votecalledvote_display);
 		else
 			WriteString(MSG_ENTITY, "");
 	}
-	else
-		WriteByte(MSG_ENTITY, nags);
+	
+	if(nags & 1)
+	{
+		for(i = 1; i <= maxclients; i += 8)
+		{
+			for(f = 0, e = edict_num(i), b = 1; b < 256; b *= 2, e = nextent(e))
+				if(clienttype(e) != CLIENTTYPE_REAL || e.ready)
+					f |= b;
+			WriteByte(MSG_ENTITY, f);
+		}
+	}
 
 	return TRUE;
 }




More information about the nexuiz-commits mailing list