Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions fpsgame/fps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,21 @@ namespace game
return false;
}

const char* pingcolor;
if(attr.length() >= 4) {
if(ping < 70) {
pingcolor = "\f0";
} else if(ping < 135) {
pingcolor = "\f2";
} else if(ping < 200) {
pingcolor = "\f6";
} else {
pingcolor = "\f3";
}
} else {
pingcolor = "";
}

if(attr.empty() || attr[0]!=PROTOCOL_VERSION)
{
switch(i)
Expand Down Expand Up @@ -2115,7 +2130,7 @@ namespace game
case 0:
{
const char *icon = attr.inrange(3) && np >= attr[3] ? "serverfull" : (attr.inrange(4) ? mastermodeicon(attr[4], "serverunk") : "serverunk");
if(g->buttonf("%d ", 0xFFFFDD, icon, ping)&G3D_UP) return true;
if(g->buttonf("%s%d ", 0xFFFFDD, icon, pingcolor, ping)&G3D_UP) return true;
break;
}

Expand Down Expand Up @@ -2349,4 +2364,3 @@ namespace game
execfile("auth.cfg", false);
}
}

17 changes: 14 additions & 3 deletions fpsgame/scoreboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,20 @@ namespace game
{
fpsent *p = o->ownernum >= 0 ? getclient(o->ownernum) : o;
if(!p) p = o;
if(!showpj && p->state==CS_LAGGED) g.text("LAG", 0xFFFFDD);
else g.textf("%d", 0xFFFFDD, NULL, p->ping);

const char *pingcolor;
if (p->ping < 70) {
pingcolor = "\f0";
} else if (p->ping < 135) {
pingcolor = "\f2";
} else if (p->ping < 200) {
pingcolor = "\f6";
} else {
pingcolor = "\f3";
}

if(!showpj && p->state==CS_LAGGED) g.text("\f3LAG", 0xFFFFFF);
else g.textf("%s%d", 0xFFFFFF, NULL, pingcolor, p->ping);
});
g.poplist();
}
Expand Down Expand Up @@ -718,4 +730,3 @@ namespace game
ICOMMAND(showplayerstats, "D", (int *down), showplayerstats(*down!=0));

}