2022-07-17 01:25:50 +00:00
|
|
|
package com.imaginarycode.minecraft.redisbungee.api.util;
|
2022-04-13 13:14:08 +00:00
|
|
|
|
|
|
|
import com.google.common.annotations.VisibleForTesting;
|
|
|
|
|
|
|
|
@VisibleForTesting
|
|
|
|
public class RedisUtil {
|
2022-07-26 06:58:00 +00:00
|
|
|
public static int PROXY_TIMEOUT = 30;
|
2022-04-13 13:14:08 +00:00
|
|
|
public static boolean isRedisVersionRight(String redisVersion) {
|
|
|
|
String[] args = redisVersion.split("\\.");
|
|
|
|
if (args.length < 2) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
int major = Integer.parseInt(args[0]);
|
|
|
|
int minor = Integer.parseInt(args[1]);
|
2022-07-17 01:25:50 +00:00
|
|
|
return major >= 3 && minor >= 0;
|
2022-04-13 13:14:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Ham1255: i am keeping this if some plugin uses this *IF*
|
|
|
|
@Deprecated
|
|
|
|
public static boolean canUseLua(String redisVersion) {
|
2022-07-17 01:25:50 +00:00
|
|
|
// Need to use >=3 to use Lua optimizations.
|
2022-04-13 13:14:08 +00:00
|
|
|
return isRedisVersionRight(redisVersion);
|
|
|
|
}
|
|
|
|
}
|