(svn r22369) -Codechange: allocate ClientInfo when needed, i.e. don't allocate it for clients that are there to just get a list of companies. This means that these short lived clients won't be seen by the admin network in their client queries anymore

This commit is contained in:
rubidium
2011-04-22 16:05:05 +00:00
parent 2cae0cd54c
commit cdfc0ec4a3
2 changed files with 12 additions and 13 deletions

View File

@@ -208,9 +208,12 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendClientJoin(ClientID clien
NetworkRecvStatus ServerNetworkAdminSocketHandler::SendClientInfo(const NetworkClientSocket *cs)
{
/* Only send data when we're a proper client, not just someone trying to query the server. */
const NetworkClientInfo *ci = cs->GetInfo();
if (ci == NULL) return NETWORK_RECV_STATUS_OKAY;
Packet *p = new Packet(ADMIN_PACKET_SERVER_CLIENT_INFO);
const NetworkClientInfo *ci = cs->GetInfo();
p->Send_uint32(ci->client_id);
p->Send_string(const_cast<NetworkAddress &>(cs->client_address).GetHostname());
p->Send_string(ci->client_name);