From 3676051e40627741cc9db2d1bdadf41d3c991434 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 14 Apr 2021 20:24:35 +0200 Subject: [PATCH 1/7] Allow paper bau + small code cleanup Signed-off-by: Lixfel --- .../steamwar/bungeecore/SubserverSystem.java | 101 +++++++++--------- .../bungeecore/commands/BauCommand.java | 23 +--- 2 files changed, 52 insertions(+), 72 deletions(-) diff --git a/src/de/steamwar/bungeecore/SubserverSystem.java b/src/de/steamwar/bungeecore/SubserverSystem.java index 8295642c..2812eb33 100644 --- a/src/de/steamwar/bungeecore/SubserverSystem.java +++ b/src/de/steamwar/bungeecore/SubserverSystem.java @@ -28,8 +28,10 @@ import net.md_5.bungee.api.connection.ProxiedPlayer; import java.io.File; import java.io.IOException; +import java.net.InetSocketAddress; import java.time.format.DateTimeFormatter; import java.util.*; +import java.util.logging.Level; public class SubserverSystem { private SubserverSystem(){} @@ -41,13 +43,13 @@ public class SubserverSystem { private static final String SERVER_PATH = BACKBONE + "server/"; private static final String EVENT_PATH = BACKBONE + "event/"; - private static final int firstArenaPort; + private static final int FIRST_ARENA_PORT; static { if(BungeeCore.EVENT_MODE) - firstArenaPort = 6000; + FIRST_ARENA_PORT = 6000; else - firstArenaPort = 2500; + FIRST_ARENA_PORT = 2500; } /** @@ -89,13 +91,13 @@ public class SubserverSystem { */ 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 - int port = freePort(firstArenaPort); + int port = freePort(FIRST_ARENA_PORT); if(serverName == null){ if(ranked) - serverName = "Ranked" + (port - firstArenaPort); + serverName = "Ranked" + (port - FIRST_ARENA_PORT); else - serverName = modus.getDisplayName() + (port - firstArenaPort); + serverName = modus.getDisplayName() + (port - FIRST_ARENA_PORT); } if(mapName == null) mapName = serverName; @@ -109,8 +111,11 @@ public class SubserverSystem { //Copy world try { new ProcessBuilder("cp", "-r", SERVER_PATH + modus.getFolder() + "/arenas/" + map, worldDir + mapName).start().waitFor(); - } catch (IOException | InterruptedException e) { + } catch (IOException e) { throw new SecurityException("Could not copy folder", e); + } catch (InterruptedException e) { + ProxyServer.getInstance().getLogger().log(Level.SEVERE, "Interrupted while copying folder", e); + Thread.currentThread().interrupt(); } List cmd = serverStartCommand( @@ -125,8 +130,8 @@ public class SubserverSystem { "ranked=" + ranked, "checkSchemID=" + checkSchemID, "prepareSchemID=" + prepareSchemID, - player1 != null && eventFightID != -1 ? "blueLeader=" + player1.toString() : null, - player2 != null ? "redLeader=" + player2.toString() : null); + player1 != null && eventFightID != -1 ? "blueLeader=" + player1 : null, + player2 != null ? "redLeader=" + player2 : null); //Start server ProcessBuilder process = new ProcessBuilder(cmd); @@ -134,26 +139,26 @@ public class SubserverSystem { String finalMapName = mapName; if(eventFightID == -1) - return new Bauserver(serverName, player1, port, process, () -> { - try { - new ProcessBuilder("rm", "-r", ARENA_PATH + finalMapName).start().waitFor(); - } catch (IOException | InterruptedException e) { - throw new SecurityException("Could not clean up folder", e); - } - }); + return new Bauserver(serverName, player1, port, process, () -> deleteFolder(ARENA_PATH + finalMapName)); else return new Subserver(Servertype.ARENA, serverName, port, process, () -> { if(eventFightID > 0) return; - - try { - new ProcessBuilder("rm", "-r", ARENA_PATH + finalMapName).start().waitFor(); - } catch (IOException | InterruptedException e) { - throw new SecurityException("Could not clean up folder", e); - } + deleteFolder(ARENA_PATH + finalMapName); }); } + public static void deleteFolder(String worldName){ + try { + new ProcessBuilder("rm", "-r", worldName).start().waitFor(); + } catch (IOException e) { + throw new SecurityException("Could not clean up folder", e); + } catch (InterruptedException e) { + ProxyServer.getInstance().getLogger().log(Level.SEVERE, "Interrupted while deleting folder", e); + Thread.currentThread().interrupt(); + } + } + public static Subserver startEventArena(EventFight eventFight, String serverName){ return startArena( eventFight.getSpielmodus(), @@ -172,50 +177,44 @@ public class SubserverSystem { 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){ + private static void sendToBau(ProxiedPlayer p, UUID owner, String prototype, String worldFolder, String serverJar, String worldDir, String worldName, String xmx, String serverName){ if(bauRunning(p, owner)) return; SteamwarUser user = SteamwarUser.get(owner); - copyBauweltIfRequired(p, BungeeCore.BAUWELT_PROTOTYP, BungeeCore.WORLD_FOLDER + owner.toString()); + copyBauweltIfRequired(p, prototype, worldFolder + worldName); int port = freePort(4000); List cmd = serverStartCommand( - "spigot-1.12.2.jar", - "/home/minecraft/userworlds", - owner.toString(), + serverJar, + worldDir, + worldName, port, - "256M", - "logPath=" + owner.toString()); + xmx, + "logPath=" + worldName); //Start server ProcessBuilder process = new ProcessBuilder(cmd); - process.directory(new File(SERVER_PATH, "UserBau")); + process.directory(new File(SERVER_PATH, serverName)); new Bauserver(user.getUserName() + "s Bau", owner, port, process, () -> {}).sendPlayer(p); } - public static void sendToBau15(ProxiedPlayer p, UUID owner){ - if(bauRunning(p, owner)) - return; + public static void sendToBauServer(ProxiedPlayer p, UUID owner){ + sendToBau(p, owner, BungeeCore.BAUWELT_PROTOTYP, BungeeCore.WORLD_FOLDER, "spigot-1.12.2.jar", "/home/minecraft/userworlds", owner.toString(), "256M", "UserBau"); + } + private static void sendToBau15(ProxiedPlayer p, UUID owner, String serverJar){ SteamwarUser user = SteamwarUser.get(owner); - copyBauweltIfRequired(p, BungeeCore.BAUWELT15, BungeeCore.USERWORLDS15 + user.getId()); - int port = freePort(4000); + sendToBau(p, owner, BungeeCore.BAUWELT15, BungeeCore.USERWORLDS15, serverJar, "/home/minecraft/userworlds15", String.valueOf(user.getId()), "512M", "Bau15"); + } - List cmd = serverStartCommand( - "spigot-1.15.2.jar", - "/home/minecraft/userworlds15", - String.valueOf(user.getId()), - port, - "512M", - "logPath=" + user.getId()); + public static void sendToBau15(ProxiedPlayer p, UUID owner){ + sendToBau15(p, owner, "spigot-1.15.2.jar"); + } - //Start server - ProcessBuilder process = new ProcessBuilder(cmd); - process.directory(new File(SERVER_PATH, "Bau15")); - - new Bauserver(user.getUserName() + "s Bau", owner, port, process, () -> {}).sendPlayer(p); + public static void sendToBau15paper(ProxiedPlayer p, UUID owner){ + sendToBau15(p, owner, "paper-1.15.2.jar"); } public static void sendDeniedMessage(ProxiedPlayer p, UUID owner){ @@ -274,11 +273,7 @@ public class SubserverSystem { File w = new File(targetPath); if (!w.exists() || !w.isDirectory()){ try { - Process pr; - ProcessBuilder pb = new ProcessBuilder( - "cp", "-r", sourcePath, targetPath); - pr = pb.start(); - pr.waitFor(); + new ProcessBuilder("cp", "-r", sourcePath, targetPath).start().waitFor(); } catch (IOException e) { Message.send("SERVER_WORLD_ERROR", p); throw new SecurityException("Could not create Bauwelt", e); @@ -298,7 +293,7 @@ public class SubserverSystem { port++; isFree = true; for(Subserver server : Subserver.getServerList()){ - if(server.getServer().getAddress().getPort() == port){ + if(((InetSocketAddress)server.getServer().getSocketAddress()).getPort() == port){ isFree = false; break; } diff --git a/src/de/steamwar/bungeecore/commands/BauCommand.java b/src/de/steamwar/bungeecore/commands/BauCommand.java index 7f2052b5..590ef93a 100644 --- a/src/de/steamwar/bungeecore/commands/BauCommand.java +++ b/src/de/steamwar/bungeecore/commands/BauCommand.java @@ -28,8 +28,6 @@ import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.event.ChatEvent; -import java.io.File; - public class BauCommand { private BauCommand(){} @@ -70,6 +68,9 @@ public class BauCommand { case "1.15": SubserverSystem.sendToBau15(p, p.getUniqueId()); break; + case "paper": + SubserverSystem.sendToBau15paper(p, p.getUniqueId()); + break; case "addmember": addmember(p, command); break; @@ -251,8 +252,7 @@ public class BauCommand { break; } } - File directory = new File(world); - del(directory); + SubserverSystem.deleteFolder(world); }); } @@ -318,19 +318,4 @@ public class BauCommand { Message.send("BAU_MEMBER_TOGGLE_OFF", p, what); } } - - private static void del(File dir){ - if (dir.isDirectory()){ - String[] entries = dir.list(); - assert entries != null; - for (String entry : entries) { - File aktFile = new File(dir.getPath(), entry); - del(aktFile); - } - dir.delete(); - } - else{ - dir.delete(); - } - } } From 93d463365a7eab4c54939146445298a211c491ff Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Thu, 15 Apr 2021 18:54:21 +0200 Subject: [PATCH 2/7] Fixed Empty Team --- src/de/steamwar/bungeecore/commands/TeamCommand.java | 2 +- src/de/steamwar/bungeecore/sql/Team.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/TeamCommand.java b/src/de/steamwar/bungeecore/commands/TeamCommand.java index 0fad2f10..e8405eb5 100644 --- a/src/de/steamwar/bungeecore/commands/TeamCommand.java +++ b/src/de/steamwar/bungeecore/commands/TeamCommand.java @@ -255,7 +255,7 @@ public class TeamCommand extends BasicCommand { user.setTeam(0); if(user.isLeader() && team.size() > 0){ - team.disband(); + team.disband(user); } Message.send("TEAM_LEAVE_LEFT", player); diff --git a/src/de/steamwar/bungeecore/sql/Team.java b/src/de/steamwar/bungeecore/sql/Team.java index 1256a1a3..6df90730 100644 --- a/src/de/steamwar/bungeecore/sql/Team.java +++ b/src/de/steamwar/bungeecore/sql/Team.java @@ -154,8 +154,9 @@ public class Team { } } - public void disband(){ - SQL.update("UPDATE Team SET TeamDeleted = 1, TeamLeader = NULL WHERE TeamID = ?", teamId); + public void disband(SteamwarUser user){ + user.setLeader(false); + SQL.update("UPDATE Team SET TeamDeleted = 1", teamId); teamCache.remove(this); } From 956339faf6321962f150ef2433b86befce5c16dd Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 23 Apr 2021 18:44:38 +0200 Subject: [PATCH 3/7] Hotfix team creation Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/commands/TeamCommand.java | 1 + src/de/steamwar/bungeecore/sql/Team.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/commands/TeamCommand.java b/src/de/steamwar/bungeecore/commands/TeamCommand.java index b85aeb7b..16c98735 100644 --- a/src/de/steamwar/bungeecore/commands/TeamCommand.java +++ b/src/de/steamwar/bungeecore/commands/TeamCommand.java @@ -179,6 +179,7 @@ public class TeamCommand extends BasicCommand { Team.create(args[1], args[2], user); user.setTeam(Team.get(args[1]).getTeamId()); + user.setLeader(true); Message.send("TEAM_CREATE_CREATED", player, args[2]); } diff --git a/src/de/steamwar/bungeecore/sql/Team.java b/src/de/steamwar/bungeecore/sql/Team.java index 6df90730..7eee1e20 100644 --- a/src/de/steamwar/bungeecore/sql/Team.java +++ b/src/de/steamwar/bungeecore/sql/Team.java @@ -53,7 +53,6 @@ public class Team { } public static void create(String kuerzel, String name, SteamwarUser user){ - user.setLeader(true); SQL.update("INSERT INTO Team (TeamKuerzel, TeamName) VALUES (?, ?)", kuerzel, name); } From c7402b34eef66e6586a1798eeb8e62609c2379b2 Mon Sep 17 00:00:00 2001 From: Zeanon Date: Mon, 26 Apr 2021 20:24:56 +0200 Subject: [PATCH 4/7] You can now ban and mute Users who never joined the server, HOOZAH --- .../bungeecore/commands/BanCommand.java | 2 +- .../bungeecore/commands/BasicCommand.java | 9 +++- .../bungeecore/commands/MuteCommand.java | 2 +- .../bungeecore/commands/UnbanCommand.java | 2 +- .../steamwar/bungeecore/sql/SteamwarUser.java | 46 ++++++++++++++++++- 5 files changed, 55 insertions(+), 6 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/BanCommand.java b/src/de/steamwar/bungeecore/commands/BanCommand.java index 293b3f1c..6b3bcea7 100644 --- a/src/de/steamwar/bungeecore/commands/BanCommand.java +++ b/src/de/steamwar/bungeecore/commands/BanCommand.java @@ -42,7 +42,7 @@ public class BanCommand extends BasicCommand { return; } - SteamwarUser target = user(sender, args[0]); + SteamwarUser target = unsafeUser(sender, args[0]); if(target == null) return; diff --git a/src/de/steamwar/bungeecore/commands/BasicCommand.java b/src/de/steamwar/bungeecore/commands/BasicCommand.java index 9cdf19a9..d4b9c0ad 100644 --- a/src/de/steamwar/bungeecore/commands/BasicCommand.java +++ b/src/de/steamwar/bungeecore/commands/BasicCommand.java @@ -53,10 +53,17 @@ abstract class BasicCommand extends Command implements TabExecutor { return new ArrayList<>(); } - protected SteamwarUser user(CommandSender sender, String arg){ + protected SteamwarUser existingUser(CommandSender sender, String arg){ SteamwarUser target = SteamwarUser.get(arg); if(target == null) Message.send("UNKNOWN_PLAYER", sender); return target; } + + protected SteamwarUser unsafeUser(CommandSender sender, String arg){ + SteamwarUser target = SteamwarUser.getOrCreateOfflinePlayer(arg); + if(target == null) + Message.send("UNKNOWN_PLAYER", sender); + return target; + } } diff --git a/src/de/steamwar/bungeecore/commands/MuteCommand.java b/src/de/steamwar/bungeecore/commands/MuteCommand.java index ea778885..9ecfde18 100644 --- a/src/de/steamwar/bungeecore/commands/MuteCommand.java +++ b/src/de/steamwar/bungeecore/commands/MuteCommand.java @@ -38,7 +38,7 @@ public class MuteCommand extends BasicCommand { return; } - SteamwarUser target = user(sender, args[0]); + SteamwarUser target = unsafeUser(sender, args[0]); if(target == null) return; diff --git a/src/de/steamwar/bungeecore/commands/UnbanCommand.java b/src/de/steamwar/bungeecore/commands/UnbanCommand.java index 58c0a6fb..176029ab 100644 --- a/src/de/steamwar/bungeecore/commands/UnbanCommand.java +++ b/src/de/steamwar/bungeecore/commands/UnbanCommand.java @@ -39,7 +39,7 @@ public class UnbanCommand extends BasicCommand { return; } - SteamwarUser target = user(sender, args[0]); + SteamwarUser target = existingUser(sender, args[0]); if(target == null) return; diff --git a/src/de/steamwar/bungeecore/sql/SteamwarUser.java b/src/de/steamwar/bungeecore/sql/SteamwarUser.java index bf11939a..d221c8b7 100644 --- a/src/de/steamwar/bungeecore/sql/SteamwarUser.java +++ b/src/de/steamwar/bungeecore/sql/SteamwarUser.java @@ -19,10 +19,15 @@ package de.steamwar.bungeecore.sql; +import com.google.gson.JsonParser; import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.commands.WebregisterCommand; import de.steamwar.bungeecore.listeners.ConnectionListener; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Scanner; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.connection.PendingConnection; @@ -38,6 +43,7 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; + public class SteamwarUser { private final int id; private final UUID uuid; @@ -51,6 +57,8 @@ public class SteamwarUser { private static final Map usersByUUID = new HashMap<>(); private static final Map usersById = new HashMap<>(); private static final InetAddress LIXFEL_DE; + private static final String API_URL = "https://api.mojang.com/users/profiles/minecraft/"; + private static final JsonParser jsonParser = new JsonParser(); static { try { @@ -85,8 +93,7 @@ public class SteamwarUser { user.userName = userName; } }else{ - SQL.update("INSERT INTO UserData (UUID, UserName, UserGroup) VALUES (?, ?, 'Member')", connection.getUniqueId().toString(), connection.getName()); - user = dbInit(SQL.select("SELECT * FROM UserData WHERE UUID = ?", connection.getUniqueId().toString())); + user = SteamwarUser.createUserInDatabase(connection.getUniqueId(), connection.getName()); if(user == null) throw new SecurityException("user == null"); ConnectionListener.newPlayer(user.uuid); @@ -97,6 +104,25 @@ public class SteamwarUser { return user; } + public static SteamwarUser getOrCreateOfflinePlayer(String name){ + SteamwarUser user = SteamwarUser.get(name); + if (user != null) { + return user; + } + + UUID uuid = SteamwarUser.loadUUID(name); + if (uuid == null) { + return null; + } + + return SteamwarUser.createUserInDatabase(uuid, name); + } + + private static SteamwarUser createUserInDatabase(UUID uuid, String name) { + SQL.update("INSERT INTO UserData (UUID, UserName, UserGroup) VALUES (?, ?, 'Member')", uuid.toString(), name); + return dbInit(SQL.select("SELECT * FROM UserData WHERE UUID = ?", uuid.toString())); + } + public static SteamwarUser get(String userName){ userName = userName.toLowerCase(); if(usersByName.containsKey(userName)) @@ -126,6 +152,22 @@ public class SteamwarUser { usersByUUID.clear(); } + public static UUID loadUUID(String playerName) { + try { + final URL url = new URL(API_URL + playerName); + return getUniqueIdFromString(jsonParser.parse(new Scanner(url.openConnection().getInputStream()).nextLine()).getAsJsonObject().get("id").getAsString()); + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + private static UUID getUniqueIdFromString(String uuid) { + return UUID.fromString(uuid.replaceFirst("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5")); + } + public void setTeam(int team){ this.team = team; SQL.update("Update UserData SET Team = ? WHERE id = ?", team, id); From ea9a98ec11f13719d52001679f11d563685bde65 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 27 Apr 2021 14:49:28 +0200 Subject: [PATCH 5/7] Add custom Branding for Bungee --- src/de/steamwar/bungeecore/BungeeCore.java | 1 + .../bungeecore/listeners/BrandListener.java | 66 +++++++++++++++++++ .../steamwar/messages/BungeeCore.properties | 2 + 3 files changed, 69 insertions(+) create mode 100644 src/de/steamwar/bungeecore/listeners/BrandListener.java diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 6ca32200..2344d565 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -84,6 +84,7 @@ public class BungeeCore extends Plugin { new CheckListener(); new ModLoaderBlocker(); new WorldDownloader(); + new BrandListener(); commands.put("/b", null); commands.put("/gs", null); diff --git a/src/de/steamwar/bungeecore/listeners/BrandListener.java b/src/de/steamwar/bungeecore/listeners/BrandListener.java new file mode 100644 index 00000000..313476e3 --- /dev/null +++ b/src/de/steamwar/bungeecore/listeners/BrandListener.java @@ -0,0 +1,66 @@ +/* + 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 . + */ + +package de.steamwar.bungeecore.listeners; + +import de.steamwar.bungeecore.BungeeCore; +import de.steamwar.bungeecore.Message; +import de.steamwar.bungeecore.sql.SteamwarUser; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import net.md_5.bungee.api.connection.ProxiedPlayer; +import net.md_5.bungee.api.event.PluginMessageEvent; +import net.md_5.bungee.event.EventHandler; +import net.md_5.bungee.protocol.DefinedPacket; +import net.md_5.bungee.protocol.ProtocolConstants; +import net.md_5.bungee.protocol.packet.PluginMessage; + +import java.util.concurrent.TimeUnit; + +public class BrandListener extends BasicListener { + + @EventHandler + public void onServerSwitch(PluginMessageEvent event) { + if(event.getTag().equals("minecraft:brand") || event.getTag().equals("MC|Brand")) { + return; + } + + if(event.getReceiver().getAddress().getHostName().contains("localhost")) { + return; + } + + BungeeCore.get().getProxy().getScheduler().schedule(BungeeCore.get(), () -> { + ProxiedPlayer player = (ProxiedPlayer) event.getReceiver(); + SteamwarUser user = SteamwarUser.get(player); + + String channel = player.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand"; + StringBuilder serverBrand = new StringBuilder(); + for (byte b:event.getData()) { + serverBrand.append((char) b); + } + + String brandString = Message.parse("STEAMWAR_BRAND", player, user.getUserGroup().getColorCode(), player.getName(), BungeeCore.get().getProxy().getName(), player.getServer().getInfo().getName(), serverBrand.substring(1)); + + ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); + DefinedPacket.writeString(brandString, brand); + player.sendData(channel, DefinedPacket.toArray(brand)); + brand.release(); + }, 50, TimeUnit.MILLISECONDS); + } +} diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 911b24d4..2c72c5a8 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -7,6 +7,8 @@ UNKNOWN_PLAYER=§cDiesen Spieler gibt es nicht. UNKNOWN_TEAM=§cDieses Team gibt es nicht. INVALID_TIME=§cUngültige Zeitangabe. +STEAMWAR_BRAND={0}{1} §r<- §eSteam§8War.de §7({2}) §r<- §e{3} §7({4})§r + #ModLoader blocker MODLOADER_INSTALLED=§7Du hast §e{0} §7installiert. Daher kannst du keinen Arenen beitreten. MODLOADER_DENIED=§cMit Fabric, Forge und LiteLoader kannst du keinen Arenen beitreten. From ead209af0a68fdad987d7eb3ced147c7bed65823 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Wed, 28 Apr 2021 12:27:32 +0200 Subject: [PATCH 6/7] Reduce Brand Info --- src/de/steamwar/bungeecore/listeners/BrandListener.java | 3 +-- src/de/steamwar/messages/BungeeCore.properties | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/BrandListener.java b/src/de/steamwar/bungeecore/listeners/BrandListener.java index 313476e3..b7bbe790 100644 --- a/src/de/steamwar/bungeecore/listeners/BrandListener.java +++ b/src/de/steamwar/bungeecore/listeners/BrandListener.java @@ -47,7 +47,6 @@ public class BrandListener extends BasicListener { BungeeCore.get().getProxy().getScheduler().schedule(BungeeCore.get(), () -> { ProxiedPlayer player = (ProxiedPlayer) event.getReceiver(); - SteamwarUser user = SteamwarUser.get(player); String channel = player.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:brand" : "MC|Brand"; StringBuilder serverBrand = new StringBuilder(); @@ -55,7 +54,7 @@ public class BrandListener extends BasicListener { serverBrand.append((char) b); } - String brandString = Message.parse("STEAMWAR_BRAND", player, user.getUserGroup().getColorCode(), player.getName(), BungeeCore.get().getProxy().getName(), player.getServer().getInfo().getName(), serverBrand.substring(1)); + String brandString = Message.parse("STEAMWAR_BRAND", player, BungeeCore.get().getProxy().getName(), player.getServer().getInfo().getName(), serverBrand.substring(1)); ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); DefinedPacket.writeString(brandString, brand); diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 2c72c5a8..6b8e93cd 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -7,7 +7,7 @@ UNKNOWN_PLAYER=§cDiesen Spieler gibt es nicht. UNKNOWN_TEAM=§cDieses Team gibt es nicht. INVALID_TIME=§cUngültige Zeitangabe. -STEAMWAR_BRAND={0}{1} §r<- §eSteam§8War.de §7({2}) §r<- §e{3} §7({4})§r +STEAMWAR_BRAND=§eSteam§8War.de §7({2}) §r<- §e{3} §7({4})§r #ModLoader blocker MODLOADER_INSTALLED=§7Du hast §e{0} §7installiert. Daher kannst du keinen Arenen beitreten. From a0f87e4916182b1ec1f1292cb1c82c93c342cccf Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Wed, 28 Apr 2021 12:28:10 +0200 Subject: [PATCH 7/7] Fix Params --- src/de/steamwar/messages/BungeeCore.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 6b8e93cd..98f81c83 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -7,7 +7,7 @@ UNKNOWN_PLAYER=§cDiesen Spieler gibt es nicht. UNKNOWN_TEAM=§cDieses Team gibt es nicht. INVALID_TIME=§cUngültige Zeitangabe. -STEAMWAR_BRAND=§eSteam§8War.de §7({2}) §r<- §e{3} §7({4})§r +STEAMWAR_BRAND=§eSteam§8War.de §7({0}) §r<- §e{1} §7({2})§r #ModLoader blocker MODLOADER_INSTALLED=§7Du hast §e{0} §7installiert. Daher kannst du keinen Arenen beitreten.