Improvements player cancels or leaves match or tournament. Draft can replace human player by draft bot if human leaves.

This commit is contained in:
LevelX2 2013-10-03 22:42:16 +02:00
parent 089fbf15b1
commit e2532a9b11
18 changed files with 300 additions and 102 deletions

View file

@ -293,14 +293,7 @@ public class User {
session.setKilled();
}
for (Entry<UUID, Table> entry: tables.entrySet()) {
entry.getValue().leaveTable(entry.getKey());
// remove tables here only, if the match or tournament did not start yet (states waiting/starting).
// all other situations have to lead to a fnished match / tournament where players left / conceded for which reasons ever
if (TableManager.getInstance().isTableOwner(entry.getValue().getId(), userId)
&& (entry.getValue().getState().equals(TableState.WAITING)
|| entry.getValue().getState().equals(TableState.STARTING))) {
TableManager.getInstance().removeTable(userId, entry.getValue().getId());
}
TableManager.getInstance().leaveTable(userId, entry.getValue().getId());
}
ChatManager.getInstance().removeUser(userId, reason);
}