mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Merge branch 'master' into add-minimum-rating-option
This commit is contained in:
commit
5cd57199c7
348 changed files with 1560 additions and 1096 deletions
|
|
@ -686,7 +686,7 @@ public class MageServerImpl implements MageServer {
|
|||
} catch (Exception ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
return null;
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -153,15 +153,15 @@ public final class Main {
|
|||
|
||||
for (ExtensionPackage pkg : extensions) {
|
||||
Map<String, Class> draftCubes = pkg.getDraftCubes();
|
||||
for (String name : draftCubes.keySet()) {
|
||||
logger.info("Loading extension: [" + name + "] " + draftCubes.get(name).toString());
|
||||
CubeFactory.instance.addDraftCube(name, draftCubes.get(name));
|
||||
}
|
||||
draftCubes.forEach((name, draftCube) -> {
|
||||
logger.info("Loading extension: [" + name + "] " + draftCube.toString());
|
||||
CubeFactory.instance.addDraftCube(name, draftCube);
|
||||
});
|
||||
Map<String, Class> deckTypes = pkg.getDeckTypes();
|
||||
for (String name : deckTypes.keySet()) {
|
||||
logger.info("Loading extension: [" + name + "] " + deckTypes.get(name));
|
||||
DeckValidatorFactory.instance.addDeckType(name, deckTypes.get(name));
|
||||
}
|
||||
deckTypes.forEach((name, deckType) -> {
|
||||
logger.info("Loading extension: [" + name + "] " + deckType);
|
||||
DeckValidatorFactory.instance.addDeckType(name, deckType);
|
||||
});
|
||||
}
|
||||
|
||||
logger.info("Config - max seconds idle: " + config.getMaxSecondsIdle());
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public enum SessionManager {
|
|||
logger.trace("Session with sessionId " + sessionId + " is not found");
|
||||
return Optional.empty();
|
||||
}
|
||||
if (session.getUserId() != null && UserManager.instance.getUser(session.getUserId()) == null) {
|
||||
if (session.getUserId() != null && !UserManager.instance.getUser(session.getUserId()).isPresent()) {
|
||||
logger.error("User for session " + sessionId + " with userId " + session.getUserId() + " is missing. Session removed.");
|
||||
// can happen if user from same host signs in multiple time with multiple clients, after he disconnects with one client
|
||||
disconnect(sessionId, DisconnectReason.ConnectingOtherInstance);
|
||||
|
|
|
|||
|
|
@ -972,7 +972,7 @@ public class TableController {
|
|||
if (!(table.getState() == TableState.WAITING || table.getState() == TableState.STARTING || table.getState() == TableState.READY_TO_START)) {
|
||||
if (match == null) {
|
||||
logger.warn("- Match table with no match:");
|
||||
logger.warn("-- matchId:" + match.getId() + " [" + match.getName() + ']');
|
||||
logger.warn("-- matchId:" + match.getId() + " , table : " + table.getId());
|
||||
// return false;
|
||||
} else if (match.isDoneSideboarding() && match.getGame() == null) {
|
||||
// no sideboarding and not active game -> match seems to hang (maybe the Draw bug)
|
||||
|
|
|
|||
|
|
@ -266,13 +266,13 @@ public class GameController implements GameCallback {
|
|||
|
||||
public void join(UUID userId) {
|
||||
UUID playerId = userPlayerMap.get(userId);
|
||||
Optional<User> user = UserManager.instance.getUser(userId);
|
||||
if (userId == null || playerId == null) {
|
||||
if (playerId == null) {
|
||||
logger.fatal("Join game failed!");
|
||||
logger.fatal("- gameId: " + game.getId());
|
||||
logger.fatal("- userId: " + userId);
|
||||
return;
|
||||
}
|
||||
Optional<User> user = UserManager.instance.getUser(userId);
|
||||
if (!user.isPresent()) {
|
||||
logger.fatal("User not found : " + userId);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@ package mage.server.game;
|
|||
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import mage.MageException;
|
||||
import mage.game.Game;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
* @param <T>
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class GameWorker<T> implements Callable {
|
||||
|
||||
|
|
@ -40,12 +40,7 @@ public class GameWorker<T> implements Callable {
|
|||
} catch (Exception e) {
|
||||
LOGGER.fatal("GameWorker general exception [" + game.getId() + "] " + e.getMessage(), e);
|
||||
if (e instanceof NullPointerException) {
|
||||
if (e.getStackTrace() == null) {
|
||||
LOGGER.info("Stack trace is null");
|
||||
} else {
|
||||
LOGGER.info("Null-Pointer-Exception: Stack trace");
|
||||
LOGGER.info(e.getStackTrace());
|
||||
}
|
||||
LOGGER.info(e.getStackTrace());
|
||||
}
|
||||
} catch (Error err) {
|
||||
LOGGER.fatal("GameWorker general error [" + game.getId() + "] " + err, err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue