From 8492bc447a529aae9a732d55268c635d58d45f30 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 22 Mar 2022 17:18:20 +0100 Subject: [PATCH 1/4] 1.4. Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/sql/UserGroup.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/de/steamwar/bungeecore/sql/UserGroup.java b/src/de/steamwar/bungeecore/sql/UserGroup.java index 6ca7a9ae..d6d3ba52 100644 --- a/src/de/steamwar/bungeecore/sql/UserGroup.java +++ b/src/de/steamwar/bungeecore/sql/UserGroup.java @@ -24,12 +24,12 @@ import java.util.stream.Collectors; public enum UserGroup { - Admin("§4", "§e", "Admin", true, true, true, true), - Developer("§3", "§f", "Dev", true, true, true, true), - Moderator("§c", "§f", "Mod", true, true, true, true), - Supporter("§9", "§f", "Sup", false, true, true, true), - Builder("§2", "§f", "Arch", false, true, false, true), - YouTuber("§5", "§f", "YT", false, false, false, true), + Admin("§4", "§e", "Obererzieher", true, true, true, true), + Developer("§3", "§f", "Seelsorger", true, true, true, true), + Moderator("§c", "§f", "Schichtleiter", true, true, true, true), + Supporter("§9", "§f", "Kindergärtner", false, true, true, true), + Builder("§2", "§f", "Kleinkind", false, true, false, true), + YouTuber("§5", "§f", "Reporter", false, false, false, true), Member("§7", "§7", "", false, false, false, false); private final String colorCode; From 385f5a5a369f29cd88ce22f3179287ce49ccc4d0 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 30 Mar 2022 18:32:07 +0200 Subject: [PATCH 2/4] Fix concurrency Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/sql/UserElo.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/sql/UserElo.java b/src/de/steamwar/bungeecore/sql/UserElo.java index ca7e7237..67409661 100644 --- a/src/de/steamwar/bungeecore/sql/UserElo.java +++ b/src/de/steamwar/bungeecore/sql/UserElo.java @@ -26,15 +26,16 @@ import net.md_5.bungee.api.connection.ProxiedPlayer; import java.util.HashMap; import java.util.Map; import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; public class UserElo { private UserElo() {} public static final int ELO_DEFAULT = 1000; - private static final Map>> gameModeUserEloCache = new HashMap<>(); - private static final Map maxEloCache = new HashMap<>(); - private static final Map emblemCache = new HashMap<>(); + private static final Map>> gameModeUserEloCache = new ConcurrentHashMap<>(); + private static final Map maxEloCache = new ConcurrentHashMap<>(); + private static final Map emblemCache = new ConcurrentHashMap<>(); private static final Statement elo = new Statement("SELECT Elo FROM UserElo WHERE UserID = ? AND GameMode = ? AND Season = ?"); private static final Statement setElo = new Statement("INSERT INTO UserElo (Season, GameMode, UserID, Elo) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE Elo = VALUES(Elo)"); From 3b358a86663ca0e4ce87e8ac1f96f35846d1cba8 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 30 Mar 2022 18:34:21 +0200 Subject: [PATCH 3/4] Fix GDPRQuery Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/commands/GDPRQuery.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/GDPRQuery.java b/src/de/steamwar/bungeecore/commands/GDPRQuery.java index bb98fca1..444a22c8 100644 --- a/src/de/steamwar/bungeecore/commands/GDPRQuery.java +++ b/src/de/steamwar/bungeecore/commands/GDPRQuery.java @@ -60,7 +60,7 @@ public class GDPRQuery extends BasicCommand { sqlCSV(user, out, bauweltMember, "BuildMember.csv"); sqlCSV(user, out, bauweltMembers, "BuildMembers.csv"); sqlCSV(user, out, checkedSchems, "SchematicChecksessions.csv"); - sqlCSV(user, out, elo, "Elo.csv"); + sqlCSV(user, out, userElo, "UserElo.csv"); sqlCSV(user, out, fights, "Fights.csv"); sqlCSV(user, out, ignoredPlayers, "IgnoredPlayers.csv"); sqlCSV(user, out, ignoringPlayers, "IgnoringPlayers.csv"); @@ -88,8 +88,8 @@ public class GDPRQuery extends BasicCommand { private static final Statement bauweltMember = new Statement("SELECT BauweltID AS Bauwelt, WorldEdit, World FROM BauweltMember WHERE MemberID = ?"); private static final Statement bauweltMembers = new Statement("SELECT u.UserName AS 'User', m.WorldEdit AS WorldEdit, m.World AS World FROM BauweltMember m INNER JOIN UserData u ON m.MemberID = u.id WHERE m.BauweltID = ?"); private static final Statement checkedSchems = new Statement("SELECT NodeName AS Schematic, StartTime, EndTime, DeclineReason AS Result FROM CheckedSchematic WHERE NodeOwner = ? ORDER BY StartTime ASC"); - private static final Statement elo = new Statement("SELECT GameMode, Elo FROM Elo WHERE UserID = ?"); - private static final Statement fights = new Statement("SELECT p.Team AS Team, p.Kit AS Kit, p.Kills AS Kills, p.IsOut AS Died, f.GameMode AS GameMode, f.Server AS Server, f.Arena AS Arena, f.StartTime AS StartTime, f.Duration AS Duration, (f.BlueLeader = p.UserID) AS IsBlueLeader, (f.RedLeader = p.UserID) AS IsRedLeader, f.Win AS Winner, f.WinCondition AS WinCondition FROM Fight f INNER JOIN FightPlayer p ON f.FightID = p.FightID WHERE p.UserID = ? ORDER BY StartTime ASC"); + private static final Statement userElo = new Statement("SELECT GameMode, Elo, Season FROM Elo WHERE UserID = ?"); + private static final Statement fights = new Statement("SELECT p.Team AS Team, p.Kit AS Kit, p.Kills AS Kills, p.IsOut AS Died, f.GameMode AS GameMode, f.Server AS Server, f.StartTime AS StartTime, f.Duration AS Duration, (f.BlueLeader = p.UserID) AS IsBlueLeader, (f.RedLeader = p.UserID) AS IsRedLeader, f.Win AS Winner, f.WinCondition AS WinCondition FROM Fight f INNER JOIN FightPlayer p ON f.FightID = p.FightID WHERE p.UserID = ? ORDER BY StartTime ASC"); private static final Statement ignoredPlayers = new Statement("SELECT u.UserName AS IgnoredPlayer FROM IgnoredPlayers i INNER JOIN UserData u ON i.Ignored = u.id WHERE Ignorer = ?"); private static final Statement ignoringPlayers = new Statement("SELECT Ignorer AS IgnoringPlayers FROM IgnoredPlayers WHERE Ignored = ?"); private static final Statement schematicMember = new Statement("SELECT s.NodeName AS SchematicName, u.UserName AS SchematicOwner FROM NodeMember m INNER JOIN SchematicNode s ON m.NodeId = s.NodeId INNER JOIN UserData u ON s.NodeOwner = u.id WHERE m.UserId = ?"); From 7293f741c7ddfe9146dd8b38c8c644f62314afac Mon Sep 17 00:00:00 2001 From: Lixfel Date: Thu, 31 Mar 2022 23:50:28 +0200 Subject: [PATCH 4/4] =?UTF-8?q?=E2=80=9Esrc/de/steamwar/bungeecore/sql/Use?= =?UTF-8?q?rGroup.java=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/de/steamwar/bungeecore/sql/UserGroup.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/sql/UserGroup.java b/src/de/steamwar/bungeecore/sql/UserGroup.java index d6d3ba52..bf7da6fe 100644 --- a/src/de/steamwar/bungeecore/sql/UserGroup.java +++ b/src/de/steamwar/bungeecore/sql/UserGroup.java @@ -28,7 +28,7 @@ public enum UserGroup { Developer("§3", "§f", "Seelsorger", true, true, true, true), Moderator("§c", "§f", "Schichtleiter", true, true, true, true), Supporter("§9", "§f", "Kindergärtner", false, true, true, true), - Builder("§2", "§f", "Kleinkind", false, true, false, true), + Builder("§2", "§f", "Hausmeister", false, true, false, true), YouTuber("§5", "§f", "Reporter", false, false, false, true), Member("§7", "§7", "", false, false, false, false);