From 72322f2e56462a2a83a7d64caf5ad95594c3586d Mon Sep 17 00:00:00 2001 From: speedxx <43330808+speedxx@users.noreply.github.com> Date: Wed, 19 Aug 2020 21:19:15 -0400 Subject: [PATCH] use UUIDs for developers --- .../command/Command_reactionbar.java | 5 +++-- .../totalfreedommod/rank/RankManager.java | 8 +++---- .../totalfreedommod/util/FUtil.java | 21 +++++++++++++++---- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_reactionbar.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_reactionbar.java index 9ccfed12..ce2cde2e 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_reactionbar.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_reactionbar.java @@ -14,12 +14,13 @@ public class Command_reactionbar extends FreedomCommand @Override public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (!FUtil.isDeveloper(sender.getName())) + if (!FUtil.isDeveloper(playerSender)) { return noPerms(); } + plugin.sh.forceStartReaction(); msg("Started a reaction."); return true; } -} +} \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java b/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java index 7f6a6216..36ce1c83 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java @@ -52,7 +52,7 @@ public class RankManager extends FreedomService } // Developers always show up - if (FUtil.isDeveloper(player.getName())) + if (FUtil.isDeveloper(player)) { return Title.DEVELOPER; } @@ -96,7 +96,7 @@ public class RankManager extends FreedomService } // Developers always show up - if (FUtil.isDeveloper(staffMember.getName())) + if (FUtil.isDeveloper((Player)staffMember)) { return Title.DEVELOPER; } @@ -180,7 +180,7 @@ public class RankManager extends FreedomService FPlayer fPlayer = plugin.pl.getPlayer(player); PlayerData data = plugin.pl.getData(player); Displayable display = getDisplay(player); - if (plugin.sl.isStaff(player) || data.isMasterBuilder() || data.isDonator() || FUtil.isDeveloper(player.getName())) + if (plugin.sl.isStaff(player) || data.isMasterBuilder() || data.isDonator() || FUtil.isDeveloper(player)) { String displayName = display.getColor() + player.getName(); player.setPlayerListName(displayName); @@ -249,7 +249,7 @@ public class RankManager extends FreedomService } // Broadcast login message - if (isStaff || FUtil.isDeveloper(player.getName()) || plugin.pl.getData(player).isMasterBuilder() || plugin.pl.getData(player).isDonator()) + if (isStaff || FUtil.isDeveloper(player) || plugin.pl.getData(player).isMasterBuilder() || plugin.pl.getData(player).isDonator()) { if (!plugin.sl.isVanished(player.getName())) { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java b/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java index 0197fe5b..1b36fcae 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java @@ -54,8 +54,21 @@ public class FUtil private static final Random RANDOM = new Random(); public static final String SAVED_FLAGS_FILENAME = "savedflags.dat"; - // See https://github.com/TotalFreedom/License - None of the listed names may be removed. + /* See https://github.com/TotalFreedom/License - None of the listed names may be removed. + Leaving this list here for anyone running TFM on a cracked server: public static final List DEVELOPERS = Arrays.asList("Madgeek1450", "Prozza", "WickedGamingUK", "Wild1145", "aggelosQQ", "scripthead", "supernt", "Telesphoreo", "CoolJWB"); + */ + public static final List DEVELOPERS = Arrays.asList( + "1156a81a-23fb-435e-9aff-fe9c2ea7e82d", // Madgeek1450 + "f9a1982e-252e-4ed3-92ed-52b0506a39c9", // Prozza + "90eb5d86-ed60-4165-a36e-bb77aa3c6664", // WickedGamingUK + "604cbb51-842d-4b43-8b0a-d1d7c6cd2869", // Wild1145 + "e67d77c4-fff9-4cea-94cc-9f1f1ab7806b", // aggelosQQ + "0061326b-8b3d-44c8-830a-5f2d59f5dc1b", // scripthead + "53b1512e-3481-4702-9f4f-63cb9c8be6a1", // supernt + "78408086-1991-4c33-a571-d8fa325465b2", // Telesphoreo + "67ce0e28-3d6b-469c-ab71-304eec81b614" // CoolJWB + ); public static String DATE_STORAGE_FORMAT = "EEE, d MMM yyyy HH:mm:ss Z"; public static final Map CHAT_COLOR_NAMES = new HashMap<>(); public static final List CHAT_COLOR_POOL = Arrays.asList( @@ -121,10 +134,10 @@ public class FUtil { return ConfigEntry.SERVER_OWNERS.getStringList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getStringList().contains(name) || ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getStringList().contains(name); } - - public static boolean isDeveloper(String name) + + public static boolean isDeveloper(Player player) { - return FUtil.DEVELOPERS.contains(name); + return DEVELOPERS.contains(player.getUniqueId().toString()); } public static boolean inDeveloperMode()