| 1444 | } |
| 1445 | |
| 1446 | void NetworkBase::ServerSendAuth(Connection& connection) |
| 1447 | { |
| 1448 | uint8_t new_playerid = 0; |
| 1449 | if (connection.player != nullptr) |
| 1450 | { |
| 1451 | new_playerid = connection.player->id; |
| 1452 | } |
| 1453 | Packet packet(Command::auth); |
| 1454 | packet << static_cast<uint32_t>(connection.authStatus) << new_playerid; |
| 1455 | if (connection.authStatus == Auth::badVersion) |
| 1456 | { |
| 1457 | packet.writeString(GetVersion()); |
| 1458 | } |
| 1459 | connection.queuePacket(std::move(packet)); |
| 1460 | if (connection.authStatus != Auth::ok && connection.authStatus != Auth::requirePassword) |
| 1461 | { |
| 1462 | connection.disconnect(); |
| 1463 | } |
| 1464 | } |
| 1465 | |
| 1466 | void NetworkBase::ServerSendMap(Connection* connection) |
| 1467 | { |
nothing calls this directly
no test coverage detected