diff options
author | rubidium42 <rubidium@openttd.org> | 2021-05-14 18:22:39 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-05-15 10:20:50 +0200 |
commit | fab120ee831ff1cdf3d5560b6b87288b07c52084 (patch) | |
tree | 5aa3a385b6eb4c4a334afb26c490892992a750ba /src/network/network_admin.cpp | |
parent | ae85af98eb02831594e4a204348c682b192e83ac (diff) | |
download | openttd-fab120ee831ff1cdf3d5560b6b87288b07c52084.tar.xz |
Codechange: [Network] Let chat communication use std::string
Diffstat (limited to 'src/network/network_admin.cpp')
-rw-r--r-- | src/network/network_admin.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/network/network_admin.cpp b/src/network/network_admin.cpp index 419de71d1..09b039485 100644 --- a/src/network/network_admin.cpp +++ b/src/network/network_admin.cpp @@ -450,7 +450,7 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCompanyStats() * @param msg The actual message. * @param data Arbitrary extra data. */ -NetworkRecvStatus ServerNetworkAdminSocketHandler::SendChat(NetworkAction action, DestType desttype, ClientID client_id, const char *msg, int64 data) +NetworkRecvStatus ServerNetworkAdminSocketHandler::SendChat(NetworkAction action, DestType desttype, ClientID client_id, const std::string &msg, int64 data) { Packet *p = new Packet(ADMIN_PACKET_SERVER_CHAT); @@ -769,8 +769,7 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_CHAT(Packet *p) DestType desttype = (DestType)p->Recv_uint8(); int dest = p->Recv_uint32(); - char msg[NETWORK_CHAT_LENGTH]; - p->Recv_string(msg, NETWORK_CHAT_LENGTH); + std::string msg = p->Recv_string(NETWORK_CHAT_LENGTH); switch (action) { case NETWORK_ACTION_CHAT: @@ -902,7 +901,7 @@ void NetworkAdminCompanyRemove(CompanyID company_id, AdminCompanyRemoveReason bc /** * Send chat to the admin network (if they did opt in for the respective update). */ -void NetworkAdminChat(NetworkAction action, DestType desttype, ClientID client_id, const char *msg, int64 data, bool from_admin) +void NetworkAdminChat(NetworkAction action, DestType desttype, ClientID client_id, const std::string &msg, int64 data, bool from_admin) { if (from_admin) return; |