2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-12-27 12:25:29 +00:00
This commit is contained in:
Tux 2013-12-15 11:41:08 -05:00
parent fa93d67e1b
commit 1bf6d98d54

View File

@ -19,6 +19,7 @@ import net.md_5.bungee.event.EventHandler;
import org.yaml.snakeyaml.Yaml;
import redis.clients.jedis.*;
import redis.clients.jedis.exceptions.JedisConnectionException;
import redis.clients.jedis.exceptions.JedisDataException;
import redis.clients.jedis.exceptions.JedisException;
import java.io.*;
@ -159,7 +160,11 @@ public final class RedisBungee extends Plugin implements Listener {
tmpRsc.set("server:" + configuration.getServerId() + ":playerCount", "0"); // reset
if (tmpRsc.scard("server:" + configuration.getServerId() + ":usersOnline") > 0) {
Set<String> smembers = tmpRsc.smembers("server:" + configuration.getServerId() + ":usersOnline");
tmpRsc.srem("server:" + configuration.getServerId() + ":usersOnline", smembers.toArray(new String[smembers.size()]));
// Make sure more one time...
if (smembers.size() > 0)
try {
tmpRsc.srem("server:" + configuration.getServerId() + ":usersOnline", smembers.toArray(new String[smembers.size()]));
} catch (JedisDataException ignored) {}
}
} finally {
pool.returnResource(tmpRsc);