mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-14 00:38:01 +00:00
Slightly optimized cleanUpPlayer()
This commit is contained in:
parent
6ed8a0df93
commit
51c769fd79
@ -37,12 +37,9 @@ public class RedisUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compatibility restraints prevent me from using using HDEL with multiple keys.
|
|
||||||
public static void cleanUpPlayer(String player, Jedis rsc) {
|
public static void cleanUpPlayer(String player, Jedis rsc) {
|
||||||
rsc.srem("proxy:" + RedisBungee.getApi().getServerId() + ":usersOnline", player);
|
rsc.srem("proxy:" + RedisBungee.getApi().getServerId() + ":usersOnline", player);
|
||||||
rsc.hdel("player:" + player, "server");
|
rsc.hdel("player:" + player, "server", "ip", "proxy");
|
||||||
rsc.hdel("player:" + player, "ip");
|
|
||||||
rsc.hdel("player:" + player, "proxy");
|
|
||||||
long timestamp = System.currentTimeMillis();
|
long timestamp = System.currentTimeMillis();
|
||||||
rsc.hset("player:" + player, "online", String.valueOf(timestamp));
|
rsc.hset("player:" + player, "online", String.valueOf(timestamp));
|
||||||
rsc.publish("redisbungee-data", RedisBungee.getGson().toJson(new DataManager.DataManagerMessage<>(
|
rsc.publish("redisbungee-data", RedisBungee.getGson().toJson(new DataManager.DataManagerMessage<>(
|
||||||
@ -52,9 +49,7 @@ public class RedisUtil {
|
|||||||
|
|
||||||
public static void cleanUpPlayer(String player, Pipeline rsc) {
|
public static void cleanUpPlayer(String player, Pipeline rsc) {
|
||||||
rsc.srem("proxy:" + RedisBungee.getApi().getServerId() + ":usersOnline", player);
|
rsc.srem("proxy:" + RedisBungee.getApi().getServerId() + ":usersOnline", player);
|
||||||
rsc.hdel("player:" + player, "server");
|
rsc.hdel("player:" + player, "server", "ip", "proxy");
|
||||||
rsc.hdel("player:" + player, "ip");
|
|
||||||
rsc.hdel("player:" + player, "proxy");
|
|
||||||
long timestamp = System.currentTimeMillis();
|
long timestamp = System.currentTimeMillis();
|
||||||
rsc.hset("player:" + player, "online", String.valueOf(timestamp));
|
rsc.hset("player:" + player, "online", String.valueOf(timestamp));
|
||||||
rsc.publish("redisbungee-data", RedisBungee.getGson().toJson(new DataManager.DataManagerMessage<>(
|
rsc.publish("redisbungee-data", RedisBungee.getGson().toJson(new DataManager.DataManagerMessage<>(
|
||||||
|
Loading…
Reference in New Issue
Block a user