From a1dd46d1d05752b201082fffcbdb60c30245b77d Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 10 Mar 2022 11:50:57 +0100 Subject: [PATCH] Remove ranked flag --- src/de/steamwar/bungeecore/SubserverSystem.java | 17 +++++------------ .../bungeecore/commands/ChallengeCommand.java | 2 +- .../bungeecore/commands/FightCommand.java | 2 +- .../bungeecore/commands/HistoricCommand.java | 2 +- .../bungeecore/commands/ReplayCommand.java | 2 +- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/de/steamwar/bungeecore/SubserverSystem.java b/src/de/steamwar/bungeecore/SubserverSystem.java index ef55b3c7..102b64fd 100644 --- a/src/de/steamwar/bungeecore/SubserverSystem.java +++ b/src/de/steamwar/bungeecore/SubserverSystem.java @@ -77,22 +77,16 @@ public class SubserverSystem { * For event, test and normal arenas: The UUID of the designated leader for the red team * or null (no designated leader). * - * @param ranked - * If the game is a ranked game. - * * @return * The new started subserver. */ - public static synchronized Subserver startArena(ArenaMode modus, String map, int eventFightID, int checkSchemID, int prepareSchemID, int replayID, String serverName, String mapName, UUID player1, UUID player2, boolean ranked){ + public static synchronized Subserver startArena(ArenaMode modus, String map, int eventFightID, int checkSchemID, int prepareSchemID, int replayID, String serverName, String mapName, UUID player1, UUID player2){ //Generate missing parameters Node node = eventFightID > 0 ? Node.local : Node.getNode(); int port = arenaPorts.freePort(); if(serverName == null){ - if(ranked) - serverName = "Ranked" + (port - arenaPorts.start); - else - serverName = modus.getDisplayName() + (port - arenaPorts.start); + serverName = modus.getDisplayName() + (port - arenaPorts.start); } if(mapName == null) mapName = serverName; @@ -112,7 +106,7 @@ public class SubserverSystem { ProcessBuilder builder = node.startServer( modus.serverJar(), directory, worldDir, mapName, port, "768M", "logPath=" + mapName, "config=" + modus.getConfig(), - "fightID=" + eventFightID, "ranked=" + ranked, + "fightID=" + eventFightID, "checkSchemID=" + checkSchemID, "prepareSchemID=" + prepareSchemID, "replay=" + replayID, player1 != null && eventFightID != -1 ? "blueLeader=" + player1 : null, @@ -144,12 +138,11 @@ public class SubserverSystem { 0, serverName, serverName + eventFight.getStartTime().toLocalDateTime().format(DateTimeFormatter.ISO_TIME), null, - null, - false); + null); } public static void startTestServer(ProxiedPlayer p, ArenaMode m, String map, int checkSchemId, int prepareSchemId){ - startArena(m, map, -1, checkSchemId, prepareSchemId, 0, p.getName() + "s Bau", p.getName(), p.getUniqueId(), null, false).sendPlayer(p); + startArena(m, map, -1, checkSchemId, prepareSchemId, 0, p.getName() + "s Bau", p.getName(), p.getUniqueId(), null).sendPlayer(p); } private static synchronized void sendToBau(ProxiedPlayer p, UUID owner, String prototype, String worldFolder, String serverJar, String worldDir, String worldName, String xmx, String serverName){ diff --git a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java index 1a2db5cf..df477c9a 100644 --- a/src/de/steamwar/bungeecore/commands/ChallengeCommand.java +++ b/src/de/steamwar/bungeecore/commands/ChallengeCommand.java @@ -76,7 +76,7 @@ public class ChallengeCommand extends BasicCommand { challenges.remove(target); challenges.remove(player); - Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, 0, null, null, player.getUniqueId(), target.getUniqueId(), false); + Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, 0, null, null, player.getUniqueId(), target.getUniqueId()); arena.sendPlayer(player); arena.sendPlayer(target); diff --git a/src/de/steamwar/bungeecore/commands/FightCommand.java b/src/de/steamwar/bungeecore/commands/FightCommand.java index 0f995a91..653db48d 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, 0, 0, null, null, player.getUniqueId(), null, false); + Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, 0, null, null, player.getUniqueId(), null); arena.sendPlayer(player); Message.broadcast("FIGHT_BROADCAST", "FIGHT_BROADCAST_HOVER" , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), player.getName()); diff --git a/src/de/steamwar/bungeecore/commands/HistoricCommand.java b/src/de/steamwar/bungeecore/commands/HistoricCommand.java index 05379381..7e34836c 100644 --- a/src/de/steamwar/bungeecore/commands/HistoricCommand.java +++ b/src/de/steamwar/bungeecore/commands/HistoricCommand.java @@ -36,7 +36,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, 0, 0, null, null, player.getUniqueId(), null, false); + Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, 0, null, null, player.getUniqueId(), null); arena.sendPlayer(player); Message.broadcast("HISTORIC_BROADCAST", "HISTORIC_BROADCAST_HOVER" , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), player.getName()); diff --git a/src/de/steamwar/bungeecore/commands/ReplayCommand.java b/src/de/steamwar/bungeecore/commands/ReplayCommand.java index 109a8a0f..806df5a3 100644 --- a/src/de/steamwar/bungeecore/commands/ReplayCommand.java +++ b/src/de/steamwar/bungeecore/commands/ReplayCommand.java @@ -35,7 +35,7 @@ public class ReplayCommand extends BasicCommand { } ArenaMode mode = fight.getGameMode(); - SubserverSystem.startArena(mode, mode.getRandomMap(), 0, 0, 0, fight.getFightID(), null, null, null, null, false).sendPlayer(player); + SubserverSystem.startArena(mode, mode.getRandomMap(), 0, 0, 0, fight.getFightID(), null, null, null, null).sendPlayer(player); }, page -> Fight.getPage(page, 45).stream().map(fight -> new SWListInv.SWListEntry<>(getFightItem(player, fight), fight)).collect(Collectors.toList())).open(); }