close server when empty
This commit is contained in:
@@ -145,6 +145,10 @@ void Server::OnPlayerJoin(std::uint8_t id) {
|
||||
void Server::OnPlayerLeave(std::uint8_t id) {
|
||||
protocol::PlayerLeavePacket packet(id);
|
||||
BroadcastPacket(&packet);
|
||||
|
||||
if (GetPlayers().empty()) {
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace server
|
||||
|
||||
Reference in New Issue
Block a user