forked from External/mage
Attempt to allow players to fix the game if the active/choosing/person with priority has left or has run down the clock
This commit is contained in:
parent
7698856d29
commit
471d49892f
2 changed files with 101 additions and 2 deletions
|
|
@ -244,6 +244,27 @@ public enum ChatManager {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
if (command.startsWith("FIX")) {
|
||||
message += "<br/>" + GameManager.instance.getChatId(chatId);
|
||||
ChatSession session = chatSessions.get(chatId);
|
||||
if (session != null && session.getInfo() != null) {
|
||||
String gameId = session.getInfo();
|
||||
if (gameId.startsWith("Game ")) {
|
||||
UUID id = java.util.UUID.fromString(gameId.substring(5, gameId.length()));
|
||||
for (Entry<UUID, GameController> entry : GameManager.instance.getGameController().entrySet()) {
|
||||
if (entry.getKey().equals(id)) {
|
||||
GameController controller = entry.getValue();
|
||||
if (controller != null) {
|
||||
message += controller.attemptToFixGame();
|
||||
chatSessions.get(chatId).broadcastInfoToUser(user, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (command.startsWith("CARD ")) {
|
||||
Matcher matchPattern = getCardTextPattern.matcher(message.toLowerCase(Locale.ENGLISH));
|
||||
if (matchPattern.find()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue