MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / ServerSendChat

Method ServerSendChat

src/openrct2/network/NetworkBase.cpp:1533–1554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1531 }
1532
1533 void NetworkBase::ServerSendChat(const char* text, const std::vector<uint8_t>& playerIds)
1534 {
1535 Packet packet(Command::chat);
1536 packet.writeString(text);
1537
1538 if (playerIds.empty())
1539 {
1540 // Empty players / default value means send to all players
1541 SendPacketToClients(packet);
1542 }
1543 else
1544 {
1545 for (auto playerId : playerIds)
1546 {
1547 auto conn = GetPlayerConnection(playerId);
1548 if (conn != nullptr)
1549 {
1550 conn->queuePacket(packet);
1551 }
1552 }
1553 }
1554 }
1555
1556 void NetworkBase::Client_Send_GAME_ACTION(const GameActions::GameAction* action)
1557 {

Callers 1

SendChatFunction · 0.80

Calls 3

queuePacketMethod · 0.80
writeStringMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected