Archiviert
1
0

Merge branch 'master' into schem_aleart

# Conflicts:
#	src/de/steamwar/bungeecore/Message.java
#	src/de/steamwar/messages/BungeeCore.properties
Dieser Commit ist enthalten in:
Chaoscaot 2021-04-14 19:26:19 +02:00
Commit 0ea0cf1b3f
52 geänderte Dateien mit 1301 neuen und 647 gelöschten Zeilen

Datei anzeigen

@ -19,17 +19,18 @@
package de.steamwar.bungeecore; package de.steamwar.bungeecore;
import de.steamwar.bungeecore.sql.SchematicType;
import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.Configuration;
import java.util.*; import java.util.*;
public class ArenaMode { public class ArenaMode {
private static Map<String, ArenaMode> byChat = new HashMap<>(); private static final Map<String, ArenaMode> byChat = new HashMap<>();
private static Map<String, ArenaMode> byInternal = new HashMap<>(); private static final Map<String, ArenaMode> byInternal = new HashMap<>();
private static Map<String, ArenaMode> byCheckSchemType = new HashMap<>(); private static final Map<SchematicType, ArenaMode> bySchemType = new HashMap<>();
private static List<ArenaMode> allModes = new LinkedList<>(); private static final List<ArenaMode> allModes = new LinkedList<>();
private static Random random = new Random(); private static final Random random = new Random();
static void init(Configuration config){ static void init(Configuration config){
for(String internalName : config.getKeys()){ for(String internalName : config.getKeys()){
@ -63,32 +64,39 @@ public class ArenaMode {
return chatNames; return chatNames;
} }
public static ArenaMode getByCheckSchemType(String checkSchemType){ public static ArenaMode getBySchemType(SchematicType schemType){
return byCheckSchemType.get(checkSchemType); return bySchemType.get(schemType);
} }
public static List<ArenaMode> getAllModes(){ public static List<ArenaMode> getAllModes(){
return allModes; return allModes;
} }
private final String internalName;
private final String displayName; private final String displayName;
private final String folder;
private final List<String> chatNames; private final List<String> chatNames;
private final String serverJar; private final String serverJar;
private final String config;
private final List<String> maps; private final List<String> maps;
private final boolean historic; private final boolean historic;
private final boolean ranked; private final boolean ranked;
private final String schemType; private final String schemType;
private ArenaMode(String internalName, Configuration config){ private ArenaMode(String internalName, Configuration config){
this.internalName = internalName; this.folder = config.getString("folder");
this.displayName = config.getString("displayName");
this.serverJar = config.getString("serverJar"); this.serverJar = config.getString("serverJar");
this.chatNames = config.getStringList("chatNames"); this.config = config.getString("config");
this.maps = config.getStringList("maps"); this.maps = config.getStringList("maps");
this.displayName = config.getString("displayName", internalName);
if(config.contains("chatNames"))
this.chatNames = config.getStringList("chatNames");
else
this.chatNames = Collections.emptyList();
this.historic = config.getBoolean("historic", false); this.historic = config.getBoolean("historic", false);
this.schemType = config.getString("schemType", "").toLowerCase();
this.ranked = config.getBoolean("ranked", false); this.ranked = config.getBoolean("ranked", false);
this.schemType = config.getString("schemType", null);
allModes.add(this); allModes.add(this);
byInternal.put(internalName, this); byInternal.put(internalName, this);
@ -96,12 +104,8 @@ public class ArenaMode {
byChat.put(name.toLowerCase(), this); byChat.put(name.toLowerCase(), this);
} }
if(config.contains("checkSchemType")) if(!this.schemType.equals(""))
byCheckSchemType.put(config.getString("checkSchemType").toLowerCase(), this); bySchemType.put(SchematicType.fromDB(this.schemType), this);
}
public String getInternalName() {
return internalName;
} }
public String getDisplayName() { public String getDisplayName() {
@ -112,6 +116,10 @@ public class ArenaMode {
return serverJar; return serverJar;
} }
public String getConfig(){
return config;
}
public String hasMap(String map){ public String hasMap(String map){
for(String m : maps){ for(String m : maps){
if(m.equalsIgnoreCase(map)) if(m.equalsIgnoreCase(map))
@ -120,6 +128,10 @@ public class ArenaMode {
return null; return null;
} }
public String getFolder() {
return folder;
}
public String getRandomMap(){ public String getRandomMap(){
return maps.get(random.nextInt(maps.size())); return maps.get(random.nextInt(maps.size()));
} }
@ -132,8 +144,8 @@ public class ArenaMode {
return chatNames.get(0); return chatNames.get(0);
} }
public boolean hasChatName(){ public boolean withoutChatName(){
return !chatNames.isEmpty(); return chatNames.isEmpty();
} }
public boolean isHistoric(){ public boolean isHistoric(){

Datei anzeigen

@ -53,8 +53,6 @@ import java.util.logging.Level;
public class BungeeCore extends Plugin { public class BungeeCore extends Plugin {
public static final String SERVER_TEAMCHAT_PREFIX = "§8STC §e";
public static final String TEAMCHAT_PREFIX = "§8TC §e";
public static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("dd.MM.yyyy"); public static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("dd.MM.yyyy");
public static String CHAT_PREFIX; public static String CHAT_PREFIX;
@ -72,7 +70,6 @@ public class BungeeCore extends Plugin {
@Override @Override
public void onEnable(){ public void onEnable(){
getProxy().registerChannel("sw:bridge"); getProxy().registerChannel("sw:bridge");
setInstance(this); setInstance(this);
@ -122,6 +119,7 @@ public class BungeeCore extends Plugin {
new IgnoreCommand(); new IgnoreCommand();
new UnIgnoreCommand(); new UnIgnoreCommand();
new PollresultCommand(); new PollresultCommand();
new ResourcereloadCommand();
if(!EVENT_MODE){ if(!EVENT_MODE){
new WebregisterCommand(); new WebregisterCommand();
@ -265,6 +263,9 @@ public class BungeeCore extends Plugin {
serverPermissions.get(serverName), serverPermissions.get(serverName),
cmds.toArray(new String[0]) cmds.toArray(new String[0])
); );
if(server.getBoolean("modchecked", false)) {
ModLoaderBlocker.addServer(serverName);
}
} }
} }

Datei anzeigen

@ -71,7 +71,7 @@ public class ErrorLogger extends Handler implements Filter {
@Override @Override
public void publish(LogRecord record) { public void publish(LogRecord record) {
if(record.getLevel() != Level.SEVERE) if(record.getLevel() != Level.SEVERE && record.getLevel() != Level.WARNING)
return; return;
StringBuilder stacktrace = new StringBuilder(record.getSourceClassName() + "\n" + record.getSourceMethodName()); StringBuilder stacktrace = new StringBuilder(record.getSourceClassName() + "\n" + record.getSourceMethodName());
@ -88,7 +88,12 @@ public class ErrorLogger extends Handler implements Filter {
String stacktraceString = stacktrace.toString(); String stacktraceString = stacktrace.toString();
String message = MessageFormat.format(record.getMessage(), record.getParameters()); String message = MessageFormat.format(record.getMessage(), record.getParameters());
if(message.contains("ServerConnector") || message.contains("InitialHandler") || message.contains("DownstreamBridge")) if(message.contains("ServerConnector")
|| message.contains("InitialHandler")
|| message.contains("UpstreamBridge")
|| message.contains("DownstreamBridge")
|| message.contains(" took ")
|| message.contains("No client connected for pending server!"))
return; return;
SWException.log("Bungee", message, stacktraceString); SWException.log("Bungee", message, stacktraceString);

Datei anzeigen

@ -73,9 +73,8 @@ public class EventStarter implements Runnable {
eventServer.put(blue.getTeamId(), subserver); eventServer.put(blue.getTeamId(), subserver);
eventServer.put(red.getTeamId(), subserver); eventServer.put(red.getTeamId(), subserver);
BungeeCore.broadcast(BungeeCore.CHAT_PREFIX + "§7Hier §eklicken §7für den Kampf §" + blue.getTeamColor() + blue.getTeamName() + " §8vs §" + red.getTeamColor() + red.getTeamName(), Message.broadcast("EVENT_FIGHT_BROADCAST", "EVENT_FIGHT_BROADCAST_HOVER",
"§eEvent beitreten", new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/event " + blue.getTeamKuerzel()), blue.getTeamColor(), blue.getTeamName(), red.getTeamColor(), red.getTeamName());
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/event " + blue.getTeamKuerzel()));
} }
} }

Datei anzeigen

@ -33,7 +33,13 @@ import java.util.Locale;
import java.util.ResourceBundle; import java.util.ResourceBundle;
public class Message { public class Message {
private Message(){}
private static final ResourceBundle.Control CONTROL = new ResourceBundle.Control() {
@Override
public long getTimeToLive(String arg0, Locale arg1) {
return 60000; //Cache only 1 minute
}
};
public static TextComponent parseToComponent(String message, boolean prefixed, CommandSender sender, Object... params){ public static TextComponent parseToComponent(String message, boolean prefixed, CommandSender sender, Object... params){
return new TextComponent(TextComponent.fromLegacyText(parse(message, prefixed, sender, params))); return new TextComponent(TextComponent.fromLegacyText(parse(message, prefixed, sender, params)));
@ -54,13 +60,20 @@ public class Message {
if(locale == null) if(locale == null)
locale = Locale.getDefault(); locale = Locale.getDefault();
ResourceBundle resourceBundle = ResourceBundle.getBundle("de.steamwar.messages.BungeeCore", locale); ResourceBundle resourceBundle = ResourceBundle.getBundle("de.steamwar.messages.BungeeCore", locale, CONTROL);
String pattern = ""; String pattern = "";
if(prefixed) if(prefixed)
pattern = resourceBundle.getObject("PREFIX") + " "; pattern = resourceBundle.getObject("PREFIX") + " ";
pattern += (String)resourceBundle.getObject(message); pattern += (String)resourceBundle.getObject(message);
return new MessageFormat(pattern, locale).format(params); MessageFormat format = new MessageFormat(pattern, locale);
for (int i = 0; i < params.length; i++) {
if(params[i] instanceof Message) {
Message msg = (Message) params[i];
params[i] = parse(msg.getMessage(), sender, msg.getParams());
}
}
return format.format(params);
} }
public static void send(String message, CommandSender sender, Object... params){ public static void send(String message, CommandSender sender, Object... params){
@ -103,7 +116,7 @@ public class Message {
public static void broadcast(String message, String onHover, ClickEvent onClick, Object... params){ public static void broadcast(String message, String onHover, ClickEvent onClick, Object... params){
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()) for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers())
send(message, player, parse(onHover, false, player), onClick, params); send(message, player, parse(onHover, false, player, params), onClick, params);
} }
public static void broadcast(String message, Object... params){ public static void broadcast(String message, Object... params){
@ -125,10 +138,11 @@ public class Message {
public static void team(String message, ChatMessageType type, Object... params){ public static void team(String message, ChatMessageType type, Object... params){
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){ for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){
if(player.getGroups().contains(ConnectionListener.TEAM_GROUP)) if(player.getGroups().contains(ConnectionListener.TEAM_GROUP)) {
sendPrefixless(message, player, type, params); sendPrefixless(message, player, type, params);
} }
} }
}
public static void team(String message, String onHover, ClickEvent onClick, Object... params){ public static void team(String message, String onHover, ClickEvent onClick, Object... params){
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){ for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){
@ -136,4 +150,20 @@ public class Message {
sendPrefixless(message, player, Message.parse(onHover, player, params), onClick, params); sendPrefixless(message, player, Message.parse(onHover, player, params), onClick, params);
} }
} }
private final String message;
private final Object[] params;
public Message(String message, Object... params) {
this.message = message;
this.params = params;
}
public String getMessage() {
return message;
}
public Object[] getParams() {
return params;
}
} }

Datei anzeigen

@ -19,7 +19,6 @@
package de.steamwar.bungeecore; package de.steamwar.bungeecore;
import de.steamwar.bungeecore.commands.EventCommand;
import de.steamwar.bungeecore.sql.EventFight; import de.steamwar.bungeecore.sql.EventFight;
import de.steamwar.bungeecore.sql.IgnoreSystem; import de.steamwar.bungeecore.sql.IgnoreSystem;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
@ -29,6 +28,7 @@ import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
public class SubserverSystem { public class SubserverSystem {
@ -87,7 +87,7 @@ public class SubserverSystem {
* @return * @return
* The new started subserver. * The new started subserver.
*/ */
public static Subserver startArena(ArenaMode modus, String map, int eventFightID, int checkSchemID, String serverName, String mapName, UUID player1, UUID player2, boolean ranked){ public static Subserver startArena(ArenaMode modus, String map, int eventFightID, int checkSchemID, int prepareSchemID, String serverName, String mapName, UUID player1, UUID player2, boolean ranked){
//Generate missing parameters //Generate missing parameters
int port = freePort(firstArenaPort); int port = freePort(firstArenaPort);
@ -108,7 +108,7 @@ public class SubserverSystem {
//Copy world //Copy world
try { try {
new ProcessBuilder("cp", "-r", SERVER_PATH + modus.getInternalName() + "/" + map, worldDir + mapName).start().waitFor(); new ProcessBuilder("cp", "-r", SERVER_PATH + modus.getFolder() + "/arenas/" + map, worldDir + mapName).start().waitFor();
} catch (IOException | InterruptedException e) { } catch (IOException | InterruptedException e) {
throw new SecurityException("Could not copy folder", e); throw new SecurityException("Could not copy folder", e);
} }
@ -120,15 +120,17 @@ public class SubserverSystem {
port, port,
"2G", "2G",
"logPath=" + mapName, "logPath=" + mapName,
"config="+modus.getConfig(),
"fightID=" + eventFightID, "fightID=" + eventFightID,
"ranked=" + ranked, "ranked=" + ranked,
"checkSchemID=" + checkSchemID, "checkSchemID=" + checkSchemID,
"prepareSchemID=" + prepareSchemID,
player1 != null && eventFightID != -1 ? "blueLeader=" + player1.toString() : null, player1 != null && eventFightID != -1 ? "blueLeader=" + player1.toString() : null,
player2 != null ? "redLeader=" + player2.toString() : null); player2 != null ? "redLeader=" + player2.toString() : null);
//Start server //Start server
ProcessBuilder process = new ProcessBuilder(cmd); ProcessBuilder process = new ProcessBuilder(cmd);
process.directory(new File(SERVER_PATH, modus.getInternalName())); process.directory(new File(SERVER_PATH, modus.getFolder()));
String finalMapName = mapName; String finalMapName = mapName;
if(eventFightID == -1) if(eventFightID == -1)
@ -152,24 +154,22 @@ public class SubserverSystem {
}); });
} }
public static Subserver startArena(ArenaMode modus, String map, int eventFightID, int checkSchemID, String serverName, String mapName, UUID player1, UUID player2){
return startArena(modus, map, eventFightID, checkSchemID, serverName, mapName, player1, player2, false);
}
public static Subserver startEventArena(EventFight eventFight, String serverName){ public static Subserver startEventArena(EventFight eventFight, String serverName){
return startArena( return startArena(
eventFight.getSpielmodus(), eventFight.getSpielmodus(),
eventFight.getMap(), eventFight.getMap(),
eventFight.getFightID(), eventFight.getFightID(),
0, 0,
0,
serverName, serverName,
serverName.replace(' ', '_') + eventFight.getStartTime().toLocalDateTime().format(EventCommand.TIME_FORMAT), serverName.replace(' ', '_') + eventFight.getStartTime().toLocalDateTime().format(DateTimeFormatter.ISO_TIME),
null, null,
null); null,
false);
} }
public static void startTestServer(ProxiedPlayer p, ArenaMode m, String map, int checkSchemId){ public static void startTestServer(ProxiedPlayer p, ArenaMode m, String map, int checkSchemId, int prepareSchemId){
startArena(m, map, -1, checkSchemId, p.getName() + "s Bau", p.getName(), p.getUniqueId(), null).sendPlayer(p); startArena(m, map, -1, checkSchemId, prepareSchemId, p.getName() + "s Bau", p.getName(), p.getUniqueId(), null, false).sendPlayer(p);
} }
public static void sendToBauServer(ProxiedPlayer p, UUID owner){ public static void sendToBauServer(ProxiedPlayer p, UUID owner){
@ -223,13 +223,12 @@ public class SubserverSystem {
if(o == null) if(o == null)
return; return;
if(IgnoreSystem.isIgnored(o, p)){ if(IgnoreSystem.isIgnored(o, p)){
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler hat dich geblockt!"); Message.send("SERVER_IGNORED", p);
return; return;
} }
BungeeCore.send(o, BungeeCore.CHAT_PREFIX + "§e" + p.getName() + " §7möchte auf deine Bauwelt."); Message.send("SERVER_ADD_MEMBER", o, p.getName());
BungeeCore.send(o, "§7Klicke §ehier§7, wenn du das erlauben möchtest.", Message.sendPrefixless("SERVER_ADD_MESSAGE", o, Message.parse("SERVER_ADD_MESSAGE_HOVER", o, p.getName()),
"§e/bau addmember " + p.getName(),
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/bau addmember " + p.getName())); new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/bau addmember " + p.getName()));
} }
@ -281,11 +280,11 @@ public class SubserverSystem {
pr = pb.start(); pr = pb.start();
pr.waitFor(); pr.waitFor();
} catch (IOException e) { } catch (IOException e) {
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDas Erstellen der Welt ist fehlgeschlagen."); Message.send("SERVER_WORLD_ERROR", p);
throw new SecurityException("Could not create Bauwelt", e); throw new SecurityException("Could not create Bauwelt", e);
} catch (InterruptedException e){ } catch (InterruptedException e){
BungeeCore.log("Could not create Bauwelt", e); BungeeCore.log("Could not create Bauwelt", e);
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDas Erstellen der Welt ist fehlgeschlagen."); Message.send("SERVER_WORLD_ERROR", p);
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} }
} }

Datei anzeigen

@ -54,9 +54,10 @@ public class BanCommand extends BasicCommand {
for (int i = 2; i < args.length; i++){ for (int i = 2; i < args.length; i++){
banReason.append(args[i]).append(" "); banReason.append(args[i]).append(" ");
} }
boolean isPerma = args[1].equalsIgnoreCase("perma");
String msg = banReason.toString(); String msg = banReason.toString();
Message.send("BAN_MESSAGE_YOU", sender, target.getUserName(), msg); target.ban(banTime, msg, SteamwarUser.get(sender.getName()).getId(), isPerma);
target.ban(banTime, msg); Message.team("BAN_TEAM_BANNED", new Message("PREFIX"), target.getUserName(), sender.getName(), new Message((isPerma?"BAN_PERMA":"BAN_UNTIL"), banTime), msg);
} }
public static Timestamp parseTime(CommandSender sender, String arg){ public static Timestamp parseTime(CommandSender sender, String arg){

Datei anzeigen

@ -34,8 +34,6 @@ public class BauCommand {
private BauCommand(){} private BauCommand(){}
private static final String UNKNOWN_PLAYER = BungeeCore.CHAT_PREFIX + "§cUnbekannter Spieler";
public static void onBau(ChatEvent e, String[] command){ public static void onBau(ChatEvent e, String[] command){
if(BungeeCore.EVENT_MODE) if(BungeeCore.EVENT_MODE)
return; return;
@ -79,11 +77,10 @@ public class BauCommand {
case "teleport": case "teleport":
teleport(p, command); teleport(p, command);
break; break;
case "togglebuild": case "info":
if(ownBau && command.length > 2) if (bau != null) {
e.setCancelled(false); e.setCancelled(false);
else }
togglebuild(p, command);
break; break;
case "togglewe": case "togglewe":
if(ownBau && command.length > 2) if(ownBau && command.length > 2)
@ -115,43 +112,43 @@ public class BauCommand {
private static void addmember(ProxiedPlayer p, String[] command){ private static void addmember(ProxiedPlayer p, String[] command){
if (command.length == 2) { if (command.length == 2) {
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "/bau addmember <Spieler>"); Message.send("BAU_ADDMEMBER_USAGE", p);
return; return;
} }
SteamwarUser target = SteamwarUser.get(command[2]); SteamwarUser target = SteamwarUser.get(command[2]);
if (target == null) { if (target == null) {
BungeeCore.send(p, UNKNOWN_PLAYER); Message.send("UNKNOWN_PLAYER", p);
return; return;
}else if(target.getUuid().equals(p.getUniqueId())) { }else if(target.getUuid().equals(p.getUniqueId())) {
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu brauchst dich nicht selbst hinzufügen!"); Message.send("BAU_ADDMEMBER_SELFADD", p);
return; return;
}else if (BauweltMember.getBauMember(p.getUniqueId(), target.getUuid()) != null) { }else if (BauweltMember.getBauMember(p.getUniqueId(), target.getUuid()) != null) {
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist bereits Mitglied auf deiner Welt"); Message.send("BAU_ADDMEMBER_ISADDED", p);
return; return;
} }
new BauweltMember(p.getUniqueId(), target.getUuid(), true, false, false); new BauweltMember(p.getUniqueId(), target.getUuid(), true, false);
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§aDer Spieler wurde zu deiner Welt hinzugefügt"); Message.send("BAU_ADDMEMBER_ADDED", p);
ProxiedPlayer z = ProxyServer.getInstance().getPlayer(target.getUuid()); ProxiedPlayer z = ProxyServer.getInstance().getPlayer(target.getUuid());
if(z != null) if(z != null)
BungeeCore.send(z, BungeeCore.CHAT_PREFIX + "§aDu wurdest zu der Welt von §6" + p.getName() + " §ahinzugefügt"); Message.send("BAU_ADDMEMBER_ADDED_TARGET", z, p.getName());
} }
private static void teleport(ProxiedPlayer p, String[] command){ private static void teleport(ProxiedPlayer p, String[] command){
if (command.length == 2) { if (command.length == 2) {
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "/bau tp <Spieler>"); Message.send("BAU_TP_USAGE", p);
return; return;
} }
SteamwarUser worldOwner = SteamwarUser.get(command[2]); SteamwarUser worldOwner = SteamwarUser.get(command[2]);
if (worldOwner == null) { if (worldOwner == null) {
BungeeCore.send(p, UNKNOWN_PLAYER); Message.send("UNKNOWN_PLAYER", p);
return; return;
}else if (!p.getUniqueId().equals(worldOwner.getUuid()) && BauweltMember.getBauMember(worldOwner.getUuid(), p.getUniqueId()) == null){ }else if (!p.getUniqueId().equals(worldOwner.getUuid()) && BauweltMember.getBauMember(worldOwner.getUuid(), p.getUniqueId()) == null){
SubserverSystem.sendDeniedMessage(p, worldOwner.getUuid()); SubserverSystem.sendDeniedMessage(p, worldOwner.getUuid());
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu darfst dich nicht auf diese Welt teleportieren"); Message.send("BAU_TP_NOALLOWED", p);
return; return;
} }
@ -185,15 +182,6 @@ public class BauCommand {
} }
} }
private static void togglebuild(ProxiedPlayer p, String[] command){
BauweltMember target = toggle(p, command, "togglebuild");
if(target == null)
return;
target.setBuild(!target.isBuild());
isAllowedTo(target.isBuild(), p, target, "bauen");
}
private static void togglewe(ProxiedPlayer p, String[] command){ private static void togglewe(ProxiedPlayer p, String[] command){
BauweltMember target = toggle(p, command, "togglewe"); BauweltMember target = toggle(p, command, "togglewe");
if(target == null) if(target == null)
@ -214,7 +202,7 @@ public class BauCommand {
private static void delmember(ProxiedPlayer p, String[] command){ private static void delmember(ProxiedPlayer p, String[] command){
if (command.length == 2) { if (command.length == 2) {
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "/bau delmember <Spieler>"); Message.send("BAU_DELMEMBER_USAGE", p);
return; return;
} }
@ -223,19 +211,19 @@ public class BauCommand {
return; return;
if(SteamwarUser.get(target.getMemberID()).getUuid().equals(p.getUniqueId())) { if(SteamwarUser.get(target.getMemberID()).getUuid().equals(p.getUniqueId())) {
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu kannst dich nicht selbst entfernen!"); Message.send("BAU_DELMEMBER_SELFDEL", p);
return; return;
} }
target.remove(); target.remove();
ProxiedPlayer z = ProxyServer.getInstance().getPlayer(SteamwarUser.get(target.getMemberID()).getUuid()); ProxiedPlayer z = ProxyServer.getInstance().getPlayer(SteamwarUser.get(target.getMemberID()).getUuid());
if(z != null){ if(z != null){
BungeeCore.send(z, BungeeCore.CHAT_PREFIX + "§cDu wurdest von der Welt von §6" + p.getName() + " §centfernt."); Message.send("BAU_DELMEMBER_DELETED_TARGET", z, p.getName());
Subserver server = Subserver.getSubserver(z); Subserver server = Subserver.getSubserver(z);
if(server != null && server.getType() == Servertype.BAUSERVER && ((Bauserver)server).getOwner().equals(p.getUniqueId())) if(server != null && server.getType() == Servertype.BAUSERVER && ((Bauserver)server).getOwner().equals(p.getUniqueId()))
z.connect(ProxyServer.getInstance().getServerInfo(BungeeCore.LOBBY_SERVER)); z.connect(ProxyServer.getInstance().getServerInfo(BungeeCore.LOBBY_SERVER));
} }
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDer Spieler wurde entfernt."); Message.send("BAU_DELMEMBER_DELETED", p);
} }
private static void delete(ProxiedPlayer p, String[] command){ private static void delete(ProxiedPlayer p, String[] command){
@ -255,7 +243,7 @@ public class BauCommand {
} }
private static void deleteWorld(ProxiedPlayer player, String world) { private static void deleteWorld(ProxiedPlayer player, String world) {
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§aDeine Welt wird zurückgesetzt."); Message.send("BAU_DELETE_DELETED", player);
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> { ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
for (Subserver subserver : Subserver.getServerList()) { for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(player.getUniqueId())) { if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(player.getUniqueId())) {
@ -268,12 +256,11 @@ public class BauCommand {
}); });
} }
private static void testarena(ProxiedPlayer p, String[] command){ public static void stopBauserver(ProxiedPlayer p){
FightCommand.createArena(p, "/bau testarena ", command, 2, false, (player, mode, map) -> ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
for (Subserver subserver : Subserver.getServerList()) { for (Subserver subserver : Subserver.getServerList()) {
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) { if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(p.getUniqueId())) {
if(subserver.getServer().getPlayers().isEmpty()){ if(subserver.getServer().getPlayers().isEmpty()){
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDer Server startet bereits."); Message.send("BAU_START_ALREADY", p);
return; return;
} }
subserver.stop(); subserver.stop();
@ -285,19 +272,24 @@ public class BauCommand {
break; break;
} }
} }
SubserverSystem.startTestServer(p, mode, map, 0); }
private static void testarena(ProxiedPlayer p, String[] command){
FightCommand.createArena(p, "/bau testarena ", command, 2, false, (player, mode, map) -> ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
stopBauserver(p);
SubserverSystem.startTestServer(p, mode, map, 0, 0);
})); }));
} }
private static BauweltMember member(ProxiedPlayer p, SteamwarUser member){ private static BauweltMember member(ProxiedPlayer p, SteamwarUser member){
if (member == null) { if (member == null) {
BungeeCore.send(p, UNKNOWN_PLAYER); Message.send("UNKNOWN_PLAYER", p);
return null; return null;
} }
BauweltMember target = BauweltMember.getBauMember(p.getUniqueId(), member.getUuid()); BauweltMember target = BauweltMember.getBauMember(p.getUniqueId(), member.getUuid());
if (target == null) { if (target == null) {
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDer Spieler ist kein Mitglied deiner Welt!"); Message.send("BAU_MEMBER_NOMEMBER", p);
return null; return null;
} }
return target; return target;
@ -305,7 +297,7 @@ public class BauCommand {
private static BauweltMember toggle(ProxiedPlayer p, String[] command, String subcommand){ private static BauweltMember toggle(ProxiedPlayer p, String[] command, String subcommand){
if (command.length == 2) { if (command.length == 2) {
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "/bau " + subcommand + " <Spieler>"); Message.send("BAU_MEMBER_TOGGLE_USAGE", p, subcommand);
return null; return null;
} }
@ -318,12 +310,12 @@ public class BauCommand {
if(permission){ if(permission){
if(player != null) if(player != null)
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§aDu kannst nun auf der Welt von §e" + p.getName() + "§a " + what); Message.send("BAU_MEMBER_TOGGLE_TARGET", player, p.getName(), what);
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§aDer Spieler darf nun " + what); Message.send("BAU_MEMBER_TOGGLE", p, what);
}else{ }else{
if(player != null) if(player != null)
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu kannst nun nicht mehr auf der Welt von §e" + p.getName() + "§c " + what); Message.send("BAU_MEMBER_TOGGLE_TARGET_OFF", player, p.getName(), what);
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDer Spieler darf nun nicht mehr " + what); Message.send("BAU_MEMBER_TOGGLE_OFF", p, what);
} }
} }

Datei anzeigen

@ -40,7 +40,7 @@ public class ChallengeCommand extends BasicCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
if(args.length < 1){ if(args.length < 1){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§echallenge §8[§7Spieler§8]"); Message.send("CHALLENGE_USAGE", sender);
return; return;
} }
@ -48,25 +48,25 @@ public class ChallengeCommand extends BasicCommand {
return; return;
if(ModLoaderBlocker.isFabric((ProxiedPlayer) sender)) { if(ModLoaderBlocker.isFabric((ProxiedPlayer) sender)) {
BungeeCore.send((ProxiedPlayer) sender, BungeeCore.CHAT_PREFIX + "§cHabe ich dir nicht gesagt, dass man mit Fabric/LiteLoader nicht auf die Arenen darf?"); Message.send("MODLOADER_DENIED", sender);
return; return;
} }
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]); ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
if(target == null){ if(target == null){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDer Herausgeforderte ist nicht online."); Message.send("CHALLENGE_OFFLINE", sender);
return; return;
}else if(target == sender){ }else if(target == sender){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cSchizophren?"); Message.send("CHALLENGE_SELF", sender);
return; return;
}else if (IgnoreSystem.isIgnored(target, (ProxiedPlayer) sender)) { }else if (IgnoreSystem.isIgnored(target, (ProxiedPlayer) sender)) {
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDer Herausgeforderte hat dich geblockt."); Message.send("CHALLENGE_IGNORED", sender);
return; return;
} }
Subserver subserver = Subserver.getSubserver(target); Subserver subserver = Subserver.getSubserver(target);
if(subserver != null && subserver.getType() == Servertype.ARENA){ if(subserver != null && subserver.getType() == Servertype.ARENA){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDer Herausgeforderte ist bereits in einer Arena."); Message.send("CHALLENGE_INARENA", sender);
return; return;
} }
@ -75,14 +75,13 @@ public class ChallengeCommand extends BasicCommand {
challenges.remove(target); challenges.remove(target);
challenges.remove(player); challenges.remove(player);
Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), target.getUniqueId()); Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, null, null, player.getUniqueId(), target.getUniqueId(), false);
arena.sendPlayer(player); arena.sendPlayer(player);
arena.sendPlayer(target); arena.sendPlayer(target);
BungeeCore.broadcast(BungeeCore.CHAT_PREFIX + "§e" + mode.getDisplayName() + "§7-§eDuell§7: " + player.getName() + " vs " + target.getName(), Message.broadcast("CHALLENGE_BROADCAST", "CHALLENGE_BROADCAST_HOVER",
"§aZuschauen", new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName(), target.getName());
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()));
}else{ }else{
if(!challenges.containsKey(player)){ if(!challenges.containsKey(player)){
challenges.put(player, new LinkedList<>()); challenges.put(player, new LinkedList<>());
@ -90,13 +89,10 @@ public class ChallengeCommand extends BasicCommand {
challenges.get(player).add(target); challenges.get(player).add(target);
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Du hast §e" + target.getName() + " §7zu einem §e" + mode.getDisplayName() + "-Kampf §7herausgefordert!"); Message.send("CHALLENGE_CHALLENGED", player, target.getName(), mode.getDisplayName());
BungeeCore.send(target, BungeeCore.CHAT_PREFIX + "§e" + player.getName() + " §7 hat dich zu einem §e" + mode.getDisplayName() + Message.send("CHALLENGE_CHALLENGED_TARGET", target, player.getName(), mode.getDisplayName(), mode.getMaps().size()!=1?Message.parse("CHALLENGE_CHALLENGED_MAP", target, map):"");
"-Kampf §7" + (mode.getMaps().size()!=1?"auf §e" + map + " §7 ":"") + "herausgefordert!");
BungeeCore.send(target, BungeeCore.CHAT_PREFIX + "§7Klicke §ehier§7, um die Herausforderung anzunehmen", Message.send("CHALLENGE_ACCEPT", target, Message.parse("CHALLENGE_ACCEPT_HOVER", target), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/challenge " + player.getName() + " " + mode.getChatName() + " " + map));
"§aHerausforderung annehmen",
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/challenge " + player.getName() + " " + mode.getChatName() + " " + map));
} }
}); });
} }

Datei anzeigen

@ -228,15 +228,10 @@ public class CheckCommand extends BasicCommand {
this.checkList = checkQuestions.get(schematic.getSchemType()).listIterator(); this.checkList = checkQuestions.get(schematic.getSchemType()).listIterator();
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> { ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
for (Subserver subserver : Subserver.getServerList()) { BauCommand.stopBauserver(checker);
if (subserver.getType() == Servertype.BAUSERVER && ((Bauserver) subserver).getOwner().equals(checker.getUniqueId())) {
subserver.stop();
break;
}
}
ArenaMode mode = ArenaMode.getByCheckSchemType(schematic.getSchemType().toDB()); ArenaMode mode = ArenaMode.getBySchemType(schematic.getSchemType().fightType());
SubserverSystem.startTestServer(checker, mode, FightCommand.getMap(checker, mode, "Random"), schematic.getSchemID()); SubserverSystem.startTestServer(checker, mode, FightCommand.getMap(checker, mode, "Random"), schematic.getSchemID(), 0);
currentCheckers.put(checker.getUniqueId(), this); currentCheckers.put(checker.getUniqueId(), this);
currentSchems.put(schematic.getSchemID(), this); currentSchems.put(schematic.getSchemID(), this);
for(CheckedSchematic previous : CheckedSchematic.previousChecks(schematic.getSchemName(), schematic.getSchemOwner())) for(CheckedSchematic previous : CheckedSchematic.previousChecks(schematic.getSchemName(), schematic.getSchemOwner()))

Datei anzeigen

@ -21,6 +21,7 @@ package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.EventStarter; import de.steamwar.bungeecore.EventStarter;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.Subserver; import de.steamwar.bungeecore.Subserver;
import de.steamwar.bungeecore.sql.Event; import de.steamwar.bungeecore.sql.Event;
import de.steamwar.bungeecore.sql.EventFight; import de.steamwar.bungeecore.sql.EventFight;
@ -37,9 +38,6 @@ import java.util.Set;
public class EventCommand extends BasicCommand { public class EventCommand extends BasicCommand {
public static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ofPattern("HH:mm");
static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("dd.MM.");
public EventCommand() { public EventCommand() {
super("event", ""); super("event", "");
} }
@ -64,13 +62,13 @@ public class EventCommand extends BasicCommand {
Team team = Team.get(args[0]); Team team = Team.get(args[0]);
if(team == null){ if(team == null){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieses Team gibt es nicht"); Message.send("EVENT_NO_TEAM", player);
return; return;
} }
Subserver eventArena = EventStarter.getEventServer().get(team.getTeamId()); Subserver eventArena = EventStarter.getEventServer().get(team.getTeamId());
if(eventArena == null || !Subserver.getServerList().contains(eventArena)){ if(eventArena == null || !Subserver.getServerList().contains(eventArena)){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDas Team kämpft derzeit nicht"); Message.send("EVENT_NO_FIGHT_TEAM", player);
return; return;
} }
@ -78,57 +76,54 @@ public class EventCommand extends BasicCommand {
} }
private void noCurrentEvent(ProxiedPlayer player){ private void noCurrentEvent(ProxiedPlayer player){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDerzeit findet kein Event statt"); Message.send("EVENT_NO_CURRENT", player);
List<Event> coming = Event.getComing(); List<Event> coming = Event.getComing();
Instant now = Instant.now();
if(!coming.isEmpty()){ if(!coming.isEmpty()){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§eKommende Events§8:"); DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern(Message.parse("EVENT_DATE_FORMAT", player));
Message.send("EVENT_COMING", player);
for(Event e : coming){ for(Event e : coming){
BungeeCore.send(player, "§7" + Message.send("EVENT_COMING_EVENT", player, e.getStart().toLocalDateTime().format(dateFormat), e.getEnd().toLocalDateTime().format(dateFormat), e.getEventName());
e.getStart().toLocalDateTime().format(DATE_FORMAT) +
"§8-§7" +
e.getEnd().toLocalDateTime().format(DATE_FORMAT) +
"§8: §e" +
e.getEventName());
Set<Team> teams = TeamTeilnahme.getTeams(e.getEventID()); Set<Team> teams = TeamTeilnahme.getTeams(e.getEventID());
if(!teams.isEmpty()){ if(now.isBefore(e.getDeadline().toInstant())) {
StringBuilder tline = new StringBuilder("§7 Mit§8: "); Message.send("EVENT_COMING_DEADLINE", player, e.getDeadline());
for(Team t : teams){
tline.append("§").append(t.getTeamColor()).append(t.getTeamKuerzel()).append(" ");
} }
BungeeCore.send(player, tline.toString()); if(!teams.isEmpty()){
StringBuilder tline = new StringBuilder();
for(Team t : teams){
tline.append(' ').append(Message.parse("EVENT_COMING_TEAM", player, t.getTeamColor(), t.getTeamKuerzel()));
}
Message.send("EVENT_COMING_TEAMS", player, tline.toString());
} }
} }
} }
} }
private void eventOverview(ProxiedPlayer player, Event currentEvent){ private void eventOverview(ProxiedPlayer player, Event currentEvent){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§eevent §8[§eTeam§8] - §7Um dich zum Kampf zu teleportieren"); Message.send("EVENT_USAGE", player);
List<EventFight> fights = EventFight.getEvent(currentEvent.getEventID()); List<EventFight> fights = EventFight.getEvent(currentEvent.getEventID());
Instant now = Instant.now(); Instant now = Instant.now();
BungeeCore.send(player, "§e§l" + currentEvent.getEventName()); Message.send("EVENT_CURRENT_EVENT", player, currentEvent.getEventName());
DateTimeFormatter timeFormat = DateTimeFormatter.ofPattern(Message.parse("EVENT_TIME_FORMAT", player));
for(EventFight fight : fights){ for(EventFight fight : fights){
Team blue = Team.get(fight.getTeamBlue()); Team blue = Team.get(fight.getTeamBlue());
Team red = Team.get(fight.getTeamRed()); Team red = Team.get(fight.getTeamRed());
StringBuilder fline = new StringBuilder("§7") StringBuilder fline = new StringBuilder(Message.parse("EVENT_CURRENT_FIGHT", player, fight.getStartTime().toLocalDateTime().format(timeFormat), blue.getTeamColor(), blue.getTeamKuerzel(),
.append(fight.getStartTime().toLocalDateTime().format(TIME_FORMAT)) red.getTeamColor(), red.getTeamKuerzel()));
.append(" §e")
.append(blue.getTeamKuerzel())
.append("§8 vs §e")
.append(red.getTeamKuerzel());
if(now.isAfter(fight.getStartTime().toInstant().plus(35, ChronoUnit.MINUTES))){ if(now.isAfter(fight.getStartTime().toInstant().plus(35, ChronoUnit.MINUTES))){
switch(fight.getErgebnis()){ switch(fight.getErgebnis()){
case 1: case 1:
fline.append("§8: §7Sieg §e").append(blue.getTeamKuerzel()); fline.append(Message.parse("EVENT_CURRENT_FIGHT_WIN", player, blue.getTeamColor(), blue.getTeamKuerzel()));
break; break;
case 2: case 2:
fline.append("§8: §7Sieg §e").append(red.getTeamKuerzel()); fline.append(Message.parse("EVENT_CURRENT_FIGHT_WIN", player, red.getTeamColor(), red.getTeamKuerzel()));
break; break;
default: default:
fline.append("§8: §7Unentschieden"); fline.append(Message.parse("EVENT_CURRENT_FIGHT_DRAW", player));
} }
} }

Datei anzeigen

@ -19,7 +19,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.Event; import de.steamwar.bungeecore.sql.Event;
import de.steamwar.bungeecore.sql.EventFight; import de.steamwar.bungeecore.sql.EventFight;
import de.steamwar.bungeecore.sql.Team; import de.steamwar.bungeecore.sql.Team;
@ -44,7 +44,7 @@ public class EventRescheduleCommand extends BasicCommand {
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
if(args.length != 2){ if(args.length != 2){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§c/eventreschedule [Team1 (Blue)] [Team2 (Red)]"); Message.send("EVENTRESCHEDULE_USAGE", player);
return; return;
} }
@ -52,7 +52,7 @@ public class EventRescheduleCommand extends BasicCommand {
Team teamRed = Team.get(args[1]); Team teamRed = Team.get(args[1]);
Event event = Event.get(); Event event = Event.get();
if(teamBlue == null || teamRed == null || event == null){ if(teamBlue == null || teamRed == null || event == null){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cEin Team ist unbekannt / Derzeit kein Event"); Message.send("EVENTRESCHEDULE_UNKNOWN_TEAM", player);
return; return;
} }
@ -65,13 +65,13 @@ public class EventRescheduleCommand extends BasicCommand {
continue; continue;
if(fight.getTeamBlue() == teamBlue.getTeamId() && fight.getTeamRed() == teamRed.getTeamId()){ if(fight.getTeamBlue() == teamBlue.getTeamId() && fight.getTeamRed() == teamRed.getTeamId()){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§aKampf startet in 30s"); Message.send("EVENTRESCHEDULE_STARTING", player);
fight.reschedule(); fight.reschedule();
EventFight.loadAllComingFights(); EventFight.loadAllComingFights();
return; return;
} }
} }
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cKein Kampf zwischen den Teams gefunden"); Message.send("EVENTRESCHEDULE_NO_FIGHT", player);
} }
} }

Datei anzeigen

@ -23,7 +23,6 @@ import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker; import de.steamwar.bungeecore.listeners.mods.ModLoaderBlocker;
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.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder; import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent; import net.md_5.bungee.api.chat.HoverEvent;
@ -51,7 +50,7 @@ public class FightCommand extends BasicCommand {
if(mode != null) if(mode != null)
return mode; return mode;
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cUnbekannter Spielmodus: " + arg); Message.send("FIGHT_UNKNOWN_GAMEMODE", sender, arg);
return null; return null;
} }
@ -62,7 +61,7 @@ public class FightCommand extends BasicCommand {
if(arg.equalsIgnoreCase("Random")) if(arg.equalsIgnoreCase("Random"))
return mode.getRandomMap(); return mode.getRandomMap();
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDie gewünschte Arena gibt es nicht."); Message.send("FIGHT_UNKNOWN_ARENA", sender);
return null; return null;
} }
@ -70,7 +69,7 @@ public class FightCommand extends BasicCommand {
TextComponent start = new TextComponent(); TextComponent start = new TextComponent();
TextComponent current = start; TextComponent current = start;
for(ArenaMode mode : ArenaMode.getAllModes()){ for(ArenaMode mode : ArenaMode.getAllModes()){
if(!mode.hasChatName() || mode.isHistoric() != historic) if(mode.withoutChatName() || mode.isHistoric() != historic)
continue; continue;
String command = precommand + mode.getChatName(); String command = precommand + mode.getChatName();
current.setBold(true); current.setBold(true);
@ -93,7 +92,7 @@ public class FightCommand extends BasicCommand {
String command = precommand + mode.getChatName() + " Random"; String command = precommand + mode.getChatName() + " Random";
start.setBold(true); start.setBold(true);
start.setColor(ChatColor.GRAY); start.setColor(ChatColor.GRAY);
start.setText("Random "); start.setText(Message.parse("FIGHT_ARENA_RANDOM", sender) + " ");
start.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§e" + command).create())); start.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§e" + command).create()));
start.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command)); start.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command));
current = new TextComponent(); current = new TextComponent();
@ -117,7 +116,7 @@ public class FightCommand extends BasicCommand {
private static boolean alreadyInArena(ProxiedPlayer player){ private static boolean alreadyInArena(ProxiedPlayer player){
Subserver subserver = Subserver.getSubserver(player); Subserver subserver = Subserver.getSubserver(player);
if(subserver != null && subserver.getType() == Servertype.ARENA){ if(subserver != null && subserver.getType() == Servertype.ARENA){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu befindest dich bereits in einer Arena."); Message.send("FIGHT_IN_ARENA", player);
return true; return true;
} }
@ -128,15 +127,15 @@ public class FightCommand extends BasicCommand {
if(!(sender instanceof ProxiedPlayer)) if(!(sender instanceof ProxiedPlayer))
return; return;
if(ModLoaderBlocker.isFabric((ProxiedPlayer) sender) && !precommand.equals("/bau testarena")) {
BungeeCore.send((ProxiedPlayer) sender, BungeeCore.CHAT_PREFIX + "§cHabe ich dir nicht gesagt, dass man mit Fabric/LiteLoader nicht auf die Arenen darf?");
return;
}
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
if(alreadyInArena(player)) if(alreadyInArena(player))
return; return;
if(ModLoaderBlocker.isFabric(player) && !precommand.equals("/bau testarena ")) {
Message.send("MODLOADER_DENIED", sender);
return;
}
if(args.length < startArg+1){ if(args.length < startArg+1){
getModes(sender, precommand, historic); getModes(sender, precommand, historic);
return; return;
@ -165,12 +164,10 @@ public class FightCommand extends BasicCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
createArena(sender, "/fight ", args, 0, false, (player, mode, map) -> { createArena(sender, "/fight ", args, 0, false, (player, mode, map) -> {
Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null); Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, null, null, player.getUniqueId(), null, false);
arena.sendPlayer(player); arena.sendPlayer(player);
TextComponent tc = new TextComponent(BungeeCore.CHAT_PREFIX + "§7Klicke §ehier§7, um §e" + mode.getDisplayName() + " §7gegen §e" + player.getName() + " §7zu §7kämpfen!"); Message.broadcast("FIGHT_BROADCAST", "FIGHT_BROADCAST_HOVER"
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§aGegen §7" + player.getName() + " §ekämpfen").create())); , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName());
tc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()));
ProxyServer.getInstance().broadcast(tc);
}); });
} }

Datei anzeigen

@ -99,7 +99,6 @@ public class HelpCommand extends BasicCommand {
Message.send("HELP_BAU_TP", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_TP_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau tp ")); Message.send("HELP_BAU_TP", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_TP_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau tp "));
Message.send("HELP_BAU_ADDMEMBER", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_ADDMEMBER_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau addmember ")); Message.send("HELP_BAU_ADDMEMBER", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_ADDMEMBER_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau addmember "));
Message.send("HELP_BAU_DELMEMBER", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_DELMEMBER_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau delmember ")); Message.send("HELP_BAU_DELMEMBER", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_DELMEMBER_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau delmember "));
Message.send("HELP_BAU_TOGGLEBUILD", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_TOGGLEBUILD_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau togglebuild "));
Message.send("HELP_BAU_TOGGLEWE", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_TOGGLEWE_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau togglewe ")); Message.send("HELP_BAU_TOGGLEWE", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_TOGGLEWE_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau togglewe "));
Message.send("HELP_BAU_TOGGLEWORLD", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_TOGGLEWORLD_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau toggleworld ")); Message.send("HELP_BAU_TOGGLEWORLD", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_TOGGLEWORLD_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau toggleworld "));
Message.send("HELP_BAU_DELETE", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_DELETE_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau delete ")); Message.send("HELP_BAU_DELETE", true, p, ChatMessageType.SYSTEM, Message.parse("HELP_BAU_DELETE_HOVER", p), new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/bau delete "));

Datei anzeigen

@ -19,16 +19,9 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.ArenaMode; import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.BungeeCore;
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.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import java.util.LinkedList; import java.util.LinkedList;
@ -40,12 +33,10 @@ public class HistoricCommand extends BasicCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> { FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> {
Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null); Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, null, null, player.getUniqueId(), null, false);
arena.sendPlayer(player); arena.sendPlayer(player);
TextComponent tc = new TextComponent(BungeeCore.CHAT_PREFIX + "§7Historischer §e" + mode.getDisplayName() + "§8-§7Kampf von §e" + player.getName() + "§8!"); Message.broadcast("HISTORIC_BROADCAST", "HISTORIC_BROADCAST_HOVER"
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§aGegen §7" + player.getName() + " §ekämpfen").create())); , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName());
tc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()));
ProxyServer.getInstance().broadcast(tc);
}); });
} }

Datei anzeigen

@ -24,9 +24,6 @@ import de.steamwar.bungeecore.sql.BauweltMember;
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;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
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;
@ -34,8 +31,6 @@ import java.util.ArrayList;
public class JoinmeCommand extends BasicCommand { public class JoinmeCommand extends BasicCommand {
private static final String DENY_MESSAGE = "§cDu kannst diesem Spieler derzeit nicht folgen.";
public JoinmeCommand() { public JoinmeCommand() {
super("joinme", ""); super("joinme", "");
} }
@ -46,17 +41,15 @@ public class JoinmeCommand extends BasicCommand {
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
if (args.length == 0 && player.hasPermission("bungeecore.joinme")) { if (args.length == 0 && player.hasPermission("bungeecore.joinme")) {
TextComponent tc = new TextComponent(BungeeCore.CHAT_PREFIX + "§7Klicke §ehier§8, §7um zu §e" + player.getName() + " §7auf §e" + player.getServer().getInfo().getName() + " §7zu kommen§8!"); Message.broadcast("JOINME_BROADCAST", "JOINME_BROADCAST_HOVER"
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§aSpieler folgen").create())); , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), player.getName(), player.getServer().getInfo().getName());
tc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()));
ProxyServer.getInstance().broadcast(tc);
} else if (args.length == 1) { } else if (args.length == 1) {
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]); ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
if(target == null || !target.isConnected()){ if(target == null || !target.isConnected()){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist offline."); Message.send("JOINME_PLAYER_OFFLINE", player);
return; return;
}else if(target.equals(player)){ }else if(target.equals(player)){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cSei eins mit dir selbst!"); Message.send("JOINME_PLAYER_SELF", player);
return; return;
} }
ServerInfo server = target.getServer().getInfo(); ServerInfo server = target.getServer().getInfo();
@ -74,18 +67,18 @@ public class JoinmeCommand extends BasicCommand {
subserver.sendPlayer(player); subserver.sendPlayer(player);
} else { } else {
SubserverSystem.sendDeniedMessage(player, bauserver.getOwner()); SubserverSystem.sendDeniedMessage(player, bauserver.getOwner());
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + DENY_MESSAGE); Message.send("JOIN_PLAYER_BLOCK", player);
} }
} }
}else if(serverPerm != null && !player.hasPermission(serverPerm)){ }else if(serverPerm != null && !player.hasPermission(serverPerm)){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + DENY_MESSAGE); Message.send("JOIN_PLAYER_BLOCK", player);
}else if(serverPerm == null && !player.getGroups().contains("team")) { }else if(serverPerm == null && !player.getGroups().contains("team")) {
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + DENY_MESSAGE); Message.send("JOIN_PLAYER_BLOCK", player);
}else{ }else{
player.connect(server); player.connect(server);
} }
} else { } else {
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Mit §8/§ejoin §8[§eSpieler§8] §7kannst du einem Spieler folgen §8(z.B. in eine Arena)§7."); Message.send("JOINME_USAGE", player);
} }
} }
} }

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
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.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
@ -35,18 +36,18 @@ public class KickCommand extends BasicCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
if(args.length == 0){ if(args.length == 0){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "/kick [Spieler] [Nachricht]"); Message.send("KICK_USAGE", sender);
return; return;
} }
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]); ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
if(target == null){ if(target == null){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); Message.send("KICK_OFFLINE", sender);
return; return;
} }
if(args.length == 1){ if(args.length == 1){
target.disconnect(BungeeCore.stringToText(BungeeCore.CHAT_PREFIX + "§cDu wurdest gekickt.")); target.disconnect(Message.parseToComponent("KICK_NORMAL", true, target));
}else{ }else{
StringBuilder msgBuilder = new StringBuilder(); StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append(BungeeCore.CHAT_PREFIX).append("§c"); msgBuilder.append(BungeeCore.CHAT_PREFIX).append("§c");
@ -55,7 +56,7 @@ public class KickCommand extends BasicCommand {
} }
target.disconnect(BungeeCore.stringToText(msgBuilder.toString())); target.disconnect(BungeeCore.stringToText(msgBuilder.toString()));
} }
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "Der Spieler " + target.getName() + " wurde gekickt."); Message.send("KICK_CONFIRM", sender, target.getName());
} }
@Override @Override

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.IgnoreSystem; import de.steamwar.bungeecore.sql.IgnoreSystem;
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;
@ -42,40 +43,38 @@ public class MsgCommand extends BasicCommand {
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
if (args.length < 2) { if (args.length < 2) {
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "/msg [Benutzer] [Nachricht]"); Message.send("MSG_USAGE", player);
return; return;
} }
SteamwarUser user = SteamwarUser.get(player); SteamwarUser user = SteamwarUser.get(player);
if(user.isMuted()){ if(user.isMuted()){
sender.sendMessage(user.muteMessage()); sender.sendMessage(user.muteMessage(player));
return; return;
} }
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]); ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
if(target == null){ if(target == null){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); Message.send("MSG_OFFLINE", player);
return; return;
}else if (IgnoreSystem.isIgnored(target, player)) { }else if (IgnoreSystem.isIgnored(target, player)) {
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler hat dich geblockt!"); Message.send("MSG_IGNORED", player);
return; return;
}else if(target.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){ }else if(target.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler empfängt derzeit keine Chatnachrichten!"); Message.send("MSG_NOMESSAGE", player);
return; return;
}else if(target.equals(player)){ }else if(target.equals(player)){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cNachrichten an dich selbst hast du wirklich nicht nötig!"); Message.send("MSG_SELF", player);
return; return;
} }
StringBuilder msgBuilder = new StringBuilder(); StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append("§e").append(player.getName()).append("§8»§e").append(target.getName()).append(" §r§7");
for (int i = 1; i < args.length; i++){ for (int i = 1; i < args.length; i++){
msgBuilder.append(args[i]).append(" "); msgBuilder.append(args[i]).append(" ");
} }
String msg = msgBuilder.toString(); Message.sendPrefixless("MSG_FORMAT", player, player.getName(), target.getName(), msgBuilder.toString());
BungeeCore.send(player, msg); Message.sendPrefixless("MSG_FORMAT", target, player.getName(), target.getName(), msgBuilder.toString());
BungeeCore.send(target, msg); BungeeCore.log(Message.parse("MSG_FORMAT", player, player.getName(), target.getName(), msgBuilder.toString()));
BungeeCore.log(msg);
lastChats.put(player, target); lastChats.put(player, target);
lastChats.put(target, player); lastChats.put(target, player);

Datei anzeigen

@ -51,7 +51,7 @@ public class MuteCommand extends BasicCommand {
muteReason.append(args[i]).append(" "); muteReason.append(args[i]).append(" ");
} }
String msg = muteReason.toString(); String msg = muteReason.toString();
Message.send("MUTE_MESSAGE_YOU", sender, target.getUserName(), msg); target.mute(muteTime, msg, SteamwarUser.get(sender.getName()).getId(), args[1].equalsIgnoreCase("perma"));
target.mute(muteTime, msg); Message.team("MUTE_TEAM_MUTED", new Message("PREFIX"), target.getUserName(), sender.getName(), new Message((args[1].equalsIgnoreCase("perma")?"BAN_PERMA":"BAN_UNTIL"), muteTime), msg);
} }
} }

Datei anzeigen

@ -19,7 +19,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
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;
@ -33,7 +33,7 @@ public class PingCommand extends BasicCommand {
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
if(sender instanceof ProxiedPlayer){ if(sender instanceof ProxiedPlayer){
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
player.sendMessage(BungeeCore.CHAT_PREFIX + "§7Dein Ping beträgt §c" + player.getPing() + "§r§7 ms!"); Message.send("PING_RESPONSE", player, player.getPing());
} }
} }
} }

Datei anzeigen

@ -19,7 +19,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.listeners.PollSystem; import de.steamwar.bungeecore.listeners.PollSystem;
import de.steamwar.bungeecore.sql.PollAnswer; import de.steamwar.bungeecore.sql.PollAnswer;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
@ -40,7 +40,7 @@ public class PollCommand extends BasicCommand {
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
if(PollSystem.noCurrentPoll()){ if(PollSystem.noCurrentPoll()){
BungeeCore.send(player, "§cDerzeit läuft keine Umfrage."); Message.send("POLL_NO_POLL", player);
return; return;
} }
@ -55,15 +55,15 @@ public class PollCommand extends BasicCommand {
if(answer < 1 || answer > PollSystem.answers()) if(answer < 1 || answer > PollSystem.answers())
throw new NumberFormatException(); throw new NumberFormatException();
}catch(NumberFormatException e){ }catch(NumberFormatException e){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDas ist keine Antwortmöglichkeit!"); Message.send("POLL_NO_ANSWER", player);
return; return;
} }
PollAnswer pollAnswer = PollAnswer.get(SteamwarUser.get(player.getUniqueId()).getId()); PollAnswer pollAnswer = PollAnswer.get(SteamwarUser.get(player.getUniqueId()).getId());
if(pollAnswer.hasAnswered()) if(pollAnswer.hasAnswered())
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§aDeine Antwort wurde aktualisiert"); Message.send("POLL_ANSWER_REFRESH", player);
else else
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§aDeine Antwort wurde registriert"); Message.send("POLL_ANSWER_NEW", player);
pollAnswer.setAnswer(answer); pollAnswer.setAnswer(answer);
} }

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.IgnoreSystem; import de.steamwar.bungeecore.sql.IgnoreSystem;
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;
@ -38,41 +39,39 @@ public class RCommand extends BasicCommand {
if(sender instanceof ProxiedPlayer){ if(sender instanceof ProxiedPlayer){
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
if(args.length == 0){ if(args.length == 0){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "/r [Antwort]"); Message.send("R_USAGE", player);
return; return;
} }
SteamwarUser user = SteamwarUser.get(player); SteamwarUser user = SteamwarUser.get(player);
if(user.isMuted()){ if(user.isMuted()){
sender.sendMessage(user.muteMessage()); sender.sendMessage(user.muteMessage(player));
return; return;
} }
ProxiedPlayer target = lastChats.get(player); ProxiedPlayer target = lastChats.get(player);
if(target == null){ if(target == null){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu hast bisher mit niemandem geschrieben!"); Message.send("R_NOTHING", player);
return; return;
}else if(!target.isConnected()){ }else if(!target.isConnected()){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist derzeit nicht online!"); Message.send("R_OFFLINE", player);
lastChats.remove(player); lastChats.remove(player);
return; return;
}else if (IgnoreSystem.isIgnored(target, player)) { }else if (IgnoreSystem.isIgnored(target, player)) {
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler hat dich geblockt!"); Message.send("R_BLOCKED", player);
return; return;
}else if(target.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){ }else if(target.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler empfängt derzeit keine Chatnachrichten!"); Message.send("R_NO_CHAT", player);
return; return;
} }
StringBuilder msgBuilder = new StringBuilder(); StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append("§e").append(player.getName()).append("§8»§e").append(target.getName()).append(" §r§7");
for (String arg : args){ for (String arg : args){
msgBuilder.append(arg).append(" "); msgBuilder.append(arg).append(" ");
} }
String msg = msgBuilder.toString(); Message.sendPrefixless("MSG_FORMAT", player, player.getName(), target.getName(), msgBuilder.toString());
BungeeCore.send(player, msg); Message.sendPrefixless("MSG_FORMAT", target, player.getName(), target.getName(), msgBuilder.toString());
BungeeCore.send(target, msg); BungeeCore.log(Message.parse("MSG_FORMAT", player, player.getName(), target.getName(), msgBuilder.toString()));
BungeeCore.log(msg);
lastChats.put(target, player); lastChats.put(target, player);
} }

Datei anzeigen

@ -20,7 +20,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.ArenaMode; import de.steamwar.bungeecore.ArenaMode;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.Elo; import de.steamwar.bungeecore.sql.Elo;
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;
@ -40,7 +40,7 @@ public class RankCommand extends BasicCommand {
return; return;
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7§lPlatzierungen"); Message.send("RANK_HEADER", player);
SteamwarUser user = SteamwarUser.get(player.getUniqueId()); SteamwarUser user = SteamwarUser.get(player.getUniqueId());
for(ArenaMode mode : ArenaMode.getAllModes()){ for(ArenaMode mode : ArenaMode.getAllModes()){
if(!mode.isRanked()) if(!mode.isRanked())
@ -49,9 +49,9 @@ public class RankCommand extends BasicCommand {
int placement = Elo.getPlacement(elo, mode.getSchemType()); int placement = Elo.getPlacement(elo, mode.getSchemType());
if(placement == -1) if(placement == -1)
BungeeCore.send(player, "§7" + mode.getChatName() + "§8: §eunplatziert"); Message.send("RANK_UNPLACED", player, mode.getChatName());
else else
BungeeCore.send(player, "§7" + mode.getChatName() + "§8: §e" + ++placement + "§8. §7mit §e" + elo + " §7Elo§8."); Message.send("RANK_PLACED", player, mode.getChatName(), placement, elo);
} }
} }

Datei anzeigen

@ -59,7 +59,7 @@ public class RankedCommand extends BasicCommand {
if(mode == null) if(mode == null)
return; return;
else if(!mode.isRanked()){ else if(!mode.isRanked()){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDieser Spielmodus ist nicht für Ranglistenspiele freigeschalten"); Message.send("RANKED_NO_RANKED_MODE", sender);
return; return;
} }
@ -81,7 +81,7 @@ public class RankedCommand extends BasicCommand {
TextComponent start = new TextComponent(); TextComponent start = new TextComponent();
TextComponent current = start; TextComponent current = start;
for(ArenaMode mode : ArenaMode.getAllModes()){ for(ArenaMode mode : ArenaMode.getAllModes()){
if(!mode.hasChatName() || !mode.isRanked()) if(mode.withoutChatName() || !mode.isRanked())
continue; continue;
String command = precommand + mode.getChatName(); String command = precommand + mode.getChatName();
current.setBold(true); current.setBold(true);
@ -114,14 +114,14 @@ public class RankedCommand extends BasicCommand {
private void togglePlayer(ProxiedPlayer player){ private void togglePlayer(ProxiedPlayer player){
for(WaitingPlayer wp : players){ for(WaitingPlayer wp : players){
if(wp.player == player){ if(wp.player == player){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cRanglistenspiel-Warteschlange verlassen"); Message.send("RANKED_QUEUE_LEFT", player);
players.remove(wp); players.remove(wp);
return; return;
} }
} }
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§aRanglistenspiel-Warteschlange betreten"); Message.send("RANKED_QUEUE_JOINED", player);
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Wiederhole den Befehl zum Verlassen der Warteschlange"); Message.send("RANKED_QUEUE_HOW_TO_LEAVE", player);
players.add(new WaitingPlayer(player, mode.getSchemType())); players.add(new WaitingPlayer(player, mode.getSchemType()));
} }
@ -160,18 +160,17 @@ public class RankedCommand extends BasicCommand {
for(Map.Entry<WaitingPlayer, WaitingPlayer> entry : inRange.entrySet()){ for(Map.Entry<WaitingPlayer, WaitingPlayer> entry : inRange.entrySet()){
WaitingPlayer wp1 = entry.getKey(); WaitingPlayer wp1 = entry.getKey();
WaitingPlayer wp2 = entry.getValue(); WaitingPlayer wp2 = entry.getValue();
BungeeCore.send(wp1.player, BungeeCore.CHAT_PREFIX + "§eGegner gefunden! Ranglistenspiel startet."); Message.send("RANKED_ENEMY_SPOTTED", wp1.player);
BungeeCore.send(wp2.player, BungeeCore.CHAT_PREFIX + "§eGegner gefunden! Ranglistenspiel startet."); Message.send("RANKED_ENEMY_SPOTTED", wp2.player);
removeFromAll(wp1.player); removeFromAll(wp1.player);
removeFromAll(wp2.player); removeFromAll(wp2.player);
Subserver arena = SubserverSystem.startArena(mode, mode.getRandomMap(), 0, 0, null, null, wp1.player.getUniqueId(), wp2.player.getUniqueId(), true); Subserver arena = SubserverSystem.startArena(mode, mode.getRandomMap(), 0, 0, 0, null, null, wp1.player.getUniqueId(), wp2.player.getUniqueId(), true);
arena.sendPlayer(wp1.player); arena.sendPlayer(wp1.player);
arena.sendPlayer(wp2.player); arena.sendPlayer(wp2.player);
BungeeCore.broadcast(BungeeCore.CHAT_PREFIX + "§7" + mode.getDisplayName() + "§8-§7Ranglistenspiel§8: §e" + wp1.player.getName() + " vs " + wp2.player.getName(), Message.broadcast("RANKED_BROADCAST", "RANKED_BROADCAST_HOVER",
"§aZuschauen", new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + wp1.player.getName()), mode.getDisplayName(), wp1.player.getName(), wp2.player.getName());
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + wp1.player.getName()));
} }
} }
} }
@ -204,7 +203,7 @@ public class RankedCommand extends BasicCommand {
if(subserver == null) if(subserver == null)
return true; return true;
if(subserver.getType() == Servertype.ARENA){ if(subserver.getType() == Servertype.ARENA){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cRanglistenspiel-Warteschlange verlassen"); Message.send("RANKED_QUEUE_LEFT", player);
return false; return false;
} }

Datei anzeigen

@ -19,7 +19,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
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 net.md_5.bungee.api.connection.ProxiedPlayer;
@ -35,10 +35,10 @@ public class RegelnCommand extends BasicCommand {
return; return;
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7§lRegelwerke"); Message.send("REGELN_RULES", player);
BungeeCore.send(player, "§eAirShip§8-§7Regelwerk", "§7https://steamwar.de/spielmodi/airship-regelwerk/", new ClickEvent(ClickEvent.Action.OPEN_URL, "https://steamwar.de/spielmodi/airship-regelwerk/")); Message.sendPrefixless("REGELN_AS", player, Message.parse("REGELN_AS_HOVER", player), new ClickEvent(ClickEvent.Action.OPEN_URL, Message.parse("REGELN_AS_URL", player)));
BungeeCore.send(player, "§eMiniWarGear§8-§7Regelwerk", "§7https://steamwar.de/spielmodi/miniwargear-regelwerk/", new ClickEvent(ClickEvent.Action.OPEN_URL, "https://steamwar.de/spielmodi/miniwargear-regelwerk/")); Message.sendPrefixless("REGELN_MWG", player, Message.parse("REGELN_MWG_HOVER", player), new ClickEvent(ClickEvent.Action.OPEN_URL, Message.parse("REGELN_MWG_URL", player)));
BungeeCore.send(player, "§eWarGear§8-§7Regelwerk", "§7https://steamwar.de/spielmodi/wargear-regelwerk/", new ClickEvent(ClickEvent.Action.OPEN_URL, "https://steamwar.de/spielmodi/wargear-regelwerk/")); Message.sendPrefixless("REGELN_WG", player, Message.parse("REGELN_WG_HOVER", player), new ClickEvent(ClickEvent.Action.OPEN_URL, Message.parse("REGELN_WG_URL", player)));
BungeeCore.send(player, "§eWarShip§8-§7Regelwerk", "§7https://steamwar.de/spielmodi/warship-regelwerk/", new ClickEvent(ClickEvent.Action.OPEN_URL, "https://steamwar.de/spielmodi/warship-regelwerk/")); Message.sendPrefixless("REGELN_WS", player, Message.parse("REGELN_WS_HOVER", player), new ClickEvent(ClickEvent.Action.OPEN_URL, Message.parse("REGELN_WS_URL", player)));
} }
} }

Datei anzeigen

@ -0,0 +1,36 @@
/*
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.bungeecore.commands;
import net.md_5.bungee.api.CommandSender;
import java.util.ResourceBundle;
public class ResourcereloadCommand extends BasicCommand {
public ResourcereloadCommand() {
super("resourcereload", "bungeecore.softreload", "rr");
}
@Override
public void execute(CommandSender commandSender, String[] strings) {
ResourceBundle.clearCache();
}
}

Datei anzeigen

@ -19,7 +19,8 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.listeners.ChatListener;
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.ProxyServer; import net.md_5.bungee.api.ProxyServer;
@ -37,27 +38,26 @@ public class ServerTeamchatCommand extends BasicCommand {
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
if(args.length == 0){ if(args.length == 0){
player.sendMessage(BungeeCore.CHAT_PREFIX + "/stc [Nachricht an das Team]"); Message.sendPrefixless("STC_USAGE", player);
return; return;
} }
StringBuilder msgBuilder = new StringBuilder(); StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append(BungeeCore.SERVER_TEAMCHAT_PREFIX).append(sender.getName()).append("» §r");
for (String arg : args){ for (String arg : args){
msgBuilder.append(arg).append(" "); msgBuilder.append(arg).append(" ");
} }
String msg = msgBuilder.toString(); String msg = msgBuilder.toString();
msg = ChatColor.translateAlternateColorCodes('&', msg); msg = ChatColor.translateAlternateColorCodes('&', msg);
sendToTeam(msg); sendToTeam(msg, player);
} }
} }
public static void sendToTeam(String message){ public static void sendToTeam(String message, ProxiedPlayer sender){
for (ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){ for (ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){
if ((target.hasPermission("bungeecore.teamchat")) if ((target.hasPermission("bungeecore.teamchat"))
&& target.getChatMode() == ProxiedPlayer.ChatMode.SHOWN){ && target.getChatMode() == ProxiedPlayer.ChatMode.SHOWN){
BungeeCore.send(target, message); Message.sendPrefixless("STC_FORMAT", target, sender.getName(), ChatListener.parseAtMessage(message, "§r", target));
} }
} }
} }

Datei anzeigen

@ -19,7 +19,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.inventory.SWItem; import de.steamwar.bungeecore.inventory.SWItem;
import de.steamwar.bungeecore.inventory.SWListInv; import de.steamwar.bungeecore.inventory.SWListInv;
import de.steamwar.bungeecore.sql.Event; import de.steamwar.bungeecore.sql.Event;
@ -36,7 +36,9 @@ import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.time.Instant; import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import static de.steamwar.bungeecore.Storage.teamInvitations; import static de.steamwar.bungeecore.Storage.teamInvitations;
@ -72,30 +74,31 @@ public class TeamCommand extends BasicCommand {
} }
private void help(CommandSender sender){ private void help(CommandSender sender){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§7Mit §e/team §7verwaltest du dein Team"); Message.send("TEAM_HELP_HEADER", sender);
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteam list §8- §7Liste alle Teams auf"); Message.send("TEAM_HELP_LIST", sender);
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteam info §8- §7Informiere dich über ein Team"); Message.send("TEAM_HELP_INFO", sender);
if(!(sender instanceof ProxiedPlayer)) if(!(sender instanceof ProxiedPlayer))
return; return;
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
SteamwarUser user = SteamwarUser.get(player.getUniqueId()); SteamwarUser user = SteamwarUser.get(player.getUniqueId());
if(user.getTeam() == 0) { if(user.getTeam() == 0) {
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteam create §8- §7Erstelle dein eigenes Team"); Message.send("TEAM_HELP_CREATE", sender);
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteam join §8- §7Trete einem Team bei"); Message.send("TEAM_HELP_JOIN", sender);
}else{ }else{
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteamchat §8- §7Sende Nachrichten an dein Team"); Message.send("TEAM_HELP_CHAT", sender);
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteam event §8- §7Nehme an Events teil"); Message.send("TEAM_HELP_EVENT", sender);
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteam leave §8- §7Verlasse dein Team"); Message.send("TEAM_HELP_LEAVE", sender);
Team team = Team.get(user.getTeam()); Team team = Team.get(user.getTeam());
if(team.getTeamLeader() == user.getId()){ if(user.isLeader()){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteam invite §8- §7Lade jemanden in dein Team ein"); Message.send("TEAM_HELP_INVITE", sender);
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteam remove §8- §7Entferne jemanden aus deinem Team"); Message.send("TEAM_HELP_REMOVE", sender);
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteam changekuerzel §8- §7Ändere dein Teamkürzel"); Message.send("TEAM_HELP_KUERZEL", sender);
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteam changename §8- §7Ändere deinen Teamnamen"); Message.send("TEAM_HELP_NAME", sender);
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteam changecolor §8- §7Ändere deine Teamfarbe"); Message.send("TEAM_HELP_COLOR", sender);
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eteam changeleader §8- §7Ernenne jemanden zum Teamleader"); Message.send("TEAM_HELP_LEADER", sender);
Message.send("TEAM_HELP_STEP_BACK", sender);
} }
} }
} }
@ -121,6 +124,9 @@ public class TeamCommand extends BasicCommand {
case "join": case "join":
join(player, user, args); join(player, user, args);
break; break;
case "stepback":
stepBack(player,user,team);
break;
case "leave": case "leave":
leave(player, user, team); leave(player, user, team);
break; break;
@ -136,8 +142,8 @@ public class TeamCommand extends BasicCommand {
case "changename": case "changename":
changename(player, user, team, args); changename(player, user, team, args);
break; break;
case "changeleader": case "promote":
changeleader(player, user, team, args); promote(player, user, team, args);
break; break;
case "changecolor": case "changecolor":
changeColor(player, user, team); changeColor(player, user, team);
@ -161,7 +167,7 @@ public class TeamCommand extends BasicCommand {
return; return;
if(args.length < 3){ if(args.length < 3){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§eteam create §8[§eTeamkürzel§8] §8[§eTeamname§8]"); Message.send("TEAM_CREATE_USAGE", player);
return; return;
} }
@ -171,9 +177,9 @@ public class TeamCommand extends BasicCommand {
if(checkTeamName(player, team, args[2])) if(checkTeamName(player, team, args[2]))
return; return;
Team.create(args[1], args[2], user.getId()); Team.create(args[1], args[2], user);
user.setTeam(Team.get(args[1]).getTeamId()); user.setTeam(Team.get(args[1]).getTeamId());
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Du hast das Team §e" + args[2] + " §7gegründet!"); Message.send("TEAM_CREATE_CREATED", player, args[2]);
} }
private void join(ProxiedPlayer player, SteamwarUser user, String[] args){ private void join(ProxiedPlayer player, SteamwarUser user, String[] args){
@ -184,7 +190,7 @@ public class TeamCommand extends BasicCommand {
return; return;
if(!teamInvitations.containsKey(user.getId())){ if(!teamInvitations.containsKey(user.getId())){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Du hast keine Einladungen erhalten."); Message.send("TEAM_JOIN_NO_INVITE", player);
return; return;
} }
@ -195,13 +201,13 @@ public class TeamCommand extends BasicCommand {
t = invs.get(0); t = invs.get(0);
}else{ }else{
if(args.length != 2){ if(args.length != 2){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§eteam join §8[§eTeam§8]"); Message.send("TEAM_JOIN_USAGE", player);
StringBuilder sb = new StringBuilder().append("§7Du wurdest von diesen Teams eingeladen§8: §e"); StringBuilder sb = new StringBuilder();
for(int inv : invs){ for(int inv : invs){
Team team = Team.get(inv); Team team = Team.get(inv);
sb.append(team.getTeamName()).append(" "); sb.append(team.getTeamName()).append(" ");
} }
BungeeCore.send(player, sb.toString()); Message.send("TEAM_JOIN_INVITED", player, sb.toString());
return; return;
} }
@ -214,32 +220,45 @@ public class TeamCommand extends BasicCommand {
} }
if(t == null){ if(t == null){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cVon diesem Team wurdest du nicht eingeladen"); Message.send("TEAM_JOIN_NOT_BY_TEAM", player);
return; return;
} }
} }
user.setTeam(t); user.setTeam(t);
teamInvitations.remove(user.getId()); teamInvitations.remove(user.getId());
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Du bist dem Team §e" + Team.get(t).getTeamName() + " §7beigetreten!"); Message.send("TEAM_JOIN_JOINED", player, Team.get(t).getTeamName());
}
private void stepBack(ProxiedPlayer player, SteamwarUser user, Team team) {
if(notLeader(player, user, team))
return;
if(team.size() > 1 && team.getMembers().stream().map(SteamwarUser::get).filter(member -> user != member).noneMatch(SteamwarUser::isLeader)){
Message.send("TEAM_OTHER_LEADER_REQUIRED", player);
return;
}
user.setLeader(false);
Message.send("TEAM_STEP_BACK", player);
} }
private void leave(ProxiedPlayer player, SteamwarUser user, Team team){ private void leave(ProxiedPlayer player, SteamwarUser user, Team team){
if(notInTeam(player, user)) if(notInTeam(player, user))
return; return;
if(team.getTeamLeader() == user.getId() && team.size() > 1){ if(team.size() > 1 && user.isLeader() && team.getMembers().stream().map(SteamwarUser::get).filter(member -> user != member).noneMatch(SteamwarUser::isLeader)){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cBitte ernenne zunächst ein anderes Teammitglied zum Leader"); Message.send("TEAM_OTHER_LEADER_REQUIRED", player);
return; return;
} }
user.setTeam(0); user.setTeam(0);
if(team.getTeamLeader() == user.getId()){ if(user.isLeader() && team.size() > 0){
team.disband(); team.disband();
} }
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Du hast dein Team verlassen!"); Message.send("TEAM_LEAVE_LEFT", player);
} }
@ -251,16 +270,16 @@ public class TeamCommand extends BasicCommand {
return; return;
if(args.length != 2){ if(args.length != 2){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§eteam invite §8[§eSpieler§8]"); Message.send("TEAM_INVITE_USAGE", player);
return; return;
} }
SteamwarUser target = SteamwarUser.get(args[1]); SteamwarUser target = SteamwarUser.get(args[1]);
if(target == null){ if(target == null){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDiesen Spieler gibt es nicht"); Message.send("TEAM_INVITE_NO_PLAYER", player);
return; return;
}else if(target.getTeam() != 0){ }else if(target.getTeam() != 0){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist bereits in einem Team"); Message.send("TEAM_INVITE_IN_TEAM", player);
return; return;
} }
@ -268,16 +287,16 @@ public class TeamCommand extends BasicCommand {
teamInvitations.put(target.getId(), new LinkedList<>()); teamInvitations.put(target.getId(), new LinkedList<>());
if(teamInvitations.get(target.getId()).contains(team.getTeamId())){ if(teamInvitations.get(target.getId()).contains(team.getTeamId())){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu hast diesen Spieler bereits eingeladen"); Message.send("TEAM_INVITE_ALREADY_INVITED", player);
return; return;
} }
teamInvitations.get(target.getId()).add(team.getTeamId()); teamInvitations.get(target.getId()).add(team.getTeamId());
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Du hast §e" + args[1] + " §7in das Team eingeladen!"); Message.send("TEAM_INVITE_INVITED", player, args[1]);
ProxiedPlayer p = ProxyServer.getInstance().getPlayer(target.getUuid()); ProxiedPlayer p = ProxyServer.getInstance().getPlayer(target.getUuid());
if(p != null) if(p != null)
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du wurdest in das Team §e" + team.getTeamName() + " §7eingeladen!"); Message.send("TEAM_INVITE_INVITED_TARGET", p, team.getTeamColor(), team.getTeamName());
} }
private void remove(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){ private void remove(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
@ -285,43 +304,43 @@ public class TeamCommand extends BasicCommand {
return; return;
if(args.length != 2){ if(args.length != 2){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§eteam remove §8[§eSpieler§8]"); Message.send("TEAM_REMOVE_USAGE", player);
return; return;
} }
SteamwarUser target = SteamwarUser.get(args[1]); SteamwarUser target = SteamwarUser.get(args[1]);
if(target == null){ if(target == null){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDiesen Spieler gibt es nicht"); Message.send("TEAM_REMOVE_NOT_PLAYER", player);
return; return;
} }
if (team.getTeamLeader() == target.getId()) { if (target.isLeader()) {
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cLeader entfernen sich nicht selbst"); Message.send("TEAM_REMOVE_NOT_LEADER", player);
return; return;
} }
if(teamInvitations.containsKey(target.getId())){ if(teamInvitations.containsKey(target.getId())){
if(teamInvitations.get(target.getId()).remove((Integer) team.getTeamId())){ if(teamInvitations.get(target.getId()).remove((Integer) team.getTeamId())){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Die Einladung wurde zurückgezogen"); Message.send("TEAM_REMOVE_INVITE", player);
if(teamInvitations.get(target.getId()).isEmpty()) if(teamInvitations.get(target.getId()).isEmpty())
teamInvitations.remove(target.getId()); teamInvitations.remove(target.getId());
}else{ }else{
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler hat keine Einladung erhalten"); Message.send("TEAM_REMOVE_NO_INVITE", player);
} }
return; return;
} }
if(target.getTeam() != user.getTeam()){ if(target.getTeam() != user.getTeam()){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist nicht in deinem Team"); Message.send("TEAM_REMOVE_NOT_IN_TEAM", player);
return; return;
} }
target.setTeam(0); target.setTeam(0);
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Der Spieler wurde aus dem Team entfernt"); Message.send("TEAM_REMOVE_REMOVED", player);
ProxiedPlayer p = ProxyServer.getInstance().getPlayer(target.getUuid()); ProxiedPlayer p = ProxyServer.getInstance().getPlayer(target.getUuid());
if(p != null) if(p != null)
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu wurdest aus dem Team entfernt"); Message.send("TEAM_REMOVE_REMOVED_TARGET", player);
} }
private void changekuerzel(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){ private void changekuerzel(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
@ -332,7 +351,7 @@ public class TeamCommand extends BasicCommand {
return; return;
if(args.length < 2){ if(args.length < 2){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§eteam changekuerzel §8[§eTeamkürzel§8]"); Message.send("TEAM_KUERZEL_USAGE", player);
return; return;
} }
@ -340,7 +359,7 @@ public class TeamCommand extends BasicCommand {
return; return;
team.setTeamKuerzel(args[1]); team.setTeamKuerzel(args[1]);
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Du hast das Kürzel des Teams geändert!"); Message.send("TEAM_KUERZEL_CHANGED", player);
} }
private void changename(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){ private void changename(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
@ -351,7 +370,7 @@ public class TeamCommand extends BasicCommand {
return; return;
if(args.length < 2){ if(args.length < 2){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§eteam changename §8[§eTeamname§8]"); Message.send("TEAM_NAME_USAGE", player);
return; return;
} }
@ -359,10 +378,10 @@ public class TeamCommand extends BasicCommand {
return; return;
team.setTeamName(args[1]); team.setTeamName(args[1]);
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Du hast das Team umbenannt!"); Message.send("TEAM_NAME_CHANGED", player);
} }
private void changeleader(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){ private void promote(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
if(notLeader(player, user, team)) if(notLeader(player, user, team))
return; return;
@ -370,63 +389,73 @@ public class TeamCommand extends BasicCommand {
return; return;
if(args.length < 2){ if(args.length < 2){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cBitte gib ein Teammitglied an"); Message.send("TEAM_LEADER_USAGE", player);
return; return;
} }
SteamwarUser target = SteamwarUser.get(args[1]); SteamwarUser target = SteamwarUser.get(args[1]);
if(target == null){ if(target == null){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDen Spieler " + args[1] + " gibt es nicht"); Message.send("TEAM_LEADER_NOT_USER", player, args[1]);
return; return;
} }
if(target.getTeam() != user.getTeam()){ if(target.getTeam() != user.getTeam()){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDer Spieler ist nicht in deinem Team"); Message.send("TEAM_LEADER_NOT_MEMBER", player);
return; return;
} }
team.setTeamLeader(target.getId()); target.setLeader(true);
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Du hast den Spieler §e" + args[1] + " §7zum Leader gemacht!"); Message.send("TEAM_LEADER_PROMOTED", player, args[1]);
}
private String playerName(SteamwarUser user){
return ProxyServer.getInstance().getPlayer(user.getUuid()) != null ? "§a" + user.getUserName() : "§e" + user.getUserName();
} }
private void info(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){ private void info(ProxiedPlayer player, SteamwarUser user, Team team, String[] args){
if(args.length == 1 && user.getTeam() == 0){ if(args.length == 1 && user.getTeam() == 0){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§eteam info §8[§eTeamname§8]"); Message.send("TEAM_INFO_USAGE", player);
return; return;
}else if(user.getTeam() == 0 || args.length == 2){ }else if(user.getTeam() == 0 || args.length == 2){
team = Team.get(args[1]); team = Team.get(args[1]);
} }
if(team == null){ if(team == null){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieses Team gibt es nicht"); Message.send("UNKNOWN_TEAM", player);
return; return;
} }
BungeeCore.send(player, "§7Team §e" + team.getTeamName() + " §8[§" + team.getTeamColor() + team.getTeamKuerzel() + "§8]"); Message.sendPrefixless("TEAM_INFO_TEAM", player, team.getTeamName(), team.getTeamColor(), team.getTeamKuerzel());
BungeeCore.send(player, "§7Leader§8: " + SteamwarUser.get(team.getTeamLeader()).getUserName());
if(team.getMembers().size() > 1) { List<SteamwarUser> users = team.getMembers().stream().map(SteamwarUser::get).collect(Collectors.toList());
StringBuilder sb = new StringBuilder();
sb.append("§7Member§8: §e"); Message.sendPrefixless("TEAM_INFO_LEADER", player, getMemberList(users, true));
List<Integer> members = team.getMembers();
for (int i : members) { String members = getMemberList(users, false);
if (i == team.getTeamLeader())
continue; if(members.length() > 0) {
SteamwarUser m = SteamwarUser.get(i); Message.sendPrefixless("TEAM_INFO_MEMBER", player, members);
sb.append(m.getUserName()).append(" ");
}
BungeeCore.send(player, sb.toString());
} }
Set<Event> events = TeamTeilnahme.getEvents(team.getTeamId()); Set<Event> events = TeamTeilnahme.getEvents(team.getTeamId());
if(!events.isEmpty()){ if(!events.isEmpty()){
StringBuilder sb = new StringBuilder("§7Events§8: §e"); StringBuilder sb = new StringBuilder();
for(Event e : events) for(Event e : events)
sb.append(e.getEventName()).append(" "); sb.append(e.getEventName()).append(" ");
BungeeCore.send(player, sb.toString()); Message.sendPrefixless("TEAM_INFO_EVENTS", player, sb.toString());
} }
} }
private String getMemberList(List<SteamwarUser> users, boolean leaders) {
StringBuilder sb = new StringBuilder();
for(SteamwarUser user : users) {
if(user.isLeader() == leaders) {
sb.append(playerName(user)).append(" ");
}
}
return sb.toString();
}
private void list(ProxiedPlayer player, String[] args){ private void list(ProxiedPlayer player, String[] args){
final int TEAMS_PER_PAGE = 10; final int TEAMS_PER_PAGE = 10;
@ -436,7 +465,7 @@ public class TeamCommand extends BasicCommand {
try{ try{
page = Integer.parseInt(args[1]); page = Integer.parseInt(args[1]);
}catch(NumberFormatException e){ }catch(NumberFormatException e){
BungeeCore.send(player, "§cKeine Seitenzahl angegeben"); Message.send("TEAM_LIST_NOT_PAGE", player);
return; return;
} }
}else }else
@ -445,32 +474,31 @@ public class TeamCommand extends BasicCommand {
List<Team> all = Team.getAll(); List<Team> all = Team.getAll();
final int lastPage = ((all.size() - 1) / 10) + 1; final int lastPage = ((all.size() - 1) / 10) + 1;
if(page < 1 || page > lastPage){ if(page < 1 || page > lastPage){
BungeeCore.send(player, "§cUngültige Seitenzahl angegeben"); Message.send("TEAM_LIST_UNKNOWN_PAGE", player);
return; return;
} }
BungeeCore.send(player, "§7§lTeamliste §7" + page + "§8/§7" + lastPage); Message.sendPrefixless("TEAM_LIST_HEADER", player, page, lastPage);
for(int i = (page-1) * TEAMS_PER_PAGE; i < (page-1) * TEAMS_PER_PAGE + TEAMS_PER_PAGE && i < all.size(); i++){ for(int i = (page-1) * TEAMS_PER_PAGE; i < (page-1) * TEAMS_PER_PAGE + TEAMS_PER_PAGE && i < all.size(); i++){
Team tm = all.get(i); Team tm = all.get(i);
BungeeCore.send(player,
"§" + tm.getTeamColor() + tm.getTeamKuerzel() + " §e" + tm.getTeamName() + " §8[§7" + SteamwarUser.get(tm.getTeamLeader()).getUserName() + "§8]", Message.sendPrefixless("TEAM_LIST_TEAM", player, Message.parse("TEAM_LIST_TEAM_HOVER", player),
"§7Teaminfo", new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team info " + tm.getTeamKuerzel()), tm.getTeamColor(), tm.getTeamKuerzel(), tm.getTeamName());
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team info " + tm.getTeamKuerzel()));
} }
TextComponent beforePage = new TextComponent("««"); TextComponent beforePage = new TextComponent("««");
if(page > 1){ if(page > 1){
beforePage.setColor(ChatColor.YELLOW); beforePage.setColor(ChatColor.YELLOW);
beforePage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§eVorherige Seite").create())); beforePage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(Message.parse("TEAM_LIST_PREV", player)).create()));
beforePage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team list " + (page - 1))); beforePage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team list " + (page - 1)));
}else }else
beforePage.setColor(ChatColor.DARK_GRAY); beforePage.setColor(ChatColor.DARK_GRAY);
TextComponent nextPage = new TextComponent(" Seite »»"); TextComponent nextPage = new TextComponent(" " + Message.parse("TEAM_LIST_PAGE", player) +" »»");
if(page < lastPage){ if(page < lastPage){
nextPage.setColor(ChatColor.YELLOW); nextPage.setColor(ChatColor.YELLOW);
nextPage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§eNächste Seite").create())); nextPage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(Message.parse("TEAM_LIST_NEXT", player)).create()));
nextPage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team list " + (page + 1))); nextPage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team list " + (page + 1)));
}else }else
nextPage.setColor(ChatColor.DARK_GRAY); nextPage.setColor(ChatColor.DARK_GRAY);
@ -484,12 +512,13 @@ public class TeamCommand extends BasicCommand {
return; return;
if(args.length < 2){ if(args.length < 2){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§eteam event §8[§eEvent§8] - §7um daran teilzunehmen"); Message.send("TEAM_EVENT_USAGE", player);
Set<Event> events = TeamTeilnahme.getEvents(team.getTeamId()); Set<Event> events = TeamTeilnahme.getEvents(team.getTeamId());
if(!events.isEmpty()){ if(!events.isEmpty()){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Dein Team nimmt an folgenden Events teil§8:"); Message.send("TEAM_EVENT_HEADER", player);
DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern(Message.parse("EVENT_DATE_FORMAT", player));
for(Event e : events) for(Event e : events)
BungeeCore.send(player, "§7" + e.getStart().toLocalDateTime().format(EventCommand.DATE_FORMAT) + "§8: §e" + e.getEventName()); Message.sendPrefixless("TEAM_EVENT_EVENT", player, e.getStart().toLocalDateTime().format(dateFormat), e.getEventName());
} }
return; return;
} }
@ -502,22 +531,22 @@ public class TeamCommand extends BasicCommand {
Event event = Event.get(args[1]); Event event = Event.get(args[1]);
if(event == null){ if(event == null){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieses Event gibt es nicht"); Message.send("TEAM_EVENT_NO_EVENT", player);
return; return;
} }
if(Instant.now().isAfter(event.getEnd().toInstant())){ if(Instant.now().isAfter(event.getDeadline().toInstant())){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieses Event ist bereits vorbei"); Message.send("TEAM_EVENT_OVER", player);
return; return;
} }
if(TeamTeilnahme.nimmtTeil(team.getTeamId(), event.getEventID())){ if(TeamTeilnahme.nimmtTeil(team.getTeamId(), event.getEventID())){
TeamTeilnahme.notTeilnehmen(team.getTeamId(), event.getEventID()); TeamTeilnahme.notTeilnehmen(team.getTeamId(), event.getEventID());
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Dein Team nimmt nicht mehr am Event teil"); Message.send("TEAM_EVENT_LEFT", player);
}else{ }else{
TeamTeilnahme.teilnehmen(team.getTeamId(), event.getEventID()); TeamTeilnahme.teilnehmen(team.getTeamId(), event.getEventID());
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Dein Team nimmt nun am Event §e" + event.getEventName() + " §7 teil!"); Message.send("TEAM_EVENT_JOINED", player, event.getEventName());
BungeeCore.send(player, "§7Um die Teilnahme abzusagen, wiederhole den Befehl"); Message.sendPrefixless("TEAM_EVENT_HOW_TO_LEAVE", player);
} }
} }
@ -535,7 +564,7 @@ public class TeamCommand extends BasicCommand {
colors.add(new SWListInv.SWListEntry<>(item, stringSWListEntry.getObject())); colors.add(new SWListInv.SWListEntry<>(item, stringSWListEntry.getObject()));
}); });
SWListInv<String> inv = new SWListInv<>(player, "§6Farbe wählen", colors, (click, element) -> {}); SWListInv<String> inv = new SWListInv<>(player, Message.parse("TEAM_COLOR_TITLE", player), colors, (click, element) -> {});
inv.setCallback((click, element) -> { inv.setCallback((click, element) -> {
inv.close(); inv.close();
team.setTeamColor(element); team.setTeamColor(element);
@ -545,13 +574,13 @@ public class TeamCommand extends BasicCommand {
private boolean checkTeamName(ProxiedPlayer player, Team team, String arg){ private boolean checkTeamName(ProxiedPlayer player, Team team, String arg){
if(arg.length() < 4 || arg.length() > 15){ if(arg.length() < 4 || arg.length() > 15){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cEin Teamname muss aus 4 bis 15 Buchstaben bestehen"); Message.send("TEAM_NAME_LENGHT", player);
return true; return true;
} }
Team t = Team.get(arg); Team t = Team.get(arg);
if(t != null && t.getTeamId() != team.getTeamId()){ if(t != null && t.getTeamId() != team.getTeamId()){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cEs gibt bereits ein Team mit diesem Namen"); Message.send("TEAM_NAME_TAKEN", player);
return true; return true;
} }
return false; return false;
@ -559,13 +588,13 @@ public class TeamCommand extends BasicCommand {
private boolean checkTeamKuerzel(ProxiedPlayer player, Team team, String arg){ private boolean checkTeamKuerzel(ProxiedPlayer player, Team team, String arg){
if(arg.length() < 2 || arg.length() > 4){ if(arg.length() < 2 || arg.length() > 4){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cEin Teamkürzel muss aus 2 bis 4 Buchstaben bestehen"); Message.send("TEAM_KUERZEL_LENGHT", player);
return true; return true;
} }
Team t = Team.get(arg); Team t = Team.get(arg);
if(t != null && (team == null || t.getTeamId() != team.getTeamId())){ if(t != null && (team == null || t.getTeamId() != team.getTeamId())){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cEs gibt bereits ein Team mit diesem Namen"); Message.send("TEAM_KUERZEL_TAKEN", player);
return true; return true;
} }
return false; return false;
@ -573,7 +602,7 @@ public class TeamCommand extends BasicCommand {
private boolean unwantedInTeam(ProxiedPlayer player, SteamwarUser user){ private boolean unwantedInTeam(ProxiedPlayer player, SteamwarUser user){
if(user.getTeam() != 0){ if(user.getTeam() != 0){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu bist bereits in einem Team"); Message.send("TEAM_IN_TEAM", player);
return true; return true;
} }
return false; return false;
@ -581,7 +610,7 @@ public class TeamCommand extends BasicCommand {
private boolean notInTeam(ProxiedPlayer player, SteamwarUser user){ private boolean notInTeam(ProxiedPlayer player, SteamwarUser user){
if(user.getTeam() == 0){ if(user.getTeam() == 0){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu bist in keinem Team"); Message.send("TEAM_NOT_IN_TEAM", player);
return true; return true;
} }
return false; return false;
@ -590,8 +619,8 @@ public class TeamCommand extends BasicCommand {
private boolean notLeader(ProxiedPlayer player, SteamwarUser user, Team team){ private boolean notLeader(ProxiedPlayer player, SteamwarUser user, Team team){
if(notInTeam(player, user)) if(notInTeam(player, user))
return true; return true;
if(team.getTeamLeader() != user.getId()){ if(!user.isLeader()){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu bist nicht der Teamleader"); Message.send("TEAM_NOT_LEADER", player);
return true; return true;
} }
return false; return false;
@ -599,7 +628,7 @@ public class TeamCommand extends BasicCommand {
private boolean notDuringEvent(ProxiedPlayer player){ private boolean notDuringEvent(ProxiedPlayer player){
if(Event.get() != null){ if(Event.get() != null){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDies ist während eines Events nicht möglich"); Message.send("TEAM_NOT_IN_EVENT", player);
return true; return true;
} }
return false; return false;
@ -612,6 +641,7 @@ public class TeamCommand extends BasicCommand {
tab.add("create"); tab.add("create");
tab.add("join"); tab.add("join");
tab.add("invite"); tab.add("invite");
tab.add("stepback");
tab.add("leave"); tab.add("leave");
tab.add("info"); tab.add("info");
tab.add("remove"); tab.add("remove");

Datei anzeigen

@ -19,10 +19,10 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.listeners.ChatListener;
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.ChatMessageType;
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.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
@ -40,17 +40,16 @@ public class TeamchatCommand extends BasicCommand {
SteamwarUser user = SteamwarUser.get(player.getUniqueId()); SteamwarUser user = SteamwarUser.get(player.getUniqueId());
if(user.getTeam() == 0){ if(user.getTeam() == 0){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu bist in keinem Team"); Message.send("TC_NO_TEAM", player);
return; return;
} }
if(args.length == 0){ if(args.length == 0){
BungeeCore.send(player, BungeeCore.TEAMCHAT_PREFIX + "/teamchat [Nachricht an das Team]"); Message.send("TC_USAGE", player);
return; return;
} }
StringBuilder msgBuilder = new StringBuilder(); StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append(BungeeCore.TEAMCHAT_PREFIX).append(sender.getName()).append("§8» §r");
for (String arg : args){ for (String arg : args){
msgBuilder.append(arg).append(" "); msgBuilder.append(arg).append(" ");
} }
@ -61,7 +60,7 @@ public class TeamchatCommand extends BasicCommand {
SteamwarUser targetuser = SteamwarUser.get(target.getUniqueId()); SteamwarUser targetuser = SteamwarUser.get(target.getUniqueId());
if (targetuser.getTeam() == user.getTeam() if (targetuser.getTeam() == user.getTeam()
&& target.getChatMode() == ProxiedPlayer.ChatMode.SHOWN){ && target.getChatMode() == ProxiedPlayer.ChatMode.SHOWN){
BungeeCore.send(target, ChatMessageType.CHAT, msg); Message.sendPrefixless("TC_FORMAT", target, player.getName(), ChatListener.parseAtMessage(msg, "§f", target));
} }
} }
} }

Datei anzeigen

@ -35,8 +35,6 @@ import java.util.Arrays;
public class TpCommand extends BasicCommand { public class TpCommand extends BasicCommand {
private static final String DENY_MESSAGE = "§cDu kannst diesem Spieler derzeit nicht folgen.";
public static void onTp(ChatEvent e, String[] command){ public static void onTp(ChatEvent e, String[] command){
if(!(e.getSender() instanceof ProxiedPlayer)) if(!(e.getSender() instanceof ProxiedPlayer))
return; return;
@ -53,7 +51,7 @@ public class TpCommand extends BasicCommand {
if(!(sender instanceof ProxiedPlayer)) if(!(sender instanceof ProxiedPlayer))
return; return;
if(!onTp((ProxiedPlayer) sender, args)) if(!onTp((ProxiedPlayer) sender, args))
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cKonnte das angegebene Ziel nicht finden."); Message.send("TP_NOT_FOUND", sender);
} }
@Override @Override
@ -67,12 +65,12 @@ public class TpCommand extends BasicCommand {
private static boolean onTp(ProxiedPlayer player, String[] args){ private static boolean onTp(ProxiedPlayer player, String[] args){
if(args.length == 0){ if(args.length == 0){
if(Event.get() == null) if(Event.get() == null)
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§etp §8[§7Spieler§8]"); Message.send("TP_USAGE", player);
else else
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§etp §8[§7Spieler §8oder §7Team§8]"); Message.send("TP_USAGE_EVENT", player);
return true; return true;
}else if(CheckCommand.isChecking(player)){ }else if(CheckCommand.isChecking(player)){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu prüfst gerade eine Schematic!"); Message.send("CHECK_CHECKING", player);
return true; return true;
} }
@ -128,13 +126,13 @@ public class TpCommand extends BasicCommand {
subserver.sendPlayer(player); subserver.sendPlayer(player);
} else { } else {
SubserverSystem.sendDeniedMessage(player, bauserver.getOwner()); SubserverSystem.sendDeniedMessage(player, bauserver.getOwner());
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + DENY_MESSAGE); Message.send("JOIN_PLAYER_BLOCK", player);
} }
} }
}else if(serverPerm != null && !player.hasPermission(serverPerm)){ }else if(serverPerm != null && !player.hasPermission(serverPerm)){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + DENY_MESSAGE); Message.send("JOIN_PLAYER_BLOCK", player);
}else if(serverPerm == null && !player.getGroups().contains("team")) { }else if(serverPerm == null && !player.getGroups().contains("team")) {
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + DENY_MESSAGE); Message.send("JOIN_PLAYER_BLOCK", player);
}else{ }else{
player.connect(server); player.connect(server);
} }

Datei anzeigen

@ -19,7 +19,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.IgnoreSystem; import de.steamwar.bungeecore.sql.IgnoreSystem;
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;
@ -34,7 +34,7 @@ public class UnIgnoreCommand extends BasicCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
if(args.length < 1) { if(args.length < 1) {
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eunignore §8[§7Spieler§8]"); Message.send("UNIGNORE_USAGE", sender);
return; return;
} }
@ -45,15 +45,15 @@ public class UnIgnoreCommand extends BasicCommand {
SteamwarUser target = SteamwarUser.get(args[0]); SteamwarUser target = SteamwarUser.get(args[0]);
if(target == null){ if(target == null){
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDiesen Spieler gibt es nicht!"); Message.send("UNIGNORE_NOT_PLAYER", p);
return; return;
}else if(!IgnoreSystem.isIgnored(user, target)){ }else if(!IgnoreSystem.isIgnored(user, target)){
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu ignorierst diesen Spieler nicht."); Message.send("UNIGNORE_NOT_IGNORED", p);
return; return;
} }
IgnoreSystem.unIgnore(user, target); IgnoreSystem.unIgnore(user, target);
BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du empfängst nun wieder Nachrichten von §e" + target.getUserName() + "§8."); Message.send("UNIGNORE_UNIGNORED", p, target.getUserName());
} }
} }

Datei anzeigen

@ -19,7 +19,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
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;
@ -35,7 +35,7 @@ public class UnbanCommand extends BasicCommand {
@Override @Override
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
if(args.length < 1){ if(args.length < 1){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "/unban [Spieler]"); Message.send("UNBAN_USAGE", sender);
return; return;
} }
@ -43,7 +43,12 @@ public class UnbanCommand extends BasicCommand {
if(target == null) if(target == null)
return; return;
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "Du hast " + target.getUserName() + " entbannt."); if(!target.isBanned()) {
target.ban(Timestamp.from(new Date().toInstant()), ""); Message.send("UNBAN_NOT_BANNED", sender);
return;
}
Message.send("UNBAN_UNBANNED", sender, target.getUserName());
target.ban(Timestamp.from(new Date().toInstant()), "Unban", SteamwarUser.get(sender.getName()).getId(), false);
} }
} }

Datei anzeigen

@ -19,7 +19,7 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.SWException; import de.steamwar.bungeecore.sql.SWException;
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;
@ -41,7 +41,7 @@ public class WebregisterCommand extends BasicCommand {
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
if(args.length != 1){ if(args.length != 1){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "/webregister [E-Mail]"); Message.send("WEB_USAGE", player);
return; return;
} }
@ -55,20 +55,20 @@ public class WebregisterCommand extends BasicCommand {
while((errorLine = reader.readLine()) != null){ while((errorLine = reader.readLine()) != null){
switch(errorLine){ switch(errorLine){
case "username_exists": case "username_exists":
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDu hast bereits einen Webaccount."); Message.send("WEB_ALREADY", player);
break; break;
case "email_exists": case "email_exists":
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDie E-Mail hast du bereits für einen anderen Account verwendet..."); Message.send("WEB_ALREADY_EMAIL", player);
// SWException.log("Bungee", "Duplicate E-Mail", player.getName() + " " + args[0]); // SWException.log("Bungee", "Duplicate E-Mail", player.getName() + " " + args[0]);
break; break;
case "invalid_email": case "invalid_email":
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§c[E-Mail], nicht [Freitext]!"); Message.send("WEB_NOT_EMAIL", player);
break; break;
case "email_updated": case "email_updated":
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§aDeine E-Mail-Adresse wurde aktualisiert."); Message.send("WEB_EMAIL_REFRESH", player);
break; break;
default: default:
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cEin interner Fehler ist aufgetreten, bitte wende dich an einen Developer."); Message.send("WEB_INTERNAL_ERROR", player);
SWException.log("Bungee", "Unknown Wordpress User Creation Error", errorLine); SWException.log("Bungee", "Unknown Wordpress User Creation Error", errorLine);
} }
error = true; error = true;
@ -77,9 +77,9 @@ public class WebregisterCommand extends BasicCommand {
if(error) if(error)
return; return;
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§aEine E-Mail zum Setzen des Passworts wurde gesendet."); Message.send("WEB_EMAIL_SEND", player);
} catch (IOException e) { } catch (IOException e) {
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cEin interner Fehler ist aufgetreten, bitte wende dich an einen Developer."); Message.send("WEB_INTERNAL_ERROR", player);
throw new SecurityException("Could not create webaccount", e); throw new SecurityException("Could not create webaccount", e);
} }
} }

Datei anzeigen

@ -19,14 +19,17 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.Team; 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.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.sql.Timestamp;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.List;
public class WhoisCommand extends BasicCommand { public class WhoisCommand extends BasicCommand {
public WhoisCommand(){ public WhoisCommand(){
@ -40,7 +43,7 @@ public class WhoisCommand extends BasicCommand {
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
if(args.length == 0){ if(args.length == 0){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§c/whois [Spieler/ID]"); Message.send("WHOIS_USAGE", player);
return; return;
} }
@ -53,7 +56,7 @@ public class WhoisCommand extends BasicCommand {
} }
if(user == null) { if(user == null) {
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cUnbekannter Spieler!"); Message.send("UNKNOWN_PLAYER", player);
return; return;
} }
@ -61,20 +64,27 @@ public class WhoisCommand extends BasicCommand {
} }
private static void sendUserinfo(ProxiedPlayer player, SteamwarUser user) { private static void sendUserinfo(ProxiedPlayer player, SteamwarUser user) {
BungeeCore.send(player, "§7Username§8: §e" + user.getUserName()); Message.send("WHOIS_USERNAME", player, user.getUserName());
BungeeCore.send(player, "§7UUID§8: §e" + user.getUuid().toString(), "", new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, user.getUuid().toString())); Message.send("WHOIS_UUID", player, Message.parse("WHOIS_UUID_HOVER", player), new ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, user.getUuid().toString()), user.getUuid().toString());
BungeeCore.send(player, "§7ID§8: §e" + user.getId()); Message.send("WHOIS_ID", player, user.getId());
BungeeCore.send(player, "§7Beigetreten am§8: §e" + user.getFirstjoin().toString()); Timestamp firstJoin = user.getFirstjoin();
BungeeCore.send(player, "§7Online Time§8: §e" + new DecimalFormat("###.##").format(user.getOnlinetime() / (double) 3600) + "h"); if(firstJoin == null)
Message.send("WHOIS_JOINED_FIRST", player, "0000-00-00 00:00:00");
else
Message.send("WHOIS_JOINED_FIRST", player, firstJoin.toString());
Message.send("WHOIS_HOURS_PLAYED", player, new DecimalFormat("###.##").format(user.getOnlinetime() / (double) 3600));
Team team = Team.get(user.getTeam()); Team team = Team.get(user.getTeam());
BungeeCore.send(player, "§7Team§8: §e" + team.getTeamName()); Message.send("WHOIS_TEAM", player, Message.parse("WHOIS_TEAM_HOVER", player, team.getTeamName()), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team info " + team.getTeamKuerzel()), team.getTeamColor(), team.getTeamKuerzel(), team.getTeamName());
if(user.isBanned()){ Message.send("WHOIS_PUNISHMENTS", player);
player.sendMessage(user.banMessage()); List<Punishment> punishmentList = Punishment.getAllPunishmentsOfPlayer(user.getId());
if(punishmentList.isEmpty()) {
Message.send("WHOIS_NO_PUNISHMENT", player);
return;
} }
if(user.isMuted()){ for (Punishment punishment : punishmentList) {
player.sendMessage(user.muteMessage()); Message.sendPrefixless("WHOIS_PUNISHMENT", player, SteamwarUser.get(punishment.getPunisher()).getUserName(), punishment.getType().name(), punishment.getBantime(punishment.getStartTime(), false), punishment.getBantime(punishment.getEndTime(), punishment.isPerma()), punishment.getReason());
} }
} }
} }

Datei anzeigen

@ -24,6 +24,7 @@ public class PacketIdManager {
//0x0(X) Standalone Packets //0x0(X) Standalone Packets
public static final byte PING_PACKET = 0x01; public static final byte PING_PACKET = 0x01;
public static final byte TABLIST_NAME = 0x02; public static final byte TABLIST_NAME = 0x02;
public static final byte PREPARE_SCHEM = 0x03;
//0x1(X) Bungee Inventory //0x1(X) Bungee Inventory
public static final byte INVENTORY_PACKET = 0x10; public static final byte INVENTORY_PACKET = 0x10;

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.bungeecore.comms;
import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteStreams; import com.google.common.io.ByteStreams;
import de.steamwar.bungeecore.comms.handlers.InventoryCallbackHandler; import de.steamwar.bungeecore.comms.handlers.InventoryCallbackHandler;
import de.steamwar.bungeecore.comms.handlers.PrepareSchemHandler;
import de.steamwar.bungeecore.comms.handlers.TablistNameHandler; import de.steamwar.bungeecore.comms.handlers.TablistNameHandler;
import de.steamwar.bungeecore.listeners.BasicListener; import de.steamwar.bungeecore.listeners.BasicListener;
import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.api.event.PluginMessageEvent;
@ -55,5 +56,6 @@ public class SpigotReceiver extends BasicListener {
static { static {
registerHandler(PacketIdManager.INVENTORY_CALLBACK_PACKET, new InventoryCallbackHandler()); registerHandler(PacketIdManager.INVENTORY_CALLBACK_PACKET, new InventoryCallbackHandler());
registerHandler(PacketIdManager.TABLIST_NAME, new TablistNameHandler()); registerHandler(PacketIdManager.TABLIST_NAME, new TablistNameHandler());
registerHandler(PacketIdManager.PREPARE_SCHEM, new PrepareSchemHandler());
} }
} }

Datei anzeigen

@ -0,0 +1,42 @@
/*
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.bungeecore.comms.handlers;
import com.google.common.io.ByteArrayDataInput;
import de.steamwar.bungeecore.ArenaMode;
import de.steamwar.bungeecore.SubserverSystem;
import de.steamwar.bungeecore.commands.BauCommand;
import de.steamwar.bungeecore.comms.SpigotHandler;
import de.steamwar.bungeecore.sql.SchematicType;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer;
public class PrepareSchemHandler implements SpigotHandler {
@Override
public void handle(ByteArrayDataInput byteArrayDataInput) {
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(SteamwarUser.get(byteArrayDataInput.readInt()).getUuid());
int schematicID = byteArrayDataInput.readInt();
ArenaMode mode = ArenaMode.getBySchemType(SchematicType.fromDB(byteArrayDataInput.readUTF()));
BauCommand.stopBauserver(player);
SubserverSystem.startTestServer(player, mode, mode.getRandomMap(), 0, schematicID);
}
}

Datei anzeigen

@ -19,9 +19,9 @@
package de.steamwar.bungeecore.listeners; package de.steamwar.bungeecore.listeners;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.BannedUserIPs; import de.steamwar.bungeecore.sql.BannedUserIPs;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
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;
@ -44,7 +44,7 @@ public class BanListener extends BasicListener {
if(user.isBanned()) { if(user.isBanned()) {
user.updateBanIP(event.getConnection().getAddress().getAddress().getHostAddress()); user.updateBanIP(event.getConnection().getAddress().getAddress().getHostAddress());
event.setCancelled(true); event.setCancelled(true);
event.setCancelReason(user.banMessage()); event.setCancelReason(user.banMessage(ProxyServer.getInstance().getPlayer(event.getConnection().getUniqueId())));
return; return;
} }
@ -52,12 +52,21 @@ public class BanListener extends BasicListener {
if(!ips.isEmpty()){ if(!ips.isEmpty()){
Timestamp highestBan = ips.get(0).getTimestamp(); Timestamp highestBan = ips.get(0).getTimestamp();
boolean perma = false;
for(BannedUserIPs banned : ips) { for(BannedUserIPs banned : ips) {
if(highestBan.before(banned.getTimestamp())) SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID());
highestBan = banned.getTimestamp(); if(bannedUser.isBanned()) {
Punishment ban = bannedUser.getPunishment(Punishment.PunishmentType.Ban);
if(ban.isPerma()) {
perma = true;
break;
}
if(ban.getEndTime().after(highestBan))
highestBan = ban.getEndTime();
}
} }
ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ban " + user.getUserName() + " " ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ban " + user.getUserName() + " "
+ highestBan.toLocalDateTime().format(DateTimeFormatter.ofPattern("dd.MM.yyyy_HH:mm")) + (perma?"perma":highestBan.toLocalDateTime().format(DateTimeFormatter.ofPattern("dd.MM.yyyy_HH:mm")))
+ " Bannumgehung"); + " Bannumgehung");
for (ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){ for (ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){
@ -70,7 +79,7 @@ public class BanListener extends BasicListener {
for(BannedUserIPs banned : ips) { for(BannedUserIPs banned : ips) {
SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID()); SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID());
potentialBan.append(Message.parse("BAN_AVOIDING_LIST", target, bannedUser.getUserName(), potentialBan.append(Message.parse("BAN_AVOIDING_LIST", target, bannedUser.getUserName(),
banned.getTimestamp().toLocalDateTime().format(BungeeCore.DATE_FORMAT))); banned.getTimestamp().toLocalDateTime().format(DateTimeFormatter.ofPattern(Message.parse("TIMEFORMAT", target)))));
} }
TextComponent msg = new TextComponent(potentialBan.toString()); TextComponent msg = new TextComponent(potentialBan.toString());

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bungeecore.listeners; package de.steamwar.bungeecore.listeners;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
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.commands.BauCommand; import de.steamwar.bungeecore.commands.BauCommand;
@ -28,10 +29,7 @@ import de.steamwar.bungeecore.comms.packets.PingPacket;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.Team; import de.steamwar.bungeecore.sql.Team;
import de.steamwar.bungeecore.sql.UserGroup; import de.steamwar.bungeecore.sql.UserGroup;
import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.*;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.Title;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.ChatEvent; import net.md_5.bungee.api.event.ChatEvent;
@ -73,7 +71,7 @@ public class ChatListener extends BasicListener {
String [] command = e.getMessage().split(" "); String [] command = e.getMessage().split(" ");
if(command[0].contains(":")){ if(command[0].contains(":")){
if(e.getSender() instanceof ProxiedPlayer) if(e.getSender() instanceof ProxiedPlayer)
BungeeCore.send((ProxiedPlayer) e.getSender(), BungeeCore.CHAT_PREFIX + "§cUnbekannter Befehl."); Message.send("UNKNOWN_COMMAND", (CommandSender) e.getSender());
e.setCancelled(true); e.setCancelled(true);
return; return;
} }
@ -99,25 +97,23 @@ public class ChatListener extends BasicListener {
private void lixfelAlert(ProxiedPlayer sender) { private void lixfelAlert(ProxiedPlayer sender) {
LIXFEL.send(sender); LIXFEL.send(sender);
final String l = "§eLixfel§8»§e" + sender.getName() + " §c"; Message.send("CHAT_LIXFEL_ACTION_BAR", sender, ChatMessageType.ACTION_BAR);
BungeeCore.send(sender, ChatMessageType.ACTION_BAR, "§4§lTechnische Probleme?");
TaskScheduler scheduler = ProxyServer.getInstance().getScheduler(); TaskScheduler scheduler = ProxyServer.getInstance().getScheduler();
scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Du hast mich gerufen!"), 3, TimeUnit.SECONDS); scheduler.schedule(BungeeCore.get(), () -> Message.sendPrefixless("MSG_FORMAT", sender, "Lixfel", sender.getDisplayName(), Message.parse("CHAT_LIXFEL_1", sender)), 3, TimeUnit.SECONDS);
scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Leider bin ich nur ein Mensch und höre nicht alles."), 6, TimeUnit.SECONDS); scheduler.schedule(BungeeCore.get(), () -> Message.sendPrefixless("MSG_FORMAT", sender, "Lixfel", sender.getDisplayName(), Message.parse("CHAT_LIXFEL_2", sender)), 6, TimeUnit.SECONDS);
scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Daher bitte ich dich, das Problem bzw. den Fehler im Forum in der Kategorie §eFehler melden §cmit einer ausreichenden Beschreibung zu hinterlegen."), 11, TimeUnit.SECONDS); scheduler.schedule(BungeeCore.get(), () -> Message.sendPrefixless("MSG_FORMAT", sender, "Lixfel", sender.getDisplayName(), Message.parse("CHAT_LIXFEL_3", sender)), 11, TimeUnit.SECONDS);
scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Vielen Dank."), 12, TimeUnit.SECONDS); scheduler.schedule(BungeeCore.get(), () -> Message.sendPrefixless("MSG_FORMAT", sender, "Lixfel", sender.getDisplayName(), Message.parse("CHAT_LIXFEL_4", sender)), 12, TimeUnit.SECONDS);
scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Ich wünsche dir noch weiterhin ein reibungsloses Spielerlebnis."), 15, TimeUnit.SECONDS); scheduler.schedule(BungeeCore.get(), () -> Message.sendPrefixless("MSG_FORMAT", sender, "Lixfel", sender.getDisplayName(), Message.parse("CHAT_LIXFEL_5", sender)), 15, TimeUnit.SECONDS);
} }
private void yoyonowAlert(ProxiedPlayer sender) { private void yoyonowAlert(ProxiedPlayer sender) {
YOYONOW.send(sender); YOYONOW.send(sender);
final String l = "§eYoyoNow§8»§e" + sender.getName() + " §c"; Message.send("CHAT_LIXFEL_ACTION_BAR", sender, ChatMessageType.ACTION_BAR);
BungeeCore.send(sender, ChatMessageType.ACTION_BAR, "§4§lTechnische Probleme?");
TaskScheduler scheduler = ProxyServer.getInstance().getScheduler(); TaskScheduler scheduler = ProxyServer.getInstance().getScheduler();
scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Du hast mich gerufen!"), 3, TimeUnit.SECONDS); scheduler.schedule(BungeeCore.get(), () -> Message.sendPrefixless("MSG_FORMAT", sender, "YoyoNow", sender.getDisplayName(), Message.parse("CHAT_YOYONOW_1", sender)), 3, TimeUnit.SECONDS);
scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Ich würde dir gerne den Befehl \"/bug <MESSAGE>\" ans Herz legen."), 10, TimeUnit.SECONDS); scheduler.schedule(BungeeCore.get(), () -> Message.sendPrefixless("MSG_FORMAT", sender, "YoyoNow", sender.getDisplayName(), Message.parse("CHAT_YOYONOW_2", sender)), 6, TimeUnit.SECONDS);
scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Vielen Dank."), 12, TimeUnit.SECONDS); scheduler.schedule(BungeeCore.get(), () -> Message.sendPrefixless("MSG_FORMAT", sender, "YoyoNow", sender.getDisplayName(), Message.parse("CHAT_YOYONOW_3", sender)), 11, TimeUnit.SECONDS);
scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Ich wünsche dir noch weiterhin ein reibungsloses Spielerlebnis."), 15, TimeUnit.SECONDS); scheduler.schedule(BungeeCore.get(), () -> Message.sendPrefixless("MSG_FORMAT", sender, "YoyoNow", sender.getDisplayName(), Message.parse("CHAT_YOYONOW_4", sender)), 12, TimeUnit.SECONDS);
} }
private void onChat(ChatEvent e){ private void onChat(ChatEvent e){
@ -130,20 +126,20 @@ public class ChatListener extends BasicListener {
yoyonowAlert(sender); yoyonowAlert(sender);
if(sender.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){ if(sender.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cUm Chatnachrichten versenden zu können, musst du auch welche empfangen!"); Message.send("CHAT_RECEIVE", sender);
e.setCancelled(true); e.setCancelled(true);
return; return;
} }
SteamwarUser user = SteamwarUser.get(sender); SteamwarUser user = SteamwarUser.get(sender);
if(user.isMuted()){ if(user.isMuted()){
sender.sendMessage(user.muteMessage()); sender.sendMessage(user.muteMessage(sender));
e.setCancelled(true); e.setCancelled(true);
return; return;
} }
if(!sender.hasPermission(ConnectionListener.TEAM_GROUP) && (e.getMessage().contains("http") || e.getMessage().contains("www"))){ if(!sender.hasPermission(ConnectionListener.TEAM_GROUP) && (e.getMessage().contains("http") || e.getMessage().contains("www"))){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDu darfst keine Links versenden."); Message.send("CHAT_NO_LINKS", sender);
e.setCancelled(true); e.setCancelled(true);
return; return;
} }
@ -170,22 +166,11 @@ public class ChatListener extends BasicListener {
msg = "§" + team.getTeamColor() + team.getTeamKuerzel() + " §r" + msg; msg = "§" + team.getTeamColor() + team.getTeamKuerzel() + " §r" + msg;
} }
String[] msgSplits = msg.split(" ");
StringBuilder builder = new StringBuilder();
for(ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){ for(ProxiedPlayer target : ProxyServer.getInstance().getPlayers()){
Subserver targetServer = Subserver.getSubserver(target); Subserver targetServer = Subserver.getSubserver(target);
if(!(targetServer == null || targetServer.getType() != Servertype.ARENA || targetServer.getServer() != target.getServer().getInfo())) continue; if(!(targetServer == null || targetServer.getType() != Servertype.ARENA || targetServer.getServer() != target.getServer().getInfo())) continue;
for (String curr : msgSplits) {
if(curr.equalsIgnoreCase("@" + target.getName())) { BungeeCore.send(target, ChatMessageType.CHAT, parseAtMessage(msg, chatcolor, target));
builder.append("§e@").append(target.getName()).append(chatcolor).append(" ");
new PingPacket(SteamwarUser.get(target).getId()).send(target);
}else {
builder.append(curr).append(" ");
}
}
BungeeCore.send(target, ChatMessageType.CHAT, builder.toString());
builder = new StringBuilder();
} }
BungeeCore.log(sender.getServer().getInfo(), msg); BungeeCore.log(sender.getServer().getInfo(), msg);
} }
@ -194,20 +179,20 @@ public class ChatListener extends BasicListener {
ProxiedPlayer sender = (ProxiedPlayer) e.getSender(); ProxiedPlayer sender = (ProxiedPlayer) e.getSender();
BungeeCore.log(sender, e.getMessage()); BungeeCore.log(sender, e.getMessage());
if(command.length == 1){ if(command.length == 1){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§e" + command[0].substring(1) + " §8[§7Nachricht§8]"); Message.send("CHAT_BC_USAGE", sender, command[0].substring(1));
e.setCancelled(true); e.setCancelled(true);
return; return;
} }
SteamwarUser user = SteamwarUser.get(sender); SteamwarUser user = SteamwarUser.get(sender);
if(user.isMuted()){ if(user.isMuted()){
sender.sendMessage(user.muteMessage()); sender.sendMessage(user.muteMessage(sender));
e.setCancelled(true); e.setCancelled(true);
return; return;
} }
if(command[1].startsWith("/")){ if(command[1].startsWith("/")){
BungeeCore.send(sender, "§cKeine Befehle mit /local möglich."); Message.send("CHAT_BC_NO_COMMANDS", sender);
e.setCancelled(true); e.setCancelled(true);
return; return;
} }
@ -215,6 +200,28 @@ public class ChatListener extends BasicListener {
e.setMessage(e.getMessage().substring(command[0].length() + 1)); e.setMessage(e.getMessage().substring(command[0].length() + 1));
} }
public static String parseAtMessage(String message, String returnColor, ProxiedPlayer player) {
if(!message.contains("@")) {
return message;
}
StringBuilder builder = new StringBuilder();
for (String curr : message.split(" ")) {
if(curr.toLowerCase().startsWith("@" + player.getName().toLowerCase())) {
new PingPacket(SteamwarUser.get(player).getId()).send(player);
builder.append("§e@")
.append(player.getName())
.append(returnColor)
.append(curr.substring(player.getName().length() + 1))
.append(" ");
}else {
builder.append(curr)
.append(" ");
}
}
return builder.toString();
}
@EventHandler @EventHandler
public void onTabCompleteEvent(TabCompleteEvent e){ public void onTabCompleteEvent(TabCompleteEvent e){
List<String> suggestions = e.getSuggestions(); List<String> suggestions = e.getSuggestions();
@ -230,6 +237,17 @@ public class ChatListener extends BasicListener {
suggestions.add(name); suggestions.add(name);
} }
} }
if(last.startsWith("@")) {
String plrName = last.replace("@", "");
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){
String name = player.getName();
if ((plrName.isEmpty() || name.startsWith(plrName)) && !plrName.equalsIgnoreCase(name)) {
suggestions.add("@" + name);
}
}
}
if(e.getSender() instanceof ProxiedPlayer && cursor.length == 1 && cursor[0].startsWith("/")){ if(e.getSender() instanceof ProxiedPlayer && cursor.length == 1 && cursor[0].startsWith("/")){
ProxiedPlayer player = (ProxiedPlayer) e.getSender(); ProxiedPlayer player = (ProxiedPlayer) e.getSender();
for(String cmd : BungeeCore.commands.keySet()){ for(String cmd : BungeeCore.commands.keySet()){

Datei anzeigen

@ -19,10 +19,7 @@
package de.steamwar.bungeecore.listeners; package de.steamwar.bungeecore.listeners;
import de.steamwar.bungeecore.Bauserver; import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Servertype;
import de.steamwar.bungeecore.Subserver;
import de.steamwar.bungeecore.commands.CheckCommand; import de.steamwar.bungeecore.commands.CheckCommand;
import de.steamwar.bungeecore.sql.Schematic; import de.steamwar.bungeecore.sql.Schematic;
import de.steamwar.bungeecore.sql.SchematicType; import de.steamwar.bungeecore.sql.SchematicType;
@ -50,7 +47,7 @@ public class CheckListener extends BasicListener {
} }
if(!uncheckedSchematics.isEmpty()) if(!uncheckedSchematics.isEmpty())
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Du hast noch §e" + uncheckedSchematics.size() + " §7ungeprüfte Schematic§8(§7s§8)!"); Message.send("CHECK_UNCHECKED", player, uncheckedSchematics.size());
} }
@EventHandler @EventHandler

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bungeecore.listeners; package de.steamwar.bungeecore.listeners;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
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.commands.ChallengeCommand; import de.steamwar.bungeecore.commands.ChallengeCommand;
@ -30,9 +31,6 @@ import de.steamwar.bungeecore.sql.UserGroup;
import net.md_5.bungee.api.AbstractReconnectHandler; import net.md_5.bungee.api.AbstractReconnectHandler;
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;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
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.PlayerDisconnectEvent; import net.md_5.bungee.api.event.PlayerDisconnectEvent;
@ -86,16 +84,14 @@ public class ConnectionListener extends BasicListener {
if(subserver.getType() == Servertype.ARENA){ if(subserver.getType() == Servertype.ARENA){
Iterator<ProxiedPlayer> it = subserver.getServer().getPlayers().iterator(); Iterator<ProxiedPlayer> it = subserver.getServer().getPlayers().iterator();
if(it.hasNext()){ if(it.hasNext()){
TextComponent tc = new TextComponent(BungeeCore.CHAT_PREFIX + "§7Klicke §ehier§7, um §e" + subserver.getServer().getName() + " §7beizutreten"); Message.send("JOIN_ARENA", player, Message.parse("JOIN_ARENA_HOVER", player),
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§eArena beitreten").create())); new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + it.next().getName()), subserver.getServer().getName());
tc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + it.next().getName()));
player.sendMessage(tc);
} }
} }
} }
if(newPlayers.contains(player.getUniqueId())){ if(newPlayers.contains(player.getUniqueId())){
BungeeCore.broadcast(BungeeCore.CHAT_PREFIX + "§7Begrüßt alle mal §e" + player.getName() + " §7auf dem Server§8!"); Message.broadcast("JOIN_FIRST", player.getName());
newPlayers.remove(player.getUniqueId()); newPlayers.remove(player.getUniqueId());
} }
} }
@ -143,6 +139,6 @@ public class ConnectionListener extends BasicListener {
ProxiedPlayer player = e.getPlayer(); ProxiedPlayer player = e.getPlayer();
Collection<ProxiedPlayer> players = server.getPlayers(); Collection<ProxiedPlayer> players = server.getPlayers();
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::stop); ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), subserver::waitForTermination);
} }
} }

Datei anzeigen

@ -1,25 +1,23 @@
package de.steamwar.bungeecore.listeners; package de.steamwar.bungeecore.listeners;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.Event; import de.steamwar.bungeecore.sql.Event;
import de.steamwar.bungeecore.sql.EventFight; import de.steamwar.bungeecore.sql.EventFight;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.TeamTeilnahme; import de.steamwar.bungeecore.sql.TeamTeilnahme;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.event.PostLoginEvent; import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.event.EventHandler; import net.md_5.bungee.event.EventHandler;
public class EventModeListener extends BasicListener { public class EventModeListener extends BasicListener {
private static final BaseComponent[] nonParticipant = TextComponent.fromLegacyText("§cDu bist kein Eventteilnehmer.");
@EventHandler @EventHandler
public void onPostLogin(PostLoginEvent e) { public void onPostLogin(PostLoginEvent e) {
SteamwarUser user = SteamwarUser.get(e.getPlayer().getUniqueId()); SteamwarUser user = SteamwarUser.get(e.getPlayer().getUniqueId());
Event event = Event.get(); Event event = Event.get();
if(event == null){ if(event == null){
e.getPlayer().disconnect(nonParticipant); e.getPlayer().disconnect(TextComponent.fromLegacyText(Message.parse("EVENTMODE_KICK", e.getPlayer())));
return; return;
} }
@ -31,6 +29,6 @@ public class EventModeListener extends BasicListener {
return; return;
} }
e.getPlayer().disconnect(nonParticipant); e.getPlayer().disconnect(TextComponent.fromLegacyText(Message.parse("EVENTMODE_KICK", e.getPlayer())));
} }
} }

Datei anzeigen

@ -19,7 +19,7 @@
package de.steamwar.bungeecore.listeners; package de.steamwar.bungeecore.listeners;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.PollAnswer; import de.steamwar.bungeecore.sql.PollAnswer;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;
@ -56,14 +56,13 @@ public class PollSystem extends BasicListener {
} }
public static void sendPoll(ProxiedPlayer player){ public static void sendPoll(ProxiedPlayer player){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§e§lUmfrage"); Message.send("POLL_HEADER", player);
BungeeCore.send(player, "§7Klicke die Antwort an, die dir gefällt!"); Message.sendPrefixless("POLL_HEADER2", player);
BungeeCore.send(player, "§e" + question); Message.sendPrefixless("POLL_QUESTION", player, question);
for(int i = 1; i <= answers.size(); i++){ for(int i = 1; i <= answers.size(); i++){
BungeeCore.send(player, "§7" + answers.get(i-1), Message.send("POLL_ANWSER", player, Message.parse("POLL_ANWSER_HOVER", player, answers.get(i-1)),
"§e" + answers.get(i-1) + " §ewählen", new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/poll " + i), answers.get(i-1));
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/poll " + i));
} }
} }

Datei anzeigen

@ -23,6 +23,7 @@ import codecrafter47.bungeetablistplus.api.bungee.BungeeTabListPlusAPI;
import codecrafter47.bungeetablistplus.api.bungee.Icon; import codecrafter47.bungeetablistplus.api.bungee.Icon;
import codecrafter47.bungeetablistplus.tablist.DefaultCustomTablist; import codecrafter47.bungeetablistplus.tablist.DefaultCustomTablist;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
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.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
@ -49,9 +50,8 @@ public class TablistManager extends BasicListener {
private Icon darkGray; private Icon darkGray;
private Icon gray; private Icon gray;
private String header;
private int size; private int size;
private TreeMap<String, List<ProxiedPlayer>> playerMap = new TreeMap<>(); private final TreeMap<String, List<ProxiedPlayer>> playerMap = new TreeMap<>();
public TablistManager(){ public TablistManager(){
ProxyServer.getInstance().getScheduler().schedule(BungeeCore.get(), this::updateCustomTablist, 1, 1, TimeUnit.SECONDS); ProxyServer.getInstance().getScheduler().schedule(BungeeCore.get(), this::updateCustomTablist, 1, 1, TimeUnit.SECONDS);
@ -67,27 +67,6 @@ public class TablistManager extends BasicListener {
} }
} }
private void calcHeader(){
if(seconds % 4 == 0){
int phase = (seconds % 16) / 4;
switch(phase){
case 0:
header = "§8Spieler online: §e" + ProxyServer.getInstance().getPlayers().size();
break;
case 1:
header = "§8Teamspeak: §eSteam§8War.de";
break;
case 2:
header = "§8Discord: §8https://discord.gg/J4NtQmM";
break;
case 3:
default:
header = "§8Website: https://§eSteam§8War.de";
break;
}
}
}
private void calculateSize(){ private void calculateSize(){
size = -1; size = -1;
for(Map.Entry<String, List<ProxiedPlayer>> server : playerMap.entrySet()) for(Map.Entry<String, List<ProxiedPlayer>> server : playerMap.entrySet())
@ -100,8 +79,6 @@ public class TablistManager extends BasicListener {
} }
private synchronized void updateCustomTablist(){ private synchronized void updateCustomTablist(){
calcHeader();
//Calculate server-player-map //Calculate server-player-map
playerMap.clear(); playerMap.clear();
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){ for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){
@ -153,6 +130,21 @@ public class TablistManager extends BasicListener {
BungeeTabListPlusAPI.setCustomTabList(player, this); BungeeTabListPlusAPI.setCustomTabList(player, this);
} }
private String calcHeader(ProxiedPlayer player){
int phase = (seconds % 16) / 4;
switch(phase){
case 0:
return Message.parse("TABLIST_PHASE_0", player, ProxyServer.getInstance().getPlayers().size());
case 1:
return Message.parse("TABLIST_PHASE_1", player);
case 2:
return Message.parse("TABLIST_PHASE_2", player);
case 3:
default:
return Message.parse("TABLIST_PHASE_DEFAULT", player);
}
}
private String getPing(){ private String getPing(){
int ping = player.getPing(); int ping = player.getPing();
if(ping < 50){ if(ping < 50){
@ -168,7 +160,7 @@ public class TablistManager extends BasicListener {
try { try {
ServerInfo currentServer = player.getServer().getInfo(); ServerInfo currentServer = player.getServer().getInfo();
setHeader(header); setHeader(calcHeader(player));
setFooter("§e" + currentServer.getName() + " " + getPing() + "§8ms"); setFooter("§e" + currentServer.getName() + " " + getPing() + "§8ms");
setSize(size, 20); setSize(size, 20);
@ -178,6 +170,8 @@ public class TablistManager extends BasicListener {
setSlot(i%20, i/20, darkGray, "", 1000); setSlot(i%20, i/20, darkGray, "", 1000);
i++; i++;
} }
if(server.equals("Bau"))
server = Message.parse("TABLIST_BAU", player);
setSlot(i%20, i/20, gray, "§7§l" + server, 1000); setSlot(i%20, i/20, gray, "§7§l" + server, 1000);
i++; i++;
for (ProxiedPlayer p : playerMap.get(server)){ for (ProxiedPlayer p : playerMap.get(server)){

Datei anzeigen

@ -29,9 +29,13 @@ import net.md_5.bungee.api.event.ServerSwitchEvent;
import net.md_5.bungee.event.EventHandler; import net.md_5.bungee.event.EventHandler;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.HashSet;
import java.util.Set;
public class ModLoaderBlocker extends BasicListener { public class ModLoaderBlocker extends BasicListener {
private static final Set<String> BLOCKED_SERVER = new HashSet<>();
@EventHandler @EventHandler
public void onPluginMessageEvent(PluginMessageEvent e){ public void onPluginMessageEvent(PluginMessageEvent e){
Connection sender = e.getSender(); Connection sender = e.getSender();
@ -79,8 +83,9 @@ public class ModLoaderBlocker extends BasicListener {
@EventHandler @EventHandler
public void onServerSwitch(ServerSwitchEvent event) { public void onServerSwitch(ServerSwitchEvent event) {
if(Subserver.getSubserver(event.getPlayer()) != null if(((Subserver.getSubserver(event.getPlayer()) != null
&& Subserver.getSubserver(event.getPlayer()).getType() == Servertype.ARENA && Subserver.getSubserver(event.getPlayer()).getType() == Servertype.ARENA)
|| BLOCKED_SERVER.contains(event.getPlayer().getServer().getInfo().getName()))
&& isFabric(event.getPlayer())) { && isFabric(event.getPlayer())) {
event.getPlayer().connect(BungeeCore.get().getProxy().getServerInfo(BungeeCore.LOBBY_SERVER)); event.getPlayer().connect(BungeeCore.get().getProxy().getServerInfo(BungeeCore.LOBBY_SERVER));
Message.send("MODLOADER_DENIED", event.getPlayer()); Message.send("MODLOADER_DENIED", event.getPlayer());
@ -90,4 +95,8 @@ public class ModLoaderBlocker extends BasicListener {
public static boolean isFabric(ProxiedPlayer player) { public static boolean isFabric(ProxiedPlayer player) {
return Storage.fabricPlayers.contains(player); return Storage.fabricPlayers.contains(player);
} }
public static void addServer(String server) {
BLOCKED_SERVER.add(server);
}
} }

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bungeecore.listeners.mods; package de.steamwar.bungeecore.listeners.mods;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.Mod; import de.steamwar.bungeecore.sql.Mod;
import de.steamwar.bungeecore.sql.Mod.ModType; import de.steamwar.bungeecore.sql.Mod.ModType;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
@ -72,9 +73,9 @@ class Utils {
if(mods.size() == 1){ if(mods.size() == 1){
if(max == ModType.YELLOW) if(max == ModType.YELLOW)
player.disconnect(BungeeCore.stringToText("§7Deaktiviere den Mod §e" + mods.get(0).getModName() + "§7, um weiter auf §eSteam§8War §7spielen zu können.")); player.disconnect(BungeeCore.stringToText(Message.parse("MOD_YELLOW_SING", player, mods.get(0).getModName())));
else{ else{
user.ban(Timestamp.from(Instant.now().plus(7, ChronoUnit.DAYS)), "Versuchte Benutzung des Mods " + mods.get(0).getModName()); user.ban(Timestamp.from(Instant.now().plus(7, ChronoUnit.DAYS)), Message.parse("MOD_RED_SING", player, mods.get(0).getModName()), 0, false);
BungeeCore.log(Level.SEVERE, user.getUserName() + " " + user.getId() + " wurde automatisch wegen des Mods " + mods.get(0).getModName() + " gebannt."); BungeeCore.log(Level.SEVERE, user.getUserName() + " " + user.getId() + " wurde automatisch wegen des Mods " + mods.get(0).getModName() + " gebannt.");
} }
}else{ }else{
@ -82,9 +83,9 @@ class Utils {
mods.forEach(mod -> sb.append(mod.getModName()).append('\n')); mods.forEach(mod -> sb.append(mod.getModName()).append('\n'));
if(max == ModType.YELLOW) if(max == ModType.YELLOW)
player.disconnect(BungeeCore.stringToText("§7Deaktiviere die Mods\n§e" + sb.toString() + "§7um weiter auf §eSteam§8War §7spielen zu können.")); player.disconnect(BungeeCore.stringToText(Message.parse("MOD_YELLOW_PLUR", player, sb.toString())));
else{ else{
user.ban(Timestamp.from(Instant.now().plus(7, ChronoUnit.DAYS)), "Versuchte Benutzung der Mods\n" + sb.toString()); user.ban(Timestamp.from(Instant.now().plus(7, ChronoUnit.DAYS)), Message.parse("MOD_RED_PLUR", player, sb.toString()), 0, false);
BungeeCore.log(Level.SEVERE, user.getUserName() + " " + user.getId() + " wurde automatisch wegen der Mods " + sb.toString() + " gebannt."); BungeeCore.log(Level.SEVERE, user.getUserName() + " " + user.getId() + " wurde automatisch wegen der Mods " + sb.toString() + " gebannt.");
} }
} }

Datei anzeigen

@ -30,27 +30,25 @@ import java.util.UUID;
public class BauweltMember{ public class BauweltMember{
private final int bauweltID; private final int bauweltID;
private final int memberID; private final int memberID;
private boolean build;
private boolean worldEdit; private boolean worldEdit;
private boolean world; private boolean world;
private BauweltMember(int ownerID, int memberID, boolean build, boolean worldEdit, boolean world, boolean updateDB){ private BauweltMember(int ownerID, int memberID, boolean worldEdit, boolean world, boolean updateDB){
bauweltID = ownerID; bauweltID = ownerID;
this.memberID = memberID; this.memberID = memberID;
this.build = build;
this.worldEdit = worldEdit; this.worldEdit = worldEdit;
this.world = world; this.world = world;
if(updateDB) if(updateDB)
updateDB(); updateDB();
} }
public BauweltMember(int ownerID, int memberID, boolean build, boolean worldEdit, boolean world){ public BauweltMember(int ownerID, int memberID, boolean worldEdit, boolean world){
this(ownerID, memberID, build, worldEdit, world, true); this(ownerID, memberID, worldEdit, world, true);
} }
public BauweltMember(UUID ownerID, UUID memberID, boolean build, boolean worldEdit, boolean world){ public BauweltMember(UUID ownerID, UUID memberID, boolean worldEdit, boolean world){
this(SteamwarUser.get(ownerID).getId(), SteamwarUser.get(memberID).getId(), build, worldEdit, world); this(SteamwarUser.get(ownerID).getId(), SteamwarUser.get(memberID).getId(), worldEdit, world);
} }
public void remove(){ public void remove(){
@ -58,8 +56,8 @@ public class BauweltMember{
} }
private void updateDB(){ private void updateDB(){
SQL.update("INSERT INTO BauweltMember (BauweltID, MemberID, Build, WorldEdit, World) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE Build = VALUES(Build), WorldEdit = VALUES(WorldEdit), World = VALUES(World)", SQL.update("INSERT INTO BauweltMember (BauweltID, MemberID, WorldEdit, World) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE WorldEdit = VALUES(WorldEdit), World = VALUES(World)",
bauweltID, memberID, build, worldEdit, world); bauweltID, memberID, worldEdit, world);
} }
public static BauweltMember getBauMember(UUID ownerID, UUID memberID){ public static BauweltMember getBauMember(UUID ownerID, UUID memberID){
@ -72,10 +70,9 @@ public class BauweltMember{
if(member == null || !member.next()){ if(member == null || !member.next()){
return null; return null;
} }
boolean build = member.getBoolean("Build");
boolean worldEdit = member.getBoolean("WorldEdit"); boolean worldEdit = member.getBoolean("WorldEdit");
boolean world = member.getBoolean("World"); boolean world = member.getBoolean("World");
return new BauweltMember(ownerID, memberID, build, worldEdit, world, false); return new BauweltMember(ownerID, memberID, worldEdit, world, false);
} catch (SQLException e) { } catch (SQLException e) {
BungeeCore.log("Could not load BauweltMember", e); BungeeCore.log("Could not load BauweltMember", e);
} }
@ -92,10 +89,9 @@ public class BauweltMember{
List<BauweltMember> members = new ArrayList<>(); List<BauweltMember> members = new ArrayList<>();
while(memberlist.next()){ while(memberlist.next()){
int memberID = memberlist.getInt("MemberID"); int memberID = memberlist.getInt("MemberID");
boolean build = memberlist.getBoolean("Build");
boolean worldEdit = memberlist.getBoolean("WorldEdit"); boolean worldEdit = memberlist.getBoolean("WorldEdit");
boolean world = memberlist.getBoolean("World"); boolean world = memberlist.getBoolean("World");
members.add(new BauweltMember(bauweltID, memberID, build, worldEdit, world, false)); members.add(new BauweltMember(bauweltID, memberID, worldEdit, world, false));
} }
return members; return members;
}catch(SQLException e){ }catch(SQLException e){
@ -112,15 +108,6 @@ public class BauweltMember{
return memberID; return memberID;
} }
public boolean isBuild() {
return build;
}
public void setBuild(boolean build) {
this.build = build;
updateDB();
}
public boolean isWorldEdit() { public boolean isWorldEdit() {
return worldEdit; return worldEdit;
} }

Datei anzeigen

@ -37,6 +37,7 @@ public class Event {
private final int maximumTeamMembers; private final int maximumTeamMembers;
private final boolean publicSchemsOnly; private final boolean publicSchemsOnly;
private final boolean spectateSystem; private final boolean spectateSystem;
private final Timestamp deadline;
private static Event current = null; private static Event current = null;
@ -48,6 +49,7 @@ public class Event {
this.maximumTeamMembers = rs.getInt("MaximumTeamMembers"); this.maximumTeamMembers = rs.getInt("MaximumTeamMembers");
this.publicSchemsOnly = rs.getBoolean("PublicSchemsOnly"); this.publicSchemsOnly = rs.getBoolean("PublicSchemsOnly");
this.spectateSystem = rs.getBoolean("SpectateSystem"); this.spectateSystem = rs.getBoolean("SpectateSystem");
this.deadline = rs.getTimestamp("Deadline");
} }
public static Event get(){ public static Event get(){
@ -133,4 +135,7 @@ public class Event {
public boolean spectateSystem(){ public boolean spectateSystem(){
return spectateSystem; return spectateSystem;
} }
public Timestamp getDeadline() {
return deadline;
}
} }

Datei anzeigen

@ -0,0 +1,155 @@
/*
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.bungeecore.sql;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.time.format.DateTimeFormatter;
import java.util.*;
public class Punishment {
public static Punishment getPunishmentOfPlayer(int user, PunishmentType type) {
ResultSet set = SQL.select("SELECT * FROM Punishments WHERE UserId = ? AND Type = ? ORDER BY PunishmentId DESC LIMIT 1", user, type.name());
try {
if(!set.next())
return null;
return new Punishment(set);
} catch (SQLException e) {
throw new SecurityException("Could not Load Punishments", e);
}
}
public static Map<PunishmentType, Punishment> getPunishmentsOfPlayer(int user) {
ResultSet set = SQL.select("SELECT * FROM Punishments WHERE PunishmentId IN (SELECT MAX(PunishmentId) FROM Punishments WHERE UserId = ? GROUP BY Type)", user);
try {
Map<PunishmentType, Punishment> punishments = new HashMap<>();
while (set.next())
punishments.put(PunishmentType.valueOf(set.getString("Type")), new Punishment(set));
return punishments;
} catch (SQLException e) {
throw new SecurityException("Could not Load Punishments", e);
}
}
public static List<Punishment> getAllPunishmentsOfPlayer(int user) {
ResultSet set = SQL.select("SELECT * FROM Punishments WHERE UserId = ? ORDER BY `PunishmentId` DESC", user);
try {
List<Punishment> punishments = new ArrayList<>();
while (set.next()) {
punishments.add(new Punishment(set));
}
return punishments;
} catch (SQLException e) {
throw new SecurityException("Could not Load all Punishments", e);
}
}
public static Punishment createPunishment(int user, int executor, PunishmentType type, String reason, Timestamp endTime, boolean perma) {
SQL.update("INSERT INTO Punishments (UserId, Punisher, Type, Reason, EndTime, Perma) VALUES (?, ?, ?, ?, ?, ?)",
user, executor, type.name(), reason, endTime, perma);
return getPunishmentOfPlayer(user, type);
}
private final Timestamp startTime;
private Timestamp endTime;
private final PunishmentType type;
private final int user;
private final int id;
private String reason;
private final int punisher;
private boolean perma;
private Punishment(ResultSet set) throws SQLException {
user = set.getInt("UserId");
reason = set.getString("Reason");
type = PunishmentType.valueOf(set.getString("Type"));
startTime = set.getTimestamp("StartTime");
endTime = set.getTimestamp("EndTime");
punisher = set.getInt("Punisher");
perma = set.getBoolean("Perma");
id = set.getInt("PunishmentId");
}
public Timestamp getStartTime() {
return startTime;
}
public Timestamp getEndTime() {
return endTime;
}
public PunishmentType getType() {
return type;
}
public int getUser() {
return user;
}
public String getReason() {
return reason;
}
public int getPunisher() {
return punisher;
}
public boolean isPerma() {
return perma;
}
public void updateEndTime(int from, String newreason, Timestamp newUpdate, boolean perma) {
if(newreason.equals(reason) && newUpdate.equals(endTime) && perma == perma)
return;
ProxiedPlayer player = BungeeCore.get().getProxy().getPlayer(SteamwarUser.get(from).getUuid());
String newReason = Message.parse("BAN_CHANGED", player, reason,
SteamwarUser.get(from).getUserName(),
getBantime(endTime, this.perma),
getBantime(newUpdate, perma),
newreason);
SQL.update("UPDATE Punishments SET EndTime = ?, Reason = ?, Perma = ? WHERE PunishmentId = ?", newUpdate, newReason, perma, id);
this.reason = newReason;
this.perma = perma;
this.endTime = newUpdate;
}
public String getBantime(Timestamp endTime, boolean perma) {
if(perma)
return "permanent";
else
return endTime.toLocalDateTime().format(DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm"));
}
public boolean isCurrent() {
return isPerma() || getEndTime().after(new Date());
}
public enum PunishmentType {
Ban,
Mute;
}
}

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bungeecore.sql; package de.steamwar.bungeecore.sql;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.commands.WebregisterCommand; import de.steamwar.bungeecore.commands.WebregisterCommand;
import de.steamwar.bungeecore.listeners.ConnectionListener; import de.steamwar.bungeecore.listeners.ConnectionListener;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
@ -32,8 +33,7 @@ import java.net.UnknownHostException;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.time.Instant; import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
@ -43,16 +43,13 @@ public class SteamwarUser {
private final UUID uuid; private final UUID uuid;
private String userName; private String userName;
private UserGroup userGroup; private UserGroup userGroup;
private Timestamp banTime;
private String banReason;
private int team; private int team;
private Timestamp muteTime; private boolean leader;
private String muteReason; private Map<Punishment.PunishmentType, Punishment> punishments;
private static final Map<String, SteamwarUser> usersByName = new HashMap<>(); private static final Map<String, SteamwarUser> usersByName = new HashMap<>();
private static final Map<UUID, SteamwarUser> usersByUUID = new HashMap<>(); private static final Map<UUID, SteamwarUser> usersByUUID = new HashMap<>();
private static final Map<Integer, SteamwarUser> usersById = new HashMap<>(); private static final Map<Integer, SteamwarUser> usersById = new HashMap<>();
private static final Timestamp PERMA_BAN = Timestamp.from(Instant.ofEpochSecond(946684800));
private static final InetAddress LIXFEL_DE; private static final InetAddress LIXFEL_DE;
static { static {
@ -69,14 +66,12 @@ public class SteamwarUser {
uuid = UUID.fromString(rs.getString("UUID")); uuid = UUID.fromString(rs.getString("UUID"));
userName = rs.getString("UserName"); userName = rs.getString("UserName");
userGroup = UserGroup.getUsergroup(rs.getString("UserGroup")); userGroup = UserGroup.getUsergroup(rs.getString("UserGroup"));
banTime = rs.getTimestamp("BanTime");
banReason = rs.getString("BanReason");
team = rs.getInt("Team"); team = rs.getInt("Team");
muteTime = rs.getTimestamp("MuteTime"); leader = rs.getBoolean("Leader");
muteReason = rs.getString("MuteReason");
usersById.put(id, this); usersById.put(id, this);
usersByName.put(userName.toLowerCase(), this); usersByName.put(userName.toLowerCase(), this);
usersByUUID.put(uuid, this); usersByUUID.put(uuid, this);
punishments = Punishment.getPunishmentsOfPlayer(id);
} }
public static SteamwarUser getOrCreate(PendingConnection connection){ public static SteamwarUser getOrCreate(PendingConnection connection){
@ -134,6 +129,7 @@ public class SteamwarUser {
public void setTeam(int team){ public void setTeam(int team){
this.team = team; this.team = team;
SQL.update("Update UserData SET Team = ? WHERE id = ?", team, id); SQL.update("Update UserData SET Team = ? WHERE id = ?", team, id);
setLeader(false);
} }
public int getId() { public int getId() {
@ -156,48 +152,47 @@ public class SteamwarUser {
return team; return team;
} }
public Punishment getPunishment(Punishment.PunishmentType type) {
return punishments.getOrDefault(type, null);
}
public boolean isBanned() { public boolean isBanned() {
if (banTime == null) { if(!punishments.containsKey(Punishment.PunishmentType.Ban))
return false; return false;
} else if (banTime.after(new Date()) || banTime.before(PERMA_BAN)) { if(!punishments.get(Punishment.PunishmentType.Ban).isCurrent()) {
return true;
} else {
SQL.update("UPDATE UserData SET BanTime = NULL, BanReason = '' WHERE id = ?", id);
SQL.update("DELETE FROM BannedUserIPs WHERE UserID = ?", id); SQL.update("DELETE FROM BannedUserIPs WHERE UserID = ?", id);
banTime = null; punishments.remove(Punishment.PunishmentType.Ban);
banReason = "";
return false; return false;
} }
return true;
} }
public boolean isMuted(){ public boolean isMuted(){
if(muteTime == null){ if(!punishments.containsKey(Punishment.PunishmentType.Mute))
return false; return false;
}else if(muteTime.after(new Date()) || muteTime.before(PERMA_BAN)){ if(!punishments.get(Punishment.PunishmentType.Mute).isCurrent()) {
punishments.remove(Punishment.PunishmentType.Mute);
return false;
}
return true; return true;
}
public TextComponent banMessage(ProxiedPlayer player){
Punishment punishment = punishments.get(Punishment.PunishmentType.Ban);
if (punishment.isPerma()) {
return BungeeCore.stringToText(Message.parsePrefixed("BANNED_MESSAGE_PERMA", player, punishment.getReason()));
} else { } else {
SQL.update("UPDATE UserData SET MuteTime = NULL, MuteReason = '' WHERE id = ?", id); return BungeeCore.stringToText(Message.parsePrefixed("BANNED_MESSAGE_UNTIL", player, punishment.getEndTime().toLocalDateTime().format(DateTimeFormatter.ofPattern(Message.parse("TIMEFORMAT", player))),
muteTime = null; punishment.getReason()));
muteReason = "";
return false;
} }
} }
public TextComponent banMessage(){ public TextComponent muteMessage(ProxiedPlayer player){
if (banTime.before(PERMA_BAN)) { Punishment punishment = punishments.get(Punishment.PunishmentType.Mute);
return BungeeCore.stringToText(BungeeCore.CHAT_PREFIX + "§cDu bist permanent gebannt. §r§lGrund§r: §c" + banReason); if (punishment.isPerma()) {
return BungeeCore.stringToText(Message.parsePrefixed("MUTED_MESSAGE_PERMA", player, punishment.getReason()));
} else { } else {
return BungeeCore.stringToText(BungeeCore.CHAT_PREFIX + " Du bist bis zum " + return BungeeCore.stringToText(Message.parsePrefixed("MUTED_MESSAGE_UNTIL", player, punishment.getEndTime().toLocalDateTime().format(DateTimeFormatter.ofPattern(Message.parse("TIMEFORMAT", player))), punishment.getReason()));
banTime.toLocalDateTime().format(BungeeCore.DATE_FORMAT) + " gebannt. §r§lGrund§r: §c" + banReason);
}
}
public TextComponent muteMessage(){
if (muteTime.before(PERMA_BAN)) {
return BungeeCore.stringToText(BungeeCore.CHAT_PREFIX + "§cDu bist permanent gemuted. §r§lGrund§r: §c" + muteReason);
} else {
return BungeeCore.stringToText(BungeeCore.CHAT_PREFIX + " Du bist bis zum " +
muteTime.toLocalDateTime().format(BungeeCore.DATE_FORMAT) + " gemuted. §r§lGrund§r: §c" + muteReason);
} }
} }
@ -205,29 +200,35 @@ public class SteamwarUser {
BannedUserIPs.banIP(this, ip); BannedUserIPs.banIP(this, ip);
} }
public void ban(Timestamp time, String banReason){ public void ban(Timestamp time, String banReason, int from, boolean perma){
SQL.update("UPDATE UserData SET BanTime = ?, BanReason = ? WHERE id = ?", time, banReason, id); if(isBanned()) {
banTime = time; punishments.get(Punishment.PunishmentType.Ban).updateEndTime(from, banReason, time, perma);
this.banReason = banReason; return;
}
punishments.remove(Punishment.PunishmentType.Ban);
punishments.put(Punishment.PunishmentType.Ban, Punishment.createPunishment(id, from, Punishment.PunishmentType.Ban, banReason, time, perma));
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(uuid); ProxiedPlayer player = ProxyServer.getInstance().getPlayer(uuid);
if(player != null){ if(player != null){
updateBanIP(player.getAddress().getAddress().getHostAddress()); updateBanIP(player.getAddress().getAddress().getHostAddress());
player.disconnect(banMessage()); player.disconnect(banMessage(player));
for (BannedUserIPs banned: for (BannedUserIPs banned:
BannedUserIPs.get(player.getAddress().getAddress().getHostAddress())) { BannedUserIPs.get(player.getAddress().getAddress().getHostAddress())) {
SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID()); SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID());
if(bannedUser.isBanned() && banned.getTimestamp().before(time)) if(bannedUser.isBanned() && banned.getTimestamp().before(time))
bannedUser.ban(time, bannedUser.banReason); bannedUser.ban(time, banReason, from, perma);
} }
}else }else
updateBanIP(""); updateBanIP("");
} }
public void mute(Timestamp time, String muteReason){ public void mute(Timestamp time, String muteReason, int from, boolean perma){
SQL.update("UPDATE UserData SET MuteTime = ?, MuteReason = ? WHERE id = ?", time, muteReason, id); if(isMuted()) {
muteTime = time; punishments.get(Punishment.PunishmentType.Mute).updateEndTime(from, muteReason, time, perma);
this.muteReason = muteReason; return;
}
punishments.remove(Punishment.PunishmentType.Mute);
punishments.put(Punishment.PunishmentType.Mute, Punishment.createPunishment(id, from, Punishment.PunishmentType.Mute, muteReason, time, perma));
} }
private static SteamwarUser dbInit(ResultSet rs){ private static SteamwarUser dbInit(ResultSet rs){
@ -243,21 +244,33 @@ public class SteamwarUser {
public double getOnlinetime() { public double getOnlinetime() {
ResultSet set = SQL.select("SELECT SUM(UNIX_TIMESTAMP(EndTime) - UNIX_TIMESTAMP(StartTime)) as Playtime FROM Session WHERE UserID = ?", id); ResultSet set = SQL.select("SELECT SUM(UNIX_TIMESTAMP(EndTime) - UNIX_TIMESTAMP(StartTime)) as Playtime FROM Session WHERE UserID = ?", id);
try { try {
set.next(); if(!set.next())
return 0;
return set.getBigDecimal("Playtime").doubleValue(); return set.getBigDecimal("Playtime").doubleValue();
} catch (SQLException throwables) { } catch (SQLException throwables) {
throwables.printStackTrace(); throw new SecurityException("Could not load Online Time", throwables);
} } catch (NullPointerException e) { //When no Sessions are recorded
return 0; return 0;
} }
}
public Timestamp getFirstjoin() { public Timestamp getFirstjoin() {
ResultSet set = SQL.select("SELECT MIN(StartTime) AS FirstJoin FROM Session WHERE UserID = ?", id); ResultSet set = SQL.select("SELECT MIN(StartTime) AS FirstJoin FROM Session WHERE UserID = ?", id);
try { try {
set.next(); if(!set.next())
return null;
return set.getTimestamp("FirstJoin"); return set.getTimestamp("FirstJoin");
} catch (SQLException throwables) { } catch (SQLException throwables) {
throw new SecurityException("Could not load First Join"); throw new SecurityException("Could not load First Join");
} }
} }
public boolean isLeader() {
return leader;
}
public void setLeader(boolean leader) {
this.leader = leader;
SQL.update("Update UserData SET Leader = ? WHERE id = ?", leader, id);
}
} }

Datei anzeigen

@ -33,17 +33,15 @@ public class Team {
private final int teamId; private final int teamId;
private String teamKuerzel; private String teamKuerzel;
private String teamName; private String teamName;
private int teamLeader;
private String teamColor; private String teamColor;
private static final List<Team> teamCache = new LinkedList<>(); private static final List<Team> teamCache = new LinkedList<>();
private static final Team pub = new Team(0, "PUB", "Öffentlich", 0, "8"); private static final Team pub = new Team(0, "PUB", "Öffentlich", "8");
private Team(int id, String kuerzel, String name, int leader, String color){ private Team(int id, String kuerzel, String name, String color){
teamId = id; teamId = id;
teamKuerzel = kuerzel; teamKuerzel = kuerzel;
teamName = name; teamName = name;
teamLeader = leader;
teamColor = color; teamColor = color;
if (id != 0) { if (id != 0) {
teamCache.add(this); teamCache.add(this);
@ -51,16 +49,17 @@ public class Team {
} }
private Team(ResultSet rs) throws SQLException { private Team(ResultSet rs) throws SQLException {
this(rs.getInt("TeamID"), rs.getString("TeamKuerzel"), rs.getString("TeamName"), rs.getInt("TeamLeader"), rs.getString("TeamColor")); this(rs.getInt("TeamID"), rs.getString("TeamKuerzel"), rs.getString("TeamName"), rs.getString("TeamColor"));
} }
public static void create(String kuerzel, String name, int leader){ public static void create(String kuerzel, String name, SteamwarUser user){
SQL.update("INSERT INTO Team (TeamKuerzel, TeamName, TeamLeader) VALUES (?, ?, ?)", kuerzel, name, leader); user.setLeader(true);
SQL.update("INSERT INTO Team (TeamKuerzel, TeamName) VALUES (?, ?)", kuerzel, name);
} }
public static Team get(int id){ public static Team get(int id){
if(id == -1) if(id == -1)
return new Team(-1, "?", "?", 0, "8"); return new Team(-1, "?", "?", "8");
if(id == 0) if(id == 0)
return pub; return pub;
for(Team team : teamCache) for(Team team : teamCache)
@ -110,7 +109,7 @@ public class Team {
} }
private void updateDB(){ private void updateDB(){
SQL.update("INSERT INTO Team (TeamID, TeamKuerzel, TeamName, TeamLeader, TeamColor) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE TeamName = VALUES(TeamName), TeamKuerzel = VALUES(TeamKuerzel), TeamLeader = VALUES(TeamLeader), TeamColor = VALUES(TeamColor)", teamId, teamKuerzel, teamName, teamLeader, teamColor); SQL.update("INSERT INTO Team (TeamID, TeamKuerzel, TeamName, TeamColor) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE TeamName = VALUES(TeamName), TeamKuerzel = VALUES(TeamKuerzel), TeamColor = VALUES(TeamColor)", teamId, teamKuerzel, teamName, teamColor);
} }
public int getTeamId() { public int getTeamId() {
@ -135,15 +134,6 @@ public class Team {
updateDB(); updateDB();
} }
public int getTeamLeader() {
return teamLeader;
}
public void setTeamLeader(int teamLeader) {
this.teamLeader = teamLeader;
updateDB();
}
public String getTeamColor() { public String getTeamColor() {
return teamColor; return teamColor;
} }

Datei anzeigen

@ -1,8 +1,10 @@
PREFIX=§eSteam§8War» PREFIX=§eSteam§8War»
SPACER= SPACER=
TIMEFORMAT=HH:mm dd.MM.yyyy
UNKNOWN_COMMAND=§cUnbekannter Befehl. UNKNOWN_COMMAND=§cUnbekannter Befehl.
UNKNOWN_PLAYER=§cDiesen Spieler gibt es nicht. UNKNOWN_PLAYER=§cDiesen Spieler gibt es nicht.
UNKNOWN_TEAM=§cDieses Team gibt es nicht.
INVALID_TIME=§cUngültige Zeitangabe. INVALID_TIME=§cUngültige Zeitangabe.
#ModLoader blocker #ModLoader blocker
@ -29,31 +31,31 @@ HELP_JOIN_HOVER=§eSpieler beitreten
HELP_LOCAL=§7Schreibe mit §8/§elocal §7nur auf dem lokalen Server! HELP_LOCAL=§7Schreibe mit §8/§elocal §7nur auf dem lokalen Server!
HELP_LOCAL_HOVER=§eLokaler Chat HELP_LOCAL_HOVER=§eLokaler Chat
HELP_TNT=§8/§etnt §8- §7(de)aktiviert Explosionsschaden HELP_TNT=§8/§7tnt §8- §7(de)aktiviert Explosionsschaden
HELP_FIRE=§8/§efire §8- §7(de)aktiviert Feuerschaden HELP_FIRE=§8/§7fire §8- §7(de)aktiviert Feuerschaden
HELP_TESTBLOCK=§8/§etestblock §8- §7Erneuert den nächsten Testblock HELP_TESTBLOCK=§8/§7testblock §8- §7Erneuert den nächsten Testblock
HELP_RESET=§8/§ereset §8- §7Setzt die derzeitige Region zurück HELP_RESET=§8/§7reset §8- §7Setzt die derzeitige Region zurück
HELP_SPEED=§8/§espeed §8- §7Ändert deine Fluggeschwindigkeit HELP_SPEED=§8/§7speed §8- §7Ändert deine Fluggeschwindigkeit
HELP_NV=§8/§env §8- §7(de)aktiviert Nachtsicht HELP_NV=§8/§7nv §8- §7(de)aktiviert Nachtsicht
HELP_WV=§8/§ewv §8- §7(de)aktiviert Unterwassersicht HELP_WV=§8/§7wv §8- §7(de)aktiviert Unterwassersicht
HELP_TRACE=§8/§etrace §8- §7Gibt einen Überblick über den TNT-Tracer HELP_TRACE=§8/§7trace §8- §7Gibt einen Überblick über den TNT-Tracer
HELP_TPSLIMIT=§8/§etpslimit §8- §7Gibt einen Überblick über den TPS-Limiter HELP_TPSLIMIT=§8/§7tpslimit §8- §7Gibt einen Überblick über den TPS-Limiter
HELP_LOADER=§8/§eloader §8- §7Nutze den automatischen Kanonenlader HELP_LOADER=§8/§7loader §8- §7Nutze den automatischen Kanonenlader
HELP_PROTECT=§8/§eprotect §8- §7Schützt den Boden der (M)WG-Region HELP_PROTECT=§8/§7protect §8- §7Schützt den Boden der (M)WG-Region
HELP_FREEZE=§8/§efreeze §8- §7Unterbindet Blockupdates HELP_FREEZE=§8/§7freeze §8- §7Unterbindet Blockupdates
HELP_SKULL=§8/§eskull §8- §7Gibt dir den Kopf eines Spielers HELP_SKULL=§8/§7skull §8- §7Gibt dir den Kopf eines Spielers
HELP_DEBUGSTICK=§8/§edebugstick §8- §7Gibt dir einen Debugstick (nur 1.15) HELP_DEBUGSTICK=§8/§7debugstick §8- §7Gibt dir einen Debugstick (nur 1.15)
HELP_BAUINFO=§8/§ebauinfo §8- §7Gibt dir Informationen über den Bauserver HELP_BAUINFO=§8/§7bauinfo §8- §7Gibt dir Informationen über den Bauserver
HELP_WE_POS1=§8//§e1 §7» §8//§epos1 HELP_WE_POS1=§8//§71 §7» §8//§7pos1
HELP_WE_POS2=§8//§e2 §7» §8//§epos2 HELP_WE_POS2=§8//§72 §7» §8//§7pos2
HELP_WE_COPY=§8//§ec §7» §8//§ecopy HELP_WE_COPY=§8//§7c §7» §8//§7copy
HELP_WE_PASTE=§8//§ep §7» §8//§epaste HELP_WE_PASTE=§8//§7p §7» §8//§7paste
HELP_WE_FLOPY=§8//§eflopy §7» §8//§ecopy §7& §8//§eflip HELP_WE_FLOPY=§8//§7flopy §7» §8//§7copy §7& §8//§7flip
HELP_WE_FLOPYP=§8//§eflopyp §7» §8//§ecopy §7& §8//§eflip §7& §8//§epaste HELP_WE_FLOPYP=§8//§7flopyp §7» §8//§7copy §7& §8//§7flip §7& §8//§7paste
HELP_WE_ROTATE_90=§8//§e90 §7» §8//§erotate 90 HELP_WE_ROTATE_90=§8//§790 §7» §8//§7rotate §e90
HELP_WE_ROTATE_180=§8//§e180 §7» §8//§erotate 180 HELP_WE_ROTATE_180=§8//§7180 §7» §8//§7rotate §e180
HELP_WE_ROTATE_N90=§8//§e-90 §7» §8//§erotate -90 HELP_WE_ROTATE_N90=§8//§7-90 §7» §8//§7rotate §e-90
HELP_BAU_GROUP_ADMIN=§7Bauserver-Verwaltungsbefehle HELP_BAU_GROUP_ADMIN=§7Bauserver-Verwaltungsbefehle
HELP_BAU_GROUP_ADMIN_HOVER=§eAlle Verwaltungsbefehle HELP_BAU_GROUP_ADMIN_HOVER=§eAlle Verwaltungsbefehle
@ -77,8 +79,6 @@ HELP_BAU_ADDMEMBER=§8/§ebau addmember §8- §7Fügt einen Freund hinzu
HELP_BAU_ADDMEMBER_HOVER=§eFüge einen Freund hinzu HELP_BAU_ADDMEMBER_HOVER=§eFüge einen Freund hinzu
HELP_BAU_DELMEMBER=§8/§ebau delmember §8- §7Entfernt einen Spieler HELP_BAU_DELMEMBER=§8/§ebau delmember §8- §7Entfernt einen Spieler
HELP_BAU_DELMEMBER_HOVER=§eEntfernt einen Spieler HELP_BAU_DELMEMBER_HOVER=§eEntfernt einen Spieler
HELP_BAU_TOGGLEBUILD=§8/§ebau togglebuild §8- §7Berechtigung zum Bauen, /tp, /gm
HELP_BAU_TOGGLEBUILD_HOVER=§eStellt Spielerberechtigungen ein
HELP_BAU_TOGGLEWE=§8/§ebau togglewe §8- §7Berechtigung für WorldEdit, /testblock HELP_BAU_TOGGLEWE=§8/§ebau togglewe §8- §7Berechtigung für WorldEdit, /testblock
HELP_BAU_TOGGLEWE_HOVER=§eStellt Spielerberechtigungen ein HELP_BAU_TOGGLEWE_HOVER=§eStellt Spielerberechtigungen ein
HELP_BAU_TOGGLEWORLD=§8/§ebau toggleworld §8- §7/reset, /trace, /fire, /tnt HELP_BAU_TOGGLEWORLD=§8/§ebau toggleworld §8- §7/reset, /trace, /fire, /tnt
@ -94,16 +94,29 @@ USAGE_BAN=§8/§7ban §8[§eSpieler§8] [§edd§8.§emm§8.§eyyyy §7oder §edd
USAGE_MUTE=§8/§7mute §8[§eSpieler§8] [§edd§8.§emm§8.§eyyyy §7oder §edd§8.§emm§8.§eyyyy§8_§ehh§8:§emm §7oder §eperma§8] [§eGrund§8] USAGE_MUTE=§8/§7mute §8[§eSpieler§8] [§edd§8.§emm§8.§eyyyy §7oder §edd§8.§emm§8.§eyyyy§8_§ehh§8:§emm §7oder §eperma§8] [§eGrund§8]
USAGE_IGNORE=§8/§7ignore §8[§eSpieler§8] USAGE_IGNORE=§8/§7ignore §8[§eSpieler§8]
#ModListener
MOD_RED_SING=Versuchte Benutzung des Mods {0}
MOD_RED_PLUR=Versuchte Benutzung der Mods:\n{0}
MOD_YELLOW_SING=§7Deaktiviere den Mod §e{0}§7, um weiter auf §eSteam§8War §7spielen zu können.
MOD_YELLOW_PLUR=§7Deaktiviere die Mods\n§e{0}\n§7um weiter auf §eSteam§8War §7spielen zu können.
#Various commands #Various commands
ALERT=§f{0} ALERT=§f{0}
BAN_MESSAGE_YOU=§7Du hast §e{0} §7gebannt§8. §7Grund§8: §c{1} #Ban&Mute-Command
BAN_TEAM_BANNED={0} §c{1} wurde von {2} {3} gebannt. §f§lGrund: §f{4}
BANNED_MESSAGE_PERMA=§cDu bist permanent gebannt. §r§lGrund§r: §c{0}
BANNED_MESSAGE_UNTIL=§cDu bist bis zum {0} gebannt. §r§lGrund§r: §c{1}
MUTE_TEAM_MUTED={0} §c{1} wurde von {2} {3} gemuted. §f§lGrund: §f{4}
MUTED_MESSAGE_PERMA=§cDu bist permanent gemuted. §r§lGrund§r: §c{0}
MUTED_MESSAGE_UNTIL=§cDu bist bis zum {0} gemuted. §r§lGrund§r: §c{1}
BAN_CHANGED={0}verändert von {1} von {2} auf {3} wegen {4}
BAN_PERMA=permanent
BAN_UNTIL=bis zum {0}
BAN_AVOIDING_ALERT=§cMögliche Bannumgehung durch §r{0}§c: §c BAN_AVOIDING_ALERT=§cMögliche Bannumgehung durch §r{0}§c: §c
BAN_AVOIDING_LIST={0} §e{1} §c BAN_AVOIDING_LIST={0} §e{1} §c
BAN_AVOIDING_BAN_HOVER=§cBanne Spieler wegen Bannumgehung BAN_AVOIDING_BAN_HOVER=§cBanne Spieler wegen Bannumgehung
MUTE_MESSAGE_YOU=§7Du hast §e{0} §7gemutet§8. §7Grund§8: §c{1}
BUG_MESSAGE=§7Dein Bugreport wurde gespeichert. BUG_MESSAGE=§7Dein Bugreport wurde gespeichert.
IGNORE_YOURSELF=§cWie willst du dich selber ignorieren? IGNORE_YOURSELF=§cWie willst du dich selber ignorieren?
@ -116,18 +129,82 @@ POLLRESULT_HEADER=§eEs haben {0} abgestimmt auf die Frage: §7{1}
POLLRESULT_LIST=§e{0}§8: §7{1} POLLRESULT_LIST=§e{0}§8: §7{1}
#BauCommand #BauCommand
BAU_ADDMEMBER_USAGE=§8/§7bau addmember §8[§eSpieler§8]
BAU_ADDMEMBER_SELFADD=§cDu brauchst dich nicht selbst hinzufügen!
BAU_ADDMEMBER_ISADDED=§cDieser Spieler ist bereits Mitglied auf deiner Welt.
BAU_ADDMEMBER_ADDED=§aDer Spieler wurde zu deiner Welt hinzugefügt.
BAU_ADDMEMBER_ADDED_TARGET=§aDu wurdest zu der Welt von §e{0} §ahinzugefügt.
BAU_TP_USAGE=§8/§7bau tp §8[§eSpieler§8]
BAU_TP_NOALLOWED=§cDu darfst dich nicht auf diese Welt teleportieren.
BAU_DELMEMBER_USAGE=§8/§7bau delmember §8[§eSpieler§8]
BAU_DELMEMBER_SELFDEL=§cDu kannst dich nicht selbst entfernen!
BAU_DELMEMBER_DELETED=§cDer Spieler wurde entfernt.
BAU_DELMEMBER_DELETED_TARGET=§cDu wurdest von der Welt von §e{0} §centfernt.
BAU_DELETE_DELETED=§aDeine Welt wird zurückgesetzt.
BAU_DELETE_GUI_NAME=§eWirklich Welt löschen? BAU_DELETE_GUI_NAME=§eWirklich Welt löschen?
BAU_DELETE_GUI_CANCEL=§cAbbrechen BAU_DELETE_GUI_CANCEL=§cAbbrechen
BAU_DELETE_GUI_DELETE=§aLöschen BAU_DELETE_GUI_DELETE=§aLöschen
BAU_START_ALREADY=§cDer Server startet bereits.
BAU_MEMBER_NOMEMBER=§cDer Spieler ist kein Mitglied deiner Welt!
BAU_MEMBER_TOGGLE_USAGE=§8/§7bau {0} §8[§eSpieler§8]
BAU_MEMBER_TOGGLE_TARGET=§aDu kannst nun auf der Welt von §e{0}§a {1}.
BAU_MEMBER_TOGGLE=§aDer Spieler darf nun {0}.
BAU_MEMBER_TOGGLE_TARGET_OFF=§cDu kannst nun nicht mehr auf der Welt von §e{0}§c {1}.
BAU_MEMBER_TOGGLE_OFF=§cDer Spieler darf nun nicht mehr {0}.
#ChallengeCommand
CHALLENGE_USAGE=§8/§7challenge §8[§eSpieler§8]
CHALLENGE_OFFLINE=§cDer Herausgeforderte ist nicht online.
CHALLENGE_SELF=§cSchizophren?
CHALLENGE_IGNORED=§cDer Herausgeforderte hat dich geblockt.
CHALLENGE_INARENA=§cDer Herausgeforderte ist bereits in einer Arena.
CHALLENGE_BROADCAST=§e{0}§7-§eDuell§7: §e{1} §7vs §e{2}
CHALLENGE_BROADCAST_HOVER=§aZuschauen
CHALLENGE_CHALLENGED=§7Du hast §e{0} §7zu einem §e{1}-Kampf §7herausgefordert!
CHALLENGE_CHALLENGED_TARGET=§e{0} §7 hat dich zu einem §e{1}-Kampf §7{2}herausgefordert!
CHALLENGE_CHALLENGED_MAP=auf §e{0} §7
CHALLENGE_ACCEPT=§7Klicke §ehier§7, um die Herausforderung anzunehmen
CHALLENGE_ACCEPT_HOVER=§aHerausforderung annehmen
#EventCommand
EVENT_TIME_FORMAT=HH:mm
EVENT_DATE_FORMAT=dd.MM.
EVENT_USAGE=§8/§7event §8[§eTeam§8] - §7Um dich zum Kampf zu teleportieren
EVENT_NO_TEAM=§cDieses Team gibt es nicht
EVENT_NO_FIGHT_TEAM=§cDas Team kämpft derzeit nicht
EVENT_NO_CURRENT=§cDerzeit findet kein Event statt
EVENT_COMING=§eKommende Events§8:
EVENT_COMING_EVENT=§7{0}§8-§7{1}§8: §e{2}
EVENT_COMING_DEADLINE=§7 Anmeldeschluss§8: §7{0}
EVENT_COMING_TEAMS=§7 Mit§8:{0}
EVENT_COMING_TEAM= §{0}{1}
EVENT_CURRENT_EVENT=§e§l{0}
EVENT_CURRENT_FIGHT=§7{0} §{1}{2}§8 vs §{3}{4}
EVENT_CURRENT_FIGHT_WIN=§8: §7Sieg §{0}{1}
EVENT_CURRENT_FIGHT_DRAW=§8: §7Unentschieden
#EventRescheduleCommand
EVENTRESCHEDULE_USAGE=§8/§7eventreschedule §8[§eTeam1§8] [§eTeam2§8]
EVENTRESCHEDULE_UNKNOWN_TEAM=§cEin Team ist unbekannt / Derzeit kein Event
EVENTRESCHEDULE_NO_FIGHT="§cKein Kampf zwischen den Teams gefunden"
EVENTRESCHEDULE_STARTING=§aKampf startet in 30s
#FightCommand
FIGHT_UNKNOWN_GAMEMODE=§cUnbekannter Spielmodus: {0}
FIGHT_UNKNOWN_ARENA=§cDie gewünschte Arena gibt es nicht.
FIGHT_ARENA_RANDOM=Random
FIGHT_IN_ARENA=§cDu befindest dich bereits in einer Arena.
FIGHT_BROADCAST=§7Klicke §ehier§7, um §e{0} §7gegen §e{1} §7zu §7kämpfen!
FIGHT_BROADCAST_HOVER=§aGegen §7{1} §ekämpfen
#CheckCommand #CheckCommand
CHECK_REMINDER=§7Es sind §e{0} §7Schematics zu prüfen§8! CHECK_REMINDER=§7Es sind §e{0} §7Schematics zu prüfen§8!
CHECK_REMINDER_HOVER=§eZu prüfende Schematics CHECK_REMINDER_HOVER=§eZu prüfende Schematics
CHECK_NOT_CHECKING=§cDu prüfst derzeit nicht. CHECK_NOT_CHECKING=§cDu prüfst derzeit nicht.
CHECK_HELP_LIST=§8/§echeck list §8- §7Zeigt die Liste der ungeprüften Schematics CHECK_HELP_LIST=§8/§7check list §8- §7Zeigt die Liste der ungeprüften Schematics
CHECK_HELP_NEXT=§8/§echeck next §8- §7Nächste Prüffrage§8/§7freigeben CHECK_HELP_NEXT=§8/§7check next §8- §7Nächste Prüffrage§8/§7freigeben
CHECK_HELP_DECLINE=§8/§echeck decline §8[§eGrund§8] - §7Schematic ablehnen CHECK_HELP_DECLINE=§8/§7check decline §8[§eGrund§8] - §7Schematic ablehnen
CHECK_HELP_CANCEL=§8/§echeck cancel §8- §7Bricht den Prüfvorgang ab CHECK_HELP_CANCEL=§8/§7check cancel §8- §7Bricht den Prüfvorgang ab
CHECK_LIST_HEADER=§e§lZu prüfen sind {0} Schematics CHECK_LIST_HEADER=§e§lZu prüfen sind {0} Schematics
CHECK_LIST_TO_CHECK=§8{0} §7{1} §e{2} CHECK_LIST_TO_CHECK=§8{0} §7{1} §e{2}
CHECK_LIST_TO_CHECK_HOVER=§eSchematic prüfen CHECK_LIST_TO_CHECK_HOVER=§eSchematic prüfen
@ -147,3 +224,283 @@ CHECK_ACCEPTED=§aDein §e{0} {1} §ewurde freigegeben§8!
CHECK_ACCEPTED_TEAM=§7Die Schematic §e{0} §7von §e{1} §7ist nun freigegeben! CHECK_ACCEPTED_TEAM=§7Die Schematic §e{0} §7von §e{1} §7ist nun freigegeben!
CHECK_DECLINED=§cDein §e{0} {1} §cwurde abgelehnt§8: §c{2} CHECK_DECLINED=§cDein §e{0} {1} §cwurde abgelehnt§8: §c{2}
CHECK_DECLINED_TEAM=§7Die Schematic §e{0} §7von §e{1} §7wurde aufgrund von §e{2} §7abgelehnt! CHECK_DECLINED_TEAM=§7Die Schematic §e{0} §7von §e{1} §7wurde aufgrund von §e{2} §7abgelehnt!
#HistoricCommand
HISTORIC_BROADCAST=§7Historischer §e{0}§8-§7Kampf von §e{1}§8!
HISTORIC_BROADCAST_HOVER=§aGegen §7{1} §ekämpfen
#JoinCommand
JOIN_PLAYER_BLOCK=§cDu kannst diesem Spieler derzeit nicht folgen.
#JoinmeCommand
JOINME_USAGE=§8/§7join §8[§eSpieler§8].
JOINME_BROADCAST=§7Klicke §ehier§8, §7um zu §e{0} §7auf §e{1} §7zu kommen§8!
JOINME_BROADCAST_HOVER=§aSpieler folgen
JOINME_PLAYER_OFFLINE=§cDieser Spieler ist offline.
JOINME_PLAYER_SELF=§cSei eins mit dir selbst!
#KickCommand
KICK_USAGE=§8/§7kick §8[§eSpieler§8] [§eNachricht§8]
KICK_OFFLINE=§cDieser Spieler ist derzeit nicht online!
KICK_CONFIRM=Der Spieler {0} wurde gekickt.
KICK_NORMAL=§cDu wurdest gekickt.
#MsgCommand
MSG_USAGE=§8/§7msg §8[§eBenutzer§8] [§eNachricht§8]
MSG_OFFLINE=§cDieser Spieler ist derzeit nicht online!
MSG_IGNORED=§cDieser Spieler hat dich geblockt!
MSG_NOMESSAGE=§cDieser Spieler empfängt derzeit keine Chatnachrichten!
MSG_SELF=§cNachrichten an dich selbst hast du wirklich nicht nötig!
MSG_FORMAT=§e{0}§8»§e{1} §r§7{2}
#PingCommand
PING_RESPONSE=§7Dein Ping beträgt §c{0}§7 ms!
#PollCommand
POLL_NO_POLL=§cDerzeit läuft keine Umfrage.
POLL_NO_ANSWER=§cDas ist keine Antwortmöglichkeit!
POLL_ANSWER_REFRESH=§aDeine Antwort wurde aktualisiert.
POLL_ANSWER_NEW=§aDeine Antwort wurde registriert.
#RankCommand
RANK_HEADER=§7§lPlatzierungen
RANK_UNPLACED=§7{0}§8: §eunplatziert
RANK_PLACED=§7{0}§8: §e{1}§8. §7mit §e{2} §7Elo§8.
#RankedCommand
RANKED_NO_RANKED_MODE=§cDieser Spielmodus ist nicht für Ranglistenspiele freigeschalten.
RANKED_QUEUE_JOINED=§aRanglistenspiel-Warteschlange betreten.
RANKED_QUEUE_HOW_TO_LEAVE=§7Wiederhole den Befehl zum Verlassen der Warteschlange.
RANKED_QUEUE_LEFT=§cRanglistenspiel-Warteschlange verlassen.
RANKED_ENEMY_SPOTTED=§eGegner gefunden! Ranglistenspiel startet.
RANKED_BROADCAST=§7{0}§8-§7Ranglistenspiel§8: §e{1} vs {2}
RANKED_BROADCAST_HOVER=§aZuschauen
#RCommand
R_USAGE=§8/§7r §8[§eAntwort§8]
R_NOTHING=§cDu hast bisher mit niemandem geschrieben!
R_OFFLINE=§cDieser Spieler ist derzeit nicht online!
R_BLOCKED=§cDieser Spieler hat dich geblockt!
R_NO_CHAT=§cDieser Spieler empfängt derzeit keine Chatnachrichten!
#RegelnCommand
REGELN_RULES=§7§lRegelwerke
REGELN_AS=§eAirShip§8-§7Regelwerk
REGELN_AS_HOVER=§7https://steamwar.de/spielmodi/airship-regelwerk/
REGELN_AS_URL=https://steamwar.de/spielmodi/airship-regelwerk/
REGELN_MWG=§eMiniWarGear§8-§7Regelwerk
REGELN_MWG_HOVER=§7https://steamwar.de/spielmodi/miniwargear-regelwerk/
REGELN_MWG_URL=https://steamwar.de/spielmodi/miniwargear-regelwerk/
REGELN_WG=§eWarGear§8-§7Regelwerk
REGELN_WG_HOVER=§7https://steamwar.de/spielmodi/wargear-regelwerk/
REGELN_WG_URL=https://steamwar.de/spielmodi/wargear-regelwerk/
REGELN_WS=§eWarShip§8-§7Regelwerk
REGELN_WS_HOVER=§7https://steamwar.de/spielmodi/warship-regelwerk/
REGELN_WS_URL=https://steamwar.de/spielmodi/warship-regelwerk/
#ServerTeamchatCommand
STC_USAGE=§8/§7stc §8[§eNachricht an das Team§8]
STC_FORMAT=§8STC §e{0}» §r{1}
#TeamchatCommand
TC_USAGE=§8/§7tc §8[§eNachricht an das Team§8]
TC_NO_TEAM=§cDu bist in keinem Team.
TC_FORMAT=§8TC §e{0}§8» §r{1}
#TeamCommand
TEAM_IN_TEAM=§cDu bist bereits in einem Team.
TEAM_NOT_IN_TEAM=§cDu bist in keinem Team.
TEAM_NOT_LEADER=§cDu bist nicht der Teamleader.
TEAM_NOT_IN_EVENT=§cDies ist während eines Events nicht möglich.
TEAM_HELP_HEADER=§7Mit §e/team §7verwaltest du dein Team.
TEAM_HELP_LIST=§8/§7team list §8- §7Liste alle Teams auf.
TEAM_HELP_INFO=§8/§7team info §8- §7Informiere dich über ein Team.
TEAM_HELP_CREATE=§8/§7team create §8- §7Erstelle dein eigenes Team.
TEAM_HELP_JOIN=§8/§7team join §8- §7Trete einem Team bei.
TEAM_HELP_CHAT=§8/§7teamchat §8- §7Sende Nachrichten an dein Team.
TEAM_HELP_EVENT=§8/§7team event §8- §7Nehme an Events teil.
TEAM_HELP_LEAVE=§8/§7team leave §8- §7Verlasse dein Team.
TEAM_HELP_INVITE=§8/§7team invite §8- §7Lade jemanden in dein Team ein.
TEAM_HELP_REMOVE=§8/§7team remove §8- §7Entferne jemanden aus deinem Team.
TEAM_HELP_KUERZEL=§8/§7team changekuerzel §8- §7Ändere dein Teamkürzel.
TEAM_HELP_NAME=§8/§7team changename §8- §7Ändere deinen Teamnamen.
TEAM_HELP_COLOR=§8/§7team changecolor §8- §7Ändere deine Teamfarbe.
TEAM_HELP_LEADER=§8/§7team promote §8- §7Ernenne jemanden zum Teamleader.
TEAM_HELP_STEP_BACK=§8/§7team stepback §8- §7Tritt als Leader zurück.
#Team Create
TEAM_CREATE_USAGE=§8/§7team create §8[§eTeamkürzel§8] §8[§eTeamname§8]
TEAM_CREATE_CREATED=§7Du hast das Team §e{0} §7gegründet!
#Team Join
TEAM_JOIN_NO_INVITE=§7Du hast keine Einladungen erhalten.
TEAM_JOIN_USAGE=§8/§7team join §8[§eTeam§8]
TEAM_JOIN_INVITED=§7Du wurdest von diesen Teams eingeladen§8: §e{0}
TEAM_JOIN_NOT_BY_TEAM=§cVon diesem Team wurdest du nicht eingeladen.
TEAM_JOIN_JOINED=§7Du bist dem Team §e{0} §7beigetreten!
#Team Leave
TEAM_OTHER_LEADER_REQUIRED=§cBitte ernenne zunächst ein anderes Teammitglied zum Leader!
TEAM_LEAVE_LEFT=§7Du hast dein Team verlassen!
#Team Step Back
TEAM_STEP_BACK=§7Du hast deinen Posten als Teamleader abgegeben§8!
#Team Invite
TEAM_INVITE_USAGE=§8/§7team invite §8[§eSpieler§8]
TEAM_INVITE_NO_PLAYER=§cDiesen Spieler gibt es nicht.
TEAM_INVITE_IN_TEAM=§cDieser Spieler ist bereits in einem Team.
TEAM_INVITE_ALREADY_INVITED=§cDu hast diesen Spieler bereits eingeladen.
TEAM_INVITE_INVITED=§7Du hast §e{0} §7in das Team eingeladen!
TEAM_INVITE_INVITED_TARGET=§7Du wurdest in das Team §{0}{1} §7eingeladen!
#Team Remove
TEAM_REMOVE_USAGE=§8/§7team remove §8[§eSpieler§8]
TEAM_REMOVE_NOT_PLAYER=§cDiesen Spieler gibt es nicht.
TEAM_REMOVE_NOT_LEADER=§cLeader können nicht rausgeworfen werden.
TEAM_REMOVE_INVITE=§7Die Einladung wurde zurückgezogen.
TEAM_REMOVE_NO_INVITE=§cDieser Spieler hat keine Einladung erhalten.
TEAM_REMOVE_NOT_IN_TEAM=§cDieser Spieler ist nicht in deinem Team.
TEAM_REMOVE_REMOVED=§7Der Spieler wurde aus dem Team entfernt.
TEAM_REMOVE_REMOVED_TARGET=§cDu wurdest aus dem Team entfernt.
#Team Kuerzel
TEAM_KUERZEL_USAGE=§8/§7team changekuerzel §8[§eTeamkürzel§8]
TEAM_KUERZEL_CHANGED=§7Du hast das Kürzel des Teams geändert!
TEAM_KUERZEL_LENGHT=§cEin Teamkürzel muss aus 2 bis 4 Buchstaben bestehen.
TEAM_KUERZEL_TAKEN=§cEs gibt bereits ein Team mit diesem Namen.
#Team Name
TEAM_NAME_USAGE=§8/§7team changename §8[§eTeamname§8]
TEAM_NAME_CHANGED=§7Du hast das Team umbenannt!
TEAM_NAME_LENGHT=§cEin Teamname muss aus 4 bis 15 Buchstaben bestehen.
TEAM_NAME_TAKEN=§cEs gibt bereits ein Team mit diesem Namen.
#Team Leader
TEAM_LEADER_USAGE=§8/§7team promote §8[§eMember§8]
TEAM_LEADER_NOT_USER=§cDen Spieler {0} gibt es nicht.
TEAM_LEADER_NOT_MEMBER=§cDer Spieler ist nicht in deinem Team.
TEAM_LEADER_PROMOTED=§7Du hast den Spieler §e{0} §7zum Leader gemacht!
#Team Info
TEAM_INFO_USAGE=§8/§7team info §8[§eTeamname§8]
TEAM_INFO_TEAM=§7Team §e{0} §8[§{1}{2}§8]
TEAM_INFO_LEADER=§7Leader§8: {0}
TEAM_INFO_MEMBER=§7Member§8: {0}
TEAM_INFO_EVENTS=§7Events§8: §e{0}
#Team List
TEAM_LIST_NOT_PAGE=§cKeine Seitenzahl angegeben
TEAM_LIST_UNKNOWN_PAGE=§cUngültige Seitenzahl angegeben
TEAM_LIST_HEADER=§7§lTeamliste §7{0}§8/§7{1}
TEAM_LIST_TEAM=§{0}{1} §e{2}
TEAM_LIST_TEAM_HOVER=§7Teaminfo
TEAM_LIST_PAGE=Seite
TEAM_LIST_NEXT=§eNächste Seite
TEAM_LIST_PREV=§eVorherige Seite
#Team Event
TEAM_EVENT_USAGE=§8/§7team event §8[§eEvent§8] - §7um daran teilzunehmen
TEAM_EVENT_HEADER=§7Dein Team nimmt an folgenden Events teil§8:
TEAM_EVENT_EVENT=§7{0}§8: §e{1}
TEAM_EVENT_NO_EVENT=§cDieses Event gibt es nicht
TEAM_EVENT_OVER=§cDie Anmeldephase für dieses Event ist bereits vorbei
TEAM_EVENT_LEFT=§7Dein Team nimmt nicht mehr am Event teil
TEAM_EVENT_JOINED=§7Dein Team nimmt nun am Event §e{0} §7 teil!
TEAM_EVENT_HOW_TO_LEAVE=§7Um die Teilnahme abzusagen, wiederhole den Befehl
#Team Color
TEAM_COLOR_TITLE=Farbe wählen
#TpCommand
TP_USAGE=§8/§7tp §8[§eSpieler§8]
TP_USAGE_EVENT=§8/§7tp §8[§eSpieler §7oder §eTeam§8]
TP_NOT_FOUND=§cKonnte das angegebene Ziel nicht finden.
#UnbanCommand
UNBAN_USAGE=§8/§7unban §8[§eSpieler§8]
UNBAN_NOT_BANNED=§cDer Spieler ist nicht gebannt.
UNBAN_UNBANNED=Du hast {0} entbannt.
#UnignoreCommand
UNIGNORE_USAGE=§8/§7unignore §8[§eSpieler§8]
UNIGNORE_NOT_PLAYER=§cDiesen Spieler gibt es nicht!
UNIGNORE_NOT_IGNORED=§cDu ignorierst diesen Spieler nicht.
UNIGNORE_UNIGNORED=§7Du empfängst nun wieder Nachrichten von §e{0}§8.
#WebregisterCommand
WEB_USAGE=§8/§7webregister §8[§eE-Mail§8]
WEB_ALREADY=§cDu hast bereits einen Webaccount.
WEB_ALREADY_EMAIL=§cDie E-Mail hast du bereits für einen anderen Account verwendet...
WEB_NOT_EMAIL=§c[E-Mail], nicht [Freitext]!
WEB_EMAIL_REFRESH=§aDeine E-Mail-Adresse wurde aktualisiert.
WEB_INTERNAL_ERROR=§cEin interner Fehler ist aufgetreten, bitte wende dich an einen Developer.
WEB_EMAIL_SEND=§aEine E-Mail zum Setzen des Passworts wurde gesendet.
#ChatListener
CHAT_LIXFEL_ACTION_BAR=§4§lTechnische Probleme?
CHAT_LIXFEL_1=Du hast mich gerufen!
CHAT_LIXFEL_2=Leider bin ich nur ein Mensch und höre nicht alles.
CHAT_LIXFEL_3=Daher bitte ich dich, das Problem bzw. den Fehler im Forum in der Kategorie §eFehler melden §cmit einer ausreichenden Beschreibung zu hinterlegen.
CHAT_LIXFEL_4=Vielen Dank.
CHAT_LIXFEL_5=Ich wünsche dir noch weiterhin ein reibungsloses Spielerlebnis.
CHAT_YOYONOW_1=Du hast mich gerufen!
CHAT_YOYONOW_2=Ich würde dir gerne den Befehl "/bug <MESSAGE>" ans Herz legen.
CHAT_YOYONOW_3=Vielen Dank.
CHAT_YOYONOW_4=Ich wünsche dir noch weiterhin ein reibungsloses Spielerlebnis.
CHAT_RECEIVE=§cUm Chatnachrichten versenden zu können, musst du auch welche empfangen!
CHAT_NO_LINKS=§cDu darfst keine Links versenden.
CHAT_BC_USAGE=§8/§e{0} §8[§7Nachricht§8]
CHAT_BC_NO_COMMANDS=§cKeine Befehle mit /local möglich.
#CheckListner
CHECK_UNCHECKED=§7Du hast noch §e{0} §7ungeprüfte Schematic§8(§7s§8)!
CHECK_CHECKING=§cDu prüfst gerade eine Schematic!
#ConnectionListener
JOIN_ARENA=§7Klicke §ehier§7, um §e{0} §7beizutreten
JOIN_ARENA_HOVER=§eArena beitreten
JOIN_FIRST=§7Begrüßt alle mal §e{0} §7auf dem Server§8!
#EventModeListener
EVENTMODE_KICK=§cDu bist kein Eventteilnehmer.
#PollSystem
POLL_HEADER=§e§lUmfrage
POLL_HEADER2=§7Klicke die Antwort an, die dir gefällt!
POLL_QUESTION=§e{0}
POLL_ANWSER=§7{0}
POLL_ANWSER_HOVER=§e{0} §ewählen
#TablistManager
TABLIST_PHASE_0=§8Spieler online: §e{0}
TABLIST_PHASE_1=§8Teamspeak: §eSteam§8War.de
TABLIST_PHASE_2=§8Discord: §8https://§eSteam§8War.de/discord
TABLIST_PHASE_DEFAULT=§8Website: https://§eSteam§8War.de
TABLIST_BAU=Bau
#EventStarter
EVENT_FIGHT_BROADCAST=§7Hier §eklicken §7für den Kampf §{0}{1} §8vs §{2}{3}
EVENT_FIGHT_BROADCAST_HOVER=§eEvent beitreten
#SubserverSystem
SERVER_IGNORED=§cDieser Spieler hat dich geblockt!
SERVER_ADD_MEMBER=§e{0} §7möchte auf deine Bauwelt.
SERVER_ADD_MESSAGE=§7Klicke §ehier§7, wenn du das erlauben möchtest.
SERVER_ADD_MESSAGE_HOVER=§8/§7bau addmember §e{0}
SERVER_WORLD_ERROR=§cDas Erstellen der Welt ist fehlgeschlagen.
#WhoisCommand
WHOIS_USAGE=§c/whois [Spieler/ID]
WHOIS_USERNAME=§7Username§8: §e{0}
WHOIS_UUID=§7UUID§8: §e{0}
WHOIS_UUID_HOVER=§eUUID Kopieren
WHOIS_ID=§7ID§8: §e{0}
WHOIS_JOINED_FIRST=§7Beigetreten am§8: §e{0}
WHOIS_HOURS_PLAYED=§7Online Time§8: §e{0}h
WHOIS_TEAM=§7Team§8: §e[§{0}{1}§e] {2}
WHOIS_TEAM_HOVER=§e{0} anzeigen
WHOIS_PUNISHMENTS=§7Strafen:
WHOIS_PUNISHMENT=§7{0}§8» §f§l{1}: §e{2} - {3} §f{4}
WHOIS_NO_PUNISHMENT=§a✓ §7Der Spieler hat noch nichts getan.