(svn r22367) -Codechange: send ClientSockets instead of ClientInfos to the admin "core" as they send IP addresses to the admin "bots"
This commit is contained in:
@@ -206,10 +206,11 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendClientJoin(ClientID clien
|
||||
return NETWORK_RECV_STATUS_OKAY;
|
||||
}
|
||||
|
||||
NetworkRecvStatus ServerNetworkAdminSocketHandler::SendClientInfo(const NetworkClientInfo *ci)
|
||||
NetworkRecvStatus ServerNetworkAdminSocketHandler::SendClientInfo(const NetworkClientSocket *cs)
|
||||
{
|
||||
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 &>(ci->client_address).GetHostname());
|
||||
p->Send_string(ci->client_name);
|
||||
@@ -570,14 +571,14 @@ DEF_ADMIN_RECEIVE_COMMAND(Server, ADMIN_PACKET_ADMIN_POLL)
|
||||
|
||||
case ADMIN_UPDATE_CLIENT_INFO:
|
||||
/* The admin is requesting client info. */
|
||||
const NetworkClientInfo *ci;
|
||||
const NetworkClientSocket *cs;
|
||||
if (d1 == UINT32_MAX) {
|
||||
FOR_ALL_CLIENT_INFOS(ci) {
|
||||
this->SendClientInfo(ci);
|
||||
FOR_ALL_CLIENT_SOCKETS(cs) {
|
||||
this->SendClientInfo(cs);
|
||||
}
|
||||
} else {
|
||||
ci = NetworkClientInfo::GetByClientID((ClientID)d1);
|
||||
if (ci != NULL) this->SendClientInfo(ci);
|
||||
cs = NetworkClientSocket::GetByClientID((ClientID)d1);
|
||||
if (cs != NULL) this->SendClientInfo(cs);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -654,14 +655,14 @@ DEF_ADMIN_RECEIVE_COMMAND(Server, ADMIN_PACKET_ADMIN_CHAT)
|
||||
* @param ci the client info.
|
||||
* @param new_client if this is a new client, send the respective packet too.
|
||||
*/
|
||||
void NetworkAdminClientInfo(const NetworkClientInfo *ci, bool new_client)
|
||||
void NetworkAdminClientInfo(const NetworkClientSocket *cs, bool new_client)
|
||||
{
|
||||
ServerNetworkAdminSocketHandler *as;
|
||||
FOR_ALL_ADMIN_SOCKETS(as) {
|
||||
if (as->update_frequency[ADMIN_UPDATE_CLIENT_INFO] & ADMIN_FREQUENCY_AUTOMATIC) {
|
||||
as->SendClientInfo(ci);
|
||||
as->SendClientInfo(cs);
|
||||
if (new_client) {
|
||||
as->SendClientJoin(ci->client_id);
|
||||
as->SendClientJoin(cs->client_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user