implement Redis
parent
6a6b0ceb32
commit
dc9232c420
|
@ -12,10 +12,10 @@ public class PlayerDisconnectListener implements Listener {
|
|||
public void onDisconnect(PlayerDisconnectEvent event) {
|
||||
ProxiedPlayer proxiedPlayer = event.getPlayer();
|
||||
|
||||
ProxySystem.getInstance().getRedisManager().getKeyReactiveCommands()
|
||||
.del("player:" + proxiedPlayer.getUniqueId().toString());
|
||||
String value = ProxySystem.getInstance().getRedisManager().getCommands()
|
||||
.getdel("player:" + proxiedPlayer.getUniqueId().toString());
|
||||
|
||||
ProxySystem.getInstance().getLogger().info("player disconnected: " + proxiedPlayer.getName());
|
||||
ProxySystem.getInstance().getLogger().info("val: " + value);
|
||||
|
||||
//String uuid = ProxySystem.getInstance().getFormatter()
|
||||
// .formatUuid(proxiedPlayer.getUniqueId().toString());
|
||||
|
|
|
@ -2,7 +2,6 @@ package net.krakatoa.proxy.redis;
|
|||
|
||||
import io.lettuce.core.RedisClient;
|
||||
import io.lettuce.core.api.StatefulRedisConnection;
|
||||
import io.lettuce.core.api.reactive.RedisKeyReactiveCommands;
|
||||
import io.lettuce.core.api.sync.RedisStringCommands;
|
||||
import lombok.Data;
|
||||
|
||||
|
@ -14,13 +13,13 @@ public class RedisManager {
|
|||
private RedisClient client;
|
||||
private StatefulRedisConnection<String, String> connection;
|
||||
private RedisStringCommands<String, String> commands;
|
||||
private RedisKeyReactiveCommands<String, String> keyReactiveCommands;
|
||||
//private RedisKeyReactiveCommands<String, String> keyReactiveCommands;
|
||||
|
||||
public void connect() {
|
||||
this.client = RedisClient.create(this.getConnectionUri());
|
||||
this.connection = client.connect();
|
||||
this.commands = connection.sync();
|
||||
this.keyReactiveCommands = this.connection.reactive();
|
||||
//this.keyReactiveCommands = this.connection.reactive();
|
||||
}
|
||||
}
|
||||
// RedisKeyReactiveCommands
|
Loading…
Reference in New Issue