* Send a chat message from external source. * @param source Name of the source this message came from. * @param colour TextColour to use for the message. * @param user Name of the user who sent the message. * @param msg The actual message. */
| 703 | * @param msg The actual message. |
| 704 | */ |
| 705 | NetworkRecvStatus ServerNetworkGameSocketHandler::SendExternalChat(std::string_view source, TextColour colour, std::string_view user, std::string_view msg) |
| 706 | { |
| 707 | Debug(net, 9, "client[{}] SendExternalChat(): source={}", this->client_id, source); |
| 708 | |
| 709 | if (this->status < STATUS_PRE_ACTIVE) return NETWORK_RECV_STATUS_OKAY; |
| 710 | |
| 711 | auto p = std::make_unique<Packet>(this, PACKET_SERVER_EXTERNAL_CHAT); |
| 712 | |
| 713 | p->Send_string(source); |
| 714 | p->Send_uint16(colour); |
| 715 | p->Send_string(user); |
| 716 | p->Send_string(msg); |
| 717 | |
| 718 | this->SendPacket(std::move(p)); |
| 719 | return NETWORK_RECV_STATUS_OKAY; |
| 720 | } |
| 721 | |
| 722 | /** |
| 723 | * Tell the client another client quit with an error. |
no test coverage detected