mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
Little fixes and code refactor
This commit is contained in:
parent
c67e937dfb
commit
ab8a4eb26a
8 changed files with 71 additions and 98 deletions
|
|
@ -201,7 +201,7 @@ public class MageServerImpl implements MageServer {
|
|||
// check if user can create another table
|
||||
int notStartedTables = user.getNumberOfNotStartedTables();
|
||||
if (notStartedTables > 1) {
|
||||
user.showUserMessage("Create table", "You have already " + notStartedTables + " not started table" + (notStartedTables == 1 ? "" : "s") + ". You can't create another.");
|
||||
user.showUserMessage("Create table", "You have already " + notStartedTables + " not started tables. You can't create another.");
|
||||
throw new MageException("No message");
|
||||
}
|
||||
// check AI players max
|
||||
|
|
@ -1102,7 +1102,7 @@ public class MageServerImpl implements MageServer {
|
|||
execute("removeTable", sessionId, () -> {
|
||||
SessionManager.instance.getSession(sessionId).ifPresent(session -> {
|
||||
UUID userId = session.getUserId();
|
||||
TableManager.instance.removeTable(userId, tableId);
|
||||
TableManager.instance.removeTable(userId, tableId); // delete account
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -1327,7 +1327,7 @@ public class MageServerImpl implements MageServer {
|
|||
// check if user can create another table
|
||||
int notStartedTables = user.getNumberOfNotStartedTables();
|
||||
if (notStartedTables > 1) {
|
||||
user.showUserMessage("Create table", "You have already " + notStartedTables + " not started table" + (notStartedTables == 1 ? "" : "s") + ". You can't create another.");
|
||||
user.showUserMessage("Create table", "You have already " + notStartedTables + " not started tables. You can't create another.");
|
||||
throw new MageException("No message");
|
||||
}
|
||||
// check if the user itself satisfies the quitRatio requirement.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue