2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-22 20:28:00 +00:00
This commit is contained in:
Tux 2013-11-15 22:05:49 -05:00
parent c393f4c553
commit f2f84fcc13

View File

@ -138,7 +138,9 @@ public class RedisBungee extends Plugin implements Listener {
Jedis tmpRsc = pool.getResource();
try {
tmpRsc.set("server:" + configuration.getServerId() + ":playerCount", "0"); // reset
tmpRsc.srem("server:" + configuration.getServerId() + ":usersOnline", (String[]) tmpRsc.smembers("server:" + configuration.getServerId() + ":usersOnline").toArray());
Set<String> smembers = tmpRsc.smembers("server:" + configuration.getServerId() + ":usersOnline");
if (smembers.size() > 0)
tmpRsc.srem("server:" + configuration.getServerId() + ":usersOnline", smembers.toArray(new String[smembers.size()]));
} finally {
pool.returnResource(tmpRsc);
}
@ -172,7 +174,9 @@ public class RedisBungee extends Plugin implements Listener {
Jedis tmpRsc = pool.getResource();
try {
tmpRsc.set("server:" + configuration.getServerId() + ":playerCount", "0"); // reset
tmpRsc.srem("server:" + configuration.getServerId() + ":usersOnline", (String[]) tmpRsc.smembers("server:" + configuration.getServerId() + ":usersOnline").toArray());
Set<String> smembers = tmpRsc.smembers("server:" + configuration.getServerId() + ":usersOnline");
if (smembers.size() > 0)
tmpRsc.srem("server:" + configuration.getServerId() + ":usersOnline", smembers.toArray(new String[smembers.size()]));
} catch (JedisException | ClassCastException ignored) {
} finally {
pool.returnResource(tmpRsc);