mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2026-04-08 16:10:26 +00:00
more changes
This commit is contained in:
@@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit;
|
||||
*
|
||||
* @since 0.3.3
|
||||
*/
|
||||
public abstract class DataManager<P, PL, PD, PS> {
|
||||
public abstract class AbstractDataManager<P, PL, PD, PS> {
|
||||
private final RedisBungeePlugin<P> plugin;
|
||||
private final Cache<UUID, String> serverCache = createCache();
|
||||
private final Cache<UUID, String> proxyCache = createCache();
|
||||
@@ -31,7 +31,7 @@ public abstract class DataManager<P, PL, PD, PS> {
|
||||
private final Cache<UUID, Long> lastOnlineCache = createCache();
|
||||
private final Gson gson = new Gson();
|
||||
|
||||
public DataManager(RedisBungeePlugin<P> plugin) {
|
||||
public AbstractDataManager(RedisBungeePlugin<P> plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public interface RedisBungeePlugin<P> extends EventsPlatform{
|
||||
|
||||
Set<String> getLocalPlayersAsUuidStrings();
|
||||
|
||||
DataManager<P, ?, ?, ?> getDataManager();
|
||||
AbstractDataManager<P, ?, ?, ?> getDataManager();
|
||||
|
||||
Set<UUID> getPlayers();
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ public class RedisUtil {
|
||||
rsc.hdel("player:" + player, "server", "ip", "proxy");
|
||||
long timestamp = System.currentTimeMillis();
|
||||
rsc.hset("player:" + player, "online", String.valueOf(timestamp));
|
||||
rsc.publish("redisbungee-data", gson.toJson(new DataManager.DataManagerMessage<>(
|
||||
UUID.fromString(player), RedisBungeeAPI.getRedisBungeeApi().getServerId(), DataManager.DataManagerMessage.Action.LEAVE,
|
||||
new DataManager.LogoutPayload(timestamp))));
|
||||
rsc.publish("redisbungee-data", gson.toJson(new AbstractDataManager.DataManagerMessage<>(
|
||||
UUID.fromString(player), RedisBungeeAPI.getRedisBungeeApi().getServerId(), AbstractDataManager.DataManagerMessage.Action.LEAVE,
|
||||
new AbstractDataManager.LogoutPayload(timestamp))));
|
||||
}
|
||||
|
||||
public static void cleanUpPlayer(String player, Pipeline rsc) {
|
||||
@@ -27,9 +27,9 @@ public class RedisUtil {
|
||||
rsc.hdel("player:" + player, "server", "ip", "proxy");
|
||||
long timestamp = System.currentTimeMillis();
|
||||
rsc.hset("player:" + player, "online", String.valueOf(timestamp));
|
||||
rsc.publish("redisbungee-data", gson.toJson(new DataManager.DataManagerMessage<>(
|
||||
UUID.fromString(player), RedisBungeeAPI.getRedisBungeeApi().getServerId(), DataManager.DataManagerMessage.Action.LEAVE,
|
||||
new DataManager.LogoutPayload(timestamp))));
|
||||
rsc.publish("redisbungee-data", gson.toJson(new AbstractDataManager.DataManagerMessage<>(
|
||||
UUID.fromString(player), RedisBungeeAPI.getRedisBungeeApi().getServerId(), AbstractDataManager.DataManagerMessage.Action.LEAVE,
|
||||
new AbstractDataManager.LogoutPayload(timestamp))));
|
||||
}
|
||||
|
||||
public static boolean isRedisVersionRight(String redisVersion) {
|
||||
|
||||
Reference in New Issue
Block a user