send team update after restart

This commit is contained in:
2023-08-14 18:41:51 +02:00
parent 7ab8c79fdf
commit dbe91b52fd
3 changed files with 14 additions and 1 deletions

View File

@@ -100,6 +100,17 @@ void ServerGame::BalanceTeams() {
}
}
void ServerGame::Reset() {
Game::Reset();
// update players teams to none
for (auto& playerInfo : m_Players) {
game::Player& player = playerInfo.second;
protocol::UpdatePlayerTeamPacket packet(player.GetID(), player.GetTeamColor());
m_Server->BroadcastPacket(&packet);
}
}
void ServerGame::OnGameStateUpdate(game::GameState newState) {
SetGameState(newState);
protocol::UpdateGameStatePacket packet(newState);