Skip to content

Commit

Permalink
Stay in game if no side could be found
Browse files Browse the repository at this point in the history
Having no side is the definition of an observer. No need to add new
client-server messages for this. This is not a new feature either.
  • Loading branch information
soliton- committed Feb 14, 2018
1 parent 33f9bb9 commit 8083c3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/gui/dialogs/multiplayer/mp_join_game.cpp
Expand Up @@ -125,8 +125,6 @@ bool mp_join_game::fetch_game_config()
}

has_scenario_and_controllers = true;
} else if(revc.has_child("became_observer")) {
observe_game_ = true;
}
}

Expand Down Expand Up @@ -185,7 +183,8 @@ bool mp_join_game::fetch_game_config()
}

if(!side_choice) {
return false;
observe_game_ = true;
return true;
}

// If the client is allowed to choose their team, do that here instead of having it set by the server
Expand Down
8 changes: 0 additions & 8 deletions src/server/game.cpp
Expand Up @@ -1409,14 +1409,6 @@ bool game::add_player(const socket_ptr& player, bool observer)
player_connections_.find(user)->info().set_status((observer) ? player::OBSERVING : player::PLAYING);
DBG_GAME << debug_player_info();

// If a player was switched to an observer, notify them of the fact.
if(became_observer) {
simple_wml::document became_observer_notif;
became_observer_notif.root().add_child("became_observer");

send_to_player(player, became_observer_notif);
}

// Send the user the game data.
send_to_player(player, level_);

Expand Down

0 comments on commit 8083c3d

Please sign in to comment.