diff --git a/CommonCore/Linkage/src/de/steamwar/linkage/AbstractLinker.java b/CommonCore/Linkage/src/de/steamwar/linkage/AbstractLinker.java index ab401aa2..2c013f76 100644 --- a/CommonCore/Linkage/src/de/steamwar/linkage/AbstractLinker.java +++ b/CommonCore/Linkage/src/de/steamwar/linkage/AbstractLinker.java @@ -71,6 +71,8 @@ public abstract class AbstractLinker { MinVersion minVersion = clazz.getAnnotation(MinVersion.class); MaxVersion maxVersion = clazz.getAnnotation(MaxVersion.class); if (!versionCheck(clazz, minVersion, maxVersion)) return; + EventMode eventMode = clazz.getAnnotation(EventMode.class); + if (!eventModeCheck(clazz, eventMode)) return; PluginCheck[] pluginChecks = clazz.getAnnotationsByType(PluginCheck.class); for (PluginCheck pluginCheck : pluginChecks) { if (!pluginCheck(clazz, pluginCheck)) return; @@ -140,13 +142,22 @@ public abstract class AbstractLinker { return true; } + /** + * @return {@code true} if the clazz passes the checks {@code false} otherwise + */ + protected boolean eventModeCheck(@NonNull Class clazz, EventMode eventMode) { + return true; + } + /** * There is no need in calling {@link Enable#enable()} by this method. */ - protected abstract void linkObject(Object any); + protected void linkObject(Object any) { + } /** * There is no need in calling {@link Disable#disable()} ()} by this method. */ - protected abstract void unlinkObject(Object any); + protected void unlinkObject(Object any) { + } } diff --git a/CommonCore/Linkage/src/de/steamwar/linkage/EventMode.java b/CommonCore/Linkage/src/de/steamwar/linkage/EventMode.java new file mode 100644 index 00000000..513982aa --- /dev/null +++ b/CommonCore/Linkage/src/de/steamwar/linkage/EventMode.java @@ -0,0 +1,31 @@ +/* + * 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.linkage; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) +public @interface EventMode { + boolean value(); +} diff --git a/VelocityCore/src/de/steamwar/velocitycore/Broadcaster.java b/VelocityCore/src/de/steamwar/velocitycore/Broadcaster.java index f5df6d10..f5a05b7f 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/Broadcaster.java +++ b/VelocityCore/src/de/steamwar/velocitycore/Broadcaster.java @@ -19,17 +19,21 @@ package de.steamwar.velocitycore; +import de.steamwar.linkage.EventMode; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import java.util.List; import java.util.concurrent.TimeUnit; +@Linked +@EventMode(false) class Broadcaster { private final List broadcasts = VelocityCore.get().getConfig().getBroadcasts(); private int lastBroadCast = 0; - Broadcaster() { + public Broadcaster() { if(!broadcasts.isEmpty()) VelocityCore.schedule(this::broadcast).repeat(10, TimeUnit.MINUTES).schedule(); } diff --git a/VelocityCore/src/de/steamwar/velocitycore/EventStarter.java b/VelocityCore/src/de/steamwar/velocitycore/EventStarter.java index 2a5f85f7..6401ec30 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/EventStarter.java +++ b/VelocityCore/src/de/steamwar/velocitycore/EventStarter.java @@ -19,6 +19,7 @@ package de.steamwar.velocitycore; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.persistent.Subserver; @@ -36,6 +37,7 @@ import java.util.concurrent.TimeUnit; import static de.steamwar.persistent.Storage.eventServer; +@Linked public class EventStarter { @Getter diff --git a/VelocityCore/src/de/steamwar/velocitycore/VelocityCore.java b/VelocityCore/src/de/steamwar/velocitycore/VelocityCore.java index d5ae82e9..58a9033c 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/VelocityCore.java +++ b/VelocityCore/src/de/steamwar/velocitycore/VelocityCore.java @@ -29,22 +29,24 @@ import com.velocitypowered.api.plugin.annotation.DataDirectory; import com.velocitypowered.api.proxy.ProxyServer; import com.velocitypowered.api.scheduler.Scheduler; import de.steamwar.command.*; +import de.steamwar.linkage.AbstractLinker; +import de.steamwar.linkage.EventMode; +import de.steamwar.linkage.LinkedInstance; import de.steamwar.messages.Chatter; -import de.steamwar.network.packets.PacketHandler; import de.steamwar.persistent.ReloadablePlugin; import de.steamwar.sql.Punishment; import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.Team; import de.steamwar.sql.UserElo; import de.steamwar.sql.internal.Statement; -import de.steamwar.velocitycore.commands.*; +import de.steamwar.velocitycore.commands.PunishmentCommand; +import de.steamwar.velocitycore.commands.ServerSwitchCommand; +import de.steamwar.velocitycore.commands.TeamCommand; import de.steamwar.velocitycore.discord.DiscordBot; import de.steamwar.velocitycore.discord.DiscordConfig; -import de.steamwar.velocitycore.listeners.*; -import de.steamwar.velocitycore.mods.*; -import de.steamwar.velocitycore.network.handlers.*; -import de.steamwar.velocitycore.tablist.TablistManager; +import de.steamwar.velocitycore.listeners.PollSystem; import lombok.Getter; +import lombok.NonNull; import java.nio.file.Path; import java.sql.Driver; @@ -94,9 +96,9 @@ public class VelocityCore implements ReloadablePlugin { @Getter private Config config; private ErrorLogger errorLogger; - private TablistManager tablistManager; @Getter + @LinkedInstance private TeamCommand teamCommand; @Inject @@ -104,9 +106,10 @@ public class VelocityCore implements ReloadablePlugin { this.proxyServer = proxyServer; this.logger = logger; this.dataDirectory = dataDirectory; - } + private AbstractLinker linker; + @Subscribe @Override public void onProxyInitialization(ProxyInitializeEvent event) { @@ -139,64 +142,11 @@ public class VelocityCore implements ReloadablePlugin { initStaticServers(); PollSystem.init(); - new Hostname(); - new PluginMessage(); - new Schematica(); - new Badlion(); - new FabricModSender(); - new ReplayMod(); - new FML2(); - - new ConnectionListener(); - new ChatListener(); - new BanListener(); - new CheckListener(); - new IPSanitizer(); - new VersionAnnouncer(); - new TexturePackSystem(); - local = new Node.LocalNode(); if(MAIN_SERVER) { //new Node.RemoteNode("lx"); } - new TeamchatCommand(); - new MsgCommand(); - new RCommand(); - new PingCommand(); - new AlertCommand(); - new KickCommand(); - new JoinmeCommand(); - new TpCommand(); - HelpCommand helpCommand = new HelpCommand(); - teamCommand = new TeamCommand(); - new ServerTeamchatCommand(); - new DevCommand(); - new SendCommand(); - new EventCommand(); - new EventreloadCommand(); - new EventRescheduleCommand(); - new PollCommand(); - new BugCommand(); - new WhoisCommand(); - new RulesCommand(); - new IgnoreCommand(); - new UnIgnoreCommand(); - new PollresultCommand(); - new ListCommand(); - new StatCommand(); - new VerifyCommand(); - new GDPRQuery(); - new PlaytimeCommand(); - new ArenaCommand(); - new RankCommand(); - new LocalCommand(); - new SetLocaleCommand(); - new BuilderCloudCommand(); - new CheckCommand(); - - new ModCommand(); - // Punishment Commands: new PunishmentCommand("ban", Punishment.PunishmentType.Ban); new PunishmentCommand("mute", Punishment.PunishmentType.Mute); @@ -208,32 +158,19 @@ public class VelocityCore implements ReloadablePlugin { new PunishmentCommand("noteamserver", Punishment.PunishmentType.NoTeamServer); new PunishmentCommand("note", Punishment.PunishmentType.Note); - if(!config.isEventmode()){ - new BauCommand(helpCommand); - new WebpasswordCommand(); - new FightCommand(); - new ChallengeCommand(); - new HistoricCommand(); - new ReplayCommand(); - - new Broadcaster(); - new CookieEvents(); - new StreamingCommand(); - }else{ - new EventModeListener(); + linker = new AbstractLinker<>(this) { + @Override + protected boolean eventModeCheck(@NonNull Class clazz, EventMode eventMode) { + return eventMode == null || eventMode.value() == config.isEventmode(); + } + }; + try { + linker.link(); + } catch (AbstractLinker.LinkException e) { + VelocityCore.getProxy().shutdown(); + return; } - for(PacketHandler handler : new PacketHandler[] { - new EloPlayerHandler(), new EloSchemHandler(), new ExecuteCommandHandler(), new FightInfoHandler(), - new ImALobbyHandler(), new InventoryCallbackHandler(), new PrepareSchemHandler(), new PlayerSkinHandler(), new AnvilAnswerHandler() - }) - handler.register(); - - new EventStarter(); - new SessionManager(); - tablistManager = new TablistManager(); - new SettingsChangedListener(); - schedule(() -> { SteamwarUser.clear(); UserElo.clear(); @@ -269,8 +206,7 @@ public class VelocityCore implements ReloadablePlugin { logger.log(Level.SEVERE, "Could not shutdown discord bot", e); } - if(tablistManager != null) - tablistManager.disable(); + linker.unlink(); errorLogger.unregister(); Statement.closeAll(); diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/AlertCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/AlertCommand.java index b95bbd69..b1fed2f1 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/AlertCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/AlertCommand.java @@ -19,11 +19,13 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.discord.DiscordBot; import de.steamwar.command.SWCommand; import de.steamwar.messages.Chatter; import de.steamwar.sql.UserPerm; +@Linked public class AlertCommand extends SWCommand { public AlertCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/ArenaCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/ArenaCommand.java index cee6cb04..c7d19a39 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/ArenaCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/ArenaCommand.java @@ -23,6 +23,7 @@ import com.velocitypowered.api.proxy.server.RegisteredServer; import de.steamwar.command.PreviousArguments; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeMapper; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.PlayerChatter; import de.steamwar.persistent.Subserver; @@ -31,6 +32,7 @@ import de.steamwar.velocitycore.VelocityCore; import java.util.Collection; import java.util.List; +@Linked public class ArenaCommand extends SWCommand { public ArenaCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/BauCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/BauCommand.java index 9b24434d..139524a0 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/BauCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/BauCommand.java @@ -19,6 +19,9 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.EventMode; +import de.steamwar.linkage.Linked; +import de.steamwar.linkage.LinkedInstance; import de.steamwar.velocitycore.*; import de.steamwar.velocitycore.inventory.SWInventory; import de.steamwar.velocitycore.inventory.SWItem; @@ -40,9 +43,12 @@ import de.steamwar.sql.SteamwarUser; import java.util.Collection; import java.util.function.Consumer; +@Linked +@EventMode(false) public class BauCommand extends SWCommand { - private final HelpCommand command; + @LinkedInstance + private HelpCommand command; public BauCommand(HelpCommand command) { super("bau", "b", "build", "gs"); diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/BugCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/BugCommand.java index 088acb09..3a89640c 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/BugCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/BugCommand.java @@ -19,12 +19,13 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; +import de.steamwar.messages.Chatter; import de.steamwar.persistent.Subserver; import de.steamwar.sql.SWException; -import de.steamwar.command.SWCommand; -import de.steamwar.messages.Chatter; -import de.steamwar.velocitycore.SubserverSystem; +@Linked public class BugCommand extends SWCommand { public BugCommand() { super("bug"); diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/BuilderCloudCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/BuilderCloudCommand.java index 51c0f1bf..766268f5 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/BuilderCloudCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/BuilderCloudCommand.java @@ -19,6 +19,7 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.ArenaMode; import de.steamwar.velocitycore.ServerStarter; import de.steamwar.velocitycore.ServerVersion; @@ -37,6 +38,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; +@Linked public class BuilderCloudCommand extends SWCommand { public BuilderCloudCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/ChallengeCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/ChallengeCommand.java index 78ced8d1..9e5fc81c 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/ChallengeCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/ChallengeCommand.java @@ -22,6 +22,8 @@ package de.steamwar.velocitycore.commands; import com.velocitypowered.api.proxy.Player; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeValidator; +import de.steamwar.linkage.EventMode; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.messages.PlayerChatter; @@ -35,6 +37,8 @@ import java.util.LinkedList; import static de.steamwar.persistent.Storage.challenges; +@Linked +@EventMode(false) public class ChallengeCommand extends SWCommand { public ChallengeCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java index 8d618600..864187f4 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java @@ -21,6 +21,7 @@ package de.steamwar.velocitycore.commands; import com.velocitypowered.api.proxy.Player; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.messages.PlayerChatter; @@ -44,6 +45,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.BooleanSupplier; import java.util.logging.Level; +@Linked public class CheckCommand extends SWCommand { private static final Map fightTypes = new HashMap<>(); private static final Map> checkQuestions = new HashMap<>(); diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/DevCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/DevCommand.java index 39703e36..077c663f 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/DevCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/DevCommand.java @@ -27,6 +27,7 @@ import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommandUtils; import de.steamwar.command.TypeMapper; import de.steamwar.command.TypeValidator; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.messages.PlayerChatter; @@ -43,6 +44,7 @@ import java.net.InetSocketAddress; import java.util.HashMap; import java.util.Map; +@Linked public class DevCommand extends SWCommand { private final File devServerDir = new File("/configs/DevServer"); diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java index b57d6aad..27d85a86 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/EventCommand.java @@ -23,6 +23,7 @@ import de.steamwar.command.PreviousArguments; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeMapper; import de.steamwar.command.TypeValidator; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.PlayerChatter; import de.steamwar.persistent.Subserver; @@ -37,6 +38,7 @@ import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; +@Linked public class EventCommand extends SWCommand { public EventCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/EventRescheduleCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/EventRescheduleCommand.java index 9660eba4..857a5060 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/EventRescheduleCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/EventRescheduleCommand.java @@ -21,6 +21,7 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeMapper; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.sql.Event; import de.steamwar.sql.EventFight; @@ -32,6 +33,7 @@ import java.util.Date; import java.util.List; import java.util.ListIterator; +@Linked public class EventRescheduleCommand extends SWCommand { public EventRescheduleCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/EventreloadCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/EventreloadCommand.java index 45aa61b8..64e350b9 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/EventreloadCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/EventreloadCommand.java @@ -20,10 +20,12 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.sql.EventFight; import de.steamwar.sql.UserPerm; +@Linked public class EventreloadCommand extends SWCommand { public EventreloadCommand() { super("eventreload", UserPerm.MODERATION); diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/FightCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/FightCommand.java index ee82988c..39d9beea 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/FightCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/FightCommand.java @@ -21,6 +21,8 @@ package de.steamwar.velocitycore.commands; import com.velocitypowered.api.proxy.Player; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.EventMode; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.messages.PlayerChatter; @@ -36,6 +38,8 @@ import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.TextDecoration; +@Linked +@EventMode(false) public class FightCommand extends SWCommand { public FightCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/GDPRQuery.java b/VelocityCore/src/de/steamwar/velocitycore/commands/GDPRQuery.java index e54a7ffa..32c9b1ec 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/GDPRQuery.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/GDPRQuery.java @@ -19,6 +19,7 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.VelocityCore; import de.steamwar.command.SWCommand; import de.steamwar.messages.Chatter; @@ -31,6 +32,7 @@ import java.io.*; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; +@Linked public class GDPRQuery extends SWCommand { public GDPRQuery() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/HelpCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/HelpCommand.java index 33e595d0..bdcfa73f 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/HelpCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/HelpCommand.java @@ -20,12 +20,14 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import net.kyori.adventure.text.event.ClickEvent; import java.util.function.Function; +@Linked public class HelpCommand extends SWCommand { public HelpCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/HistoricCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/HistoricCommand.java index 395eff33..dee2cb40 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/HistoricCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/HistoricCommand.java @@ -20,6 +20,8 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.EventMode; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.messages.PlayerChatter; @@ -27,6 +29,8 @@ import de.steamwar.velocitycore.ArenaMode; import de.steamwar.velocitycore.ServerStarter; import net.kyori.adventure.text.event.ClickEvent; +@Linked +@EventMode(false) public class HistoricCommand extends SWCommand { public HistoricCommand() { super("historic"); diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/IgnoreCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/IgnoreCommand.java index 684ab5a6..c6165cd0 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/IgnoreCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/IgnoreCommand.java @@ -20,10 +20,12 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.sql.IgnoreSystem; import de.steamwar.sql.SteamwarUser; +@Linked public class IgnoreCommand extends SWCommand { public IgnoreCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/JoinmeCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/JoinmeCommand.java index 4bab8d11..508b18f1 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/JoinmeCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/JoinmeCommand.java @@ -20,12 +20,14 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.messages.PlayerChatter; import de.steamwar.sql.UserPerm; import net.kyori.adventure.text.event.ClickEvent; +@Linked public class JoinmeCommand extends SWCommand { public JoinmeCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/KickCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/KickCommand.java index 4bbd8bef..b0d93bb0 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/KickCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/KickCommand.java @@ -21,9 +21,11 @@ package de.steamwar.velocitycore.commands; import com.velocitypowered.api.proxy.Player; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.sql.UserPerm; +@Linked public class KickCommand extends SWCommand { public KickCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/ListCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/ListCommand.java index dab59005..f57df245 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/ListCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/ListCommand.java @@ -22,6 +22,7 @@ package de.steamwar.velocitycore.commands; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.ServerConnection; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.persistent.Subserver; import de.steamwar.velocitycore.VelocityCore; @@ -32,6 +33,7 @@ import java.util.SortedMap; import java.util.TreeMap; import java.util.stream.Collectors; +@Linked public class ListCommand extends SWCommand { public ListCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/LocalCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/LocalCommand.java index d53afdb7..4ede8e76 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/LocalCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/LocalCommand.java @@ -19,10 +19,12 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.listeners.ChatListener; import de.steamwar.command.SWCommand; import de.steamwar.messages.PlayerChatter; +@Linked public class LocalCommand extends SWCommand { public LocalCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/ModCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/ModCommand.java index c37a3e7c..220bac58 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/ModCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/ModCommand.java @@ -19,6 +19,7 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.inventory.SWInventory; import de.steamwar.velocitycore.inventory.SWItem; import de.steamwar.velocitycore.inventory.SWListInv; @@ -35,6 +36,7 @@ import java.util.Map; import java.util.UUID; import java.util.function.Consumer; +@Linked public class ModCommand extends SWCommand { public ModCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/MsgCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/MsgCommand.java index 5300909d..6491a27a 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/MsgCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/MsgCommand.java @@ -20,17 +20,18 @@ package de.steamwar.velocitycore.commands; import com.velocitypowered.api.proxy.Player; -import com.velocitypowered.proxy.Velocity; -import de.steamwar.velocitycore.VelocityCore; -import de.steamwar.velocitycore.listeners.ChatListener; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.ChatterGroup; import de.steamwar.messages.PlayerChatter; import de.steamwar.sql.IgnoreSystem; +import de.steamwar.velocitycore.VelocityCore; +import de.steamwar.velocitycore.listeners.ChatListener; import static de.steamwar.persistent.Storage.lastChats; +@Linked public class MsgCommand extends SWCommand { public MsgCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/PingCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/PingCommand.java index 583f263a..e3c8c8e2 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/PingCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/PingCommand.java @@ -20,8 +20,10 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.PlayerChatter; +@Linked public class PingCommand extends SWCommand { public PingCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/PlaytimeCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/PlaytimeCommand.java index bf04c28a..8b13d44a 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/PlaytimeCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/PlaytimeCommand.java @@ -20,11 +20,13 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.sql.SteamwarUser; import java.text.NumberFormat; +@Linked public class PlaytimeCommand extends SWCommand { public PlaytimeCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/PollCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/PollCommand.java index 72646164..7cd654b9 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/PollCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/PollCommand.java @@ -19,12 +19,14 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.listeners.PollSystem; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeValidator; import de.steamwar.messages.Chatter; import de.steamwar.sql.PollAnswer; +@Linked public class PollCommand extends SWCommand { public PollCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/PollresultCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/PollresultCommand.java index 611fd7ed..c47d1e53 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/PollresultCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/PollresultCommand.java @@ -19,6 +19,7 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.listeners.PollSystem; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeValidator; @@ -28,6 +29,7 @@ import de.steamwar.sql.UserPerm; import java.util.Map; +@Linked public class PollresultCommand extends SWCommand { public PollresultCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/RCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/RCommand.java index 8ed4a38b..5430b313 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/RCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/RCommand.java @@ -20,10 +20,12 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.PlayerChatter; import static de.steamwar.persistent.Storage.lastChats; +@Linked public class RCommand extends SWCommand { public RCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/RankCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/RankCommand.java index 4d68f07b..45123e18 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/RankCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/RankCommand.java @@ -20,6 +20,7 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.sql.SteamwarUser; @@ -28,6 +29,7 @@ import de.steamwar.velocitycore.ArenaMode; import java.util.Optional; +@Linked public class RankCommand extends SWCommand { public RankCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/ReplayCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/ReplayCommand.java index fe8d9af1..6d825e2a 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/ReplayCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/ReplayCommand.java @@ -19,6 +19,8 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.EventMode; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.ArenaMode; import de.steamwar.messages.Message; import de.steamwar.velocitycore.ServerStarter; @@ -32,6 +34,8 @@ import de.steamwar.sql.*; import java.util.ArrayList; import java.util.List; +@Linked +@EventMode(false) public class ReplayCommand extends SWCommand { public ReplayCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/RulesCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/RulesCommand.java index e379d6b1..8128eaff 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/RulesCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/RulesCommand.java @@ -20,12 +20,14 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import net.kyori.adventure.text.event.ClickEvent; import java.util.Arrays; +@Linked public class RulesCommand extends SWCommand { public RulesCommand() { super("rules", "regeln"); diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/SendCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/SendCommand.java index f1590957..78d27b4d 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/SendCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/SendCommand.java @@ -26,6 +26,7 @@ import com.velocitypowered.api.proxy.server.ServerInfo; import de.steamwar.command.PreviousArguments; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeMapper; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.persistent.Subserver; @@ -38,6 +39,7 @@ import java.util.Collection; import java.util.List; import java.util.stream.Collectors; +@Linked public class SendCommand extends SWCommand { // /send [] diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/ServerTeamchatCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/ServerTeamchatCommand.java index 927644ab..6dc9ea92 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/ServerTeamchatCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/ServerTeamchatCommand.java @@ -19,11 +19,13 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.listeners.ChatListener; import de.steamwar.command.SWCommand; import de.steamwar.messages.Chatter; import de.steamwar.sql.UserPerm; +@Linked public class ServerTeamchatCommand extends SWCommand { public ServerTeamchatCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/SetLocaleCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/SetLocaleCommand.java index a2e66b6b..61abeca1 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/SetLocaleCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/SetLocaleCommand.java @@ -20,10 +20,12 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.PlayerChatter; import de.steamwar.network.packets.server.LocaleInvalidationPacket; import de.steamwar.velocitycore.network.NetworkSender; +@Linked public class SetLocaleCommand extends SWCommand { public SetLocaleCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/StatCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/StatCommand.java index d9694d6c..af545358 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/StatCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/StatCommand.java @@ -19,6 +19,7 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.Node; import de.steamwar.command.SWCommand; import de.steamwar.messages.Chatter; @@ -29,6 +30,7 @@ import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; +@Linked public class StatCommand extends SWCommand { public StatCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/StreamingCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/StreamingCommand.java index edab1c5b..04ddd6e2 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/StreamingCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/StreamingCommand.java @@ -20,11 +20,15 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.EventMode; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.persistent.Storage; import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.UserPerm; +@Linked +@EventMode(false) public class StreamingCommand extends SWCommand { public static boolean isNotStreaming(Chatter sender) { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java index f0a7be00..d95ed3b5 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java @@ -29,6 +29,7 @@ import de.steamwar.command.PreviousArguments; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeMapper; import de.steamwar.command.TypeValidator; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.messages.PlayerChatter; @@ -52,6 +53,7 @@ import java.util.stream.Stream; import static de.steamwar.persistent.Storage.teamInvitations; +@Linked public class TeamCommand extends SWCommand { public TeamCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/TeamchatCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/TeamchatCommand.java index 8381ba94..ee74d5d6 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/TeamchatCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/TeamchatCommand.java @@ -19,12 +19,14 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.listeners.ChatListener; import de.steamwar.command.SWCommand; import de.steamwar.messages.Chatter; import de.steamwar.messages.ChatterGroup; import de.steamwar.sql.SteamwarUser; +@Linked public class TeamchatCommand extends SWCommand { public TeamchatCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/TpCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/TpCommand.java index 2292c258..9a270dde 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/TpCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/TpCommand.java @@ -22,6 +22,7 @@ package de.steamwar.velocitycore.commands; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.ServerConnection; import com.velocitypowered.api.proxy.server.RegisteredServer; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.*; import de.steamwar.velocitycore.util.BauLock; import de.steamwar.command.PreviousArguments; @@ -39,6 +40,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +@Linked public class TpCommand extends SWCommand { public TpCommand(){ diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/UnIgnoreCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/UnIgnoreCommand.java index 7f1a5de0..30952834 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/UnIgnoreCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/UnIgnoreCommand.java @@ -20,10 +20,12 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.sql.IgnoreSystem; import de.steamwar.sql.SteamwarUser; +@Linked public class UnIgnoreCommand extends SWCommand { public UnIgnoreCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/VerifyCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/VerifyCommand.java index 96324de2..cf8ba5bd 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/VerifyCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/VerifyCommand.java @@ -19,6 +19,7 @@ package de.steamwar.velocitycore.commands; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.discord.util.AuthManager; import de.steamwar.command.SWCommand; @@ -28,6 +29,7 @@ import net.dv8tion.jda.api.entities.User; import java.util.Base64; import java.util.logging.Level; +@Linked public class VerifyCommand extends SWCommand { public VerifyCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/WebpasswordCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/WebpasswordCommand.java index d19dedd0..8b9632b8 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/WebpasswordCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/WebpasswordCommand.java @@ -20,9 +20,13 @@ package de.steamwar.velocitycore.commands; import de.steamwar.command.SWCommand; +import de.steamwar.linkage.EventMode; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.sql.SteamwarUser; +@Linked +@EventMode(false) public class WebpasswordCommand extends SWCommand { public WebpasswordCommand() { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/WhoisCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/WhoisCommand.java index 7576f75f..a76c8ac7 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/WhoisCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/WhoisCommand.java @@ -23,6 +23,7 @@ import com.velocitypowered.api.proxy.Player; import de.steamwar.command.PreviousArguments; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeMapper; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.persistent.Storage; @@ -41,7 +42,7 @@ import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; - +@Linked public class WhoisCommand extends SWCommand { public WhoisCommand() { super("whois"); diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/BanListener.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/BanListener.java index 1d205cc8..0ac6423c 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/BanListener.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/BanListener.java @@ -22,6 +22,7 @@ package de.steamwar.velocitycore.listeners; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.connection.LoginEvent; import com.velocitypowered.api.proxy.Player; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.sql.BannedUserIPs; @@ -36,6 +37,7 @@ import java.util.List; import java.util.function.Function; import java.util.stream.Collectors; +@Linked public class BanListener extends BasicListener { @Subscribe diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/ChatListener.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/ChatListener.java index dfdf5c7f..673733b9 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/ChatListener.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/ChatListener.java @@ -29,6 +29,7 @@ import com.velocitypowered.api.proxy.ConsoleCommandSource; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.ServerConnection; import com.velocitypowered.api.proxy.server.ServerInfo; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.ChatterGroup; import de.steamwar.messages.Message; @@ -50,6 +51,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.stream.Collectors; +@Linked public class ChatListener extends BasicListener { private static final Logger cmdLogger = Logger.getLogger("Command logger"); diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/CheckListener.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/CheckListener.java index 4c8ef131..0c3000c1 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/CheckListener.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/CheckListener.java @@ -24,6 +24,7 @@ import com.velocitypowered.api.event.connection.DisconnectEvent; import com.velocitypowered.api.event.connection.PostLoginEvent; import com.velocitypowered.api.event.player.ServerConnectedEvent; import com.velocitypowered.api.proxy.Player; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.persistent.Bauserver; import de.steamwar.persistent.Subserver; @@ -34,6 +35,7 @@ import de.steamwar.velocitycore.commands.CheckCommand; import java.util.ArrayList; import java.util.List; +@Linked public class CheckListener extends BasicListener { @Subscribe diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/ConnectionListener.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/ConnectionListener.java index 765d09c7..1cfd8a49 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/ConnectionListener.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/ConnectionListener.java @@ -27,6 +27,7 @@ import com.velocitypowered.api.event.player.KickedFromServerEvent; import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.permission.Tristate; import com.velocitypowered.api.proxy.Player; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.persistent.Subserver; @@ -45,6 +46,7 @@ import java.util.HashSet; import java.util.Set; import java.util.UUID; +@Linked public class ConnectionListener extends BasicListener { private static final Set newPlayers = new HashSet<>(); diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/CookieEvents.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/CookieEvents.java index 660ebc87..f34fe1c5 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/CookieEvents.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/CookieEvents.java @@ -22,11 +22,15 @@ package de.steamwar.velocitycore.listeners; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.player.CookieReceiveEvent; import com.velocitypowered.api.proxy.Player; +import de.steamwar.linkage.EventMode; +import de.steamwar.linkage.Linked; import de.steamwar.sql.EventFight; import de.steamwar.sql.SteamwarUser; import de.steamwar.velocitycore.EventStarter; import de.steamwar.velocitycore.VelocityCore; +@Linked +@EventMode(false) public class CookieEvents extends BasicListener { @Subscribe diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/EventModeListener.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/EventModeListener.java index 7777408e..ecc977ed 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/EventModeListener.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/EventModeListener.java @@ -19,27 +19,25 @@ package de.steamwar.velocitycore.listeners; -import java.net.InetSocketAddress; -import java.nio.charset.Charset; -import java.util.List; - import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.connection.PostLoginEvent; import com.velocitypowered.api.event.player.ServerConnectedEvent; import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.proxy.Player; - +import de.steamwar.linkage.EventMode; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.persistent.Subserver; -import de.steamwar.sql.Event; -import de.steamwar.sql.EventFight; -import de.steamwar.sql.Referee; -import de.steamwar.sql.SteamwarUser; -import de.steamwar.sql.TeamTeilnahme; +import de.steamwar.sql.*; import de.steamwar.velocitycore.EventStarter; import de.steamwar.velocitycore.VelocityCore; import net.kyori.adventure.key.Key; +import java.net.InetSocketAddress; +import java.util.List; + +@Linked +@EventMode(true) public class EventModeListener extends BasicListener { public static final Key EVENT_TO_SPECTATE_KEY = Key.key("sw", "event_to_spectate"); diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/IPSanitizer.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/IPSanitizer.java index bc8c42ba..ca99fbed 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/IPSanitizer.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/IPSanitizer.java @@ -26,6 +26,7 @@ import com.velocitypowered.api.proxy.Player; import com.velocitypowered.proxy.connection.MinecraftConnection; import com.velocitypowered.proxy.connection.client.ConnectedPlayer; import com.velocitypowered.proxy.connection.client.LoginInboundConnection; +import de.steamwar.linkage.Linked; import de.steamwar.persistent.Reflection; import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.mods.Hostname; @@ -38,6 +39,7 @@ import java.util.Map; import java.util.UUID; import java.util.logging.Level; +@Linked public class IPSanitizer extends BasicListener { private static final Map trueAddress = new HashMap<>(); // Will likely slightly leak over time diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/PluginMessage.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/PluginMessage.java index b35279fb..8b37cf8b 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/PluginMessage.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/PluginMessage.java @@ -31,6 +31,7 @@ import com.velocitypowered.api.proxy.messages.ChannelMessageSource; import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier; import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier; import com.velocitypowered.proxy.protocol.ProtocolUtils; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.network.packets.NetworkPacket; import de.steamwar.sql.SteamwarUser; @@ -50,6 +51,7 @@ import java.util.*; import java.util.function.Consumer; import java.util.logging.Level; +@Linked public class PluginMessage extends BasicListener { public static void send(Player player, String legacyChannel, String channel, byte[] data) { diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/SessionManager.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/SessionManager.java index 248fd606..30895cea 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/SessionManager.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/SessionManager.java @@ -22,6 +22,7 @@ package de.steamwar.velocitycore.listeners; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.connection.DisconnectEvent; import com.velocitypowered.api.event.connection.PostLoginEvent; +import de.steamwar.linkage.Linked; import de.steamwar.sql.AuditLog; import de.steamwar.velocitycore.VelocityCore; import de.steamwar.sql.Session; @@ -32,6 +33,7 @@ import java.time.Instant; import static de.steamwar.persistent.Storage.sessions; +@Linked public class SessionManager extends BasicListener { @Subscribe diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/SettingsChangedListener.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/SettingsChangedListener.java index 59693af5..3cd7ae77 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/SettingsChangedListener.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/SettingsChangedListener.java @@ -22,11 +22,13 @@ package de.steamwar.velocitycore.listeners; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.player.PlayerSettingsChangedEvent; import com.velocitypowered.api.proxy.Player; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.network.NetworkSender; import de.steamwar.sql.SteamwarUser; import de.steamwar.network.packets.server.LocaleInvalidationPacket; +@Linked public class SettingsChangedListener extends BasicListener { @Subscribe diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/TexturePackSystem.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/TexturePackSystem.java index 8d07e0c7..65a1a621 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/TexturePackSystem.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/TexturePackSystem.java @@ -22,6 +22,7 @@ package de.steamwar.velocitycore.listeners; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.player.ServerPostConnectEvent; import com.velocitypowered.api.proxy.player.ResourcePackInfo; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.VelocityCore; import net.kyori.adventure.text.Component; @@ -33,6 +34,7 @@ import java.util.UUID; import java.util.concurrent.TimeUnit; // https://jd.papermc.io/velocity/3.4.0/com/velocitypowered/api/proxy/player/ResourcePackInfo.Builder.html#setHash(byte%5B%5D) +@Linked public class TexturePackSystem extends BasicListener { private static final File PACKS_DIR = new File("/var/www/packs"); diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/VersionAnnouncer.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/VersionAnnouncer.java index 5204d258..7393358c 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/VersionAnnouncer.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/VersionAnnouncer.java @@ -26,6 +26,7 @@ import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.server.ServerInfo; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.velocity.platform.VelocityViaConfig; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.network.packets.server.ClientVersionPacket; import de.steamwar.persistent.Subserver; @@ -35,6 +36,7 @@ import de.steamwar.velocitycore.network.NetworkSender; import java.time.Duration; import java.time.temporal.ChronoUnit; +@Linked public class VersionAnnouncer extends BasicListener { @Subscribe diff --git a/VelocityCore/src/de/steamwar/velocitycore/mods/Badlion.java b/VelocityCore/src/de/steamwar/velocitycore/mods/Badlion.java index 57cc3986..cb26c30b 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/mods/Badlion.java +++ b/VelocityCore/src/de/steamwar/velocitycore/mods/Badlion.java @@ -22,7 +22,9 @@ package de.steamwar.velocitycore.mods; import com.google.gson.JsonObject; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier; +import de.steamwar.linkage.Linked; +@Linked public class Badlion { // https://github.com/BadlionClient/BadlionClientModAPI diff --git a/VelocityCore/src/de/steamwar/velocitycore/mods/FML2.java b/VelocityCore/src/de/steamwar/velocitycore/mods/FML2.java index fa0917dd..f2b4bc8c 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/mods/FML2.java +++ b/VelocityCore/src/de/steamwar/velocitycore/mods/FML2.java @@ -25,6 +25,7 @@ import com.velocitypowered.api.proxy.LoginPhaseConnection; import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier; import com.velocitypowered.proxy.connection.client.LoginInboundConnection; import com.velocitypowered.proxy.protocol.ProtocolUtils; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.listeners.BasicListener; import de.steamwar.velocitycore.listeners.PluginMessage; @@ -37,6 +38,7 @@ import net.kyori.adventure.text.Component; import java.util.*; import java.util.logging.Level; +@Linked public class FML2 extends BasicListener { // FML2: https://wiki.vg/Minecraft_Forge_Handshake#FML2_protocol_.281.13_-_Current.29 // FML3: https://github.com/adde0109/Ambassador/tree/non-api/src/main/java/org/adde0109/ambassador/forge diff --git a/VelocityCore/src/de/steamwar/velocitycore/mods/FabricModSender.java b/VelocityCore/src/de/steamwar/velocitycore/mods/FabricModSender.java index 2f492a88..209ad423 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/mods/FabricModSender.java +++ b/VelocityCore/src/de/steamwar/velocitycore/mods/FabricModSender.java @@ -28,6 +28,7 @@ import com.velocitypowered.api.event.connection.PluginMessageEvent; import com.velocitypowered.api.event.player.ServerConnectedEvent; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.proxy.protocol.ProtocolUtils; +import de.steamwar.linkage.Linked; import de.steamwar.persistent.Storage; import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.listeners.BasicListener; @@ -40,6 +41,7 @@ import io.netty.buffer.Unpooled; import java.util.*; import java.util.concurrent.TimeUnit; +@Linked public class FabricModSender extends BasicListener { private final Set neededFabricMods = new HashSet<>(); diff --git a/VelocityCore/src/de/steamwar/velocitycore/mods/Hostname.java b/VelocityCore/src/de/steamwar/velocitycore/mods/Hostname.java index 19547194..a7c00d9b 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/mods/Hostname.java +++ b/VelocityCore/src/de/steamwar/velocitycore/mods/Hostname.java @@ -24,6 +24,7 @@ import com.velocitypowered.api.event.connection.ConnectionHandshakeEvent; import com.velocitypowered.proxy.connection.client.InitialInboundConnection; import com.velocitypowered.proxy.connection.client.LoginInboundConnection; import com.velocitypowered.proxy.protocol.packet.HandshakePacket; +import de.steamwar.linkage.Linked; import de.steamwar.persistent.Reflection; import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.listeners.BasicListener; @@ -32,6 +33,7 @@ import java.util.HashSet; import java.util.Set; import java.util.logging.Level; +@Linked public class Hostname extends BasicListener { private static final Reflection.Field delegate = new Reflection.Field<>(LoginInboundConnection.class, "delegate"); diff --git a/VelocityCore/src/de/steamwar/velocitycore/mods/ReplayMod.java b/VelocityCore/src/de/steamwar/velocitycore/mods/ReplayMod.java index a09e7295..4e08ac8b 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/mods/ReplayMod.java +++ b/VelocityCore/src/de/steamwar/velocitycore/mods/ReplayMod.java @@ -22,6 +22,7 @@ package de.steamwar.velocitycore.mods; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.player.ServerPostConnectEvent; import com.velocitypowered.api.proxy.Player; +import de.steamwar.linkage.Linked; import de.steamwar.persistent.Bauserver; import de.steamwar.persistent.Builderserver; import de.steamwar.velocitycore.VelocityCore; @@ -32,6 +33,7 @@ import de.steamwar.velocitycore.listeners.PluginMessage; import java.util.Arrays; +@Linked public class ReplayMod extends BasicListener { // https://gist.github.com/Johni0702/2547c463e51f65f312cb // https://github.com/ReplayMod/replay-restrictions/blob/master/bungeecord/src/main/java/de/johni0702/replay/restrictions/BungeeCordPlugin.java diff --git a/VelocityCore/src/de/steamwar/velocitycore/mods/Schematica.java b/VelocityCore/src/de/steamwar/velocitycore/mods/Schematica.java index 9cf2c0c7..caac9a27 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/mods/Schematica.java +++ b/VelocityCore/src/de/steamwar/velocitycore/mods/Schematica.java @@ -22,8 +22,10 @@ package de.steamwar.velocitycore.mods; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.connection.PostLoginEvent; import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.listeners.BasicListener; +@Linked public class Schematica extends BasicListener { // https://github.com/Lunatrius/SchematicaPlugin/blob/master/src/main/java/com/github/lunatrius/schematica/plugin/SchematicaPlugin.java diff --git a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/AnvilAnswerHandler.java b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/AnvilAnswerHandler.java index f0abb739..d772672e 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/AnvilAnswerHandler.java +++ b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/AnvilAnswerHandler.java @@ -19,10 +19,12 @@ package de.steamwar.velocitycore.network.handlers; +import de.steamwar.linkage.Linked; import de.steamwar.network.packets.PacketHandler; import de.steamwar.network.packets.client.AnvilAnswerPacket; import de.steamwar.velocitycore.inventory.SWAnvilInv; +@Linked public class AnvilAnswerHandler extends PacketHandler { @Handler diff --git a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/EloPlayerHandler.java b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/EloPlayerHandler.java index 3ef4eb8f..8915cb42 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/EloPlayerHandler.java +++ b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/EloPlayerHandler.java @@ -20,6 +20,8 @@ package de.steamwar.velocitycore.network.handlers; import com.velocitypowered.api.proxy.Player; +import de.steamwar.linkage.EventMode; +import de.steamwar.linkage.Linked; import de.steamwar.messages.Chatter; import de.steamwar.network.packets.PacketHandler; import de.steamwar.network.packets.common.FightEndsPacket; @@ -38,6 +40,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.IntFunction; import java.util.stream.Collectors; +@Linked public class EloPlayerHandler extends PacketHandler { private static final int MEDIAN_ELO_GAIN = 40; diff --git a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/EloSchemHandler.java b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/EloSchemHandler.java index 49da0116..eec033e1 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/EloSchemHandler.java +++ b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/EloSchemHandler.java @@ -19,6 +19,7 @@ package de.steamwar.velocitycore.network.handlers; +import de.steamwar.linkage.Linked; import de.steamwar.network.packets.PacketHandler; import de.steamwar.network.packets.common.FightEndsPacket; import de.steamwar.sql.SchemElo; @@ -26,6 +27,7 @@ import de.steamwar.sql.SchematicNode; import de.steamwar.sql.SchematicType; import de.steamwar.velocitycore.ArenaMode; +@Linked public class EloSchemHandler extends PacketHandler { private static final int K = 20; diff --git a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/ExecuteCommandHandler.java b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/ExecuteCommandHandler.java index e96f9286..0f79d12e 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/ExecuteCommandHandler.java +++ b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/ExecuteCommandHandler.java @@ -19,11 +19,13 @@ package de.steamwar.velocitycore.network.handlers; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.VelocityCore; import de.steamwar.network.packets.PacketHandler; import de.steamwar.network.packets.client.ExecuteCommandPacket; import de.steamwar.sql.SteamwarUser; +@Linked public class ExecuteCommandHandler extends PacketHandler { @Handler diff --git a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/FightInfoHandler.java b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/FightInfoHandler.java index 6565f1db..9d7a2067 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/FightInfoHandler.java +++ b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/FightInfoHandler.java @@ -21,6 +21,7 @@ package de.steamwar.velocitycore.network.handlers; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.server.RegisteredServer; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.network.NetworkSender; import de.steamwar.velocitycore.network.ServerMetaInfo; import de.steamwar.velocitycore.tablist.TablistManager; @@ -30,6 +31,7 @@ import de.steamwar.network.packets.common.FightInfoPacket; import java.util.HashSet; import java.util.Set; +@Linked public class FightInfoHandler extends PacketHandler { private static final Set lobbys = new HashSet<>(); diff --git a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/ImALobbyHandler.java b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/ImALobbyHandler.java index 391ee1b7..b4eb48f1 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/ImALobbyHandler.java +++ b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/ImALobbyHandler.java @@ -19,10 +19,12 @@ package de.steamwar.velocitycore.network.handlers; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.network.ServerMetaInfo; import de.steamwar.network.packets.PacketHandler; import de.steamwar.network.packets.client.ImALobbyPacket; +@Linked public class ImALobbyHandler extends PacketHandler { @Handler diff --git a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/InventoryCallbackHandler.java b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/InventoryCallbackHandler.java index 54668d94..e8f9894b 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/InventoryCallbackHandler.java +++ b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/InventoryCallbackHandler.java @@ -20,6 +20,7 @@ package de.steamwar.velocitycore.network.handlers; import com.velocitypowered.api.proxy.Player; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.inventory.InvCallback; import de.steamwar.velocitycore.inventory.SWInventory; import de.steamwar.velocitycore.network.NetworkSender; @@ -33,6 +34,7 @@ import de.steamwar.sql.SteamwarUser; import java.util.HashMap; import java.util.Map; +@Linked public class InventoryCallbackHandler extends PacketHandler { public static final Map inventoryHashMap = new HashMap<>(); diff --git a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/PlayerSkinHandler.java b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/PlayerSkinHandler.java index ff18d309..0293545c 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/PlayerSkinHandler.java +++ b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/PlayerSkinHandler.java @@ -27,6 +27,7 @@ import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.connection.PostLoginEvent; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.util.GameProfile; +import de.steamwar.linkage.Linked; import de.steamwar.network.packets.PacketHandler; import de.steamwar.network.packets.common.PlayerSkinRequestPacket; import de.steamwar.network.packets.common.PlayerSkinResponsePacket; @@ -46,6 +47,7 @@ import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; +@Linked public class PlayerSkinHandler extends PacketHandler { private final int maxCacheSize = 1000; diff --git a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/PrepareSchemHandler.java b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/PrepareSchemHandler.java index eec027c5..4a90f5ca 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/network/handlers/PrepareSchemHandler.java +++ b/VelocityCore/src/de/steamwar/velocitycore/network/handlers/PrepareSchemHandler.java @@ -20,6 +20,7 @@ package de.steamwar.velocitycore.network.handlers; import com.velocitypowered.api.proxy.Player; +import de.steamwar.linkage.Linked; import de.steamwar.velocitycore.ArenaMode; import de.steamwar.velocitycore.ServerStarter; import de.steamwar.velocitycore.VelocityCore; @@ -28,6 +29,7 @@ import de.steamwar.network.packets.client.PrepareSchemPacket; import de.steamwar.sql.SchematicType; import de.steamwar.sql.SteamwarUser; +@Linked public class PrepareSchemHandler extends PacketHandler { @Handler diff --git a/VelocityCore/src/de/steamwar/velocitycore/tablist/TablistManager.java b/VelocityCore/src/de/steamwar/velocitycore/tablist/TablistManager.java index 205cf067..2a8c5367 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/tablist/TablistManager.java +++ b/VelocityCore/src/de/steamwar/velocitycore/tablist/TablistManager.java @@ -26,6 +26,8 @@ import com.velocitypowered.api.event.player.ServerPostConnectEvent; import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.server.RegisteredServer; +import de.steamwar.linkage.Linked; +import de.steamwar.linkage.api.Disable; import de.steamwar.network.packets.common.FightInfoPacket; import de.steamwar.persistent.Storage; import de.steamwar.persistent.Subserver; @@ -38,7 +40,8 @@ import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; -public class TablistManager extends BasicListener { +@Linked +public class TablistManager extends BasicListener implements Disable { private static final Map fightInfos = new HashMap<>();