* Send a chat message. * @param action The action associated with the message. * @param client_id The origin of the chat message. * @param self_send Whether we did send the message. * @param msg The actual message. * @param data Arbitrary extra data. */
| 678 | * @param data Arbitrary extra data. |
| 679 | */ |
| 680 | NetworkRecvStatus ServerNetworkGameSocketHandler::SendChat(NetworkAction action, ClientID client_id, bool self_send, std::string_view msg, int64_t data) |
| 681 | { |
| 682 | Debug(net, 9, "client[{}] SendChat(): action={}, client_id={}, self_send={}", this->client_id, action, client_id, self_send); |
| 683 | |
| 684 | if (this->status < STATUS_PRE_ACTIVE) return NETWORK_RECV_STATUS_OKAY; |
| 685 | |
| 686 | auto p = std::make_unique<Packet>(this, PACKET_SERVER_CHAT); |
| 687 | |
| 688 | p->Send_uint8 (action); |
| 689 | p->Send_uint32(client_id); |
| 690 | p->Send_bool (self_send); |
| 691 | p->Send_string(msg); |
| 692 | p->Send_uint64(data); |
| 693 | |
| 694 | this->SendPacket(std::move(p)); |
| 695 | return NETWORK_RECV_STATUS_OKAY; |
| 696 | } |
| 697 | |
| 698 | /** |
| 699 | * Send a chat message from external source. |
no test coverage detected