Update VelocityCore to use Linkage

This commit is contained in:
2025-09-29 15:26:26 +02:00
parent ca589bd07c
commit d850894a00
75 changed files with 246 additions and 109 deletions
@@ -71,6 +71,8 @@ public abstract class AbstractLinker<T> {
MinVersion minVersion = clazz.getAnnotation(MinVersion.class); MinVersion minVersion = clazz.getAnnotation(MinVersion.class);
MaxVersion maxVersion = clazz.getAnnotation(MaxVersion.class); MaxVersion maxVersion = clazz.getAnnotation(MaxVersion.class);
if (!versionCheck(clazz, minVersion, maxVersion)) return; if (!versionCheck(clazz, minVersion, maxVersion)) return;
EventMode eventMode = clazz.getAnnotation(EventMode.class);
if (!eventModeCheck(clazz, eventMode)) return;
PluginCheck[] pluginChecks = clazz.getAnnotationsByType(PluginCheck.class); PluginCheck[] pluginChecks = clazz.getAnnotationsByType(PluginCheck.class);
for (PluginCheck pluginCheck : pluginChecks) { for (PluginCheck pluginCheck : pluginChecks) {
if (!pluginCheck(clazz, pluginCheck)) return; if (!pluginCheck(clazz, pluginCheck)) return;
@@ -140,13 +142,22 @@ public abstract class AbstractLinker<T> {
return true; 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. * 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. * There is no need in calling {@link Disable#disable()} ()} by this method.
*/ */
protected abstract void unlinkObject(Object any); protected void unlinkObject(Object any) {
}
} }
@@ -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 <https://www.gnu.org/licenses/>.
*/
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();
}
@@ -19,17 +19,21 @@
package de.steamwar.velocitycore; package de.steamwar.velocitycore;
import de.steamwar.linkage.EventMode;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@Linked
@EventMode(false)
class Broadcaster { class Broadcaster {
private final List<String> broadcasts = VelocityCore.get().getConfig().getBroadcasts(); private final List<String> broadcasts = VelocityCore.get().getConfig().getBroadcasts();
private int lastBroadCast = 0; private int lastBroadCast = 0;
Broadcaster() { public Broadcaster() {
if(!broadcasts.isEmpty()) if(!broadcasts.isEmpty())
VelocityCore.schedule(this::broadcast).repeat(10, TimeUnit.MINUTES).schedule(); VelocityCore.schedule(this::broadcast).repeat(10, TimeUnit.MINUTES).schedule();
} }
@@ -19,6 +19,7 @@
package de.steamwar.velocitycore; package de.steamwar.velocitycore;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.persistent.Subserver; import de.steamwar.persistent.Subserver;
@@ -36,6 +37,7 @@ import java.util.concurrent.TimeUnit;
import static de.steamwar.persistent.Storage.eventServer; import static de.steamwar.persistent.Storage.eventServer;
@Linked
public class EventStarter { public class EventStarter {
@Getter @Getter
@@ -29,22 +29,24 @@ import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.ProxyServer; import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.scheduler.Scheduler; import com.velocitypowered.api.scheduler.Scheduler;
import de.steamwar.command.*; 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.messages.Chatter;
import de.steamwar.network.packets.PacketHandler;
import de.steamwar.persistent.ReloadablePlugin; import de.steamwar.persistent.ReloadablePlugin;
import de.steamwar.sql.Punishment; import de.steamwar.sql.Punishment;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.Team; import de.steamwar.sql.Team;
import de.steamwar.sql.UserElo; import de.steamwar.sql.UserElo;
import de.steamwar.sql.internal.Statement; 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.DiscordBot;
import de.steamwar.velocitycore.discord.DiscordConfig; import de.steamwar.velocitycore.discord.DiscordConfig;
import de.steamwar.velocitycore.listeners.*; import de.steamwar.velocitycore.listeners.PollSystem;
import de.steamwar.velocitycore.mods.*;
import de.steamwar.velocitycore.network.handlers.*;
import de.steamwar.velocitycore.tablist.TablistManager;
import lombok.Getter; import lombok.Getter;
import lombok.NonNull;
import java.nio.file.Path; import java.nio.file.Path;
import java.sql.Driver; import java.sql.Driver;
@@ -94,9 +96,9 @@ public class VelocityCore implements ReloadablePlugin {
@Getter @Getter
private Config config; private Config config;
private ErrorLogger errorLogger; private ErrorLogger errorLogger;
private TablistManager tablistManager;
@Getter @Getter
@LinkedInstance
private TeamCommand teamCommand; private TeamCommand teamCommand;
@Inject @Inject
@@ -104,9 +106,10 @@ public class VelocityCore implements ReloadablePlugin {
this.proxyServer = proxyServer; this.proxyServer = proxyServer;
this.logger = logger; this.logger = logger;
this.dataDirectory = dataDirectory; this.dataDirectory = dataDirectory;
} }
private AbstractLinker<ReloadablePlugin> linker;
@Subscribe @Subscribe
@Override @Override
public void onProxyInitialization(ProxyInitializeEvent event) { public void onProxyInitialization(ProxyInitializeEvent event) {
@@ -139,64 +142,11 @@ public class VelocityCore implements ReloadablePlugin {
initStaticServers(); initStaticServers();
PollSystem.init(); 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(); local = new Node.LocalNode();
if(MAIN_SERVER) { if(MAIN_SERVER) {
//new Node.RemoteNode("lx"); //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: // Punishment Commands:
new PunishmentCommand("ban", Punishment.PunishmentType.Ban); new PunishmentCommand("ban", Punishment.PunishmentType.Ban);
new PunishmentCommand("mute", Punishment.PunishmentType.Mute); new PunishmentCommand("mute", Punishment.PunishmentType.Mute);
@@ -208,32 +158,19 @@ public class VelocityCore implements ReloadablePlugin {
new PunishmentCommand("noteamserver", Punishment.PunishmentType.NoTeamServer); new PunishmentCommand("noteamserver", Punishment.PunishmentType.NoTeamServer);
new PunishmentCommand("note", Punishment.PunishmentType.Note); new PunishmentCommand("note", Punishment.PunishmentType.Note);
if(!config.isEventmode()){ linker = new AbstractLinker<>(this) {
new BauCommand(helpCommand); @Override
new WebpasswordCommand(); protected boolean eventModeCheck(@NonNull Class<?> clazz, EventMode eventMode) {
new FightCommand(); return eventMode == null || eventMode.value() == config.isEventmode();
new ChallengeCommand(); }
new HistoricCommand(); };
new ReplayCommand(); try {
linker.link();
new Broadcaster(); } catch (AbstractLinker.LinkException e) {
new CookieEvents(); VelocityCore.getProxy().shutdown();
new StreamingCommand(); return;
}else{
new EventModeListener();
} }
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(() -> { schedule(() -> {
SteamwarUser.clear(); SteamwarUser.clear();
UserElo.clear(); UserElo.clear();
@@ -269,8 +206,7 @@ public class VelocityCore implements ReloadablePlugin {
logger.log(Level.SEVERE, "Could not shutdown discord bot", e); logger.log(Level.SEVERE, "Could not shutdown discord bot", e);
} }
if(tablistManager != null) linker.unlink();
tablistManager.disable();
errorLogger.unregister(); errorLogger.unregister();
Statement.closeAll(); Statement.closeAll();
@@ -19,11 +19,13 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.discord.DiscordBot; import de.steamwar.velocitycore.discord.DiscordBot;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.sql.UserPerm; import de.steamwar.sql.UserPerm;
@Linked
public class AlertCommand extends SWCommand { public class AlertCommand extends SWCommand {
public AlertCommand() { public AlertCommand() {
@@ -23,6 +23,7 @@ import com.velocitypowered.api.proxy.server.RegisteredServer;
import de.steamwar.command.PreviousArguments; import de.steamwar.command.PreviousArguments;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.command.TypeMapper; import de.steamwar.command.TypeMapper;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
import de.steamwar.persistent.Subserver; import de.steamwar.persistent.Subserver;
@@ -31,6 +32,7 @@ import de.steamwar.velocitycore.VelocityCore;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@Linked
public class ArenaCommand extends SWCommand { public class ArenaCommand extends SWCommand {
public ArenaCommand() { public ArenaCommand() {
@@ -19,6 +19,9 @@
package de.steamwar.velocitycore.commands; 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.*;
import de.steamwar.velocitycore.inventory.SWInventory; import de.steamwar.velocitycore.inventory.SWInventory;
import de.steamwar.velocitycore.inventory.SWItem; import de.steamwar.velocitycore.inventory.SWItem;
@@ -40,9 +43,12 @@ import de.steamwar.sql.SteamwarUser;
import java.util.Collection; import java.util.Collection;
import java.util.function.Consumer; import java.util.function.Consumer;
@Linked
@EventMode(false)
public class BauCommand extends SWCommand { public class BauCommand extends SWCommand {
private final HelpCommand command; @LinkedInstance
private HelpCommand command;
public BauCommand(HelpCommand command) { public BauCommand(HelpCommand command) {
super("bau", "b", "build", "gs"); super("bau", "b", "build", "gs");
@@ -19,12 +19,13 @@
package de.steamwar.velocitycore.commands; 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.persistent.Subserver;
import de.steamwar.sql.SWException; 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 class BugCommand extends SWCommand {
public BugCommand() { public BugCommand() {
super("bug"); super("bug");
@@ -19,6 +19,7 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.ArenaMode; import de.steamwar.velocitycore.ArenaMode;
import de.steamwar.velocitycore.ServerStarter; import de.steamwar.velocitycore.ServerStarter;
import de.steamwar.velocitycore.ServerVersion; import de.steamwar.velocitycore.ServerVersion;
@@ -37,6 +38,7 @@ import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
@Linked
public class BuilderCloudCommand extends SWCommand { public class BuilderCloudCommand extends SWCommand {
public BuilderCloudCommand() { public BuilderCloudCommand() {
@@ -22,6 +22,8 @@ package de.steamwar.velocitycore.commands;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.command.TypeValidator; import de.steamwar.command.TypeValidator;
import de.steamwar.linkage.EventMode;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
@@ -35,6 +37,8 @@ import java.util.LinkedList;
import static de.steamwar.persistent.Storage.challenges; import static de.steamwar.persistent.Storage.challenges;
@Linked
@EventMode(false)
public class ChallengeCommand extends SWCommand { public class ChallengeCommand extends SWCommand {
public ChallengeCommand() { public ChallengeCommand() {
@@ -21,6 +21,7 @@ package de.steamwar.velocitycore.commands;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
@@ -44,6 +45,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.BooleanSupplier; import java.util.function.BooleanSupplier;
import java.util.logging.Level; import java.util.logging.Level;
@Linked
public class CheckCommand extends SWCommand { public class CheckCommand extends SWCommand {
private static final Map<SchematicType, SchematicType> fightTypes = new HashMap<>(); private static final Map<SchematicType, SchematicType> fightTypes = new HashMap<>();
private static final Map<SchematicType, List<String>> checkQuestions = new HashMap<>(); private static final Map<SchematicType, List<String>> checkQuestions = new HashMap<>();
@@ -27,6 +27,7 @@ import de.steamwar.command.SWCommand;
import de.steamwar.command.SWCommandUtils; import de.steamwar.command.SWCommandUtils;
import de.steamwar.command.TypeMapper; import de.steamwar.command.TypeMapper;
import de.steamwar.command.TypeValidator; import de.steamwar.command.TypeValidator;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
@@ -43,6 +44,7 @@ import java.net.InetSocketAddress;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@Linked
public class DevCommand extends SWCommand { public class DevCommand extends SWCommand {
private final File devServerDir = new File("/configs/DevServer"); private final File devServerDir = new File("/configs/DevServer");
@@ -23,6 +23,7 @@ import de.steamwar.command.PreviousArguments;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.command.TypeMapper; import de.steamwar.command.TypeMapper;
import de.steamwar.command.TypeValidator; import de.steamwar.command.TypeValidator;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
import de.steamwar.persistent.Subserver; import de.steamwar.persistent.Subserver;
@@ -37,6 +38,7 @@ import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Linked
public class EventCommand extends SWCommand { public class EventCommand extends SWCommand {
public EventCommand() { public EventCommand() {
@@ -21,6 +21,7 @@ package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.command.TypeMapper; import de.steamwar.command.TypeMapper;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.sql.Event; import de.steamwar.sql.Event;
import de.steamwar.sql.EventFight; import de.steamwar.sql.EventFight;
@@ -32,6 +33,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.ListIterator; import java.util.ListIterator;
@Linked
public class EventRescheduleCommand extends SWCommand { public class EventRescheduleCommand extends SWCommand {
public EventRescheduleCommand() { public EventRescheduleCommand() {
@@ -20,10 +20,12 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.sql.EventFight; import de.steamwar.sql.EventFight;
import de.steamwar.sql.UserPerm; import de.steamwar.sql.UserPerm;
@Linked
public class EventreloadCommand extends SWCommand { public class EventreloadCommand extends SWCommand {
public EventreloadCommand() { public EventreloadCommand() {
super("eventreload", UserPerm.MODERATION); super("eventreload", UserPerm.MODERATION);
@@ -21,6 +21,8 @@ package de.steamwar.velocitycore.commands;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.EventMode;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.messages.PlayerChatter; 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.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration; import net.kyori.adventure.text.format.TextDecoration;
@Linked
@EventMode(false)
public class FightCommand extends SWCommand { public class FightCommand extends SWCommand {
public FightCommand() { public FightCommand() {
@@ -19,6 +19,7 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
@@ -31,6 +32,7 @@ import java.io.*;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
@Linked
public class GDPRQuery extends SWCommand { public class GDPRQuery extends SWCommand {
public GDPRQuery() { public GDPRQuery() {
@@ -20,12 +20,14 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.ClickEvent;
import java.util.function.Function; import java.util.function.Function;
@Linked
public class HelpCommand extends SWCommand { public class HelpCommand extends SWCommand {
public HelpCommand() { public HelpCommand() {
@@ -20,6 +20,8 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.EventMode;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
@@ -27,6 +29,8 @@ import de.steamwar.velocitycore.ArenaMode;
import de.steamwar.velocitycore.ServerStarter; import de.steamwar.velocitycore.ServerStarter;
import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.ClickEvent;
@Linked
@EventMode(false)
public class HistoricCommand extends SWCommand { public class HistoricCommand extends SWCommand {
public HistoricCommand() { public HistoricCommand() {
super("historic"); super("historic");
@@ -20,10 +20,12 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.sql.IgnoreSystem; import de.steamwar.sql.IgnoreSystem;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
@Linked
public class IgnoreCommand extends SWCommand { public class IgnoreCommand extends SWCommand {
public IgnoreCommand() { public IgnoreCommand() {
@@ -20,12 +20,14 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
import de.steamwar.sql.UserPerm; import de.steamwar.sql.UserPerm;
import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.ClickEvent;
@Linked
public class JoinmeCommand extends SWCommand { public class JoinmeCommand extends SWCommand {
public JoinmeCommand() { public JoinmeCommand() {
@@ -21,9 +21,11 @@ package de.steamwar.velocitycore.commands;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.sql.UserPerm; import de.steamwar.sql.UserPerm;
@Linked
public class KickCommand extends SWCommand { public class KickCommand extends SWCommand {
public KickCommand() { public KickCommand() {
@@ -22,6 +22,7 @@ package de.steamwar.velocitycore.commands;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ServerConnection; import com.velocitypowered.api.proxy.ServerConnection;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.persistent.Subserver; import de.steamwar.persistent.Subserver;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
@@ -32,6 +33,7 @@ import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Linked
public class ListCommand extends SWCommand { public class ListCommand extends SWCommand {
public ListCommand() { public ListCommand() {
@@ -19,10 +19,12 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.listeners.ChatListener; import de.steamwar.velocitycore.listeners.ChatListener;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
@Linked
public class LocalCommand extends SWCommand { public class LocalCommand extends SWCommand {
public LocalCommand() { public LocalCommand() {
@@ -19,6 +19,7 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.inventory.SWInventory; import de.steamwar.velocitycore.inventory.SWInventory;
import de.steamwar.velocitycore.inventory.SWItem; import de.steamwar.velocitycore.inventory.SWItem;
import de.steamwar.velocitycore.inventory.SWListInv; import de.steamwar.velocitycore.inventory.SWListInv;
@@ -35,6 +36,7 @@ import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.function.Consumer; import java.util.function.Consumer;
@Linked
public class ModCommand extends SWCommand { public class ModCommand extends SWCommand {
public ModCommand() { public ModCommand() {
@@ -20,17 +20,18 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import com.velocitypowered.api.proxy.Player; 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.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.ChatterGroup; import de.steamwar.messages.ChatterGroup;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
import de.steamwar.sql.IgnoreSystem; import de.steamwar.sql.IgnoreSystem;
import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.velocitycore.listeners.ChatListener;
import static de.steamwar.persistent.Storage.lastChats; import static de.steamwar.persistent.Storage.lastChats;
@Linked
public class MsgCommand extends SWCommand { public class MsgCommand extends SWCommand {
public MsgCommand() { public MsgCommand() {
@@ -20,8 +20,10 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
@Linked
public class PingCommand extends SWCommand { public class PingCommand extends SWCommand {
public PingCommand() { public PingCommand() {
@@ -20,11 +20,13 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
import java.text.NumberFormat; import java.text.NumberFormat;
@Linked
public class PlaytimeCommand extends SWCommand { public class PlaytimeCommand extends SWCommand {
public PlaytimeCommand() { public PlaytimeCommand() {
@@ -19,12 +19,14 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.listeners.PollSystem; import de.steamwar.velocitycore.listeners.PollSystem;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.command.TypeValidator; import de.steamwar.command.TypeValidator;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.sql.PollAnswer; import de.steamwar.sql.PollAnswer;
@Linked
public class PollCommand extends SWCommand { public class PollCommand extends SWCommand {
public PollCommand() { public PollCommand() {
@@ -19,6 +19,7 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.listeners.PollSystem; import de.steamwar.velocitycore.listeners.PollSystem;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.command.TypeValidator; import de.steamwar.command.TypeValidator;
@@ -28,6 +29,7 @@ import de.steamwar.sql.UserPerm;
import java.util.Map; import java.util.Map;
@Linked
public class PollresultCommand extends SWCommand { public class PollresultCommand extends SWCommand {
public PollresultCommand() { public PollresultCommand() {
@@ -20,10 +20,12 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
import static de.steamwar.persistent.Storage.lastChats; import static de.steamwar.persistent.Storage.lastChats;
@Linked
public class RCommand extends SWCommand { public class RCommand extends SWCommand {
public RCommand() { public RCommand() {
@@ -20,6 +20,7 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
@@ -28,6 +29,7 @@ import de.steamwar.velocitycore.ArenaMode;
import java.util.Optional; import java.util.Optional;
@Linked
public class RankCommand extends SWCommand { public class RankCommand extends SWCommand {
public RankCommand() { public RankCommand() {
@@ -19,6 +19,8 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.linkage.EventMode;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.ArenaMode; import de.steamwar.velocitycore.ArenaMode;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.velocitycore.ServerStarter; import de.steamwar.velocitycore.ServerStarter;
@@ -32,6 +34,8 @@ import de.steamwar.sql.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@Linked
@EventMode(false)
public class ReplayCommand extends SWCommand { public class ReplayCommand extends SWCommand {
public ReplayCommand() { public ReplayCommand() {
@@ -20,12 +20,14 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.ClickEvent;
import java.util.Arrays; import java.util.Arrays;
@Linked
public class RulesCommand extends SWCommand { public class RulesCommand extends SWCommand {
public RulesCommand() { public RulesCommand() {
super("rules", "regeln"); super("rules", "regeln");
@@ -26,6 +26,7 @@ import com.velocitypowered.api.proxy.server.ServerInfo;
import de.steamwar.command.PreviousArguments; import de.steamwar.command.PreviousArguments;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.command.TypeMapper; import de.steamwar.command.TypeMapper;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.persistent.Subserver; import de.steamwar.persistent.Subserver;
@@ -38,6 +39,7 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Linked
public class SendCommand extends SWCommand { public class SendCommand extends SWCommand {
// /send <server> [<users>] // /send <server> [<users>]
@@ -19,11 +19,13 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.listeners.ChatListener; import de.steamwar.velocitycore.listeners.ChatListener;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.sql.UserPerm; import de.steamwar.sql.UserPerm;
@Linked
public class ServerTeamchatCommand extends SWCommand { public class ServerTeamchatCommand extends SWCommand {
public ServerTeamchatCommand() { public ServerTeamchatCommand() {
@@ -20,10 +20,12 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
import de.steamwar.network.packets.server.LocaleInvalidationPacket; import de.steamwar.network.packets.server.LocaleInvalidationPacket;
import de.steamwar.velocitycore.network.NetworkSender; import de.steamwar.velocitycore.network.NetworkSender;
@Linked
public class SetLocaleCommand extends SWCommand { public class SetLocaleCommand extends SWCommand {
public SetLocaleCommand() { public SetLocaleCommand() {
@@ -19,6 +19,7 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.Node; import de.steamwar.velocitycore.Node;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
@@ -29,6 +30,7 @@ import java.io.InputStreamReader;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@Linked
public class StatCommand extends SWCommand { public class StatCommand extends SWCommand {
public StatCommand() { public StatCommand() {
@@ -20,11 +20,15 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.EventMode;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.persistent.Storage; import de.steamwar.persistent.Storage;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.UserPerm; import de.steamwar.sql.UserPerm;
@Linked
@EventMode(false)
public class StreamingCommand extends SWCommand { public class StreamingCommand extends SWCommand {
public static boolean isNotStreaming(Chatter sender) { public static boolean isNotStreaming(Chatter sender) {
@@ -29,6 +29,7 @@ import de.steamwar.command.PreviousArguments;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.command.TypeMapper; import de.steamwar.command.TypeMapper;
import de.steamwar.command.TypeValidator; import de.steamwar.command.TypeValidator;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.messages.PlayerChatter; import de.steamwar.messages.PlayerChatter;
@@ -52,6 +53,7 @@ import java.util.stream.Stream;
import static de.steamwar.persistent.Storage.teamInvitations; import static de.steamwar.persistent.Storage.teamInvitations;
@Linked
public class TeamCommand extends SWCommand { public class TeamCommand extends SWCommand {
public TeamCommand() { public TeamCommand() {
@@ -19,12 +19,14 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.listeners.ChatListener; import de.steamwar.velocitycore.listeners.ChatListener;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.ChatterGroup; import de.steamwar.messages.ChatterGroup;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
@Linked
public class TeamchatCommand extends SWCommand { public class TeamchatCommand extends SWCommand {
public TeamchatCommand() { public TeamchatCommand() {
@@ -22,6 +22,7 @@ package de.steamwar.velocitycore.commands;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ServerConnection; import com.velocitypowered.api.proxy.ServerConnection;
import com.velocitypowered.api.proxy.server.RegisteredServer; import com.velocitypowered.api.proxy.server.RegisteredServer;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.*; import de.steamwar.velocitycore.*;
import de.steamwar.velocitycore.util.BauLock; import de.steamwar.velocitycore.util.BauLock;
import de.steamwar.command.PreviousArguments; import de.steamwar.command.PreviousArguments;
@@ -39,6 +40,7 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@Linked
public class TpCommand extends SWCommand { public class TpCommand extends SWCommand {
public TpCommand(){ public TpCommand(){
@@ -20,10 +20,12 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.sql.IgnoreSystem; import de.steamwar.sql.IgnoreSystem;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
@Linked
public class UnIgnoreCommand extends SWCommand { public class UnIgnoreCommand extends SWCommand {
public UnIgnoreCommand() { public UnIgnoreCommand() {
@@ -19,6 +19,7 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.velocitycore.discord.util.AuthManager; import de.steamwar.velocitycore.discord.util.AuthManager;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
@@ -28,6 +29,7 @@ import net.dv8tion.jda.api.entities.User;
import java.util.Base64; import java.util.Base64;
import java.util.logging.Level; import java.util.logging.Level;
@Linked
public class VerifyCommand extends SWCommand { public class VerifyCommand extends SWCommand {
public VerifyCommand() { public VerifyCommand() {
@@ -20,9 +20,13 @@
package de.steamwar.velocitycore.commands; package de.steamwar.velocitycore.commands;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.linkage.EventMode;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
@Linked
@EventMode(false)
public class WebpasswordCommand extends SWCommand { public class WebpasswordCommand extends SWCommand {
public WebpasswordCommand() { public WebpasswordCommand() {
@@ -23,6 +23,7 @@ import com.velocitypowered.api.proxy.Player;
import de.steamwar.command.PreviousArguments; import de.steamwar.command.PreviousArguments;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.command.TypeMapper; import de.steamwar.command.TypeMapper;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.persistent.Storage; import de.steamwar.persistent.Storage;
@@ -41,7 +42,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@Linked
public class WhoisCommand extends SWCommand { public class WhoisCommand extends SWCommand {
public WhoisCommand() { public WhoisCommand() {
super("whois"); super("whois");
@@ -22,6 +22,7 @@ package de.steamwar.velocitycore.listeners;
import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.connection.LoginEvent; import com.velocitypowered.api.event.connection.LoginEvent;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.sql.BannedUserIPs; import de.steamwar.sql.BannedUserIPs;
@@ -36,6 +37,7 @@ import java.util.List;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Linked
public class BanListener extends BasicListener { public class BanListener extends BasicListener {
@Subscribe @Subscribe
@@ -29,6 +29,7 @@ import com.velocitypowered.api.proxy.ConsoleCommandSource;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ServerConnection; import com.velocitypowered.api.proxy.ServerConnection;
import com.velocitypowered.api.proxy.server.ServerInfo; import com.velocitypowered.api.proxy.server.ServerInfo;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.ChatterGroup; import de.steamwar.messages.ChatterGroup;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
@@ -50,6 +51,7 @@ import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Linked
public class ChatListener extends BasicListener { public class ChatListener extends BasicListener {
private static final Logger cmdLogger = Logger.getLogger("Command logger"); private static final Logger cmdLogger = Logger.getLogger("Command logger");
@@ -24,6 +24,7 @@ import com.velocitypowered.api.event.connection.DisconnectEvent;
import com.velocitypowered.api.event.connection.PostLoginEvent; import com.velocitypowered.api.event.connection.PostLoginEvent;
import com.velocitypowered.api.event.player.ServerConnectedEvent; import com.velocitypowered.api.event.player.ServerConnectedEvent;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.persistent.Bauserver; import de.steamwar.persistent.Bauserver;
import de.steamwar.persistent.Subserver; import de.steamwar.persistent.Subserver;
@@ -34,6 +35,7 @@ import de.steamwar.velocitycore.commands.CheckCommand;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@Linked
public class CheckListener extends BasicListener { public class CheckListener extends BasicListener {
@Subscribe @Subscribe
@@ -27,6 +27,7 @@ import com.velocitypowered.api.event.player.KickedFromServerEvent;
import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.network.ProtocolVersion;
import com.velocitypowered.api.permission.Tristate; import com.velocitypowered.api.permission.Tristate;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message; import de.steamwar.messages.Message;
import de.steamwar.persistent.Subserver; import de.steamwar.persistent.Subserver;
@@ -45,6 +46,7 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
@Linked
public class ConnectionListener extends BasicListener { public class ConnectionListener extends BasicListener {
private static final Set<UUID> newPlayers = new HashSet<>(); private static final Set<UUID> newPlayers = new HashSet<>();
@@ -22,11 +22,15 @@ package de.steamwar.velocitycore.listeners;
import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.player.CookieReceiveEvent; import com.velocitypowered.api.event.player.CookieReceiveEvent;
import com.velocitypowered.api.proxy.Player; 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.EventFight;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
import de.steamwar.velocitycore.EventStarter; import de.steamwar.velocitycore.EventStarter;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
@Linked
@EventMode(false)
public class CookieEvents extends BasicListener { public class CookieEvents extends BasicListener {
@Subscribe @Subscribe
@@ -19,27 +19,25 @@
package de.steamwar.velocitycore.listeners; 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.Subscribe;
import com.velocitypowered.api.event.connection.PostLoginEvent; import com.velocitypowered.api.event.connection.PostLoginEvent;
import com.velocitypowered.api.event.player.ServerConnectedEvent; import com.velocitypowered.api.event.player.ServerConnectedEvent;
import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.network.ProtocolVersion;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.linkage.EventMode;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.persistent.Subserver; import de.steamwar.persistent.Subserver;
import de.steamwar.sql.Event; import de.steamwar.sql.*;
import de.steamwar.sql.EventFight;
import de.steamwar.sql.Referee;
import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.TeamTeilnahme;
import de.steamwar.velocitycore.EventStarter; import de.steamwar.velocitycore.EventStarter;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
import net.kyori.adventure.key.Key; import net.kyori.adventure.key.Key;
import java.net.InetSocketAddress;
import java.util.List;
@Linked
@EventMode(true)
public class EventModeListener extends BasicListener { public class EventModeListener extends BasicListener {
public static final Key EVENT_TO_SPECTATE_KEY = Key.key("sw", "event_to_spectate"); public static final Key EVENT_TO_SPECTATE_KEY = Key.key("sw", "event_to_spectate");
@@ -26,6 +26,7 @@ import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.proxy.connection.MinecraftConnection; import com.velocitypowered.proxy.connection.MinecraftConnection;
import com.velocitypowered.proxy.connection.client.ConnectedPlayer; import com.velocitypowered.proxy.connection.client.ConnectedPlayer;
import com.velocitypowered.proxy.connection.client.LoginInboundConnection; import com.velocitypowered.proxy.connection.client.LoginInboundConnection;
import de.steamwar.linkage.Linked;
import de.steamwar.persistent.Reflection; import de.steamwar.persistent.Reflection;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.velocitycore.mods.Hostname; import de.steamwar.velocitycore.mods.Hostname;
@@ -38,6 +39,7 @@ import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.logging.Level; import java.util.logging.Level;
@Linked
public class IPSanitizer extends BasicListener { public class IPSanitizer extends BasicListener {
private static final Map<UUID, InetAddress> trueAddress = new HashMap<>(); // Will likely slightly leak over time private static final Map<UUID, InetAddress> trueAddress = new HashMap<>(); // Will likely slightly leak over time
@@ -31,6 +31,7 @@ import com.velocitypowered.api.proxy.messages.ChannelMessageSource;
import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier; import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier;
import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier; import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
import com.velocitypowered.proxy.protocol.ProtocolUtils; import com.velocitypowered.proxy.protocol.ProtocolUtils;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.network.packets.NetworkPacket; import de.steamwar.network.packets.NetworkPacket;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
@@ -50,6 +51,7 @@ import java.util.*;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.logging.Level; import java.util.logging.Level;
@Linked
public class PluginMessage extends BasicListener { public class PluginMessage extends BasicListener {
public static void send(Player player, String legacyChannel, String channel, byte[] data) { public static void send(Player player, String legacyChannel, String channel, byte[] data) {
@@ -22,6 +22,7 @@ package de.steamwar.velocitycore.listeners;
import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.connection.DisconnectEvent; import com.velocitypowered.api.event.connection.DisconnectEvent;
import com.velocitypowered.api.event.connection.PostLoginEvent; import com.velocitypowered.api.event.connection.PostLoginEvent;
import de.steamwar.linkage.Linked;
import de.steamwar.sql.AuditLog; import de.steamwar.sql.AuditLog;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.sql.Session; import de.steamwar.sql.Session;
@@ -32,6 +33,7 @@ import java.time.Instant;
import static de.steamwar.persistent.Storage.sessions; import static de.steamwar.persistent.Storage.sessions;
@Linked
public class SessionManager extends BasicListener { public class SessionManager extends BasicListener {
@Subscribe @Subscribe
@@ -22,11 +22,13 @@ package de.steamwar.velocitycore.listeners;
import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.player.PlayerSettingsChangedEvent; import com.velocitypowered.api.event.player.PlayerSettingsChangedEvent;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.velocitycore.network.NetworkSender; import de.steamwar.velocitycore.network.NetworkSender;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
import de.steamwar.network.packets.server.LocaleInvalidationPacket; import de.steamwar.network.packets.server.LocaleInvalidationPacket;
@Linked
public class SettingsChangedListener extends BasicListener { public class SettingsChangedListener extends BasicListener {
@Subscribe @Subscribe
@@ -22,6 +22,7 @@ package de.steamwar.velocitycore.listeners;
import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.player.ServerPostConnectEvent; import com.velocitypowered.api.event.player.ServerPostConnectEvent;
import com.velocitypowered.api.proxy.player.ResourcePackInfo; import com.velocitypowered.api.proxy.player.ResourcePackInfo;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
@@ -33,6 +34,7 @@ import java.util.UUID;
import java.util.concurrent.TimeUnit; 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) // 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 { public class TexturePackSystem extends BasicListener {
private static final File PACKS_DIR = new File("/var/www/packs"); private static final File PACKS_DIR = new File("/var/www/packs");
@@ -26,6 +26,7 @@ import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.server.ServerInfo; import com.velocitypowered.api.proxy.server.ServerInfo;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.velocity.platform.VelocityViaConfig; import com.viaversion.viaversion.velocity.platform.VelocityViaConfig;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.network.packets.server.ClientVersionPacket; import de.steamwar.network.packets.server.ClientVersionPacket;
import de.steamwar.persistent.Subserver; import de.steamwar.persistent.Subserver;
@@ -35,6 +36,7 @@ import de.steamwar.velocitycore.network.NetworkSender;
import java.time.Duration; import java.time.Duration;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;
@Linked
public class VersionAnnouncer extends BasicListener { public class VersionAnnouncer extends BasicListener {
@Subscribe @Subscribe
@@ -22,7 +22,9 @@ package de.steamwar.velocitycore.mods;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier; import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
import de.steamwar.linkage.Linked;
@Linked
public class Badlion { public class Badlion {
// https://github.com/BadlionClient/BadlionClientModAPI // https://github.com/BadlionClient/BadlionClientModAPI
@@ -25,6 +25,7 @@ import com.velocitypowered.api.proxy.LoginPhaseConnection;
import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier; import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
import com.velocitypowered.proxy.connection.client.LoginInboundConnection; import com.velocitypowered.proxy.connection.client.LoginInboundConnection;
import com.velocitypowered.proxy.protocol.ProtocolUtils; import com.velocitypowered.proxy.protocol.ProtocolUtils;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.velocitycore.listeners.BasicListener; import de.steamwar.velocitycore.listeners.BasicListener;
import de.steamwar.velocitycore.listeners.PluginMessage; import de.steamwar.velocitycore.listeners.PluginMessage;
@@ -37,6 +38,7 @@ import net.kyori.adventure.text.Component;
import java.util.*; import java.util.*;
import java.util.logging.Level; import java.util.logging.Level;
@Linked
public class FML2 extends BasicListener { public class FML2 extends BasicListener {
// FML2: https://wiki.vg/Minecraft_Forge_Handshake#FML2_protocol_.281.13_-_Current.29 // 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 // FML3: https://github.com/adde0109/Ambassador/tree/non-api/src/main/java/org/adde0109/ambassador/forge
@@ -28,6 +28,7 @@ import com.velocitypowered.api.event.connection.PluginMessageEvent;
import com.velocitypowered.api.event.player.ServerConnectedEvent; import com.velocitypowered.api.event.player.ServerConnectedEvent;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.proxy.protocol.ProtocolUtils; import com.velocitypowered.proxy.protocol.ProtocolUtils;
import de.steamwar.linkage.Linked;
import de.steamwar.persistent.Storage; import de.steamwar.persistent.Storage;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.velocitycore.listeners.BasicListener; import de.steamwar.velocitycore.listeners.BasicListener;
@@ -40,6 +41,7 @@ import io.netty.buffer.Unpooled;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@Linked
public class FabricModSender extends BasicListener { public class FabricModSender extends BasicListener {
private final Set<String> neededFabricMods = new HashSet<>(); private final Set<String> neededFabricMods = new HashSet<>();
@@ -24,6 +24,7 @@ import com.velocitypowered.api.event.connection.ConnectionHandshakeEvent;
import com.velocitypowered.proxy.connection.client.InitialInboundConnection; import com.velocitypowered.proxy.connection.client.InitialInboundConnection;
import com.velocitypowered.proxy.connection.client.LoginInboundConnection; import com.velocitypowered.proxy.connection.client.LoginInboundConnection;
import com.velocitypowered.proxy.protocol.packet.HandshakePacket; import com.velocitypowered.proxy.protocol.packet.HandshakePacket;
import de.steamwar.linkage.Linked;
import de.steamwar.persistent.Reflection; import de.steamwar.persistent.Reflection;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.velocitycore.listeners.BasicListener; import de.steamwar.velocitycore.listeners.BasicListener;
@@ -32,6 +33,7 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
import java.util.logging.Level; import java.util.logging.Level;
@Linked
public class Hostname extends BasicListener { public class Hostname extends BasicListener {
private static final Reflection.Field<LoginInboundConnection, InitialInboundConnection> delegate = new Reflection.Field<>(LoginInboundConnection.class, "delegate"); private static final Reflection.Field<LoginInboundConnection, InitialInboundConnection> delegate = new Reflection.Field<>(LoginInboundConnection.class, "delegate");
@@ -22,6 +22,7 @@ package de.steamwar.velocitycore.mods;
import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.player.ServerPostConnectEvent; import com.velocitypowered.api.event.player.ServerPostConnectEvent;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.linkage.Linked;
import de.steamwar.persistent.Bauserver; import de.steamwar.persistent.Bauserver;
import de.steamwar.persistent.Builderserver; import de.steamwar.persistent.Builderserver;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
@@ -32,6 +33,7 @@ import de.steamwar.velocitycore.listeners.PluginMessage;
import java.util.Arrays; import java.util.Arrays;
@Linked
public class ReplayMod extends BasicListener { public class ReplayMod extends BasicListener {
// https://gist.github.com/Johni0702/2547c463e51f65f312cb // https://gist.github.com/Johni0702/2547c463e51f65f312cb
// https://github.com/ReplayMod/replay-restrictions/blob/master/bungeecord/src/main/java/de/johni0702/replay/restrictions/BungeeCordPlugin.java // https://github.com/ReplayMod/replay-restrictions/blob/master/bungeecord/src/main/java/de/johni0702/replay/restrictions/BungeeCordPlugin.java
@@ -22,8 +22,10 @@ package de.steamwar.velocitycore.mods;
import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.connection.PostLoginEvent; import com.velocitypowered.api.event.connection.PostLoginEvent;
import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier; import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.listeners.BasicListener; import de.steamwar.velocitycore.listeners.BasicListener;
@Linked
public class Schematica extends BasicListener { public class Schematica extends BasicListener {
// https://github.com/Lunatrius/SchematicaPlugin/blob/master/src/main/java/com/github/lunatrius/schematica/plugin/SchematicaPlugin.java // https://github.com/Lunatrius/SchematicaPlugin/blob/master/src/main/java/com/github/lunatrius/schematica/plugin/SchematicaPlugin.java
@@ -19,10 +19,12 @@
package de.steamwar.velocitycore.network.handlers; package de.steamwar.velocitycore.network.handlers;
import de.steamwar.linkage.Linked;
import de.steamwar.network.packets.PacketHandler; import de.steamwar.network.packets.PacketHandler;
import de.steamwar.network.packets.client.AnvilAnswerPacket; import de.steamwar.network.packets.client.AnvilAnswerPacket;
import de.steamwar.velocitycore.inventory.SWAnvilInv; import de.steamwar.velocitycore.inventory.SWAnvilInv;
@Linked
public class AnvilAnswerHandler extends PacketHandler { public class AnvilAnswerHandler extends PacketHandler {
@Handler @Handler
@@ -20,6 +20,8 @@
package de.steamwar.velocitycore.network.handlers; package de.steamwar.velocitycore.network.handlers;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.linkage.EventMode;
import de.steamwar.linkage.Linked;
import de.steamwar.messages.Chatter; import de.steamwar.messages.Chatter;
import de.steamwar.network.packets.PacketHandler; import de.steamwar.network.packets.PacketHandler;
import de.steamwar.network.packets.common.FightEndsPacket; import de.steamwar.network.packets.common.FightEndsPacket;
@@ -38,6 +40,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.IntFunction; import java.util.function.IntFunction;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Linked
public class EloPlayerHandler extends PacketHandler { public class EloPlayerHandler extends PacketHandler {
private static final int MEDIAN_ELO_GAIN = 40; private static final int MEDIAN_ELO_GAIN = 40;
@@ -19,6 +19,7 @@
package de.steamwar.velocitycore.network.handlers; package de.steamwar.velocitycore.network.handlers;
import de.steamwar.linkage.Linked;
import de.steamwar.network.packets.PacketHandler; import de.steamwar.network.packets.PacketHandler;
import de.steamwar.network.packets.common.FightEndsPacket; import de.steamwar.network.packets.common.FightEndsPacket;
import de.steamwar.sql.SchemElo; import de.steamwar.sql.SchemElo;
@@ -26,6 +27,7 @@ import de.steamwar.sql.SchematicNode;
import de.steamwar.sql.SchematicType; import de.steamwar.sql.SchematicType;
import de.steamwar.velocitycore.ArenaMode; import de.steamwar.velocitycore.ArenaMode;
@Linked
public class EloSchemHandler extends PacketHandler { public class EloSchemHandler extends PacketHandler {
private static final int K = 20; private static final int K = 20;
@@ -19,11 +19,13 @@
package de.steamwar.velocitycore.network.handlers; package de.steamwar.velocitycore.network.handlers;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.VelocityCore; import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.network.packets.PacketHandler; import de.steamwar.network.packets.PacketHandler;
import de.steamwar.network.packets.client.ExecuteCommandPacket; import de.steamwar.network.packets.client.ExecuteCommandPacket;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
@Linked
public class ExecuteCommandHandler extends PacketHandler { public class ExecuteCommandHandler extends PacketHandler {
@Handler @Handler
@@ -21,6 +21,7 @@ package de.steamwar.velocitycore.network.handlers;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.server.RegisteredServer; import com.velocitypowered.api.proxy.server.RegisteredServer;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.network.NetworkSender; import de.steamwar.velocitycore.network.NetworkSender;
import de.steamwar.velocitycore.network.ServerMetaInfo; import de.steamwar.velocitycore.network.ServerMetaInfo;
import de.steamwar.velocitycore.tablist.TablistManager; import de.steamwar.velocitycore.tablist.TablistManager;
@@ -30,6 +31,7 @@ import de.steamwar.network.packets.common.FightInfoPacket;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
@Linked
public class FightInfoHandler extends PacketHandler { public class FightInfoHandler extends PacketHandler {
private static final Set<RegisteredServer> lobbys = new HashSet<>(); private static final Set<RegisteredServer> lobbys = new HashSet<>();
@@ -19,10 +19,12 @@
package de.steamwar.velocitycore.network.handlers; package de.steamwar.velocitycore.network.handlers;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.network.ServerMetaInfo; import de.steamwar.velocitycore.network.ServerMetaInfo;
import de.steamwar.network.packets.PacketHandler; import de.steamwar.network.packets.PacketHandler;
import de.steamwar.network.packets.client.ImALobbyPacket; import de.steamwar.network.packets.client.ImALobbyPacket;
@Linked
public class ImALobbyHandler extends PacketHandler { public class ImALobbyHandler extends PacketHandler {
@Handler @Handler
@@ -20,6 +20,7 @@
package de.steamwar.velocitycore.network.handlers; package de.steamwar.velocitycore.network.handlers;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.inventory.InvCallback; import de.steamwar.velocitycore.inventory.InvCallback;
import de.steamwar.velocitycore.inventory.SWInventory; import de.steamwar.velocitycore.inventory.SWInventory;
import de.steamwar.velocitycore.network.NetworkSender; import de.steamwar.velocitycore.network.NetworkSender;
@@ -33,6 +34,7 @@ import de.steamwar.sql.SteamwarUser;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@Linked
public class InventoryCallbackHandler extends PacketHandler { public class InventoryCallbackHandler extends PacketHandler {
public static final Map<Integer, SWInventory> inventoryHashMap = new HashMap<>(); public static final Map<Integer, SWInventory> inventoryHashMap = new HashMap<>();
@@ -27,6 +27,7 @@ import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.connection.PostLoginEvent; import com.velocitypowered.api.event.connection.PostLoginEvent;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.util.GameProfile; import com.velocitypowered.api.util.GameProfile;
import de.steamwar.linkage.Linked;
import de.steamwar.network.packets.PacketHandler; import de.steamwar.network.packets.PacketHandler;
import de.steamwar.network.packets.common.PlayerSkinRequestPacket; import de.steamwar.network.packets.common.PlayerSkinRequestPacket;
import de.steamwar.network.packets.common.PlayerSkinResponsePacket; import de.steamwar.network.packets.common.PlayerSkinResponsePacket;
@@ -46,6 +47,7 @@ import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Linked
public class PlayerSkinHandler extends PacketHandler { public class PlayerSkinHandler extends PacketHandler {
private final int maxCacheSize = 1000; private final int maxCacheSize = 1000;
@@ -20,6 +20,7 @@
package de.steamwar.velocitycore.network.handlers; package de.steamwar.velocitycore.network.handlers;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import de.steamwar.linkage.Linked;
import de.steamwar.velocitycore.ArenaMode; import de.steamwar.velocitycore.ArenaMode;
import de.steamwar.velocitycore.ServerStarter; import de.steamwar.velocitycore.ServerStarter;
import de.steamwar.velocitycore.VelocityCore; 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.SchematicType;
import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.SteamwarUser;
@Linked
public class PrepareSchemHandler extends PacketHandler { public class PrepareSchemHandler extends PacketHandler {
@Handler @Handler
@@ -26,6 +26,8 @@ import com.velocitypowered.api.event.player.ServerPostConnectEvent;
import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.network.ProtocolVersion;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.server.RegisteredServer; 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.network.packets.common.FightInfoPacket;
import de.steamwar.persistent.Storage; import de.steamwar.persistent.Storage;
import de.steamwar.persistent.Subserver; import de.steamwar.persistent.Subserver;
@@ -38,7 +40,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
public class TablistManager extends BasicListener { @Linked
public class TablistManager extends BasicListener implements Disable {
private static final Map<RegisteredServer, FightInfoPacket> fightInfos = new HashMap<>(); private static final Map<RegisteredServer, FightInfoPacket> fightInfos = new HashMap<>();