* Send an initial set of data from some client's information. * @param cs The socket of the client. * @param ci The information about the client. */
| 234 | * @param ci The information about the client. |
| 235 | */ |
| 236 | NetworkRecvStatus ServerNetworkAdminSocketHandler::SendClientInfo(const NetworkClientSocket *cs, const NetworkClientInfo *ci) |
| 237 | { |
| 238 | /* Only send data when we're a proper client, not just someone trying to query the server. */ |
| 239 | if (ci == nullptr) return NETWORK_RECV_STATUS_OKAY; |
| 240 | |
| 241 | auto p = std::make_unique<Packet>(this, ADMIN_PACKET_SERVER_CLIENT_INFO); |
| 242 | |
| 243 | p->Send_uint32(ci->client_id); |
| 244 | p->Send_string(cs == nullptr ? "" : const_cast<NetworkAddress &>(cs->client_address).GetHostname()); |
| 245 | p->Send_string(ci->client_name); |
| 246 | p->Send_uint8 (0); // Used to be language |
| 247 | p->Send_uint32(ci->join_date.base()); |
| 248 | p->Send_uint8 (ci->client_playas); |
| 249 | |
| 250 | this->SendPacket(std::move(p)); |
| 251 | |
| 252 | return NETWORK_RECV_STATUS_OKAY; |
| 253 | } |
| 254 | |
| 255 | |
| 256 | /** |
no test coverage detected