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