Skip to content

Commit

Permalink
Make sure server field is withen map than calling redis seperatly
Browse files Browse the repository at this point in the history
  • Loading branch information
ham1255 committed Nov 14, 2022
1 parent a526298 commit 0b9fd6d
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,19 @@ public static boolean isKickedOtherLocation(String uuid, UnifiedJedis unifiedJed


public static void createPlayer(UUID uuid, UnifiedJedis unifiedJedis, String currentServer, InetAddress hostname, boolean fireEvent) {
if (currentServer != null) {
unifiedJedis.hset("player:" + uuid, "server", currentServer);
}
final boolean isKickedFromOtherLocation = isKickedOtherLocation(uuid.toString(), unifiedJedis);
Map<String, String> playerData = new HashMap<>(4);
playerData.put("online", "0");
playerData.put("ip", hostname.getHostName());
playerData.put("proxy", AbstractRedisBungeeAPI.getAbstractRedisBungeeAPI().getProxyId());

if (currentServer != null) {
playerData.put("server", currentServer);
}
unifiedJedis.sadd("proxy:" + AbstractRedisBungeeAPI.getAbstractRedisBungeeAPI().getProxyId() + ":usersOnline", uuid.toString());
unifiedJedis.hset("player:" + uuid, playerData);

if (fireEvent && !isKickedFromOtherLocation) {
playerJoinPayload(uuid, unifiedJedis, hostname);
}

}


Expand Down

0 comments on commit 0b9fd6d

Please sign in to comment.