Skip to content

Commit

Permalink
Be more consistent in ping display, show ping ≥ 4000 as ∞.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyp committed May 21, 2012
1 parent e14c39f commit bedd870
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion src/multiint.cpp
Expand Up @@ -4089,7 +4089,16 @@ void displayPlayer(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *p
char buf[250] = {'\0'};

// show "actual" ping time
ssprintf(buf, "%s%s: %03d", subText.empty()? "" : ", ", _("Ping"), ingame.PingTimes[j]);
ssprintf(buf, "%s%s: ", subText.empty()? "" : ", ", _("Ping"));
subText += buf;
if (ingame.PingTimes[j] < PING_LIMIT)
{
ssprintf(buf, "%03d", ingame.PingTimes[j]);
}
else
{
ssprintf(buf, ""); // Player has ping of somewhat questionable quality.
}
subText += buf;
}
iV_DrawText(name.c_str(), x + nameX, y + (subText.empty()? 22 : 18));
Expand Down
6 changes: 3 additions & 3 deletions src/multimenu.cpp
Expand Up @@ -950,13 +950,13 @@ static void displayMultiPlayer(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset,
//c11:ping
if (!isSelectedPlayer && isHuman)
{
if (ingame.PingTimes[player] >= 2000)
if (ingame.PingTimes[player] < PING_LIMIT)
{
sprintf(str, "???");
sprintf(str, "%03d", ingame.PingTimes[player]);
}
else
{
sprintf(str, "%d", ingame.PingTimes[player]);
sprintf(str, "");
}
iV_DrawText(str, x + MULTIMENU_C11, y + MULTIMENU_FONT_OSET);
}
Expand Down
2 changes: 1 addition & 1 deletion src/multiplay.h
Expand Up @@ -129,7 +129,7 @@ extern UBYTE bDisplayMultiJoiningStatus; // draw load progress?
//#define PING_LO 0 // this ping is kickin'.
#define PING_MED 200 // this ping is crawlin'
#define PING_HI 400 // this ping just plain sucks :P
#define PING_LIMIT 1000 // if ping is bigger than this, then worry and panic.
#define PING_LIMIT 4000 // If ping is bigger than this, then worry and panic, and don't even try showing the ping.

#define LEV_LOW 400 // how many points to allocate for res levels???
#define LEV_MED 700
Expand Down

0 comments on commit bedd870

Please sign in to comment.