diff options
author | rubidium <rubidium@openttd.org> | 2008-12-22 21:26:26 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-12-22 21:26:26 +0000 |
commit | 573d1b324a1b919efa76763c94bdf3075bd2bfa8 (patch) | |
tree | b491caf9bf4a134ae72e13337a00c518804cd8b6 /src/network | |
parent | 5b7cd460e9b75838de5732a56a01ad6311356cb3 (diff) | |
download | openttd-573d1b324a1b919efa76763c94bdf3075bd2bfa8.tar.xz |
(svn r14716) -Codechange: move more network core querying to the network files.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_client.cpp | 15 | ||||
-rw-r--r-- | src/network/network_func.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 1ef35508b..6f14efd80 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -974,4 +974,19 @@ bool NetworkClientPreferTeamChat(const NetworkClientInfo *cio) return false; } +/** + * Print all the clients to the console + */ +void NetworkPrintClients() +{ + NetworkClientInfo *ci; + FOR_ALL_ACTIVE_CLIENT_INFOS(ci) { + IConsolePrintF(CC_INFO, "Client #%1d name: '%s' company: %1d IP: %s", + ci->client_id, + ci->client_name, + ci->client_playas + (IsValidCompanyID(ci->client_playas) ? 1 : 0), + GetClientIP(ci)); + } +} + #endif /* ENABLE_NETWORK */ diff --git a/src/network/network_func.h b/src/network/network_func.h index 9d45035b7..e79d7926f 100644 --- a/src/network/network_func.h +++ b/src/network/network_func.h @@ -42,6 +42,7 @@ void NetworkClientSendRcon(const char *password, const char *command); void NetworkClientSendChat(NetworkAction action, DestType type, int dest, const char *msg); void NetworkClientSetPassword(const char *password); bool NetworkClientPreferTeamChat(const NetworkClientInfo *cio); +void NetworkPrintClients(); /*** Commands ran by the server ***/ void NetworkServerMonthlyLoop(); |