From 6054901c62e3e0b472d5b8e80d6708ada15d15f9 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Fri, 15 Feb 2019 20:51:44 -0600 Subject: [PATCH 01/11] Ping kick changes + other quality of life improvements [REDO] --- src/d_clisrv.c | 43 +++++++++++++++++++++++++++++++++++++------ src/d_clisrv.h | 1 + src/d_netcmd.c | 10 ++++++++++ src/d_netcmd.h | 2 ++ src/hu_stuff.c | 28 ++++++++++++++++++++++++++-- src/m_menu.c | 20 ++++++++++++-------- 6 files changed, 88 insertions(+), 16 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 961c1e59..04816fd1 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -93,6 +93,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. +tic_t servermaxping = 800; // server's max ping. Defaults to 800 #endif SINT8 nodetoplayer[MAXNETNODES]; SINT8 nodetoplayer2[MAXNETNODES]; // say the numplayer for this node if any (splitscreen) @@ -4355,6 +4356,9 @@ FILESTAMP for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]) playerpingtable[i] = (tic_t)netbuffer->u.pingtable[i]; + + servermaxping = (tic_t)netbuffer->u.pingtable[i++]; + CONS_Printf("got server maxping: %d\n", servermaxping); } break; @@ -4997,6 +5001,18 @@ void TryRunTics(tic_t realtics) } #ifdef NEWPING + +/* Ping Update except better: + We call this once per second and check for people's pings. If their ping happens to be too high, we increment some timer and kick them out. + If they're not lagging, decrement the timer by 1. Of course, reset all of this if they leave. + + Why do we do that? Well, I'm a person with unfortunately sometimes unstable internet and happen to keep getting kicked very unconveniently for very short high spikes. (700+ ms) + Because my spikes are so high, the average ping is exponentially higher too (700s really add up...!) which leads me to getting kicked for a short burst of spiking. + With this change here, this doesn't happen anymore as it checks if my ping has been CONSISTENTLY bad for long enough before killing me. +*/ + +static INT32 pingtimeout[MAXPLAYERS]; + static inline void PingUpdate(void) { INT32 i; @@ -5017,6 +5033,9 @@ static inline void PingUpdate(void) laggers[i] = true; numlaggers++; } + else + pingtimeout[i] = 0; + } //kick lagging players... unless everyone but the server's ping sucks. @@ -5027,12 +5046,21 @@ static inline void PingUpdate(void) { if (playeringame[i] && laggers[i]) { - XBOXSTATIC char buf[2]; + pingtimeout[i]++; + CONS_Printf("Player %d is lagging, incrementing timeout... %d/%d\n", i, pingtimeout[i], cv_pingtimeout.value); // debug print, don't forget to remove this... - buf[0] = (char)i; - buf[1] = KICK_MSG_PING_HIGH; - SendNetXCmd(XD_KICK, &buf, 2); + if (pingtimeout[i] > cv_pingtimeout.value) // ok your net has been bad for too long, you deserve to die. + { + pingtimeout[i] = 0; + XBOXSTATIC char buf[2]; + + buf[0] = (char)i; + buf[1] = KICK_MSG_PING_HIGH; + SendNetXCmd(XD_KICK, &buf, 2); + } } + else // you aren't lagging, but you aren't free yet. In case you'll keep spiking, we just make the timer go back down. (Very unstable net must still get kicked). + pingtimeout[i] = (pingtimeout[i] == 0 ? 0 : pingtimeout[i]-1); } } } @@ -5047,10 +5075,13 @@ static inline void PingUpdate(void) realpingtable[i] = 0; //Reset each as we go. } + // send the server's maxping as last element of our ping table. This is useful to let us know when we're about to get kicked. + netbuffer->u.pingtable[i++] = cv_maxping.value; + //send out our ping packets for (i = 0; i < MAXNETNODES; i++) if (nodeingame[i]) - HSendPacket(i, true, 0, sizeof(INT32) * MAXPLAYERS); + HSendPacket(i, true, 0, sizeof(INT32) * (MAXPLAYERS+1)); pingmeasurecount = 1; //Reset count } @@ -5064,7 +5095,7 @@ static void UpdatePingTable(void) INT32 i; if (server) { - if (netgame && !(gametime % 255)) + if (netgame && !(gametime % 35)) // update once per second. PingUpdate(); // update node latency values so we can take an average later. for (i = 0; i < MAXPLAYERS; i++) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 62bd8bc1..04569198 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -519,6 +519,7 @@ extern tic_t jointimeout; extern UINT16 pingmeasurecount; extern UINT32 realpingtable[MAXPLAYERS]; extern UINT32 playerpingtable[MAXPLAYERS]; +extern tic_t servermaxping; #endif extern consvar_t diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 438cdcd5..ce54960d 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -435,6 +435,14 @@ consvar_t cv_jointimeout = {"jointimeout", "105", CV_CALL|CV_SAVE, nettimeout_co #ifdef NEWPING static CV_PossibleValue_t maxping_cons_t[] = {{0, "MIN"}, {1000, "MAX"}, {0, NULL}}; consvar_t cv_maxping = {"maxping", "800", CV_SAVE, maxping_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + +static CV_PossibleValue_t pingtimeout_cons_t[] = {{8, "MIN"}, {120, "MAX"}, {0, NULL}}; +consvar_t cv_pingtimeout = {"pingtimeout", "15", CV_SAVE, pingtimeout_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + +// show your ping on the HUD next to framerate. Defaults to warning only (shows up if your ping is > maxping) +static CV_PossibleValue_t showping_cons_t[] = {{0, "Off"}, {1, "Always"}, {2, "Warning"}, {0, NULL}}; +consvar_t cv_showping = {"showping", "Warning", CV_SAVE, showping_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + #endif // Intermission time Tails 04-19-2002 static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}}; @@ -664,6 +672,8 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_sleep); #ifdef NEWPING CV_RegisterVar(&cv_maxping); + CV_RegisterVar(&cv_pingtimeout); + CV_RegisterVar(&cv_showping); #endif #ifdef SEENAMES diff --git a/src/d_netcmd.h b/src/d_netcmd.h index c590eee6..54c00484 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -145,6 +145,8 @@ extern consvar_t cv_specialrings, cv_powerstones, cv_matchboxes, cv_competitionb #ifdef NEWPING extern consvar_t cv_maxping; +extern consvar_t cv_pingtimeout; +extern consvar_t cv_showping; #endif extern consvar_t cv_skipmapcheck; diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 3d8f2383..216d14b0 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2178,6 +2178,22 @@ static void HU_DrawSongCredits(void) V_DrawRightAlignedThinString(cursongcredit.x, y, V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_SNAPTOLEFT|(cursongcredit.trans< servermaxping)) // only show 2 (warning) if our ping is at a bad level + { + INT32 dispx = cv_ticrate.value ? 260 : 290; + HU_drawPing(dispx, 190, ping, false); + } +} + // Heads up displays drawer, call each frame // void HU_Drawer(void) @@ -2290,6 +2306,9 @@ void HU_Drawer(void) V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_YELLOWMAP | V_ALLOWLOWERCASE, resynch_text); } + + // draw the ping if the user wishes to + HU_drawLocalPing(); } //====================================================================== @@ -2376,6 +2395,7 @@ void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext) SINT8 i = 0; SINT8 yoffset = 6; INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2); + boolean highping = (servermaxping && ping > servermaxping) ? true : false; if (ping < 128) { @@ -2387,13 +2407,17 @@ void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext) numbars = 2; // Apparently ternaries w/ multiple statements don't look good in C so I decided against it. barcolor = 103; } + else if (highping) // yikes...! + { + numbars = 0; + } if (!notext || vid.width >= 640) // how sad, we're using a shit resolution. - V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE, va("%dms", ping)); + V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE|((highping && hu_tick < 4) ? V_REDMAP : 0), va("%dms", ping)); for (i=0; (i<3); i++) // Draw the ping bar { - V_DrawFill(x+2 *(i-1), y+yoffset-4, 2, 8-yoffset, 31); + V_DrawFill(x+2 *(i-1), y+yoffset-4, 2, 8-yoffset, (highping && hu_tick < 4) ? 128 : 31); if (i < numbars) V_DrawFill(x+2 *(i-1), y+yoffset-3, 1, 8-yoffset-1, barcolor); diff --git a/src/m_menu.c b/src/m_menu.c index d8b1c2d7..966f4fa7 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1390,7 +1390,7 @@ static menuitem_t OP_HUDOptionsMenu[] = {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "HUD Visibility", &cv_translucenthud, 20}, - {IT_STRING | IT_SUBMENU, NULL, "Online chat options...",&OP_ChatOptionsDef, 35}, + {IT_STRING | IT_SUBMENU, NULL, "Online HUD options...",&OP_ChatOptionsDef, 35}, {IT_STRING | IT_CVAR, NULL, "Background Glass", &cons_backcolor, 45}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, @@ -1404,6 +1404,7 @@ static menuitem_t OP_HUDOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 120}, }; +// Ok it's still called chatoptions but we'll put ping display in here to be clean static menuitem_t OP_ChatOptionsMenu[] = { // will ANYONE who doesn't know how to use the console want to touch this one? @@ -1417,6 +1418,8 @@ static menuitem_t OP_ChatOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Chat Background Tint", &cv_chatbacktint, 50}, {IT_STRING | IT_CVAR, NULL, "Message Fadeout Time", &cv_chattime, 60}, {IT_STRING | IT_CVAR, NULL, "Spam Protection", &cv_chatspamprotection, 70}, + + {IT_STRING | IT_CVAR, NULL, "Local ping display", &cv_showping, 90}, // shows ping next to framerate if we want to. }; static menuitem_t OP_GameOptionsMenu[] = @@ -1469,15 +1472,16 @@ static menuitem_t OP_AdvServerOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 40}, {IT_STRING | IT_CVAR, NULL, "Ping limit (ms)", &cv_maxping, 50}, - {IT_STRING | IT_CVAR, NULL, "Connection timeout (tics)", &cv_nettimeout, 60}, - {IT_STRING | IT_CVAR, NULL, "Join timeout (tics)", &cv_jointimeout, 70}, + {IT_STRING | IT_CVAR, NULL, "Ping timeout (s)", &cv_pingtimeout, 60}, + {IT_STRING | IT_CVAR, NULL, "Connection timeout (tics)", &cv_nettimeout, 70}, + {IT_STRING | IT_CVAR, NULL, "Join timeout (tics)", &cv_jointimeout, 80}, - {IT_STRING | IT_CVAR, NULL, "Max. file transfer send (KB)", &cv_maxsend, 90}, - {IT_STRING | IT_CVAR, NULL, "File transfer packet rate", &cv_downloadspeed, 100}, + {IT_STRING | IT_CVAR, NULL, "Max. file transfer send (KB)", &cv_maxsend, 100}, + {IT_STRING | IT_CVAR, NULL, "File transfer packet rate", &cv_downloadspeed, 110}, - {IT_STRING | IT_CVAR, NULL, "Log join addresses", &cv_showjoinaddress, 120}, - {IT_STRING | IT_CVAR, NULL, "Log resyncs", &cv_blamecfail, 130}, - {IT_STRING | IT_CVAR, NULL, "Log file transfers", &cv_noticedownload, 140}, + {IT_STRING | IT_CVAR, NULL, "Log join addresses", &cv_showjoinaddress, 130}, + {IT_STRING | IT_CVAR, NULL, "Log resyncs", &cv_blamecfail, 140}, + {IT_STRING | IT_CVAR, NULL, "Log file transfers", &cv_noticedownload, 150}, }; #endif From 3349b9b196b6612c388ce65d11a1b1c4681bcaf4 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Fri, 15 Feb 2019 03:12:08 +0100 Subject: [PATCH 02/11] forgot to remove this print --- src/d_clisrv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 04816fd1..cb02bf83 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4358,7 +4358,6 @@ FILESTAMP playerpingtable[i] = (tic_t)netbuffer->u.pingtable[i]; servermaxping = (tic_t)netbuffer->u.pingtable[i++]; - CONS_Printf("got server maxping: %d\n", servermaxping); } break; From 07e56e550e9f203998d02d5a59906337de8ec01f Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Fri, 15 Feb 2019 21:08:08 -0600 Subject: [PATCH 03/11] New visuals for ping and fps display alike [REDO] --- src/d_main.c | 2 +- src/hu_stuff.c | 73 ++++++++++++++++++++++++++---------------------- src/hu_stuff.h | 6 +++- src/k_kart.c | 3 +- src/lua_hudlib.c | 19 +++++++++++++ src/screen.c | 20 +++++++++---- src/v_video.c | 22 +++++++++++++++ src/v_video.h | 4 +++ 8 files changed, 107 insertions(+), 42 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 5cf95f4b..b35296aa 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -932,7 +932,7 @@ static void IdentifyVersion(void) D_AddFile(va(pandf,srb2waddir,"chars.kart")); D_AddFile(va(pandf,srb2waddir,"maps.kart")); #ifdef USE_PATCH_KART - D_AddFile(va(pandf,srb2waddir,"patch.kart")); + D_AddFile(va(pandf,srb2waddir,"patchping.kart")); // also don't forget to change that, this is to avoid conflicting with our regular patch.kart #endif #if !defined (HAVE_SDL) || defined (HAVE_MIXER) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 216d14b0..7e9f703d 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -74,6 +74,14 @@ patch_t *nightsnum[10]; // 0-9 patch_t *lt_font[LT_FONTSIZE]; patch_t *cred_font[CRED_FONTSIZE]; +// ping font +// Note: I'd like to adress that at this point we might *REALLY* want to work towards a common drawString function that can take any font we want because this is really turning into a MESS. :V -Lat' +patch_t *pingnum[10]; +patch_t *pinggfx[5]; // small ping graphic + +patch_t *framecounter; +patch_t *frameslash; // framerate stuff. Used in screen.c + static player_t *plr; boolean chat_on; // entering a chat message? static char w_chat[HU_MAXMSGLEN]; @@ -263,6 +271,8 @@ void HU_LoadGraphics(void) tallnum[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX); sprintf(buffer, "NGTNUM%d", i); nightsnum[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX); + sprintf(buffer, "PINGN%d", i); + pingnum[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX); } // minus for negative tallnums @@ -295,6 +305,17 @@ void HU_LoadGraphics(void) tinyemeraldpics[6] = W_CachePatchName("TEMER7", PU_HUDGFX); songcreditbg = W_CachePatchName("K_SONGCR", PU_HUDGFX); + + // cache ping gfx: + for (i = 0; i < 5; i++) + { + sprintf(buffer, "PINGGFX%d", i+1); + pinggfx[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX); + } + + // fps stuff + framecounter = W_CachePatchName("FRAMER", PU_HUDGFX); + frameslash = W_CachePatchName("FRAMESL", PU_HUDGFX);; } // Initialise Heads up @@ -2183,14 +2204,14 @@ static void HU_DrawSongCredits(void) void HU_drawLocalPing(void) { - if (!cv_showping.value || !netgame || consoleplayer == serverplayer) // we don't want to see it or aren't in a netgame, or are the server + if (!cv_showping.value || !netgame || consoleplayer != serverplayer) // we don't want to see it or aren't in a netgame, or are the server return; INT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P if (cv_showping.value == 1 || (cv_showping.value == 2 && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level { - INT32 dispx = cv_ticrate.value ? 260 : 290; - HU_drawPing(dispx, 190, ping, false); + INT32 dispy = cv_ticrate.value ? 160 : 181; + HU_drawPing(307, dispy, ping, V_SNAPTORIGHT|V_SNAPTOBOTTOM); } } @@ -2388,41 +2409,25 @@ void HU_Erase(void) // // HU_drawPing // -void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext) +void HU_drawPing(INT32 x, INT32 y, INT32 ping, INT32 flags) { - UINT8 numbars = 1; // how many ping bars do we draw? - UINT8 barcolor = 128; // color we use for the bars (green, yellow or red) - SINT8 i = 0; - SINT8 yoffset = 6; - INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2); - boolean highping = (servermaxping && ping > servermaxping) ? true : false; + INT32 gfxnum = 4; // gfx to draw + UINT8 const *colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SALMON, GTC_CACHE); - if (ping < 128) - { - numbars = 3; - barcolor = 184; - } + if (ping < 76) + gfxnum = 0; + else if (ping < 137) + gfxnum = 1; else if (ping < 256) - { - numbars = 2; // Apparently ternaries w/ multiple statements don't look good in C so I decided against it. - barcolor = 103; - } - else if (highping) // yikes...! - { - numbars = 0; - } + gfxnum = 2; + else if (ping < 500) + gfxnum = 3; - if (!notext || vid.width >= 640) // how sad, we're using a shit resolution. - V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE|((highping && hu_tick < 4) ? V_REDMAP : 0), va("%dms", ping)); - - for (i=0; (i<3); i++) // Draw the ping bar - { - V_DrawFill(x+2 *(i-1), y+yoffset-4, 2, 8-yoffset, (highping && hu_tick < 4) ? 128 : 31); - if (i < numbars) - V_DrawFill(x+2 *(i-1), y+yoffset-3, 1, 8-yoffset-1, barcolor); - - yoffset -= 2; - } + V_DrawScaledPatch(x, y, flags, pinggfx[gfxnum]); + if (servermaxping && ping > servermaxping && hu_tick < 4) // flash ping red if too high + V_DrawPingNum(x, y+9, flags, ping, colormap); + else + V_DrawPingNum(x, y+9, flags, ping, NULL); } // diff --git a/src/hu_stuff.h b/src/hu_stuff.h index f1ecb2ff..0c94034d 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -80,7 +80,11 @@ extern boolean chat_on; extern patch_t *hu_font[HU_FONTSIZE], *kart_font[KART_FONTSIZE], *tny_font[HU_FONTSIZE]; // SRB2kart extern patch_t *tallnum[10]; +extern patch_t *pingnum[10]; +extern patch_t *pinggfx[5]; extern patch_t *nightsnum[10]; +extern patch_t *framecounter; +extern patch_t *frameslash; extern patch_t *lt_font[LT_FONTSIZE]; extern patch_t *cred_font[CRED_FONTSIZE]; extern patch_t *emeraldpics[7]; @@ -109,7 +113,7 @@ void HU_Drawer(void); char HU_dequeueChatChar(void); void HU_Erase(void); void HU_clearChatChars(void); -void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext); // Lat': Ping drawer for scoreboard. +void HU_drawPing(INT32 x, INT32 y, INT32 ping, INT32 flags); // Lat': Ping drawer for scoreboard. //void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer); //void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer); void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol); diff --git a/src/k_kart.c b/src/k_kart.c index 8d2936d3..ad6da417 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4682,6 +4682,7 @@ static void K_KartDrift(player_t *player, boolean onground) player->kartstuff[k_driftend] = 0; } + // Incease/decrease the drift value to continue drifting in that direction if (player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_jmp] == 1 && onground && player->kartstuff[k_drift] != 0) { @@ -7168,7 +7169,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I if (netgame // don't draw it offline && tab[i].num != serverplayer) - HU_drawPing(x + ((i < 8) ? -19 : rightoffset + 13), y+2, playerpingtable[tab[i].num], false); + HU_drawPing(x + ((i < 8) ? -17 : rightoffset + 11), y-4, playerpingtable[tab[i].num], 0); STRBUFCPY(strtime, tab[i].name); diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index cd8e0392..fb6814b2 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -410,6 +410,24 @@ static int libd_drawPaddedNum(lua_State *L) return 0; } + +static int libd_drawPingNum(lua_State *L) +{ + INT32 x, y, flags, num; + const UINT8 *colormap = NULL; + HUDONLY + x = luaL_checkinteger(L, 1); + y = luaL_checkinteger(L, 2); + num = luaL_checkinteger(L, 3); + flags = luaL_optinteger(L, 4, 0); + flags &= ~V_PARAMMASK; // Don't let crashes happen. + if (!lua_isnoneornil(L, 5)) + colormap = *((UINT8 **)luaL_checkudata(L, 5, META_COLORMAP)); + + V_DrawPingNum(x, y, flags, num, colormap); + return 0; +} + static int libd_drawFill(lua_State *L) { INT32 x = luaL_optinteger(L, 1, 0); @@ -613,6 +631,7 @@ static luaL_Reg lib_draw[] = { {"drawScaled", libd_drawScaled}, {"drawNum", libd_drawNum}, {"drawPaddedNum", libd_drawPaddedNum}, + {"drawPingNum", libd_drawPingNum}, {"drawFill", libd_drawFill}, {"fadeScreen", libd_fadeScreen}, {"drawString", libd_drawString}, diff --git a/src/screen.c b/src/screen.c index af6aed03..937d6caa 100644 --- a/src/screen.c +++ b/src/screen.c @@ -403,7 +403,7 @@ void SCR_DisplayTicRate(void) tic_t i; tic_t ontic = I_GetTime(); tic_t totaltics = 0; - INT32 ticcntcolor = 0; + const UINT8 *ticcntcolor = NULL; for (i = lasttic + 1; i < TICRATE+lasttic && i < ontic; ++i) fpsgraph[i % TICRATE] = false; @@ -414,13 +414,23 @@ void SCR_DisplayTicRate(void) if (fpsgraph[i]) ++totaltics; - if (totaltics <= TICRATE/2) ticcntcolor = V_REDMAP; - else if (totaltics == TICRATE) ticcntcolor = V_GREENMAP; + if (totaltics <= TICRATE/2) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SALMON, GTC_CACHE); + else if (totaltics == TICRATE) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_MINT, GTC_CACHE); - V_DrawString(vid.width-(24*vid.dupx), vid.height-(16*vid.dupy), + /*V_DrawString(vid.width-(24*vid.dupx), vid.height-(16*vid.dupy), V_YELLOWMAP|V_NOSCALESTART, "FPS"); V_DrawString(vid.width-(40*vid.dupx), vid.height-( 8*vid.dupy), - ticcntcolor|V_NOSCALESTART, va("%02d/%02u", totaltics, TICRATE)); + ticcntcolor|V_NOSCALESTART, va("%02d/%02u", totaltics, TICRATE));*/ + + // draw "FPS" + V_DrawFixedPatch(306<width); // this SHOULD always be 5 but I guess custom graphics exist. + + if (flags & V_NOSCALESTART) + w *= vid.dupx; + + if (num < 0) + num = -num; + + // draw the number + do + { + x -= (w-1); // Oni wanted their outline to intersect. + V_DrawFixedPatch(x< Date: Fri, 15 Feb 2019 22:30:13 +0100 Subject: [PATCH 04/11] Forgot to change this back from testing --- src/hu_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 7e9f703d..63673740 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2204,7 +2204,7 @@ static void HU_DrawSongCredits(void) void HU_drawLocalPing(void) { - if (!cv_showping.value || !netgame || consoleplayer != serverplayer) // we don't want to see it or aren't in a netgame, or are the server + if (!cv_showping.value || !netgame || consoleplayer == serverplayer) // we don't want to see it or aren't in a netgame, or are the server return; INT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P From 95bbb0d833002dce797779a15fe3998c7ef4dd99 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sat, 16 Feb 2019 02:40:55 +0100 Subject: [PATCH 05/11] Remove debug stuff --- src/d_clisrv.c | 2 -- src/d_main.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index cb02bf83..b5de6896 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5046,8 +5046,6 @@ static inline void PingUpdate(void) if (playeringame[i] && laggers[i]) { pingtimeout[i]++; - CONS_Printf("Player %d is lagging, incrementing timeout... %d/%d\n", i, pingtimeout[i], cv_pingtimeout.value); // debug print, don't forget to remove this... - if (pingtimeout[i] > cv_pingtimeout.value) // ok your net has been bad for too long, you deserve to die. { pingtimeout[i] = 0; diff --git a/src/d_main.c b/src/d_main.c index b35296aa..5cf95f4b 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -932,7 +932,7 @@ static void IdentifyVersion(void) D_AddFile(va(pandf,srb2waddir,"chars.kart")); D_AddFile(va(pandf,srb2waddir,"maps.kart")); #ifdef USE_PATCH_KART - D_AddFile(va(pandf,srb2waddir,"patchping.kart")); // also don't forget to change that, this is to avoid conflicting with our regular patch.kart + D_AddFile(va(pandf,srb2waddir,"patch.kart")); #endif #if !defined (HAVE_SDL) || defined (HAVE_MIXER) From a119d1cddd24215148575773fc06bb5b5bf1af02 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sat, 16 Feb 2019 12:19:03 +0100 Subject: [PATCH 06/11] Lower default ping timeout + Fix chat arrows being missing while we're at it --- src/d_netcmd.c | 2 +- src/hu_stuff.c | 4 ++-- src/v_video.c | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index ce54960d..53d88f2f 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -437,7 +437,7 @@ static CV_PossibleValue_t maxping_cons_t[] = {{0, "MIN"}, {1000, "MAX"}, {0, NUL consvar_t cv_maxping = {"maxping", "800", CV_SAVE, maxping_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t pingtimeout_cons_t[] = {{8, "MIN"}, {120, "MAX"}, {0, NULL}}; -consvar_t cv_pingtimeout = {"pingtimeout", "15", CV_SAVE, pingtimeout_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_pingtimeout = {"pingtimeout", "10", CV_SAVE, pingtimeout_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // show your ping on the HUD next to framerate. Defaults to warning only (shows up if your ping is > maxping) static CV_PossibleValue_t showping_cons_t[] = {{0, "Off"}, {1, "Always"}, {2, "Warning"}, {0, NULL}}; diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 63673740..3bc28c17 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1633,9 +1633,9 @@ static void HU_drawChatLog(INT32 offset) // draw arrows to indicate that we can (or not) scroll. if (chat_scroll > 0) - V_DrawThinString(chatx-9, ((justscrolledup) ? (chat_topy-1) : (chat_topy)), V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight, "\x1A"); // up arrow + V_DrawCharacter(chatx-9, ((justscrolledup) ? (chat_topy-1) : (chat_topy)), V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight | '\x1A', false); // up arrow if (chat_scroll < chat_maxscroll) - V_DrawThinString(chatx-9, chat_bottomy-((justscrolleddown) ? 5 : 6), V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight, "\x1B"); // down arrow + V_DrawCharacter(chatx-9, chat_bottomy-((justscrolleddown) ? 5 : 6), V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight | '\x1B', false); // down arrow justscrolleddown = false; justscrolledup = false; diff --git a/src/v_video.c b/src/v_video.c index 7cbcd99a..473adeed 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1342,8 +1342,8 @@ void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed) V_DrawScaledPatch(x, y, flags, hu_font[c]); } -// Writes a single character for the chat. (draw WHITE if bit 7 set) -// Essentially the same as the above but it's small or big depending on what resolution you've chosen to huge.. +// Writes a single character for the chat (half scaled). (draw WHITE if bit 7 set) +// 16/02/19: Scratch the scaling thing, chat doesn't work anymore under 2x res -Lat' // void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap) { @@ -1359,13 +1359,11 @@ void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UI if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) return; - w = (vid.width < 640 ) ? (SHORT(hu_font[c]->width)/2) : (SHORT(hu_font[c]->width)); // use normal sized characters if we're using a terribly low resolution. + w = SHORT(hu_font[c]->width)/2; if (x + w > vid.width) return; - V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, (vid.width < 640) ? (FRACUNIT) : (FRACUNIT/2), flags, hu_font[c], colormap); - - + V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT/2, flags, hu_font[c], colormap); } // Precompile a wordwrapped string to any given width. From 24516cbf8440b7534602292073a2093997be7910 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sat, 16 Feb 2019 13:38:50 +0100 Subject: [PATCH 07/11] Move ping display in i_video for consistency with showfps display --- src/djgppdos/i_video.c | 5 +++++ src/hu_stuff.c | 3 ++- src/sdl/i_video.c | 7 ++++++- src/sdl12/i_video.c | 5 +++++ src/win32/win_vid.c | 5 +++++ src/win32ce/win_vid.c | 5 +++++ 6 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/djgppdos/i_video.c b/src/djgppdos/i_video.c index 612c7221..69addfb0 100644 --- a/src/djgppdos/i_video.c +++ b/src/djgppdos/i_video.c @@ -41,6 +41,7 @@ #include "../m_argv.h" #include "vid_vesa.h" #include "../i_video.h" +#include "../hu_stuff.h" //dosstuff -newly added @@ -93,6 +94,10 @@ void I_FinishUpdate (void) // draw FPS if enabled if (cv_ticrate.value) SCR_DisplayTicRate(); + + // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. + // no additional checks are needed here, this function does them all so no need to worry. :) + HU_drawLocalPing(); //blast it to the screen // this code sucks diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 3bc28c17..404b4509 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2329,7 +2329,8 @@ void HU_Drawer(void) } // draw the ping if the user wishes to - HU_drawLocalPing(); + // THIS IS NOW HANDLED IN I_VIDEO + //HU_drawLocalPing(); } //====================================================================== diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 2a77604d..9e5e4b60 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -64,9 +64,10 @@ #include "../m_menu.h" #include "../d_main.h" #include "../s_sound.h" -#include "../i_sound.h" // midi pause/unpause +#include "../i_sound.h" // midi pause/unpause #include "../i_joy.h" #include "../st_stuff.h" +#include "../hu_stuff.h" // ping drawer #include "../g_game.h" #include "../i_video.h" #include "../console.h" @@ -1360,6 +1361,10 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + + // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. + // no additional checks are needed here, this function does them all so no need to worry. :) + HU_drawLocalPing(); if (rendermode == render_soft && screens[0]) { diff --git a/src/sdl12/i_video.c b/src/sdl12/i_video.c index 69cf5ca9..08e6bd94 100644 --- a/src/sdl12/i_video.c +++ b/src/sdl12/i_video.c @@ -99,6 +99,7 @@ #include "../i_sound.h" // midi pause/unpause #include "../i_joy.h" #include "../st_stuff.h" +#include "../hu_stuff.h" #include "../g_game.h" #include "../i_video.h" #include "../console.h" @@ -1342,6 +1343,10 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + + // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. + // no additional checks are needed here, this function does them all so no need to worry. :) + HU_drawLocalPing(); if (render_soft == rendermode && screens[0]) { diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index 9f3d13f8..cba0c209 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -28,6 +28,7 @@ #include "../m_argv.h" #include "../v_video.h" #include "../st_stuff.h" +#include "../hu_stuff.h" #include "../i_video.h" #include "../z_zone.h" #include "fabdxlib.h" @@ -365,6 +366,10 @@ void I_FinishUpdate(void) // display a graph of ticrate if (cv_ticrate.value) SCR_DisplayTicRate(); + + // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. + // no additional checks are needed here, this function does them all so no need to worry. :) + HU_drawLocalPing(); // if (bDIBMode) diff --git a/src/win32ce/win_vid.c b/src/win32ce/win_vid.c index 5e8e7e1f..c6610fa0 100644 --- a/src/win32ce/win_vid.c +++ b/src/win32ce/win_vid.c @@ -26,6 +26,7 @@ #include "../m_argv.h" #include "../v_video.h" #include "../st_stuff.h" +#include "../hu_stuff.h" #include "../i_video.h" #include "../z_zone.h" #include "fabdxlib.h" @@ -198,6 +199,10 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. + // no additional checks are needed here, this function does them all so no need to worry. :) + HU_drawLocalPing(); + // if (bDIBMode) { From 82dbf45fa489881a5a0c6ff506bd7c9581efdbce Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sat, 16 Feb 2019 08:29:48 -0600 Subject: [PATCH 08/11] Fix compiler warnings --- src/hu_stuff.c | 4 ++-- src/hu_stuff.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 404b4509..175c8bf3 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2207,7 +2207,7 @@ void HU_drawLocalPing(void) if (!cv_showping.value || !netgame || consoleplayer == serverplayer) // we don't want to see it or aren't in a netgame, or are the server return; - INT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P + UINT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P 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 ? 160 : 181; @@ -2410,7 +2410,7 @@ void HU_Erase(void) // // HU_drawPing // -void HU_drawPing(INT32 x, INT32 y, INT32 ping, INT32 flags) +void HU_drawPing(INT32 x, INT32 y, UINT32 ping, INT32 flags) { INT32 gfxnum = 4; // gfx to draw UINT8 const *colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SALMON, GTC_CACHE); diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 0c94034d..6788c701 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -109,11 +109,12 @@ void HU_Start(void); boolean HU_Responder(event_t *ev); void HU_Ticker(void); +void HU_drawLocalPing(void); void HU_Drawer(void); char HU_dequeueChatChar(void); void HU_Erase(void); void HU_clearChatChars(void); -void HU_drawPing(INT32 x, INT32 y, INT32 ping, INT32 flags); // Lat': Ping drawer for scoreboard. +void HU_drawPing(INT32 x, INT32 y, UINT32 ping, INT32 flags); // Lat': Ping drawer for scoreboard. //void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer); //void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer); void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol); From 1fb65c72ff0b1db2546830bf825b19da75b42d9e Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Tue, 19 Feb 2019 18:52:57 -0600 Subject: [PATCH 09/11] Reorganization + kill old interfaces --- src/djgppdos/i_video.c | 5 ----- src/hu_stuff.c | 15 --------------- src/hu_stuff.h | 1 - src/screen.c | 13 +++++++++++++ src/screen.h | 1 + src/sdl/i_video.c | 8 +++----- src/sdl12/i_video.c | 5 ----- src/win32/win_vid.c | 5 ----- src/win32ce/win_vid.c | 5 ----- 9 files changed, 17 insertions(+), 41 deletions(-) diff --git a/src/djgppdos/i_video.c b/src/djgppdos/i_video.c index 69addfb0..612c7221 100644 --- a/src/djgppdos/i_video.c +++ b/src/djgppdos/i_video.c @@ -41,7 +41,6 @@ #include "../m_argv.h" #include "vid_vesa.h" #include "../i_video.h" -#include "../hu_stuff.h" //dosstuff -newly added @@ -94,10 +93,6 @@ void I_FinishUpdate (void) // draw FPS if enabled if (cv_ticrate.value) SCR_DisplayTicRate(); - - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); //blast it to the screen // this code sucks diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 175c8bf3..1ae48886 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2199,21 +2199,6 @@ static void HU_DrawSongCredits(void) V_DrawRightAlignedThinString(cursongcredit.x, y, V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_SNAPTOLEFT|(cursongcredit.trans< servermaxping)) // only show 2 (warning) if our ping is at a bad level - { - INT32 dispy = cv_ticrate.value ? 160 : 181; - HU_drawPing(307, dispy, ping, V_SNAPTORIGHT|V_SNAPTOBOTTOM); - } -} // Heads up displays drawer, call each frame // diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 6788c701..0f316bc7 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -109,7 +109,6 @@ void HU_Start(void); boolean HU_Responder(event_t *ev); void HU_Ticker(void); -void HU_drawLocalPing(void); void HU_Drawer(void); char HU_dequeueChatChar(void); void HU_Erase(void); diff --git a/src/screen.c b/src/screen.c index 937d6caa..4de2abd0 100644 --- a/src/screen.c +++ b/src/screen.c @@ -434,3 +434,16 @@ void SCR_DisplayTicRate(void) lasttic = ontic; } + +// SCR_DisplayLocalPing +// Used to draw the user's local ping next to the framerate for a quick check without having to hold TAB for instance. By default, it only shows up if your ping is too high and risks getting you kicked. + +void SCR_DisplayLocalPing(void) +{ + UINT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P + 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 ? 160 : 181; + HU_drawPing(307, dispy, ping, V_SNAPTORIGHT | V_SNAPTOBOTTOM); + } +} diff --git a/src/screen.h b/src/screen.h index 9ad254d3..5b4a8e58 100644 --- a/src/screen.h +++ b/src/screen.h @@ -180,5 +180,6 @@ FUNCMATH boolean SCR_IsAspectCorrect(INT32 width, INT32 height); // move out to main code for consistency void SCR_DisplayTicRate(void); +void SCR_DisplayLocalPing(void); #undef DNWH #endif //__SCREEN_H__ diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 9e5e4b60..39a2c5ef 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -67,7 +67,6 @@ #include "../i_sound.h" // midi pause/unpause #include "../i_joy.h" #include "../st_stuff.h" -#include "../hu_stuff.h" // ping drawer #include "../g_game.h" #include "../i_video.h" #include "../console.h" @@ -1361,10 +1360,9 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); - - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); + + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); if (rendermode == render_soft && screens[0]) { diff --git a/src/sdl12/i_video.c b/src/sdl12/i_video.c index 08e6bd94..69cf5ca9 100644 --- a/src/sdl12/i_video.c +++ b/src/sdl12/i_video.c @@ -99,7 +99,6 @@ #include "../i_sound.h" // midi pause/unpause #include "../i_joy.h" #include "../st_stuff.h" -#include "../hu_stuff.h" #include "../g_game.h" #include "../i_video.h" #include "../console.h" @@ -1343,10 +1342,6 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); - - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); if (render_soft == rendermode && screens[0]) { diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index cba0c209..9f3d13f8 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -28,7 +28,6 @@ #include "../m_argv.h" #include "../v_video.h" #include "../st_stuff.h" -#include "../hu_stuff.h" #include "../i_video.h" #include "../z_zone.h" #include "fabdxlib.h" @@ -366,10 +365,6 @@ void I_FinishUpdate(void) // display a graph of ticrate if (cv_ticrate.value) SCR_DisplayTicRate(); - - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); // if (bDIBMode) diff --git a/src/win32ce/win_vid.c b/src/win32ce/win_vid.c index c6610fa0..5e8e7e1f 100644 --- a/src/win32ce/win_vid.c +++ b/src/win32ce/win_vid.c @@ -26,7 +26,6 @@ #include "../m_argv.h" #include "../v_video.h" #include "../st_stuff.h" -#include "../hu_stuff.h" #include "../i_video.h" #include "../z_zone.h" #include "fabdxlib.h" @@ -199,10 +198,6 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); - // this is now handled here so that wipes and other things don't overlap it for the sake of consistency. - // no additional checks are needed here, this function does them all so no need to worry. :) - HU_drawLocalPing(); - // if (bDIBMode) { From 30d37ce4cadcd2b09084ce677a5c68a896be0868 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Tue, 19 Feb 2019 18:54:24 -0600 Subject: [PATCH 10/11] ...remove this forgotten comment too while I'm at it. --- src/hu_stuff.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 1ae48886..a9aa7c56 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2312,10 +2312,6 @@ void HU_Drawer(void) V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_YELLOWMAP | V_ALLOWLOWERCASE, resynch_text); } - - // draw the ping if the user wishes to - // THIS IS NOW HANDLED IN I_VIDEO - //HU_drawLocalPing(); } //====================================================================== From d9759df874608e97a1ea5708b95916f224f3d18d Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Fri, 22 Feb 2019 18:13:22 -0600 Subject: [PATCH 11/11] I don't think these old interfaces even compile but let's not kill them off --- src/djgppdos/i_video.c | 3 +++ src/sdl12/i_video.c | 3 +++ src/win32/win_vid.c | 3 +++ src/win32ce/win_vid.c | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/djgppdos/i_video.c b/src/djgppdos/i_video.c index 612c7221..7829acbb 100644 --- a/src/djgppdos/i_video.c +++ b/src/djgppdos/i_video.c @@ -94,6 +94,9 @@ void I_FinishUpdate (void) if (cv_ticrate.value) SCR_DisplayTicRate(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + //blast it to the screen // this code sucks //memcpy(dascreen,screens[0],screenwidth*screenheight); diff --git a/src/sdl12/i_video.c b/src/sdl12/i_video.c index 69cf5ca9..a2a20c61 100644 --- a/src/sdl12/i_video.c +++ b/src/sdl12/i_video.c @@ -1343,6 +1343,9 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + if (render_soft == rendermode && screens[0]) { SDL_Rect *dstrect = NULL; diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index 9f3d13f8..45f96e9d 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -366,6 +366,9 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + // if (bDIBMode) { diff --git a/src/win32ce/win_vid.c b/src/win32ce/win_vid.c index 5e8e7e1f..244dfaf3 100644 --- a/src/win32ce/win_vid.c +++ b/src/win32ce/win_vid.c @@ -198,6 +198,9 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + // if (bDIBMode) {