Archiviert
1
0

Remove ranked flag

Dieser Commit ist enthalten in:
yoyosource 2022-03-10 11:50:57 +01:00
Ursprung 750cf0ee97
Commit a1dd46d1d0
5 geänderte Dateien mit 9 neuen und 16 gelöschten Zeilen

Datei anzeigen

@ -77,22 +77,16 @@ public class SubserverSystem {
* For event, test and normal arenas: The UUID of the designated leader for the red team * For event, test and normal arenas: The UUID of the designated leader for the red team
* or null (no designated leader). * or null (no designated leader).
* *
* @param ranked
* If the game is a ranked game.
*
* @return * @return
* The new started subserver. * 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 //Generate missing parameters
Node node = eventFightID > 0 ? Node.local : Node.getNode(); Node node = eventFightID > 0 ? Node.local : Node.getNode();
int port = arenaPorts.freePort(); int port = arenaPorts.freePort();
if(serverName == null){ if(serverName == null){
if(ranked) serverName = modus.getDisplayName() + (port - arenaPorts.start);
serverName = "Ranked" + (port - arenaPorts.start);
else
serverName = modus.getDisplayName() + (port - arenaPorts.start);
} }
if(mapName == null) if(mapName == null)
mapName = serverName; mapName = serverName;
@ -112,7 +106,7 @@ public class SubserverSystem {
ProcessBuilder builder = node.startServer( ProcessBuilder builder = node.startServer(
modus.serverJar(), directory, worldDir, mapName, port, "768M", modus.serverJar(), directory, worldDir, mapName, port, "768M",
"logPath=" + mapName, "config=" + modus.getConfig(), "logPath=" + mapName, "config=" + modus.getConfig(),
"fightID=" + eventFightID, "ranked=" + ranked, "fightID=" + eventFightID,
"checkSchemID=" + checkSchemID, "prepareSchemID=" + prepareSchemID, "checkSchemID=" + checkSchemID, "prepareSchemID=" + prepareSchemID,
"replay=" + replayID, "replay=" + replayID,
player1 != null && eventFightID != -1 ? "blueLeader=" + player1 : null, player1 != null && eventFightID != -1 ? "blueLeader=" + player1 : null,
@ -144,12 +138,11 @@ public class SubserverSystem {
0, serverName, 0, serverName,
serverName + eventFight.getStartTime().toLocalDateTime().format(DateTimeFormatter.ISO_TIME), serverName + eventFight.getStartTime().toLocalDateTime().format(DateTimeFormatter.ISO_TIME),
null, null,
null, null);
false);
} }
public static void startTestServer(ProxiedPlayer p, ArenaMode m, String map, int checkSchemId, int prepareSchemId){ 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){ private static synchronized void sendToBau(ProxiedPlayer p, UUID owner, String prototype, String worldFolder, String serverJar, String worldDir, String worldName, String xmx, String serverName){

Datei anzeigen

@ -76,7 +76,7 @@ public class ChallengeCommand extends BasicCommand {
challenges.remove(target); challenges.remove(target);
challenges.remove(player); 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(player);
arena.sendPlayer(target); arena.sendPlayer(target);

Datei anzeigen

@ -164,7 +164,7 @@ public class FightCommand extends BasicCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
createArena(sender, "/fight ", args, 0, false, (player, mode, map) -> { 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); arena.sendPlayer(player);
Message.broadcast("FIGHT_BROADCAST", "FIGHT_BROADCAST_HOVER" Message.broadcast("FIGHT_BROADCAST", "FIGHT_BROADCAST_HOVER"
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), player.getName()); , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), player.getName());

Datei anzeigen

@ -36,7 +36,7 @@ public class HistoricCommand extends BasicCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> { 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); arena.sendPlayer(player);
Message.broadcast("HISTORIC_BROADCAST", "HISTORIC_BROADCAST_HOVER" Message.broadcast("HISTORIC_BROADCAST", "HISTORIC_BROADCAST_HOVER"
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), player.getName()); , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), player.getName());

Datei anzeigen

@ -35,7 +35,7 @@ public class ReplayCommand extends BasicCommand {
} }
ArenaMode mode = fight.getGameMode(); 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(); }, page -> Fight.getPage(page, 45).stream().map(fight -> new SWListInv.SWListEntry<>(getFightItem(player, fight), fight)).collect(Collectors.toList())).open();
} }