mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-22 18:49:40 +00:00
Codechange: use scope enum and rename DestType to NetworkChatDestinationType
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user