add player to redis when player enters server

master
Alex 2022-04-04 19:42:57 +02:00
parent 8297beb679
commit 56b939d385
1 changed files with 19 additions and 0 deletions

View File

@ -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();