added a todo + some tweaks
This commit is contained in:
parent
3523291960
commit
55f8b1431a
2 changed files with 6 additions and 6 deletions
|
@ -876,6 +876,8 @@ bool game::end_turn() {
|
|||
return true;
|
||||
}
|
||||
|
||||
//@todo differentiate between "observers not allowed" and "player already in the game" errors.
|
||||
// maybe return a string with an error message.
|
||||
bool game::add_player(const network::connection player, bool observer, bool admin) {
|
||||
if(is_member(player)) {
|
||||
ERR_GAME << "ERROR: Player is already in this game. (socket: "
|
||||
|
|
|
@ -1892,7 +1892,8 @@ void server::process_data_lobby(const network::connection sock,
|
|||
}
|
||||
LOG_SERVER << network::ip_address(sock) << "\t" << pl->second.name()
|
||||
<< "\tjoined game:\t\"" << (*g)->name()
|
||||
<< "\" (" << game_id << (observer ? ") as an observer.\n" : ").\n");
|
||||
<< "\" (" << game_id << ")" << (observer ? " as an observer" : "")
|
||||
<< ". (socket: " << sock << ")\n";
|
||||
lobby_.remove_player(sock);
|
||||
(*g)->describe_slots();
|
||||
|
||||
|
@ -1934,11 +1935,8 @@ void server::process_data_game(const network::connection sock,
|
|||
return;
|
||||
}
|
||||
|
||||
std::vector<wesnothd::game*>::iterator itor;
|
||||
for (itor = games_.begin(); itor != games_.end(); ++itor) {
|
||||
if ((*itor)->is_owner(sock) || (*itor)->is_member(sock))
|
||||
break;
|
||||
}
|
||||
const std::vector<wesnothd::game*>::iterator itor =
|
||||
std::find_if(games_.begin(),games_.end(), wesnothd::game_is_member(sock));
|
||||
if (itor == games_.end()) {
|
||||
ERR_SERVER << "ERROR: Could not find game for player: "
|
||||
<< pl->second.name() << ". (socket: " << sock << ")\n";
|
||||
|
|
Loading…
Add table
Reference in a new issue