Load invite browser info at the right time

This commit is contained in:
Dan Mulloy 2018-06-19 19:19:59 -04:00 committed by Alexander Meech
parent e0245b562c
commit 3f83ac642a
1 changed files with 7 additions and 7 deletions

View File

@ -179,14 +179,20 @@ public class CommunityManager extends MiniDbClientPlugin<CommunityMemberData>
@Override @Override
public void processLoginResultSet(String playerName, UUID uuid, int accountId, ResultSet resultSet) throws SQLException public void processLoginResultSet(String playerName, UUID uuid, int accountId, ResultSet resultSet) throws SQLException
{ {
CommunityMemberData data = Get(uuid);
while (resultSet.next()) while (resultSet.next())
{ {
String region = resultSet.getString("region"); String region = resultSet.getString("region");
if (region.equalsIgnoreCase(_region.name())) 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 @Override
@ -929,12 +935,6 @@ public class CommunityManager extends MiniDbClientPlugin<CommunityMemberData>
_repo.handlePlayerJoin(_loadedCommunities, load, accountId); _repo.handlePlayerJoin(_loadedCommunities, load, accountId);
System.out.println("Loaded communities: " + load + "; Total: " + _loadedCommunities.size()); 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) @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)