From 44175e8a6859e7d2a021bbed5c39ef4d88f556dd Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel Date: Sat, 24 Feb 2024 00:03:59 +0400 Subject: [PATCH] fix redis version detection --- .../minecraft/redisbungee/api/util/RedisUtil.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/api/util/RedisUtil.java b/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/api/util/RedisUtil.java index 3020a4a..9740fde 100644 --- a/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/api/util/RedisUtil.java +++ b/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/api/util/RedisUtil.java @@ -6,6 +6,9 @@ import com.google.common.annotations.VisibleForTesting; public class RedisUtil { 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) { String[] args = redisVersion.split("\\."); if (args.length < 2) { @@ -13,7 +16,10 @@ public class RedisUtil { } int major = Integer.parseInt(args[0]); 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*