Specify reason when on game leave; fix #2624 (#2633)

* fix #2624

* feedback++
This commit is contained in:
ctrlaltca
2017-04-24 22:20:08 +02:00
committed by GitHub
parent 38ad71b06a
commit 29904c49da
8 changed files with 48 additions and 16 deletions

View File

@@ -616,7 +616,7 @@ Response::ResponseCode Server_Player::setCardAttrHelper(GameEventStorage &ges, c
Response::ResponseCode Server_Player::cmdLeaveGame(const Command_LeaveGame & /*cmd*/, ResponseContainer & /*rc*/, GameEventStorage & /*ges*/)
{
game->removePlayer(this);
game->removePlayer(this, Event_Leave::USER_LEFT);
return Response::RespOk;
}
@@ -1715,7 +1715,7 @@ void Server_Player::setUserInterface(Server_AbstractUserInterface *_userInterfac
void Server_Player::disconnectClient()
{
if (!(userInfo->user_level() & ServerInfo_User::IsRegistered) || spectator)
game->removePlayer(this);
game->removePlayer(this, Event_Leave::USER_DISCONNECTED);
else
setUserInterface(0);
}