From 45a8aab321bb568e82286b84310ff0a9207228a7 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 18 May 2025 19:44:29 +0200 Subject: [PATCH] Revert "Add "/event vote" command for SteamWarArcade Event" This reverts commit 7f215b921ec427693dc67c985aec739a67150ab4. --- .../steamwar/messages/BungeeCore.properties | 2 -- .../steamwar/velocitycore/EventStarter.java | 32 ----------------- .../velocitycore/commands/EventCommand.java | 34 ------------------- 3 files changed, 68 deletions(-) diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties index 8531389b..c46cd317 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties @@ -755,5 +755,3 @@ DC_SCHEMUPLOAD_IGNORED=Skipping `{0}`, not a schematic file. DC_SCHEMUPLOAD_INVCHAR=`{0}` has invalid characters in its name. DC_SCHEMUPLOAD_SUCCESS=`{0}` was uploaded successfully. DC_SCHEMUPLOAD_ERROR=An error has occured during the upload of `{0}`. For more information ask a Developer. - -EVENT_VOTE_SUCCESS=§aYour teams vote was accepted! diff --git a/VelocityCore/src/de/steamwar/velocitycore/EventStarter.java b/VelocityCore/src/de/steamwar/velocitycore/EventStarter.java index 54d17747..15c16b64 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/EventStarter.java +++ b/VelocityCore/src/de/steamwar/velocitycore/EventStarter.java @@ -24,7 +24,6 @@ import de.steamwar.messages.Message; import de.steamwar.persistent.Subserver; import de.steamwar.sql.EventFight; import de.steamwar.sql.Team; -import de.steamwar.velocitycore.commands.EventCommand; import net.kyori.adventure.text.event.ClickEvent; import java.sql.Timestamp; @@ -43,19 +42,6 @@ public class EventStarter { spectatePorts.put(port, command); } - private static final Map VOTES = new HashMap<>(); - private static final Map VOTES_REVERSE = new HashMap<>(); - - static { - VOTES.put("MissileWars", 0); - VOTES.put("TowerRun", 1); - VOTES.put("TNTLeague", 2); - - VOTES_REVERSE.put(0, "MissileWars"); - VOTES_REVERSE.put(1, "TowerRun"); - VOTES_REVERSE.put(2, "TNTLeague"); - } - public EventStarter() { EventFight.loadAllComingFights(); VelocityCore.schedule(this::run).repeat(10, TimeUnit.SECONDS).schedule(); @@ -77,24 +63,6 @@ public class EventStarter { //Don't start EventServer if not the event bungee String command; if(VelocityCore.get().getConfig().isEventmode() || next.getSpectatePort() == null) { - ArenaMode blueVote = ArenaMode.getByChat(EventCommand.TEAM_VOTES.getOrDefault(blue.getTeamId(), "TowerRun")); - ArenaMode redVote = ArenaMode.getByChat(EventCommand.TEAM_VOTES.getOrDefault(red.getTeamId(), "TowerRun")); - - ArenaMode mode = blueVote; - - if (!blueVote.getInternalName().equals(redVote.getInternalName())) { - mode = ArenaMode.getByChat(VOTES_REVERSE.get(3 - VOTES.get(blueVote.getInternalName()) - VOTES.get(redVote.getInternalName()))); - } - - next.update( - next.getStartTime(), - mode.getInternalName(), - mode.getRandomMap(), - next.getTeamBlue(), - next.getTeamRed(), - next.getSpectatePort() - ); - ServerStarter starter = new ServerStarter().event(next); starter.callback(subserver -> { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java index d718073b..b57d6aad 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java @@ -27,7 +27,6 @@ import de.steamwar.messages.Chatter; import de.steamwar.messages.PlayerChatter; import de.steamwar.persistent.Subserver; import de.steamwar.sql.*; -import de.steamwar.velocitycore.ArenaMode; import de.steamwar.velocitycore.EventStarter; import de.steamwar.velocitycore.SubserverSystem; @@ -49,39 +48,6 @@ public class EventCommand extends SWCommand { return (sender, value, messageSender) -> Event.get() == null; } - public static final Map TEAM_VOTES = new HashMap<>(); - - @Register("vote") - public void eventVote(@Validator(value = "noEvent", invert = true) PlayerChatter sender, ArenaMode gamemode) { - if (!TeamTeilnahme.nimmtTeil(sender.user().getTeam(), Event.get().getEventID())) { - return; - } - - TEAM_VOTES.put(sender.user().getTeam(), gamemode.getChatName()); - sender.system("EVENT_VOTE_SUCCESS"); - } - - @ClassMapper(value = ArenaMode.class, local = true) - public TypeMapper eventGamemode() { - return new TypeMapper<>() { - @Override - public ArenaMode map(Chatter sender, PreviousArguments previousArguments, String s) { - ArenaMode mode = ArenaMode.getByChat(s); - - if (tabCompletes(null, previousArguments, null).contains(mode.getChatName())) { - return mode; - } - - return null; - } - - @Override - public Collection tabCompletes(Chatter sender, PreviousArguments previousArguments, String s) { - return Arrays.asList("TowerRun", "MissileWars", "TNTLeague"); - } - }; - } - @Register public void noCurrentEvent(@Validator("noEvent") Chatter sender) { sender.system("EVENT_NO_CURRENT");