SteamWar/BungeeCore
Archiviert
13
2

Fix stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2021-10-02 21:24:32 +02:00
Ursprung b24c3d0d6b
Commit 4f7ccf2028
6 geänderte Dateien mit 21 neuen und 33 gelöschten Zeilen

Datei anzeigen

@ -21,8 +21,6 @@ package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker; import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;

Datei anzeigen

@ -19,12 +19,12 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.ArenaMode;
import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.Subserver;
import de.steamwar.bungeecore.SubserverSystem;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.LinkedList; import java.util.LinkedList;

Datei anzeigen

@ -22,7 +22,6 @@ package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
@ -31,16 +30,14 @@ import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.Instant; import java.time.Instant;
import java.util.Date; import java.util.Date;
import java.util.logging.Level;
public class PunishmentCommand { public class PunishmentCommand {
public PunishmentCommand(String command, Punishment.PunishmentType punishmentType) { public PunishmentCommand(String command, Punishment.PunishmentType punishmentType) {
BungeeCord.getInstance().getLogger().log(Level.INFO, "CMD: " + command + " " + punishmentType);
new BasicCommand(command, "bungeecore.ban") { new BasicCommand(command, "bungeecore.ban") {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
if (punishmentType == Punishment.PunishmentType.NoDevServer && !SteamwarUser.get((ProxiedPlayer) sender).getUserGroup().isAdminGroup()) { if (punishmentType.isNeedsAdmin() && !SteamwarUser.get((ProxiedPlayer) sender).getUserGroup().isAdminGroup()) {
return; return;
} }
if (args.length < 3) { if (args.length < 3) {
@ -70,7 +67,7 @@ public class PunishmentCommand {
new BasicCommand(antiCommand, "bungeecore.ban") { new BasicCommand(antiCommand, "bungeecore.ban") {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
if (punishmentType == Punishment.PunishmentType.NoDevServer && !SteamwarUser.get((ProxiedPlayer) sender).getUserGroup().isAdminGroup()) { if (punishmentType.isNeedsAdmin() && !SteamwarUser.get((ProxiedPlayer) sender).getUserGroup().isAdminGroup()) {
return; return;
} }
if (args.length < 1) { if (args.length < 1) {

Datei anzeigen

@ -21,7 +21,6 @@ package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.sql.Elo; import de.steamwar.bungeecore.sql.Elo;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;

Datei anzeigen

@ -27,7 +27,6 @@ import de.steamwar.bungeecore.bot.util.DiscordRanks;
import de.steamwar.bungeecore.commands.ChallengeCommand; import de.steamwar.bungeecore.commands.ChallengeCommand;
import de.steamwar.bungeecore.commands.CheckCommand; import de.steamwar.bungeecore.commands.CheckCommand;
import de.steamwar.bungeecore.commands.MsgCommand; import de.steamwar.bungeecore.commands.MsgCommand;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.UserGroup; import de.steamwar.bungeecore.sql.UserGroup;
import net.md_5.bungee.api.AbstractReconnectHandler; import net.md_5.bungee.api.AbstractReconnectHandler;
@ -35,7 +34,10 @@ import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.*; import net.md_5.bungee.api.event.PlayerDisconnectEvent;
import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.event.ServerDisconnectEvent;
import net.md_5.bungee.api.event.ServerKickEvent;
import net.md_5.bungee.event.EventHandler; import net.md_5.bungee.event.EventHandler;
import java.util.*; import java.util.*;
@ -142,13 +144,4 @@ public class ConnectionListener extends BasicListener {
if(players.isEmpty() || (players.size() == 1 && players.contains(player))) if(players.isEmpty() || (players.size() == 1 && players.contains(player)))
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), subserver::waitForTermination); ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), subserver::waitForTermination);
} }
@EventHandler
public void onServerConnect(ServerConnectEvent e) {
ServerInfo server = e.getTarget();
Subserver subserver = Subserver.getSubserver(server);
if (subserver == null) {
return;
}
}
} }

Datei anzeigen

@ -129,16 +129,17 @@ public class Punishment {
@AllArgsConstructor @AllArgsConstructor
@Getter @Getter
public enum PunishmentType { public enum PunishmentType {
Ban("BAN_TEAM_BANNED", "BANNED_MESSAGE_PERMA", "BANNED_MESSAGE_UNTIL", "UNBAN_NOT_BANNED", "UNBAN_UNBANNED"), Ban(false, "BAN_TEAM_BANNED", "BANNED_MESSAGE_PERMA", "BANNED_MESSAGE_UNTIL", "UNBAN_NOT_BANNED", "UNBAN_UNBANNED"),
Mute( "MUTE_TEAM_MUTED", "MUTED_MESSAGE_PERMA", "MUTED_MESSAGE_UNTIL", "UNMUTE_NOT_MUTED", "UNMUTE_UNMUTED"), Mute( false, "MUTE_TEAM_MUTED", "MUTED_MESSAGE_PERMA", "MUTED_MESSAGE_UNTIL", "UNMUTE_NOT_MUTED", "UNMUTE_UNMUTED"),
NoSchemReceiving("NOSCHEMRECEIVING_TEAM_NOSCHEMRECEIVING", "NOSCHEMRECEIVING_MESSAGE_PERMA", "NOSCHEMRECEIVING_MESSAGE_UNTIL", "UNNOSCHEMRECEIVING_NOT_NOSCHEMRECEIVING", "UNNOSCHEMRECEIVING_UNNOSCHEMRECEIVING"), NoSchemReceiving(false, "NOSCHEMRECEIVING_TEAM_NOSCHEMRECEIVING", "NOSCHEMRECEIVING_MESSAGE_PERMA", "NOSCHEMRECEIVING_MESSAGE_UNTIL", "UNNOSCHEMRECEIVING_NOT_NOSCHEMRECEIVING", "UNNOSCHEMRECEIVING_UNNOSCHEMRECEIVING"),
NoSchemSharing("NOSCHEMSHARING_TEAM_NOSCHEMSHARING", "NOSCHEMSHARING_MESSAGE_PERMA", "NOSCHEMSHARING_MESSAGE_UNTIL", "UNNOSCHEMSHARING_NOT_NOSCHEMSHARING", "UNNOSCHEMSHARING_UNNOSCHEMSHARING"), NoSchemSharing(false, "NOSCHEMSHARING_TEAM_NOSCHEMSHARING", "NOSCHEMSHARING_MESSAGE_PERMA", "NOSCHEMSHARING_MESSAGE_UNTIL", "UNNOSCHEMSHARING_NOT_NOSCHEMSHARING", "UNNOSCHEMSHARING_UNNOSCHEMSHARING"),
NoDevServer("NODEVSERVER_TEAM_NODEVSERVER", "NODEVSERVER_MESSAGE_PERMA", "NODEVSERVER_MESSAGE_UNTIL", "UNNODEVSERVER_NOT_NODEVSERVER", "UNNODEVSERVER_UNNODEVSERVER"); NoDevServer(true, "NODEVSERVER_TEAM_NODEVSERVER", "NODEVSERVER_MESSAGE_PERMA", "NODEVSERVER_MESSAGE_UNTIL", "UNNODEVSERVER_NOT_NODEVSERVER", "UNNODEVSERVER_UNNODEVSERVER");
private String teamMessage; private final boolean needsAdmin;
private String playerMessagePerma; private final String teamMessage;
private String playerMessageUntil; private final String playerMessagePerma;
private String usageNotPunished; private final String playerMessageUntil;
private String unpunishmentMessage; private final String usageNotPunished;
private final String unpunishmentMessage;
} }
} }