mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
added JoinTournamentTable + more refactoring
This commit is contained in:
parent
1d2108fe7f
commit
a316b01b15
21 changed files with 98 additions and 169 deletions
|
|
@ -305,27 +305,22 @@ public class ServerMain implements MageServer {
|
|||
return ret;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean joinTournamentTable(final String sessionId, final UUID roomId, final UUID tableId, final String name, final String playerType, final int skill, final DeckCardLists deckList, final String password) throws MageException, GameException {
|
||||
// return executeWithResult("joinTournamentTable", sessionId, new ActionWithBooleanResult() {
|
||||
// @Override
|
||||
// public Boolean execute() throws MageException {
|
||||
// UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
|
||||
// if (logger.isTraceEnabled()) {
|
||||
// User user = UserManager.getInstance().getUser(userId);
|
||||
// if (user != null) {
|
||||
// logger.trace("join tourn. tableId: " + tableId + " " + name);
|
||||
// }
|
||||
// }
|
||||
// if (userId == null) {
|
||||
// logger.fatal("Got no userId from sessionId" + sessionId + " tableId" + tableId);
|
||||
// return false;
|
||||
// }
|
||||
// boolean ret = GamesRoomManager.getInstance().getRoom(roomId).joinTournamentTable(userId, tableId, name, playerType, skill, deckList, password);
|
||||
// return ret;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
@Override
|
||||
public boolean joinTournamentTable(final String sessionId, final UUID roomId, final UUID tableId, final String name, final String playerType, final int skill, final DeckCardLists deckList, final String password) {
|
||||
UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
|
||||
if (logger.isTraceEnabled()) {
|
||||
User user = UserManager.getInstance().getUser(userId);
|
||||
if (user != null) {
|
||||
logger.trace("join tourn. tableId: " + tableId + " " + name);
|
||||
}
|
||||
}
|
||||
if (userId == null) {
|
||||
logger.fatal("Got no userId from sessionId" + sessionId + " tableId" + tableId);
|
||||
return false;
|
||||
}
|
||||
boolean ret = GamesRoomManager.getInstance().getRoom(roomId).joinTournamentTable(userId, tableId, name, playerType, skill, deckList, password);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean submitDeck(final String sessionId, final UUID tableId, final DeckCardLists deckList) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue