2014-04-20 05:12:28 +00:00
|
|
|
/**
|
|
|
|
* Copyright © 2013 tuxed <write@imaginarycode.com>
|
|
|
|
* This work is free. You can redistribute it and/or modify it under the
|
|
|
|
* terms of the Do What The Fuck You Want To Public License, Version 2,
|
|
|
|
* as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
|
|
|
|
*/
|
2014-04-19 20:08:49 +00:00
|
|
|
package com.imaginarycode.minecraft.redisbungee;
|
|
|
|
|
|
|
|
import redis.clients.jedis.Jedis;
|
2014-06-11 11:24:09 +00:00
|
|
|
import redis.clients.jedis.Pipeline;
|
2014-04-19 20:08:49 +00:00
|
|
|
|
2014-05-31 03:57:42 +00:00
|
|
|
class RedisUtil {
|
2014-04-19 20:08:49 +00:00
|
|
|
public static void cleanUpPlayer(String player, Jedis rsc) {
|
2014-08-09 19:32:12 +00:00
|
|
|
rsc.srem("proxy:" + RedisBungee.getApi().getServerId() + ":usersOnline", player);
|
2014-04-19 20:08:49 +00:00
|
|
|
rsc.hdel("player:" + player, "server");
|
|
|
|
rsc.hdel("player:" + player, "ip");
|
2014-08-09 19:32:12 +00:00
|
|
|
rsc.hdel("player:" + player, "proxy");
|
2014-04-19 20:08:49 +00:00
|
|
|
}
|
2014-06-11 11:24:09 +00:00
|
|
|
|
|
|
|
public static void cleanUpPlayer(String player, Pipeline rsc) {
|
2014-08-09 19:32:12 +00:00
|
|
|
rsc.srem("proxy:" + RedisBungee.getApi().getServerId() + ":usersOnline", player);
|
2014-06-11 11:24:09 +00:00
|
|
|
rsc.hdel("player:" + player, "server");
|
|
|
|
rsc.hdel("player:" + player, "ip");
|
2014-08-09 19:32:12 +00:00
|
|
|
rsc.hdel("player:" + player, "proxy");
|
2014-06-11 11:24:09 +00:00
|
|
|
}
|
2014-04-19 20:08:49 +00:00
|
|
|
}
|