2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-05 04:48:02 +00:00

fix redis version detection

This commit is contained in:
mohammed jasem alaajel 2024-02-24 00:03:59 +04:00
parent 6c27228920
commit 44175e8a68

View File

@ -6,6 +6,9 @@ import com.google.common.annotations.VisibleForTesting;
public class RedisUtil { public class RedisUtil {
public final static int PROXY_TIMEOUT = 30; public final static int PROXY_TIMEOUT = 30;
public static final int MAJOR_VERSION = 6;
public static final int MINOR_VERSION = 6;
public static boolean isRedisVersionRight(String redisVersion) { public static boolean isRedisVersionRight(String redisVersion) {
String[] args = redisVersion.split("\\."); String[] args = redisVersion.split("\\.");
if (args.length < 2) { if (args.length < 2) {
@ -13,7 +16,10 @@ public class RedisUtil {
} }
int major = Integer.parseInt(args[0]); int major = Integer.parseInt(args[0]);
int minor = Integer.parseInt(args[1]); int minor = Integer.parseInt(args[1]);
return major >= 6 && minor >= 2;
if (major > MAJOR_VERSION) return true;
return major == MAJOR_VERSION && minor >= MINOR_VERSION;
} }
// Ham1255: i am keeping this if some plugin uses this *IF* // Ham1255: i am keeping this if some plugin uses this *IF*