mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-12-23 02:28:01 +00:00
Make sure server field is withen map than calling redis seperatly
This commit is contained in:
parent
a526298d1c
commit
0b9fd6d7ff
@ -38,22 +38,19 @@ public class PlayerUtils {
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user