SteamWar/BungeeCore
Archiviert
13
2

Add NoFightServer Punishment type
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-03-31 12:38:22 +02:00
Ursprung 3b358a8666
Commit b59189ec48
10 geänderte Dateien mit 62 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -132,6 +132,7 @@ public class BungeeCore extends Plugin {
new PunishmentCommand("noschemsharing", Punishment.PunishmentType.NoSchemSharing); new PunishmentCommand("noschemsharing", Punishment.PunishmentType.NoSchemSharing);
new PunishmentCommand("noschemsubmitting", Punishment.PunishmentType.NoSchemSubmitting); new PunishmentCommand("noschemsubmitting", Punishment.PunishmentType.NoSchemSubmitting);
new PunishmentCommand("nodev", Punishment.PunishmentType.NoDevServer); new PunishmentCommand("nodev", Punishment.PunishmentType.NoDevServer);
new PunishmentCommand("nofight", Punishment.PunishmentType.NoFightServer);
if(!EVENT_MODE){ if(!EVENT_MODE){
new BauCommand(); new BauCommand();

Datei anzeigen

@ -23,6 +23,8 @@ import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.Servertype; import de.steamwar.bungeecore.Servertype;
import de.steamwar.bungeecore.Subserver; import de.steamwar.bungeecore.Subserver;
import de.steamwar.bungeecore.SubserverSystem; import de.steamwar.bungeecore.SubserverSystem;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.config.ServerInfo;
@ -40,6 +42,11 @@ public class ArenaCommand extends BasicCommand {
return; return;
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
SteamwarUser steamwarUser = SteamwarUser.get(player);
if (steamwarUser.isPunishedWithMessage(player, Punishment.PunishmentType.NoFightServer)) {
return;
}
ServerInfo server = ProxyServer.getInstance().getServerInfo(String.join(" ", args)); ServerInfo server = ProxyServer.getInstance().getServerInfo(String.join(" ", args));
if(server == null) { if(server == null) {
Message.send("ARENA_NOT_FOUND", player); Message.send("ARENA_NOT_FOUND", player);

Datei anzeigen

@ -24,6 +24,7 @@ import de.steamwar.bungeecore.comms.packets.BaumemberUpdatePacket;
import de.steamwar.bungeecore.inventory.SWInventory; import de.steamwar.bungeecore.inventory.SWInventory;
import de.steamwar.bungeecore.inventory.SWItem; import de.steamwar.bungeecore.inventory.SWItem;
import de.steamwar.bungeecore.sql.BauweltMember; import de.steamwar.bungeecore.sql.BauweltMember;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;

Datei anzeigen

@ -22,6 +22,8 @@ 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.IgnoreSystem; import de.steamwar.bungeecore.sql.IgnoreSystem;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;
@ -48,6 +50,11 @@ public class ChallengeCommand extends BasicCommand {
if (!(sender instanceof ProxiedPlayer)) if (!(sender instanceof ProxiedPlayer))
return; return;
SteamwarUser steamwarUser = SteamwarUser.get((ProxiedPlayer) sender);
if (steamwarUser.isPunishedWithMessage((ProxiedPlayer) sender, Punishment.PunishmentType.NoFightServer)) {
return;
}
if(ModLoaderBlocker.isFabric((ProxiedPlayer) sender)) { if(ModLoaderBlocker.isFabric((ProxiedPlayer) sender)) {
Message.send("MODLOADER_DENIED", sender); Message.send("MODLOADER_DENIED", sender);
return; return;

Datei anzeigen

@ -21,6 +21,8 @@ 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;
@ -128,6 +130,12 @@ public class FightCommand extends BasicCommand {
return; return;
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
SteamwarUser steamwarUser = SteamwarUser.get(player);
if (steamwarUser.isPunishedWithMessage(player, Punishment.PunishmentType.NoFightServer)) {
return;
}
if(alreadyInArena(player)) if(alreadyInArena(player))
return; return;
@ -163,6 +171,11 @@ public class FightCommand extends BasicCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
SteamwarUser steamwarUser = SteamwarUser.get((ProxiedPlayer) sender);
if (steamwarUser.isPunishedWithMessage((ProxiedPlayer) sender, Punishment.PunishmentType.NoFightServer)) {
return;
}
createArena(sender, "/fight ", args, 0, false, (player, mode, map) -> { createArena(sender, "/fight ", args, 0, false, (player, mode, map) -> {
Subserver arena = new ServerStarter().arena(mode, map).blueLeader(player).start(); Subserver arena = new ServerStarter().arena(mode, map).blueLeader(player).start();
Message.broadcast("FIGHT_BROADCAST", "FIGHT_BROADCAST_HOVER" Message.broadcast("FIGHT_BROADCAST", "FIGHT_BROADCAST_HOVER"

Datei anzeigen

@ -20,8 +20,11 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser;
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;
@ -32,6 +35,11 @@ public class HistoricCommand extends BasicCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
SteamwarUser steamwarUser = SteamwarUser.get((ProxiedPlayer) sender);
if (steamwarUser.isPunishedWithMessage((ProxiedPlayer) sender, Punishment.PunishmentType.NoFightServer)) {
return;
}
FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> { FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> {
Subserver arena = new ServerStarter().arena(mode, map).blueLeader(player).start(); Subserver arena = new ServerStarter().arena(mode, map).blueLeader(player).start();
Message.broadcast("HISTORIC_BROADCAST", "HISTORIC_BROADCAST_HOVER" Message.broadcast("HISTORIC_BROADCAST", "HISTORIC_BROADCAST_HOVER"

Datei anzeigen

@ -24,6 +24,7 @@ import de.steamwar.bungeecore.inventory.SWItem;
import de.steamwar.bungeecore.inventory.SWListInv; import de.steamwar.bungeecore.inventory.SWListInv;
import de.steamwar.bungeecore.inventory.SWStreamInv; import de.steamwar.bungeecore.inventory.SWStreamInv;
import de.steamwar.bungeecore.sql.Fight; import de.steamwar.bungeecore.sql.Fight;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SchematicType; import de.steamwar.bungeecore.sql.SchematicType;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
@ -45,6 +46,11 @@ public class ReplayCommand extends BasicCommand {
return; return;
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
SteamwarUser steamwarUser = SteamwarUser.get(player);
if (steamwarUser.isPunishedWithMessage(player, Punishment.PunishmentType.NoFightServer)) {
return;
}
new SWStreamInv<>(player, Message.parse("REPLAY_TITLE", player), (click, fight) -> { new SWStreamInv<>(player, Message.parse("REPLAY_TITLE", player), (click, fight) -> {
SteamwarUser user = SteamwarUser.get(player.getUniqueId()); SteamwarUser user = SteamwarUser.get(player.getUniqueId());
ArenaMode mode = fight.getGameMode(); ArenaMode mode = fight.getGameMode();

Datei anzeigen

@ -20,10 +20,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.sql.BauweltMember; import de.steamwar.bungeecore.sql.*;
import de.steamwar.bungeecore.sql.Event;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.Team;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.config.ServerInfo;
@ -50,6 +47,7 @@ public class TpCommand extends BasicCommand {
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer)) if(!(sender instanceof ProxiedPlayer))
return; return;
if(!onTp((ProxiedPlayer) sender, args)) if(!onTp((ProxiedPlayer) sender, args))
Message.send("TP_NOT_FOUND", sender); Message.send("TP_NOT_FOUND", sender);
} }
@ -77,6 +75,14 @@ public class TpCommand extends BasicCommand {
//Get target player server //Get target player server
ServerInfo server = getTargetPlayer(args[0]); ServerInfo server = getTargetPlayer(args[0]);
// Check if player is allowed to join fights
if (Subserver.getSubserver(server).getType() == Servertype.ARENA) {
SteamwarUser steamwarUser = SteamwarUser.get(player);
if (steamwarUser.isPunishedWithMessage(player, Punishment.PunishmentType.NoFightServer)) {
return true;
}
}
//Get target team event arena //Get target team event arena
if(server == null){ if(server == null){
Team team = Team.get(args[0]); Team team = Team.get(args[0]);

Datei anzeigen

@ -134,7 +134,9 @@ public class Punishment {
NoSchemReceiving(false, "NOSCHEMRECEIVING_TEAM", "NOSCHEMRECEIVING_PERMA", "NOSCHEMRECEIVING_UNTIL", "UNNOSCHEMRECEIVING_ERROR", "UNNOSCHEMRECEIVING"), NoSchemReceiving(false, "NOSCHEMRECEIVING_TEAM", "NOSCHEMRECEIVING_PERMA", "NOSCHEMRECEIVING_UNTIL", "UNNOSCHEMRECEIVING_ERROR", "UNNOSCHEMRECEIVING"),
NoSchemSharing(false, "NOSCHEMSHARING_TEAM", "NOSCHEMSHARING_PERMA", "NOSCHEMSHARING_UNTIL", "UNNOSCHEMSHARING_ERROR", "UNNOSCHEMSHARING"), NoSchemSharing(false, "NOSCHEMSHARING_TEAM", "NOSCHEMSHARING_PERMA", "NOSCHEMSHARING_UNTIL", "UNNOSCHEMSHARING_ERROR", "UNNOSCHEMSHARING"),
NoSchemSubmitting(true, "NOSCHEMSUBMITTING_TEAM", "NOSCHEMSUBMITTING_PERMA", "NOSCHEMSUBMITTING_UNTIL", "UNNOSCHEMSUBMITTING_ERROR", "UNNOSCHEMSUBMITTING"), NoSchemSubmitting(true, "NOSCHEMSUBMITTING_TEAM", "NOSCHEMSUBMITTING_PERMA", "NOSCHEMSUBMITTING_UNTIL", "UNNOSCHEMSUBMITTING_ERROR", "UNNOSCHEMSUBMITTING"),
NoDevServer(true, "NODEVSERVER_TEAM", "NODEVSERVER_PERMA", "NODEVSERVER_UNTIL", "UNNODEVSERVER_ERROR", "UNNODEVSERVER"); NoDevServer(true, "NODEVSERVER_TEAM", "NODEVSERVER_PERMA", "NODEVSERVER_UNTIL", "UNNODEVSERVER_ERROR", "UNNODEVSERVER"),
NoFightServer(false, "NOFIGHTSERVER_TEAM", "NOFIGHTSERVER_PERMA", "NOFIGHTSERVER_UNTIL", "UNNOFIGHTSERVER_ERROR", "UNNOFIGHTSERVER"),
;
private final boolean needsAdmin; private final boolean needsAdmin;
private final String teamMessage; private final String teamMessage;

Datei anzeigen

@ -154,6 +154,12 @@ NODEVSERVER_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lDevserver §7ausgeschlo
UNNODEVSERVER_ERROR=§cDer Spieler ist nicht vom Devserver ausgeschlossen. UNNODEVSERVER_ERROR=§cDer Spieler ist nicht vom Devserver ausgeschlossen.
UNNODEVSERVER=§e{0} §7darf nun wieder dem §e§lDevserver beitreten§8. UNNODEVSERVER=§e{0} §7darf nun wieder dem §e§lDevserver beitreten§8.
NOFIGHTSERVER_TEAM={0} §e{1} §7wurde von §e{2} {3} §7vom §e§lFighten ausgeschlossen§8. §7Grund§8: §f{4}
NOFIGHTSERVER_PERMA=§7Du bist §epermanent §7vom §e§lFighten §7ausgeschlossen§8. §7Grund§8: §e{0}
NOFIGHTSERVER_UNTIL=§7Du bist §ebis zum {0} §7vom §e§lFighten §7ausgeschlossen§8. §7Grund§8: §e{1}
UNNOFIGHTSERVER_ERROR=§cDer Spieler ist nicht vom Fighten ausgeschlossen.
UNNOFIGHTSERVER=§e{0} §7darf nun wieder §e§lFights beitreten§8.
#BugCommand #BugCommand
BUG_MESSAGE=§7Dein Bugreport wurde gespeichert. BUG_MESSAGE=§7Dein Bugreport wurde gespeichert.