From: havoc Date: Fri, 25 Nov 2005 06:14:05 +0000 (+0000) Subject: ping command now works from server console X-Git-Tag: xonotic-v0.1.0preview~4453 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=71ba2584ab31feb6b1600b3d9c2dc94adf4634c7;p=xonotic%2Fdarkplaces.git ping command now works from server console git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5832 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/host_cmd.c b/host_cmd.c index 265c8d87..be312bf8 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -209,21 +209,28 @@ Host_Ping_f */ void Host_Ping_f (void) { - int i; - client_t *client; + int i; + client_t *client; + void (*print) (const char *fmt, ...); if (cmd_source == src_command) { - Cmd_ForwardToServer (); - return; + if (!sv.active) + { + Cmd_ForwardToServer (); + return; + } + print = Con_Printf; } + else + print = SV_ClientPrintf; - SV_ClientPrint("Client ping times:\n"); + print("Client ping times:\n"); for (i = 0, client = svs.clients;i < svs.maxclients;i++, client++) { if (!client->active) continue; - SV_ClientPrintf("%4i %s\n", (int)floor(client->ping*1000+0.5), client->name); + print("%4i %s\n", (int)floor(client->ping*1000+0.5), client->name); } }