mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
serve: fixed that's server can't start on some wrong config settings
This commit is contained in:
parent
2bb26521c5
commit
17cefacea7
3 changed files with 5 additions and 7 deletions
|
|
@ -51,7 +51,7 @@ public enum GameFactory {
|
|||
}
|
||||
|
||||
public void addGameType(String name, MatchType matchType, Class game) {
|
||||
if (game != null) {
|
||||
if (matchType != null && game != null) {
|
||||
this.games.put(name, game);
|
||||
this.gameTypes.put(name, matchType);
|
||||
this.gameTypeViews.add(new GameTypeView(matchType));
|
||||
|
|
|
|||
|
|
@ -45,12 +45,10 @@ public enum PlayerFactory {
|
|||
}
|
||||
|
||||
public void addPlayerType(String name, Class playerType) {
|
||||
// will raise error and stop on unknown player and that's ok - it's require HumanPlayer anyway
|
||||
PlayerType type = PlayerType.getByDescription(name);
|
||||
if (type != null) {
|
||||
if (playerType != null) {
|
||||
this.playerTypes.put(type, playerType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public enum TournamentFactory {
|
|||
|
||||
|
||||
public void addTournamentType(String name, TournamentType tournamentType, Class tournament) {
|
||||
if (tournament != null) {
|
||||
if (tournamentType != null && tournament != null) {
|
||||
this.tournaments.put(name, tournament);
|
||||
this.tournamentTypes.put(name, tournamentType);
|
||||
this.tournamentTypeViews.add(new TournamentTypeView(tournamentType));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue