Codechange: use scope enum and rename DestType to NetworkChatDestinationType

This commit is contained in:
Rubidium
2026-03-02 21:26:50 +01:00
committed by rubidium42
parent c36f9d2d2a
commit 95fbc7abf5
17 changed files with 64 additions and 63 deletions
+5 -5
View File
@@ -468,12 +468,12 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendCompanyStats()
* @param data Arbitrary extra data.
* @return The new state the network.
*/
NetworkRecvStatus ServerNetworkAdminSocketHandler::SendChat(NetworkAction action, DestType desttype, ClientID client_id, std::string_view msg, int64_t data)
NetworkRecvStatus ServerNetworkAdminSocketHandler::SendChat(NetworkAction action, NetworkChatDestinationType desttype, ClientID client_id, std::string_view msg, int64_t data)
{
auto p = std::make_unique<Packet>(this, ADMIN_PACKET_SERVER_CHAT);
p->Send_uint8 (action);
p->Send_uint8 (desttype);
p->Send_uint8(action);
p->Send_uint8(to_underlying(desttype));
p->Send_uint32(client_id);
p->Send_string(msg);
p->Send_uint64(data);
@@ -788,7 +788,7 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_CHAT(Packet &p)
if (this->status <= ADMIN_STATUS_AUTHENTICATE) return this->SendError(NetworkErrorCode::NotExpected);
NetworkAction action = (NetworkAction)p.Recv_uint8();
DestType desttype = (DestType)p.Recv_uint8();
NetworkChatDestinationType desttype = static_cast<NetworkChatDestinationType>(p.Recv_uint8());
int dest = p.Recv_uint32();
std::string msg = p.Recv_string(NETWORK_CHAT_LENGTH);
@@ -1025,7 +1025,7 @@ void NetworkAdminCompanyRemove(CompanyID company_id, AdminCompanyRemoveReason bc
* @param data Arbitrary data.
* @param from_admin Whether the message is coming from the admin.
*/
void NetworkAdminChat(NetworkAction action, DestType desttype, ClientID client_id, std::string_view msg, int64_t data, bool from_admin)
void NetworkAdminChat(NetworkAction action, NetworkChatDestinationType desttype, ClientID client_id, std::string_view msg, int64_t data, bool from_admin)
{
if (from_admin) return;