add player to redis when player enters server
parent
8297beb679
commit
56b939d385
|
@ -71,6 +71,25 @@ public class PostLoginListener implements Listener {
|
|||
// redis
|
||||
ProxySystem.getInstance().getLogger().info("mongodb player " + document.keySet());
|
||||
|
||||
RMap<String, String> map = ProxySystem.getInstance().getRedisManager()
|
||||
.getRedissonClient()
|
||||
.getMap("player:" + uuid);
|
||||
|
||||
if (map.isEmpty()) {
|
||||
map.put("uuid", uuid);
|
||||
map.put("voiceWebCode", "voiceWebCode");
|
||||
|
||||
document.forEach((key, value) -> {
|
||||
ProxySystem.getInstance().getLogger()
|
||||
.info("key " + key + " value " + value.toString());
|
||||
map.put(key, value.toString());
|
||||
});
|
||||
ProxySystem.getInstance().getLogger().info("PUT !");
|
||||
} else {
|
||||
ProxySystem.getInstance().getLogger()
|
||||
.warning("REDIS player " + uuid + " exists in the cache, but should not exist");
|
||||
}
|
||||
|
||||
// check if both sockets connected
|
||||
int cmdID = ProxySystem.getInstance().getKraSocketClientProtocol().generateCmdID();
|
||||
|
||||
|
|
Loading…
Reference in New Issue