forked from SteamWar/SteamWar
Update VelocityCore to use Linkage
This commit is contained in:
@@ -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<String> broadcasts = VelocityCore.get().getConfig().getBroadcasts();
|
||||
private int lastBroadCast = 0;
|
||||
|
||||
Broadcaster() {
|
||||
public Broadcaster() {
|
||||
if(!broadcasts.isEmpty())
|
||||
VelocityCore.schedule(this::broadcast).repeat(10, TimeUnit.MINUTES).schedule();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<ReloadablePlugin> 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();
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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<SchematicType, SchematicType> fightTypes = 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.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");
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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 <server> [<users>]
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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(){
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<UUID> newPlayers = new HashSet<>();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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<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.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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<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.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<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.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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<RegisteredServer> lobbys = new HashSet<>();
|
||||
|
||||
@@ -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
|
||||
|
||||
+2
@@ -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<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.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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<RegisteredServer, FightInfoPacket> fightInfos = new HashMap<>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user