From 670cdfb80ee861fdb7fbcbdb4de7a21863911fca Mon Sep 17 00:00:00 2001 From: FruitieX Date: Mon, 11 Apr 2011 22:46:59 +0300 Subject: [PATCH] some debug prints, distance culling (cvarred) --- defaultXonotic.cfg | 2 ++ qcsrc/client/Main.qc | 3 ++- qcsrc/server/autocvars.qh | 1 + qcsrc/server/cl_player.qc | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index ffd314825..c7cd0d032 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -402,6 +402,8 @@ net_connecttimeout 30 sv_jumpstep 1 // step up stairs while jumping, makes it easier to reach ledges set ekg 0 "Throw huge amounts of gibs" +sv_shownames_cull_distance 1000 "distance after which to not send origin/health/armor of another player" + cl_movement 1 cl_movement_track_canjump 0 cl_stairsmoothspeed 200 diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 144e1f79f..87b3997e6 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -914,6 +914,7 @@ void Ent_ShowNames() sf = ReadByte(); the_entnum = ReadByte(); + print("sendflags: ", ftos(sf), "\n"); if(sf & 1) { @@ -921,12 +922,12 @@ void Ent_ShowNames() playerslots[the_entnum].origin_y = ReadShort(); playerslots[the_entnum].origin_z = ReadShort(); print("Updated origin = ", vtos(playerslots[the_entnum].origin), " for player ", GetPlayerName(the_entnum-1), "\n"); + print("Their health/armor = ", playerslots[the_entnum].health, "/", playerslots[the_entnum].armorvalue, "\n"); } if(sf & 2) { playerslots[the_entnum].health = ReadByte(); playerslots[the_entnum].armorvalue = ReadByte(); - print("Updated health/armor = ", ftos(playerslots[the_entnum].health), "/", ftos(playerslots[the_entnum].health), "\n"); } /* diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index d5652b775..485d2b103 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -1232,3 +1232,4 @@ float autocvar_waypoint_benchmark; float autocvar_welcome_message_time; float autocvar_sv_gameplayfix_gravityunaffectedbyticrate; float autocvar_g_trueaim_minrange; +float autocvar_sv_shownames_cull_distance; diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 85e557c96..4de460f85 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -736,6 +736,9 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht // sendflags use: 1 = origin, 2 = health/armor, 0x80 = same team (includes health) float SendEntity_ShowNames(entity to, float sendflags) { + if(vlen(to.origin - self.origin) < autocvar_sv_shownames_cull_distance) // distance cull + return; + WriteByte(MSG_ENTITY, ENT_CLIENT_SHOWNAMES); //sendflags &= 127; if(teams_matter && self.team == to.team) -- 2.39.2