2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-12-23 18:48:02 +00:00

Removed player count caching and fixed typo (ported from the efficient-server-listing branch).

This commit is contained in:
Tux 2014-08-18 15:33:51 -04:00
parent ad67e1c60c
commit 5102c39ee6
2 changed files with 1 additions and 8 deletions

View File

@ -62,7 +62,6 @@ public final class RedisBungee extends Plugin {
private static PubSubListener psl = null;
private List<String> serverIds;
private AtomicInteger nagAboutServers = new AtomicInteger();
private int globalCount;
/**
* Fetch the {@link RedisBungeeAPI} object created on plugin start.
@ -126,10 +125,6 @@ public final class RedisBungee extends Plugin {
}
final int getCount() {
return globalCount;
}
final int getCurrentCount() {
int c = 0;
if (pool != null) {
Jedis rsc = pool.getResource();
@ -246,7 +241,6 @@ public final class RedisBungee extends Plugin {
pool.returnResource(tmpRsc);
}
serverIds = getCurrentServerIds();
globalCount = getCurrentCount();
uuidTranslator = new UUIDTranslator(this);
getProxy().getScheduler().schedule(this, new Runnable() {
@Override
@ -262,7 +256,6 @@ public final class RedisBungee extends Plugin {
pool.returnResource(rsc);
}
serverIds = getCurrentServerIds();
globalCount = getCurrentCount();
}
}, 0, 3, TimeUnit.SECONDS);
consumer = new RedisBungeeConsumer(this);

View File

@ -58,7 +58,7 @@ public class RedisBungeeConsumer implements Runnable {
} else if (event instanceof PlayerLoggedOffConsumerEvent) {
PlayerLoggedOffConsumerEvent event1 = (PlayerLoggedOffConsumerEvent) event;
Pipeline pipeline = jedis.pipelined();
jedis.hset("player:" + event1.getPlayer().getUniqueId().toString(), "online", String.valueOf(System.currentTimeMillis()));
pipeline.hset("player:" + event1.getPlayer().getUniqueId().toString(), "online", String.valueOf(System.currentTimeMillis()));
RedisUtil.cleanUpPlayer(event1.getPlayer().getUniqueId().toString(), pipeline);
pipeline.publish("redisbungee-data", RedisBungee.getGson().toJson(new DataManager.DataManagerMessage(event1.getPlayer().getUniqueId(), DataManager.DataManagerMessage.Action.LEAVE)));
pipeline.sync();