| 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 | { |
no test coverage detected