forked from External/mage
Changes to user / tournament / match handling.
This commit is contained in:
parent
ffa959d536
commit
eeb22c05ee
11 changed files with 55 additions and 50 deletions
|
|
@ -355,7 +355,6 @@ public class GameController implements GameCallback {
|
|||
watchers.remove(userId);
|
||||
User user = UserManager.getInstance().getUser(userId);
|
||||
if (user != null) {
|
||||
user.removeGameWatchInfo(game.getId());
|
||||
ChatManager.getInstance().broadcast(chatId, user.getName(), " has stopped watching", MessageColor.BLUE, true, ChatMessage.MessageType.STATUS);
|
||||
}
|
||||
}
|
||||
|
|
@ -368,7 +367,25 @@ public class GameController implements GameCallback {
|
|||
game.setManaPoolMode(getPlayerId(userId), autoPayment);
|
||||
}
|
||||
|
||||
public void quit(UUID userId) {
|
||||
// public void removeUser(UUID userId) {
|
||||
// UUID playerId = userPlayerMap.get(userId);
|
||||
// if (playerId != null) {
|
||||
// GameSession gameSession = gameSessions.get(playerId);
|
||||
// if (gameSession != null) {
|
||||
// gameSession.setKilled();
|
||||
// gameSessions.remove(playerId);
|
||||
// quitMatch(userId);
|
||||
// userPlayerMap.remove(userId);
|
||||
// }
|
||||
// }
|
||||
// GameWatcher gameWatcher = watchers.get(userId);
|
||||
// if (gameWatcher != null) {
|
||||
// gameWatcher.setKilled();
|
||||
// watchers.remove(userId);
|
||||
// }
|
||||
// }
|
||||
|
||||
public void quitMatch(UUID userId) {
|
||||
game.quit(getPlayerId(userId));
|
||||
}
|
||||
|
||||
|
|
@ -388,9 +405,6 @@ public class GameController implements GameCallback {
|
|||
game.restorePriority(getPlayerId(userId));
|
||||
}
|
||||
|
||||
private void leave(UUID userId) {
|
||||
game.quit(getPlayerId(userId));
|
||||
}
|
||||
|
||||
public void cheat(UUID userId, UUID playerId, DeckCardLists deckList) {
|
||||
Deck deck;
|
||||
|
|
@ -421,24 +435,6 @@ public class GameController implements GameCallback {
|
|||
}
|
||||
}
|
||||
|
||||
public void kill(UUID userId) {
|
||||
UUID playerId = userPlayerMap.get(userId);
|
||||
if (playerId != null) {
|
||||
GameSession gameSession = gameSessions.get(playerId);
|
||||
if (gameSession != null) {
|
||||
gameSession.setKilled();
|
||||
gameSessions.remove(playerId);
|
||||
leave(userId);
|
||||
userPlayerMap.remove(userId);
|
||||
}
|
||||
}
|
||||
GameWatcher gameWatcher = watchers.get(userId);
|
||||
if (gameWatcher != null) {
|
||||
gameWatcher.setKilled();
|
||||
watchers.remove(userId);
|
||||
}
|
||||
}
|
||||
|
||||
public void timeout(UUID userId) {
|
||||
if (userPlayerMap.containsKey(userId)) {
|
||||
String sb = game.getPlayer(userPlayerMap.get(userId)).getName() +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue