From 3f83ac642aec35b12fb377fdabd91d267ac726b2 Mon Sep 17 00:00:00 2001 From: Dan Mulloy Date: Tue, 19 Jun 2018 19:19:59 -0400 Subject: [PATCH] Load invite browser info at the right time --- .../core/communities/CommunityManager.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/communities/CommunityManager.java b/Plugins/Mineplex.Core/src/mineplex/core/communities/CommunityManager.java index f8c9e849c..bbd4deff4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/communities/CommunityManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/communities/CommunityManager.java @@ -179,14 +179,20 @@ public class CommunityManager extends MiniDbClientPlugin @Override public void processLoginResultSet(String playerName, UUID uuid, int accountId, ResultSet resultSet) throws SQLException { + CommunityMemberData data = Get(uuid); while (resultSet.next()) { String region = resultSet.getString("region"); if (region.equalsIgnoreCase(_region.name())) { - CommunityManager.this.Get(uuid).Invites.add(resultSet.getInt("communityId")); + data.Invites.add(resultSet.getInt("communityId")); } } + + if (!data.Invites.isEmpty()) + { + loadBrowserCommunities(data.Invites, null); + } } @Override @@ -929,12 +935,6 @@ public class CommunityManager extends MiniDbClientPlugin _repo.handlePlayerJoin(_loadedCommunities, load, accountId); System.out.println("Loaded communities: " + load + "; Total: " + _loadedCommunities.size()); } - - System.out.println("invites = " + data.Invites); // TODO debug - if (!data.Invites.isEmpty()) - { - loadBrowserCommunities(data.Invites, null); - } } @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)