mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2026-04-09 00:20:26 +00:00
move PlayerUtils and change the name
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.imaginarycode.minecraft.redisbungee.api.tasks;
|
||||
|
||||
import com.imaginarycode.minecraft.redisbungee.api.GenericPlayerUtils;
|
||||
import com.imaginarycode.minecraft.redisbungee.api.util.player.PlayerUtils;
|
||||
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin;
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.JedisCluster;
|
||||
@@ -9,9 +9,7 @@ import redis.clients.jedis.Pipeline;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public abstract class IntegrityCheckTask extends RedisTask<Void> {
|
||||
|
||||
@@ -37,7 +35,7 @@ public abstract class IntegrityCheckTask extends RedisTask<Void> {
|
||||
if (!laggedPlayers.isEmpty()) {
|
||||
plugin.logInfo("Cleaning up lagged proxy " + s + " (" + laggedPlayers.size() + " players)...");
|
||||
for (String laggedPlayer : laggedPlayers) {
|
||||
GenericPlayerUtils.cleanUpPlayer(laggedPlayer, jedis, true);
|
||||
PlayerUtils.cleanUpPlayer(laggedPlayer, jedis, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,7 +56,7 @@ public abstract class IntegrityCheckTask extends RedisTask<Void> {
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
GenericPlayerUtils.cleanUpPlayer(member, jedis, false);
|
||||
PlayerUtils.cleanUpPlayer(member, jedis, false);
|
||||
plugin.logWarn("Player found in set that was not found locally and globally: " + member);
|
||||
} else {
|
||||
jedis.srem("proxy:" + plugin.getConfiguration().getProxyId() + ":usersOnline", member);
|
||||
@@ -96,7 +94,7 @@ public abstract class IntegrityCheckTask extends RedisTask<Void> {
|
||||
if (!laggedPlayers.isEmpty()) {
|
||||
plugin.logInfo("Cleaning up lagged proxy " + s + " (" + laggedPlayers.size() + " players)...");
|
||||
for (String laggedPlayer : laggedPlayers) {
|
||||
GenericPlayerUtils.cleanUpPlayer(laggedPlayer, jedisCluster, true);
|
||||
PlayerUtils.cleanUpPlayer(laggedPlayer, jedisCluster, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,7 +115,7 @@ public abstract class IntegrityCheckTask extends RedisTask<Void> {
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
GenericPlayerUtils.cleanUpPlayer(member, jedisCluster, false);
|
||||
PlayerUtils.cleanUpPlayer(member, jedisCluster, false);
|
||||
plugin.logWarn("Player found in set that was not found locally and globally: " + member);
|
||||
} else {
|
||||
jedisCluster.srem("proxy:" + plugin.getConfiguration().getProxyId() + ":usersOnline", member);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.imaginarycode.minecraft.redisbungee.api.tasks;
|
||||
|
||||
import com.imaginarycode.minecraft.redisbungee.api.GenericPlayerUtils;
|
||||
import com.imaginarycode.minecraft.redisbungee.api.util.player.PlayerUtils;
|
||||
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin;
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.JedisCluster;
|
||||
@@ -17,7 +17,7 @@ public class ShutdownUtils {
|
||||
if (jedis.scard("proxy:" + plugin.getConfiguration().getProxyId() + ":usersOnline") > 0) {
|
||||
Set<String> players = jedis.smembers("proxy:" + plugin.getConfiguration().getProxyId() + ":usersOnline");
|
||||
for (String member : players)
|
||||
GenericPlayerUtils.cleanUpPlayer(member, jedis, true);
|
||||
PlayerUtils.cleanUpPlayer(member, jedis, true);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public class ShutdownUtils {
|
||||
if (jedisCluster.scard("proxy:" + plugin.getConfiguration().getProxyId() + ":usersOnline") > 0) {
|
||||
Set<String> players = jedisCluster.smembers("proxy:" + plugin.getConfiguration().getProxyId() + ":usersOnline");
|
||||
for (String member : players)
|
||||
GenericPlayerUtils.cleanUpPlayer(member, jedisCluster, true);
|
||||
PlayerUtils.cleanUpPlayer(member, jedisCluster, true);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.imaginarycode.minecraft.redisbungee.api;
|
||||
package com.imaginarycode.minecraft.redisbungee.api.util.player;
|
||||
|
||||
import com.imaginarycode.minecraft.redisbungee.RedisBungeeAPI;
|
||||
import redis.clients.jedis.Jedis;
|
||||
@@ -7,7 +7,7 @@ import redis.clients.jedis.Pipeline;
|
||||
|
||||
import static com.imaginarycode.minecraft.redisbungee.api.util.payload.PayloadUtils.playerQuitPayload;
|
||||
|
||||
public class GenericPlayerUtils {
|
||||
public class PlayerUtils {
|
||||
|
||||
|
||||
public static void cleanUpPlayer(String uuid, Jedis rsc, boolean firePayload) {
|
||||
Reference in New Issue
Block a user