From 9a7cc52e03bf7b8b20c81a135d0a4d80f556986e Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Sun, 8 Nov 2020 20:05:54 -0600 Subject: [PATCH] Fix players being marked as an impostor when the Discord verification system is disabled --- .../totalfreedommod/command/Command_manuallyverify.java | 2 +- .../totalfreedom/totalfreedommod/command/Command_verify.java | 4 ++-- .../me/totalfreedom/totalfreedommod/player/PlayerList.java | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_manuallyverify.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_manuallyverify.java index 066f8834..28ab5ae3 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_manuallyverify.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_manuallyverify.java @@ -33,7 +33,7 @@ public class Command_manuallyverify extends FreedomCommand return true; } - if (!plugin.pl.isImposter(player)) + if (!plugin.pl.IsImpostor(player)) { msg("That player is not an impostor."); return true; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_verify.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_verify.java index f57891a5..9855ca37 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_verify.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_verify.java @@ -29,7 +29,7 @@ public class Command_verify extends FreedomCommand return true; } - if (!plugin.pl.isImposter(playerSender)) + if (!plugin.pl.IsImpostor(playerSender)) { msg("You are not an impostor, therefore you do not need to verify.", ChatColor.RED); return true; @@ -57,7 +57,7 @@ public class Command_verify extends FreedomCommand String code = args[0]; String backupCode = null; - if (plugin.pl.isImposter(playerSender)) + if (plugin.pl.IsImpostor(playerSender)) { PlayerData mapPlayer = plugin.dc.getVerificationCodes().get(code); if (mapPlayer == null) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerList.java b/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerList.java index 5dd18943..04ba3742 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerList.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerList.java @@ -156,12 +156,13 @@ public class PlayerList extends FreedomService public Boolean isPlayerImpostor(Player player) { PlayerData playerData = getData(player); - return !plugin.sl.isStaff(player) + return plugin.dc.enabled + && !plugin.sl.isStaff(player) && (playerData.hasVerification()) && !playerData.getIps().contains(FUtil.getIp(player)); } - public boolean isImposter(Player player) + public boolean IsImpostor(Player player) { return isPlayerImpostor(player) || plugin.sl.isStaffImpostor(player); }