diff options
author | rubidium42 <rubidium@openttd.org> | 2021-05-14 17:25:16 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-05-30 10:15:22 +0200 |
commit | 8a918ce1709cb80191ba8e5195ec8ef02d484d9e (patch) | |
tree | 175190e9998dc4f5732fa3620a9549afeac8eb5b /src/network/core/tcp_admin.cpp | |
parent | 97c461d1e73f228dd366cd8f062701062edd9bd1 (diff) | |
download | openttd-8a918ce1709cb80191ba8e5195ec8ef02d484d9e.tar.xz |
Codechange: [Network] Make admin name and version std::string
Diffstat (limited to 'src/network/core/tcp_admin.cpp')
-rw-r--r-- | src/network/core/tcp_admin.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/network/core/tcp_admin.cpp b/src/network/core/tcp_admin.cpp index 0b48b419b..234ab2e25 100644 --- a/src/network/core/tcp_admin.cpp +++ b/src/network/core/tcp_admin.cpp @@ -30,8 +30,6 @@ static_assert((int)CRR_END == (int)ADMIN_CRR_END); NetworkAdminSocketHandler::NetworkAdminSocketHandler(SOCKET s) : status(ADMIN_STATUS_INACTIVE) { this->sock = s; - this->admin_name[0] = '\0'; - this->admin_version[0] = '\0'; } NetworkRecvStatus NetworkAdminSocketHandler::CloseConnection(bool error) @@ -89,9 +87,9 @@ NetworkRecvStatus NetworkAdminSocketHandler::HandlePacket(Packet *p) default: if (this->HasClientQuit()) { - DEBUG(net, 0, "[tcp/admin] Received invalid packet type %d from '%s' (%s)", type, this->admin_name, this->admin_version); + DEBUG(net, 0, "[tcp/admin] Received invalid packet type %d from '%s' (%s)", type, this->admin_name.c_str(), this->admin_version.c_str()); } else { - DEBUG(net, 0, "[tcp/admin] Received illegal packet from '%s' (%s)", this->admin_name, this->admin_version); + DEBUG(net, 0, "[tcp/admin] Received illegal packet from '%s' (%s)", this->admin_name.c_str(), this->admin_version.c_str()); } this->CloseConnection(); @@ -125,7 +123,7 @@ NetworkRecvStatus NetworkAdminSocketHandler::ReceivePackets() */ NetworkRecvStatus NetworkAdminSocketHandler::ReceiveInvalidPacket(PacketAdminType type) { - DEBUG(net, 0, "[tcp/admin] Received illegal packet type %d from admin %s (%s)", type, this->admin_name, this->admin_version); + DEBUG(net, 0, "[tcp/admin] Received illegal packet type %d from admin %s (%s)", type, this->admin_name.c_str(), this->admin_version.c_str()); return NETWORK_RECV_STATUS_MALFORMED_PACKET; } |