Added user's leave notification for ingame players

Also updated changelogs
This commit is contained in:
neverEnough 2015-11-03 03:09:19 +01:00
parent 8d22b2f5f3
commit bc8cdb3c5b
4 changed files with 11 additions and 2 deletions

View file

@ -195,6 +195,7 @@ Version 1.13.1+dev:
* Fixed Cancel Orders not working when loading MP game (bug #22133)
* Fixed broken Oasis terrain help entry (bug #23023)
* Fixed load game hot-key not working in the main menu (bug #23215)
* Added user's leave notification for ingame players
Version 1.13.1:
* Security fixes:

View file

@ -44,6 +44,7 @@ Version 1.13.1+dev:
* Enhanced tab completion in text boxes for friends and for easier whispers answer (bug #9742)
* Fixed Cancel Orders not working when loading MP game (bug #22133)
* Fixed load game hot-key not working in the main menu (bug #23215)
* Added user's leave notification for ingame players
Version 1.13.1:

View file

@ -356,10 +356,13 @@ bool is_campaign_completed(const std::string& campaign_id, const std::string &di
bool parse_should_show_lobby_join(const std::string &sender, const std::string &message)
{
// If it's actually not a lobby join message return true (show it).
// If it's actually not a lobby join or leave message return true (show it).
if (sender != "server") return true;
std::string::size_type pos = message.find(" has logged into the lobby");
if (pos == std::string::npos) return true;
if (pos == std::string::npos){
pos = message.find(" has disconnected");
if (pos == std::string::npos) return true;
}
int lj = lobby_joins();
if (lj == SHOW_NONE) return false;
if (lj == SHOW_ALL) return true;

View file

@ -851,6 +851,10 @@ void server::run() {
simple_wml::document diff;
if(make_delete_diff(games_and_users_list_.root(), NULL, "user",
pl_it->second.config_address(), diff)) {
for (t_games::const_iterator g = games_.begin(); g != games_.end(); ++g) {
// Note: This string is parsed by the client to identify lobby leave messages!
g->send_server_message_to_all(pl_it->second.name() + " has disconnected");
}
rooms_.lobby().send_data(diff, e.socket);
}