mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 22:51:57 +00:00
Fine, make it exactly like mvdsv then. Be boring, see if I care!
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1451 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
eaf3cb3c6a
commit
e7831ef52f
1 changed files with 37 additions and 9 deletions
|
@ -685,6 +685,12 @@ CONNECTIONLESS COMMANDS
|
||||||
==============================================================================
|
==============================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define STATUS_OLDSTYLE 0
|
||||||
|
#define STATUS_SERVERINFO 1
|
||||||
|
#define STATUS_PLAYERS 2
|
||||||
|
#define STATUS_SPECTATORS 4
|
||||||
|
#define STATUS_SPECTATORS_AS_PLAYERS 8 //for ASE - change only frags: show as "S"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
SVC_Status
|
SVC_Status
|
||||||
|
@ -698,38 +704,60 @@ void SVC_Status (void)
|
||||||
int displayflags;
|
int displayflags;
|
||||||
int i;
|
int i;
|
||||||
client_t *cl;
|
client_t *cl;
|
||||||
|
char *name;
|
||||||
int ping;
|
int ping;
|
||||||
int top, bottom;
|
int top, bottom;
|
||||||
|
char frags[64];
|
||||||
|
|
||||||
int slots=0;
|
int slots=0;
|
||||||
|
|
||||||
if (Cmd_Argc() < 2)
|
displayflags = atoi(Cmd_Argv(1));
|
||||||
displayflags = 3;
|
if (displayflags == STATUS_OLDSTYLE)
|
||||||
else
|
displayflags = STATUS_SERVERINFO|STATUS_PLAYERS;
|
||||||
displayflags = atoi(Cmd_Argv(1));
|
|
||||||
|
|
||||||
Cmd_TokenizeString ("status", false, false);
|
Cmd_TokenizeString ("status", false, false);
|
||||||
SV_BeginRedirect (RD_PACKET, LANGDEFAULT);
|
SV_BeginRedirect (RD_PACKET, LANGDEFAULT);
|
||||||
if (displayflags&1)
|
if (displayflags&STATUS_SERVERINFO)
|
||||||
Con_Printf ("%s\n", svs.info);
|
Con_Printf ("%s\n", svs.info);
|
||||||
for (i=0 ; i<MAX_CLIENTS ; i++)
|
for (i=0 ; i<MAX_CLIENTS ; i++)
|
||||||
{
|
{
|
||||||
cl = &svs.clients[i];
|
cl = &svs.clients[i];
|
||||||
if ((cl->state == cs_connected || cl->state == cs_spawned || cl->name[0]) && ((cl->spectator && displayflags&4) || (!cl->spectator && displayflags&2)))
|
if ((cl->state == cs_connected || cl->state == cs_spawned || cl->name[0]) && ((cl->spectator && displayflags&STATUS_SPECTATORS) || (!cl->spectator && displayflags&STATUS_PLAYERS)))
|
||||||
{
|
{
|
||||||
top = atoi(Info_ValueForKey (cl->userinfo, "topcolor"));
|
top = atoi(Info_ValueForKey (cl->userinfo, "topcolor"));
|
||||||
bottom = atoi(Info_ValueForKey (cl->userinfo, "bottomcolor"));
|
bottom = atoi(Info_ValueForKey (cl->userinfo, "bottomcolor"));
|
||||||
top = (top < 0) ? 0 : ((top > 13) ? 13 : top);
|
top = (top < 0) ? 0 : ((top > 13) ? 13 : top);
|
||||||
bottom = (bottom < 0) ? 0 : ((bottom > 13) ? 13 : bottom);
|
bottom = (bottom < 0) ? 0 : ((bottom > 13) ? 13 : bottom);
|
||||||
ping = SV_CalcPing (cl);
|
ping = SV_CalcPing (cl);
|
||||||
|
name = cl->name;
|
||||||
|
|
||||||
if (!cl->state) //show bots differently. Just to be courteous.
|
if (!cl->state) //show bots differently. Just to be courteous.
|
||||||
Con_Printf ("%i %i %i %i \"BOT:%s\" \"%s\" %i %i\n", cl->userid,
|
Con_Printf ("%i %i %i %i \"BOT:%s\" \"%s\" %i %i\n", cl->userid,
|
||||||
cl->old_frags, (int)(realtime - cl->connection_started)/60,
|
cl->old_frags, (int)(realtime - cl->connection_started)/60,
|
||||||
ping, cl->name, Info_ValueForKey (cl->userinfo, "skin"), top, bottom);
|
ping, cl->name, Info_ValueForKey (cl->userinfo, "skin"), top, bottom);
|
||||||
else
|
else
|
||||||
Con_Printf ("%i %i %i %i \"%s\" \"%s\" %i %i\n", cl->userid,
|
{
|
||||||
cl->old_frags, (int)(realtime - cl->connection_started)/60,
|
if (cl->spectator)
|
||||||
ping, cl->name, Info_ValueForKey (cl->userinfo, "skin"), top, bottom);
|
{ //silly mvdsv stuff
|
||||||
|
if (displayflags & STATUS_SPECTATORS_AS_PLAYERS)
|
||||||
|
{
|
||||||
|
frags[0] = 'S';
|
||||||
|
frags[1] = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ping = -ping;
|
||||||
|
sprintf(frags, "%i", -9999);
|
||||||
|
name = va("\\s\\%s", name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sprintf(frags, "%i", cl->old_frags);
|
||||||
|
|
||||||
|
Con_Printf ("%i %s %i %i \"%s\" \"%s\" %i %i\n", cl->userid,
|
||||||
|
frags, (int)(realtime - cl->connection_started)/60,
|
||||||
|
ping, name, Info_ValueForKey (cl->userinfo, "skin"), top, bottom);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
slots++;
|
slots++;
|
||||||
|
|
Loading…
Reference in a new issue