From a079b25c14813a39fa330dbd34762827f0b2681d Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 30 Mar 2021 19:08:09 +0200 Subject: [PATCH 1/6] Adjust config for new fight system Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/ArenaMode.java | 21 ++++++++++++++----- .../steamwar/bungeecore/SubserverSystem.java | 2 +- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/de/steamwar/bungeecore/ArenaMode.java b/src/de/steamwar/bungeecore/ArenaMode.java index c007a86f..19652ab5 100644 --- a/src/de/steamwar/bungeecore/ArenaMode.java +++ b/src/de/steamwar/bungeecore/ArenaMode.java @@ -73,22 +73,29 @@ public class ArenaMode { private final String internalName; private final String displayName; + private final String folder; private final List chatNames; private final String serverJar; private final List maps; private final boolean historic; + private final boolean ranked; private final String schemType; private ArenaMode(String internalName, Configuration config){ this.internalName = internalName; - this.displayName = config.getString("displayName"); + this.folder = config.getString("folder"); this.serverJar = config.getString("serverJar"); - this.chatNames = config.getStringList("chatNames"); this.maps = config.getStringList("maps"); + this.displayName = config.getString("displayName", internalName); + if(config.contains("chatNames")) + this.chatNames = config.getStringList("chatNames"); + else + this.chatNames = Collections.emptyList(); this.historic = config.getBoolean("historic", false); + this.schemType = config.getString("schemType", "").toLowerCase(); + this.ranked = config.getBoolean("ranked", false); - this.schemType = config.getString("schemType", null); allModes.add(this); byInternal.put(internalName, this); @@ -96,8 +103,8 @@ public class ArenaMode { byChat.put(name.toLowerCase(), this); } - if(config.contains("checkSchemType")) - byCheckSchemType.put(config.getString("checkSchemType").toLowerCase(), this); + if(!this.schemType.equals("")) + byCheckSchemType.put(this.schemType, this); } public String getInternalName() { @@ -120,6 +127,10 @@ public class ArenaMode { return null; } + public String getFolder() { + return folder; + } + public String getRandomMap(){ return maps.get(random.nextInt(maps.size())); } diff --git a/src/de/steamwar/bungeecore/SubserverSystem.java b/src/de/steamwar/bungeecore/SubserverSystem.java index 50d55526..3613febd 100644 --- a/src/de/steamwar/bungeecore/SubserverSystem.java +++ b/src/de/steamwar/bungeecore/SubserverSystem.java @@ -108,7 +108,7 @@ public class SubserverSystem { //Copy world try { - new ProcessBuilder("cp", "-r", SERVER_PATH + modus.getInternalName() + "/" + map, worldDir + mapName).start().waitFor(); + new ProcessBuilder("cp", "-r", SERVER_PATH + modus.getFolder() + "/" + map, worldDir + mapName).start().waitFor(); } catch (IOException | InterruptedException e) { throw new SecurityException("Could not copy folder", e); } From 5424a739d9d02eec74d4e03d53c267d5e47d5a1d Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 30 Mar 2021 19:12:00 +0200 Subject: [PATCH 2/6] Adjust config for new fight system Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/ArenaMode.java | 8 ++------ src/de/steamwar/bungeecore/SubserverSystem.java | 4 ++-- src/de/steamwar/bungeecore/commands/FightCommand.java | 2 +- src/de/steamwar/bungeecore/commands/RankedCommand.java | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/de/steamwar/bungeecore/ArenaMode.java b/src/de/steamwar/bungeecore/ArenaMode.java index 19652ab5..68a27a4e 100644 --- a/src/de/steamwar/bungeecore/ArenaMode.java +++ b/src/de/steamwar/bungeecore/ArenaMode.java @@ -107,10 +107,6 @@ public class ArenaMode { byCheckSchemType.put(this.schemType, this); } - public String getInternalName() { - return internalName; - } - public String getDisplayName() { return displayName; } @@ -143,8 +139,8 @@ public class ArenaMode { return chatNames.get(0); } - public boolean hasChatName(){ - return !chatNames.isEmpty(); + public boolean withoutChatName(){ + return chatNames.isEmpty(); } public boolean isHistoric(){ diff --git a/src/de/steamwar/bungeecore/SubserverSystem.java b/src/de/steamwar/bungeecore/SubserverSystem.java index 3613febd..5751f6ef 100644 --- a/src/de/steamwar/bungeecore/SubserverSystem.java +++ b/src/de/steamwar/bungeecore/SubserverSystem.java @@ -108,7 +108,7 @@ public class SubserverSystem { //Copy world try { - new ProcessBuilder("cp", "-r", SERVER_PATH + modus.getFolder() + "/" + map, worldDir + mapName).start().waitFor(); + new ProcessBuilder("cp", "-r", SERVER_PATH + modus.getFolder() + "/arenas/" + map, worldDir + mapName).start().waitFor(); } catch (IOException | InterruptedException e) { throw new SecurityException("Could not copy folder", e); } @@ -128,7 +128,7 @@ public class SubserverSystem { //Start server ProcessBuilder process = new ProcessBuilder(cmd); - process.directory(new File(SERVER_PATH, modus.getInternalName())); + process.directory(new File(SERVER_PATH, modus.getFolder())); String finalMapName = mapName; if(eventFightID == -1) diff --git a/src/de/steamwar/bungeecore/commands/FightCommand.java b/src/de/steamwar/bungeecore/commands/FightCommand.java index 44e9cf10..93292de3 100644 --- a/src/de/steamwar/bungeecore/commands/FightCommand.java +++ b/src/de/steamwar/bungeecore/commands/FightCommand.java @@ -69,7 +69,7 @@ public class FightCommand extends BasicCommand { TextComponent start = new TextComponent(); TextComponent current = start; for(ArenaMode mode : ArenaMode.getAllModes()){ - if(!mode.hasChatName() || mode.isHistoric() != historic) + if(mode.withoutChatName() || mode.isHistoric() != historic) continue; String command = precommand + mode.getChatName(); current.setBold(true); diff --git a/src/de/steamwar/bungeecore/commands/RankedCommand.java b/src/de/steamwar/bungeecore/commands/RankedCommand.java index c70fff93..5825b48f 100644 --- a/src/de/steamwar/bungeecore/commands/RankedCommand.java +++ b/src/de/steamwar/bungeecore/commands/RankedCommand.java @@ -81,7 +81,7 @@ public class RankedCommand extends BasicCommand { TextComponent start = new TextComponent(); TextComponent current = start; for(ArenaMode mode : ArenaMode.getAllModes()){ - if(!mode.hasChatName() || !mode.isRanked()) + if(mode.withoutChatName() || !mode.isRanked()) continue; String command = precommand + mode.getChatName(); current.setBold(true); From 5ee46a2ca32a38205e7d1adfd74221b2013789a0 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 30 Mar 2021 19:13:35 +0200 Subject: [PATCH 3/6] Adjust config for new fight system Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/ArenaMode.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/ArenaMode.java b/src/de/steamwar/bungeecore/ArenaMode.java index 68a27a4e..1e33cce9 100644 --- a/src/de/steamwar/bungeecore/ArenaMode.java +++ b/src/de/steamwar/bungeecore/ArenaMode.java @@ -71,7 +71,6 @@ public class ArenaMode { return allModes; } - private final String internalName; private final String displayName; private final String folder; private final List chatNames; @@ -83,7 +82,6 @@ public class ArenaMode { private final String schemType; private ArenaMode(String internalName, Configuration config){ - this.internalName = internalName; this.folder = config.getString("folder"); this.serverJar = config.getString("serverJar"); this.maps = config.getStringList("maps"); From 4c2f4fdbcd121dc2b564272587b5046260c8a11e Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 30 Mar 2021 19:47:34 +0200 Subject: [PATCH 4/6] Implement prepare Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/ArenaMode.java | 17 ++++----- .../steamwar/bungeecore/SubserverSystem.java | 15 ++++---- .../bungeecore/commands/BauCommand.java | 36 ++++++++++--------- .../bungeecore/commands/ChallengeCommand.java | 2 +- .../bungeecore/commands/CheckCommand.java | 11 ++---- .../bungeecore/commands/FightCommand.java | 2 +- .../bungeecore/commands/HistoricCommand.java | 2 +- .../bungeecore/commands/RankedCommand.java | 2 +- .../bungeecore/comms/PacketIdManager.java | 1 + .../bungeecore/comms/SpigotReceiver.java | 2 ++ .../comms/handlers/PrepareSchemHandler.java | 23 ++++++++++++ 11 files changed, 69 insertions(+), 44 deletions(-) create mode 100644 src/de/steamwar/bungeecore/comms/handlers/PrepareSchemHandler.java diff --git a/src/de/steamwar/bungeecore/ArenaMode.java b/src/de/steamwar/bungeecore/ArenaMode.java index 1e33cce9..b675b8eb 100644 --- a/src/de/steamwar/bungeecore/ArenaMode.java +++ b/src/de/steamwar/bungeecore/ArenaMode.java @@ -19,17 +19,18 @@ package de.steamwar.bungeecore; +import de.steamwar.bungeecore.sql.SchematicType; import net.md_5.bungee.config.Configuration; import java.util.*; public class ArenaMode { - private static Map byChat = new HashMap<>(); - private static Map byInternal = new HashMap<>(); - private static Map byCheckSchemType = new HashMap<>(); - private static List allModes = new LinkedList<>(); - private static Random random = new Random(); + private static final Map byChat = new HashMap<>(); + private static final Map byInternal = new HashMap<>(); + private static final Map bySchemType = new HashMap<>(); + private static final List allModes = new LinkedList<>(); + private static final Random random = new Random(); static void init(Configuration config){ for(String internalName : config.getKeys()){ @@ -63,8 +64,8 @@ public class ArenaMode { return chatNames; } - public static ArenaMode getByCheckSchemType(String checkSchemType){ - return byCheckSchemType.get(checkSchemType); + public static ArenaMode getBySchemType(SchematicType schemType){ + return bySchemType.get(schemType); } public static List getAllModes(){ @@ -102,7 +103,7 @@ public class ArenaMode { } if(!this.schemType.equals("")) - byCheckSchemType.put(this.schemType, this); + bySchemType.put(SchematicType.fromDB(this.schemType), this); } public String getDisplayName() { diff --git a/src/de/steamwar/bungeecore/SubserverSystem.java b/src/de/steamwar/bungeecore/SubserverSystem.java index 5751f6ef..48985488 100644 --- a/src/de/steamwar/bungeecore/SubserverSystem.java +++ b/src/de/steamwar/bungeecore/SubserverSystem.java @@ -87,7 +87,7 @@ public class SubserverSystem { * @return * The new started subserver. */ - public static Subserver startArena(ArenaMode modus, String map, int eventFightID, int checkSchemID, String serverName, String mapName, UUID player1, UUID player2, boolean ranked){ + public static Subserver startArena(ArenaMode modus, String map, int eventFightID, int checkSchemID, int prepareSchemID, String serverName, String mapName, UUID player1, UUID player2, boolean ranked){ //Generate missing parameters int port = freePort(firstArenaPort); @@ -123,6 +123,7 @@ public class SubserverSystem { "fightID=" + eventFightID, "ranked=" + ranked, "checkSchemID=" + checkSchemID, + "prepareSchemID=" + prepareSchemID, player1 != null && eventFightID != -1 ? "blueLeader=" + player1.toString() : null, player2 != null ? "redLeader=" + player2.toString() : null); @@ -152,24 +153,22 @@ public class SubserverSystem { }); } - public static Subserver startArena(ArenaMode modus, String map, int eventFightID, int checkSchemID, String serverName, String mapName, UUID player1, UUID player2){ - return startArena(modus, map, eventFightID, checkSchemID, serverName, mapName, player1, player2, false); - } - public static Subserver startEventArena(EventFight eventFight, String serverName){ return startArena( eventFight.getSpielmodus(), eventFight.getMap(), eventFight.getFightID(), 0, + 0, serverName, serverName.replace(' ', '_') + eventFight.getStartTime().toLocalDateTime().format(DateTimeFormatter.ISO_TIME), null, - null); + null, + false); } - public static void startTestServer(ProxiedPlayer p, ArenaMode m, String map, int checkSchemId){ - startArena(m, map, -1, checkSchemId, p.getName() + "s Bau", p.getName(), p.getUniqueId(), null).sendPlayer(p); + public static void startTestServer(ProxiedPlayer p, ArenaMode m, String map, int checkSchemId, int prepareSchemId){ + startArena(m, map, -1, checkSchemId, prepareSchemId, p.getName() + "s Bau", p.getName(), p.getUniqueId(), null, false).sendPlayer(p); } public static void sendToBauServer(ProxiedPlayer p, UUID owner){ diff --git a/src/de/steamwar/bungeecore/commands/BauCommand.java b/src/de/steamwar/bungeecore/commands/BauCommand.java index a0d120fb..355a82f9 100644 --- a/src/de/steamwar/bungeecore/commands/BauCommand.java +++ b/src/de/steamwar/bungeecore/commands/BauCommand.java @@ -266,24 +266,28 @@ public class BauCommand { }); } + public static void stopBauserver(ProxiedPlayer p){ + for (Subserver subserver : Subserver.getServerList()) { + if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) { + if(subserver.getServer().getPlayers().isEmpty()){ + Message.send("BAU_START_ALREADY", p); + return; + } + subserver.stop(); + try { + Thread.sleep(200); // Wait until possible testarena-World has been deleted + } catch (InterruptedException e) { + throw new SecurityException("Subserver stop interrupted", e); + } + break; + } + } + } + private static void testarena(ProxiedPlayer p, String[] command){ FightCommand.createArena(p, "/bau testarena ", command, 2, false, (player, mode, map) -> ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> { - for (Subserver subserver : Subserver.getServerList()) { - if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) { - if(subserver.getServer().getPlayers().isEmpty()){ - Message.send("BAU_START_ALREADY", p); - return; - } - subserver.stop(); - try { - Thread.sleep(200); // Wait until possible testarena-World has been deleted - } catch (InterruptedException e) { - throw new SecurityException("Subserver stop interrupted", e); - } - break; - } - } - SubserverSystem.startTestServer(p, mode, map, 0); + stopBauserver(p); + SubserverSystem.startTestServer(p, mode, map, 0, 0); })); } diff --git a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java index 2c3d6574..3d4150d3 100644 --- a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java +++ b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java @@ -75,7 +75,7 @@ public class ChallengeCommand extends BasicCommand { challenges.remove(target); challenges.remove(player); - Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), target.getUniqueId()); + Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, null, null, player.getUniqueId(), target.getUniqueId(), false); arena.sendPlayer(player); arena.sendPlayer(target); diff --git a/src/de/steamwar/bungeecore/commands/CheckCommand.java b/src/de/steamwar/bungeecore/commands/CheckCommand.java index 9aaed515..b121fe94 100644 --- a/src/de/steamwar/bungeecore/commands/CheckCommand.java +++ b/src/de/steamwar/bungeecore/commands/CheckCommand.java @@ -223,15 +223,10 @@ public class CheckCommand extends BasicCommand { this.checkList = checkQuestions.get(schematic.getSchemType()).listIterator(); ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> { - for (Subserver subserver : Subserver.getServerList()) { - if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(checker.getUniqueId())) { - subserver.stop(); - break; - } - } + BauCommand.stopBauserver(checker); - ArenaMode mode = ArenaMode.getByCheckSchemType(schematic.getSchemType().toDB()); - SubserverSystem.startTestServer(checker, mode, FightCommand.getMap(checker, mode, "Random"), schematic.getSchemID()); + ArenaMode mode = ArenaMode.getBySchemType(schematic.getSchemType().fightType()); + SubserverSystem.startTestServer(checker, mode, FightCommand.getMap(checker, mode, "Random"), schematic.getSchemID(), 0); currentCheckers.put(checker.getUniqueId(), this); currentSchems.put(schematic.getSchemID(), this); for(CheckedSchematic previous : CheckedSchematic.previousChecks(schematic.getSchemName(), schematic.getSchemOwner())) diff --git a/src/de/steamwar/bungeecore/commands/FightCommand.java b/src/de/steamwar/bungeecore/commands/FightCommand.java index 93292de3..984bc06b 100644 --- a/src/de/steamwar/bungeecore/commands/FightCommand.java +++ b/src/de/steamwar/bungeecore/commands/FightCommand.java @@ -164,7 +164,7 @@ public class FightCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { createArena(sender, "/fight ", args, 0, false, (player, mode, map) -> { - Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null); + Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, null, null, player.getUniqueId(), null, false); arena.sendPlayer(player); Message.broadcast("FIGHT_BROADCAST", "FIGHT_BROADCAST_HOVER" , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName()); diff --git a/src/de/steamwar/bungeecore/commands/HistoricCommand.java b/src/de/steamwar/bungeecore/commands/HistoricCommand.java index c7d64deb..ebf93123 100644 --- a/src/de/steamwar/bungeecore/commands/HistoricCommand.java +++ b/src/de/steamwar/bungeecore/commands/HistoricCommand.java @@ -33,7 +33,7 @@ public class HistoricCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> { - Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null); + Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, null, null, player.getUniqueId(), null, false); arena.sendPlayer(player); Message.broadcast("HISTORIC_BROADCAST", "HISTORIC_BROADCAST_HOVER" , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName()); diff --git a/src/de/steamwar/bungeecore/commands/RankedCommand.java b/src/de/steamwar/bungeecore/commands/RankedCommand.java index 5825b48f..1a978b55 100644 --- a/src/de/steamwar/bungeecore/commands/RankedCommand.java +++ b/src/de/steamwar/bungeecore/commands/RankedCommand.java @@ -165,7 +165,7 @@ public class RankedCommand extends BasicCommand { removeFromAll(wp1.player); removeFromAll(wp2.player); - Subserver arena = SubserverSystem.startArena(mode, mode.getRandomMap(), 0, 0, null, null, wp1.player.getUniqueId(), wp2.player.getUniqueId(), true); + Subserver arena = SubserverSystem.startArena(mode, mode.getRandomMap(), 0, 0, 0, null, null, wp1.player.getUniqueId(), wp2.player.getUniqueId(), true); arena.sendPlayer(wp1.player); arena.sendPlayer(wp2.player); diff --git a/src/de/steamwar/bungeecore/comms/PacketIdManager.java b/src/de/steamwar/bungeecore/comms/PacketIdManager.java index ae86d708..8376d591 100644 --- a/src/de/steamwar/bungeecore/comms/PacketIdManager.java +++ b/src/de/steamwar/bungeecore/comms/PacketIdManager.java @@ -24,6 +24,7 @@ public class PacketIdManager { //0x0(X) Standalone Packets public static final byte PING_PACKET = 0x01; public static final byte TABLIST_NAME = 0x02; + public static final byte PREPARE_SCHEM = 0x03; //0x1(X) Bungee Inventory public static final byte INVENTORY_PACKET = 0x10; diff --git a/src/de/steamwar/bungeecore/comms/SpigotReceiver.java b/src/de/steamwar/bungeecore/comms/SpigotReceiver.java index b18b3a04..f87646f1 100644 --- a/src/de/steamwar/bungeecore/comms/SpigotReceiver.java +++ b/src/de/steamwar/bungeecore/comms/SpigotReceiver.java @@ -22,6 +22,7 @@ package de.steamwar.bungeecore.comms; import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteStreams; import de.steamwar.bungeecore.comms.handlers.InventoryCallbackHandler; +import de.steamwar.bungeecore.comms.handlers.PrepareSchemHandler; import de.steamwar.bungeecore.comms.handlers.TablistNameHandler; import de.steamwar.bungeecore.listeners.BasicListener; import net.md_5.bungee.api.event.PluginMessageEvent; @@ -55,5 +56,6 @@ public class SpigotReceiver extends BasicListener { static { registerHandler(PacketIdManager.INVENTORY_CALLBACK_PACKET, new InventoryCallbackHandler()); registerHandler(PacketIdManager.TABLIST_NAME, new TablistNameHandler()); + registerHandler(PacketIdManager.PREPARE_SCHEM, new PrepareSchemHandler()); } } diff --git a/src/de/steamwar/bungeecore/comms/handlers/PrepareSchemHandler.java b/src/de/steamwar/bungeecore/comms/handlers/PrepareSchemHandler.java new file mode 100644 index 00000000..40880a0e --- /dev/null +++ b/src/de/steamwar/bungeecore/comms/handlers/PrepareSchemHandler.java @@ -0,0 +1,23 @@ +package de.steamwar.bungeecore.comms.handlers; + +import com.google.common.io.ByteArrayDataInput; +import de.steamwar.bungeecore.ArenaMode; +import de.steamwar.bungeecore.SubserverSystem; +import de.steamwar.bungeecore.commands.BauCommand; +import de.steamwar.bungeecore.comms.SpigotHandler; +import de.steamwar.bungeecore.sql.SchematicType; +import de.steamwar.bungeecore.sql.SteamwarUser; +import net.md_5.bungee.api.ProxyServer; +import net.md_5.bungee.api.connection.ProxiedPlayer; + +public class PrepareSchemHandler implements SpigotHandler { + @Override + public void handle(ByteArrayDataInput byteArrayDataInput) { + ProxiedPlayer player = ProxyServer.getInstance().getPlayer(SteamwarUser.get(byteArrayDataInput.readInt()).getUuid()); + int schematicID = byteArrayDataInput.readInt(); + ArenaMode mode = ArenaMode.getBySchemType(SchematicType.fromDB(byteArrayDataInput.readUTF())); + + BauCommand.stopBauserver(player); + SubserverSystem.startTestServer(player, mode, mode.getRandomMap(), 0, schematicID); + } +} From 1824dda8575280925e314e208628bfc5049c5541 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 30 Mar 2021 19:48:51 +0200 Subject: [PATCH 5/6] Fix license header Signed-off-by: Lixfel --- .../comms/handlers/PrepareSchemHandler.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/de/steamwar/bungeecore/comms/handlers/PrepareSchemHandler.java b/src/de/steamwar/bungeecore/comms/handlers/PrepareSchemHandler.java index 40880a0e..46d1a032 100644 --- a/src/de/steamwar/bungeecore/comms/handlers/PrepareSchemHandler.java +++ b/src/de/steamwar/bungeecore/comms/handlers/PrepareSchemHandler.java @@ -1,3 +1,22 @@ +/* + This file is a part of the SteamWar software. + + Copyright (C) 2020 SteamWar.de-Serverteam + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + package de.steamwar.bungeecore.comms.handlers; import com.google.common.io.ByteArrayDataInput; From 0dcb831142f9068bd26654fc0335f174626dc264 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 30 Mar 2021 20:03:56 +0200 Subject: [PATCH 6/6] Fix missing config Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/ArenaMode.java | 6 ++++++ src/de/steamwar/bungeecore/SubserverSystem.java | 1 + 2 files changed, 7 insertions(+) diff --git a/src/de/steamwar/bungeecore/ArenaMode.java b/src/de/steamwar/bungeecore/ArenaMode.java index b675b8eb..4d5a8689 100644 --- a/src/de/steamwar/bungeecore/ArenaMode.java +++ b/src/de/steamwar/bungeecore/ArenaMode.java @@ -76,6 +76,7 @@ public class ArenaMode { private final String folder; private final List chatNames; private final String serverJar; + private final String config; private final List maps; private final boolean historic; @@ -85,6 +86,7 @@ public class ArenaMode { private ArenaMode(String internalName, Configuration config){ this.folder = config.getString("folder"); this.serverJar = config.getString("serverJar"); + this.config = config.getString("config"); this.maps = config.getStringList("maps"); this.displayName = config.getString("displayName", internalName); if(config.contains("chatNames")) @@ -114,6 +116,10 @@ public class ArenaMode { return serverJar; } + public String getConfig(){ + return config; + } + public String hasMap(String map){ for(String m : maps){ if(m.equalsIgnoreCase(map)) diff --git a/src/de/steamwar/bungeecore/SubserverSystem.java b/src/de/steamwar/bungeecore/SubserverSystem.java index 48985488..8295642c 100644 --- a/src/de/steamwar/bungeecore/SubserverSystem.java +++ b/src/de/steamwar/bungeecore/SubserverSystem.java @@ -120,6 +120,7 @@ public class SubserverSystem { port, "2G", "logPath=" + mapName, + "config="+modus.getConfig(), "fightID=" + eventFightID, "ranked=" + ranked, "checkSchemID=" + checkSchemID,