redis test
parent
cdd37df717
commit
2435d363f1
|
@ -13,6 +13,7 @@ import earth.krakatoa.core.config.MongoConfig;
|
|||
import earth.krakatoa.core.config.RedisConfig;
|
||||
import earth.krakatoa.core.mongo.MongoManager;
|
||||
import earth.krakatoa.core.redis.RedisManager;
|
||||
import earth.krakatoa.core.util.Formatter;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.List;
|
||||
|
@ -44,6 +45,8 @@ public class KrakatoaAPI extends JavaPlugin {
|
|||
private MongoManager mongoManager;
|
||||
private RedisManager redisManager;
|
||||
|
||||
private Formatter formatter;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
super.onEnable();
|
||||
|
@ -87,6 +90,8 @@ public class KrakatoaAPI extends JavaPlugin {
|
|||
new RedisConfig(this.configHandler.getRedisHost(), this.getConfigHandler().getRedisPort()));
|
||||
this.redisManager.connect();
|
||||
|
||||
this.formatter = new Formatter();
|
||||
|
||||
loadListeners();
|
||||
loadCommands();
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package net.krakatoaapi.listener;
|
||||
|
||||
import net.krakatoaapi.KrakatoaAPI;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.redisson.api.RMap;
|
||||
|
||||
public class PlayerJoinListener implements Listener {
|
||||
|
||||
|
@ -13,6 +15,15 @@ public class PlayerJoinListener implements Listener {
|
|||
|
||||
event.setJoinMessage(null);
|
||||
|
||||
String uuid = KrakatoaAPI.getInstance().getFormatter()
|
||||
.formatUuid(player.getUniqueId().toString());
|
||||
|
||||
RMap<String, String> map = KrakatoaAPI.getInstance().getRedisManager()
|
||||
.getRedissonClient()
|
||||
.getMap("player:" + uuid);
|
||||
|
||||
KrakatoaAPI.getInstance().getLogger().info("redis player: " + map.keySet());
|
||||
|
||||
// TODO: server != lobby -> send player to last location
|
||||
/*
|
||||
RMap<String, String> map = ProxySystem.getInstance().getRedisManager()
|
||||
|
|
Loading…
Reference in New Issue