From f9a0bf90a3fce38b1b61195db1f9026591391730 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Wed, 17 Nov 2021 14:03:51 +0100 Subject: [PATCH] Don't search unknown players by default This shouldn't be needed in any of the internal usage of the event and could lead to unexpected network lookups. --- .../java/com/Acrobot/ChestShop/Events/AccountQueryEvent.java | 5 +++-- src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/Acrobot/ChestShop/Events/AccountQueryEvent.java b/src/main/java/com/Acrobot/ChestShop/Events/AccountQueryEvent.java index 8e5932e..90bf520 100644 --- a/src/main/java/com/Acrobot/ChestShop/Events/AccountQueryEvent.java +++ b/src/main/java/com/Acrobot/ChestShop/Events/AccountQueryEvent.java @@ -11,7 +11,7 @@ public class AccountQueryEvent extends Event { private static final HandlerList handlers = new HandlerList(); private final String name; private Account account = null; - private boolean searchOfflinePlayers = true; + private boolean searchOfflinePlayers = false; public AccountQueryEvent(String name) { this.name = name; @@ -38,7 +38,8 @@ public class AccountQueryEvent extends Event { } /** - * Set whether or not offline player data should be searched (too) + * Set whether or not offline player data should be searched (too). + * This could lead to network lookups if the player by the name never joined the server! * @param searchOfflinePlayers Whether or not offline player data should be searched (too) */ public void searchOfflinePlayers(boolean searchOfflinePlayers) { diff --git a/src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java b/src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java index 523f8bc..b42daf1 100644 --- a/src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java +++ b/src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java @@ -277,7 +277,6 @@ public class NameManager implements Listener { } AccountQueryEvent queryEvent = new AccountQueryEvent(name); - queryEvent.searchOfflinePlayers(false); ChestShop.callEvent(queryEvent); Account account = queryEvent.getAccount(); if (account == null) {