mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-23 04:28:01 +00:00
bleh
This commit is contained in:
parent
c393f4c553
commit
f2f84fcc13
@ -138,7 +138,9 @@ public class RedisBungee extends Plugin implements Listener {
|
|||||||
Jedis tmpRsc = pool.getResource();
|
Jedis tmpRsc = pool.getResource();
|
||||||
try {
|
try {
|
||||||
tmpRsc.set("server:" + configuration.getServerId() + ":playerCount", "0"); // reset
|
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 {
|
} finally {
|
||||||
pool.returnResource(tmpRsc);
|
pool.returnResource(tmpRsc);
|
||||||
}
|
}
|
||||||
@ -172,7 +174,9 @@ public class RedisBungee extends Plugin implements Listener {
|
|||||||
Jedis tmpRsc = pool.getResource();
|
Jedis tmpRsc = pool.getResource();
|
||||||
try {
|
try {
|
||||||
tmpRsc.set("server:" + configuration.getServerId() + ":playerCount", "0"); // reset
|
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) {
|
} catch (JedisException | ClassCastException ignored) {
|
||||||
} finally {
|
} finally {
|
||||||
pool.returnResource(tmpRsc);
|
pool.returnResource(tmpRsc);
|
||||||
|
Loading…
Reference in New Issue
Block a user