wesnothd: process wml commands one at a time in handle_read_from_player
as is done in rest of wesnothd. This also fixes crash from self-kick
due to it trying to continue processing looking for further tags
after /query kick kicked the user in quesion.
(cherry-picked from commit 6a310f0c79
)
This commit is contained in:
parent
71f2c37b25
commit
6bb4d43c37
1 changed files with 7 additions and 0 deletions
|
@ -855,16 +855,20 @@ void server::handle_read_from_player(socket_ptr socket, std::shared_ptr<simple_w
|
|||
//DBG_SERVER << client_address(socket) << "\tWML received:\n" << doc->output() << std::endl;
|
||||
if(doc->child("refresh_lobby")) {
|
||||
send_to_player(socket, games_and_users_list_);
|
||||
return;
|
||||
}
|
||||
|
||||
if(simple_wml::node* whisper = doc->child("whisper")) {
|
||||
handle_whisper(socket, *whisper);
|
||||
return;
|
||||
}
|
||||
if(simple_wml::node* query = doc->child("query")) {
|
||||
handle_query(socket, *query);
|
||||
return;
|
||||
}
|
||||
if(simple_wml::node* nickserv = doc->child("nickserv")) {
|
||||
handle_nickserv(socket, *nickserv);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!player_is_in_game(socket))
|
||||
|
@ -877,14 +881,17 @@ void server::handle_read_from_player(socket_ptr socket, std::shared_ptr<simple_w
|
|||
void server::handle_player_in_lobby(socket_ptr socket, std::shared_ptr<simple_wml::document> doc) {
|
||||
if(simple_wml::node* message = doc->child("message")) {
|
||||
handle_message(socket, *message);
|
||||
return;
|
||||
}
|
||||
|
||||
if(simple_wml::node* create_game = doc->child("create_game")) {
|
||||
handle_create_game(socket, *create_game);
|
||||
return;
|
||||
}
|
||||
|
||||
if(simple_wml::node* join = doc->child("join")) {
|
||||
handle_join_game(socket, *join);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue