update pingdisplay only once per second
this will make sense later......
This commit is contained in:
1 parent
8ae6f71578
commit
4140f93e41
6 files changed
+44
-3
No files matched your search
+10
-2
@@ -125,6 +125,7 @@ static tic_t freezetimeout[MAXNETNODES]; // Until when can this node freeze the
|
||||
UINT16 pingmeasurecount = 1;
|
||||
UINT32 realpingtable[MAXPLAYERS] = {}; //the base table of ping where an average will be sent to everyone.
|
||||
UINT32 playerpingtable[MAXPLAYERS] = {}; //table of player latency values.
|
||||
UINT32 localplayerping = 0;
|
||||
|
||||
#define GENTLEMANSMOOTHING (TICRATE)
|
||||
static tic_t reference_lag = 0;
|
||||
@@ -4447,6 +4448,7 @@ void SV_ResetServer(void)
|
||||
pingmeasurecount = 1;
|
||||
memset(realpingtable, 0, sizeof(realpingtable));
|
||||
memset(playerpingtable, 0, sizeof(playerpingtable));
|
||||
localplayerping = 0;
|
||||
|
||||
ClearAdminPlayers();
|
||||
|
||||
@@ -6983,10 +6985,12 @@ static void UpdatePingTable(void)
|
||||
|
||||
INT32 i;
|
||||
|
||||
const boolean playing = Playing();
|
||||
|
||||
if (server)
|
||||
{
|
||||
//if (Playing() && !(gametime % 8)) // Value chosen based on _my vibes man_ << dont do this for v8 atleast, this is placeboeing ppl to hell and back
|
||||
if (Playing() && !(gametime % 35)) // update once per second.
|
||||
//if (playing && !(gametime % 8)) // Value chosen based on _my vibes man_ << dont do this for v8 atleast, this is placeboeing ppl to hell and back
|
||||
if (playing && !(gametime % 35)) // update once per second.
|
||||
PingUpdate();
|
||||
|
||||
fastest = 0;
|
||||
@@ -7045,6 +7049,10 @@ static void UpdatePingTable(void)
|
||||
else
|
||||
lowest_lag = simulated_lag = 0;
|
||||
}
|
||||
|
||||
// this is really dumb but oh well
|
||||
if (playing && !(gametime % 35))
|
||||
localplayerping = playerpingtable[consoleplayer];
|
||||
}
|
||||
|
||||
#ifdef HOLEPUNCH
|
||||
|
||||
@@ -650,6 +650,8 @@ extern UINT8 playernode[MAXPLAYERS];
|
||||
|
||||
extern boolean player_muted[MAXPLAYERS];
|
||||
|
||||
extern UINT32 localplayerping;
|
||||
|
||||
INT32 D_NumPlayers(void);
|
||||
|
||||
void D_ResetTiccmds(void);
|
||||
|
||||
@@ -2478,6 +2478,26 @@ void HU_drawPlayerPing(INT32 x, INT32 y, INT32 pnum, INT32 flags)
|
||||
}
|
||||
}
|
||||
|
||||
void HU_drawLocalPlayerPing(INT32 x, INT32 y, INT32 flags)
|
||||
{
|
||||
UINT32 lag = localplayerping;
|
||||
const boolean gentleman = (cv_mindelay.value && (lag < (tic_t)simulated_lag));
|
||||
|
||||
if (gentleman)
|
||||
{
|
||||
lag = simulated_lag;
|
||||
}
|
||||
|
||||
if (cv_pingstyle.value == 0) // kart
|
||||
{
|
||||
HU_drawKartPing(x, y, lag, flags, gentleman);
|
||||
}
|
||||
else if (cv_pingstyle.value == 1) // old style ping
|
||||
{
|
||||
HU_drawOldPing(x, y, lag, flags, gentleman);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// HU_DrawSpectatorTicker
|
||||
//
|
||||
|
||||
@@ -104,6 +104,7 @@ void HU_Drawer(void);
|
||||
char HU_dequeueChatChar(void);
|
||||
void HU_clearChatChars(void);
|
||||
void HU_drawPlayerPing(INT32 x, INT32 y, INT32 pnum, INT32 flags); // Lat': Ping drawer for scoreboard.
|
||||
void HU_drawLocalPlayerPing(INT32 x, INT32 y, INT32 flags);
|
||||
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 hilicol);
|
||||
void HU_DrawEmeralds(INT32 x, INT32 y, INT32 pemeralds);
|
||||
const char *HU_SkinColorToConsoleColor(skincolors_t color);
|
||||
|
||||
+1
-1
@@ -530,6 +530,6 @@ void SCR_DisplayLocalPing(void)
|
||||
if (cv_showping.value == 1 || (cv_showping.value == 2 && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level
|
||||
{
|
||||
INT32 dispy = (cv_ticrate.value == 1) ? 165 : ((cv_ticrate.value == 2 || cv_ticrate.value == 4) ? 172 : ((cv_ticrate.value == 3) ? 163 : 181)); // absolute buttpain
|
||||
HU_drawPlayerPing(308, dispy, consoleplayer, pingflags); // consoleplayer's ping is everyone's ping in a splitnetgame :P
|
||||
HU_drawLocalPlayerPing(308, dispy, pingflags); // consoleplayer's ping is everyone's ping in a splitnetgame :P
|
||||
}
|
||||
}
|
||||
@@ -2203,6 +2203,7 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string)
|
||||
{
|
||||
if (!*ch)
|
||||
break;
|
||||
|
||||
if (*ch & 0x80) //color parsing -x 2.16.09
|
||||
{
|
||||
// manually set flags override color codes
|
||||
@@ -2213,6 +2214,7 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (*ch == '\n')
|
||||
{
|
||||
cx = x;
|
||||
@@ -2247,6 +2249,7 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string)
|
||||
|
||||
if (cx > scrwidth)
|
||||
break;
|
||||
|
||||
if (cx+left + w < 0) //left boundary check
|
||||
{
|
||||
cx += w;
|
||||
@@ -2304,6 +2307,7 @@ void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string)
|
||||
{
|
||||
if (!*ch)
|
||||
break;
|
||||
|
||||
if (*ch & 0x80) //color parsing -x 2.16.09
|
||||
{
|
||||
// manually set flags override color codes
|
||||
@@ -2314,6 +2318,7 @@ void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (*ch == '\n')
|
||||
{
|
||||
cx = x;
|
||||
@@ -2348,6 +2353,7 @@ void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string)
|
||||
|
||||
if (cx > scrwidth)
|
||||
break;
|
||||
|
||||
if (cx+left + w < 0) //left boundary check
|
||||
{
|
||||
cx += w;
|
||||
@@ -2422,6 +2428,7 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string)
|
||||
{
|
||||
if (!*ch)
|
||||
break;
|
||||
|
||||
if (*ch & 0x80) //color parsing -x 2.16.09
|
||||
{
|
||||
// manually set flags override color codes
|
||||
@@ -2432,6 +2439,7 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (*ch == '\n')
|
||||
{
|
||||
cx = x;
|
||||
@@ -2540,6 +2548,7 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string)
|
||||
{
|
||||
if (!*ch)
|
||||
break;
|
||||
|
||||
if (*ch & 0x80) //color parsing -x 2.16.09
|
||||
{
|
||||
// manually set flags override color codes
|
||||
@@ -2550,6 +2559,7 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (*ch == '\n')
|
||||
{
|
||||
cx = x;
|
||||
|
||||
Reference in new issue
Block a user