Send message if nick is already taken in a game hosted by a client.
This commit is contained in:
parent
0a646f9de7
commit
4818d9e0ab
2 changed files with 4 additions and 0 deletions
|
@ -693,6 +693,7 @@ void connect::process_network_data(const config& data, const network::connection
|
|||
if(find_player_side(name) != -1) {
|
||||
config response;
|
||||
response.values["failed"] = "yes";
|
||||
response["message"] = "The nick '" + name + "' is already in use.";
|
||||
network::send_data(response,sock);
|
||||
return;
|
||||
} else {
|
||||
|
|
|
@ -303,6 +303,9 @@ void wait::process_network_data(const config& data, const network::connection so
|
|||
{
|
||||
ui::process_network_data(data, sock);
|
||||
|
||||
if(data["message"] != "") {
|
||||
gui::show_dialog(disp(),NULL,_("Response"),data["message"],gui::OK_ONLY);
|
||||
}
|
||||
if(data["failed"] == "yes") {
|
||||
set_result(QUIT);
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue