From 7a27ca8ecfc32739b81425bc5e877a4cad961917 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Sun, 6 Jun 2021 17:43:55 +0200 Subject: [PATCH] feat: added max lobbies parameter --- .../java/uulm/teamname/marvelous/server/Server.java | 12 ++++++++++-- .../teamname/marvelous/server/args/ServerArgs.java | 7 +++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/Server.java b/Server/src/main/java/uulm/teamname/marvelous/server/Server.java index 76700ff..2cd519a 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/Server.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/Server.java @@ -11,6 +11,7 @@ import uulm.teamname.marvelous.gamelibrary.config.ScenarioConfig; import uulm.teamname.marvelous.gamelibrary.json.JSON; import uulm.teamname.marvelous.gamelibrary.json.ValidationUtility; import uulm.teamname.marvelous.server.args.ServerArgs; +import uulm.teamname.marvelous.server.lobbymanager.LobbyManager; import uulm.teamname.marvelous.server.netconnector.MarvelousServer; import uulm.teamname.marvelous.server.netconnector.UserManager; @@ -27,10 +28,11 @@ import java.util.Map; * -s .\configs\asgard.scenario.json -v} into the arguments field. */ public class Server { - private static PartyConfig partyConfig; + private static ScenarioConfig scenarioConfig; private static CharacterConfig characterConfig; + private static int maxLobbies; public static void main(String[] args) { @@ -46,7 +48,9 @@ public class Server { System.exit(1); } - System.out.println(serverArgs); + // System.out.println(serverArgs); + + maxLobbies = serverArgs.getMaxLobbies(); if (serverArgs.isVerbose() || serverArgs.isCheckConfig()) { // If checkConfig, the LogLevel is also set to max, because more information @@ -225,4 +229,8 @@ public class Server { public static CharacterConfig getCharacterConfig() { return characterConfig; } + + public static int getMaxLobbies() { + return maxLobbies; + } } diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/args/ServerArgs.java b/Server/src/main/java/uulm/teamname/marvelous/server/args/ServerArgs.java index 53d33fe..7401a8c 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/args/ServerArgs.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/args/ServerArgs.java @@ -49,6 +49,9 @@ public class ServerArgs { @Parameter(names = {"--replay", "-r"}) private String folderPath; + @Parameter(names = {"--max-lobbies", "-l", "--team25-max-lobbies"} ) + private int maxLobbies = 8; + /** Whether help is requested */ public boolean isHelp() { return help; @@ -94,6 +97,10 @@ public class ServerArgs { return folderPath; } + public int getMaxLobbies() { + return maxLobbies; + } + @Override public String toString() {