From eac00e1cd222dfd03c9410a9459b27f68d10c357 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel Date: Tue, 25 Apr 2023 10:58:39 +0400 Subject: [PATCH] cleanup InitialUtils class and change how some logs are sent --- .../minecraft/redisbungee/api/tasks/InitialUtils.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/api/tasks/InitialUtils.java b/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/api/tasks/InitialUtils.java index 9f0253c..8a2986f 100644 --- a/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/api/tasks/InitialUtils.java +++ b/RedisBungee-API/src/main/java/com/imaginarycode/minecraft/redisbungee/api/tasks/InitialUtils.java @@ -12,8 +12,6 @@ package com.imaginarycode.minecraft.redisbungee.api.tasks; import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin; import com.imaginarycode.minecraft.redisbungee.api.util.RedisUtil; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisCluster; import redis.clients.jedis.Protocol; import redis.clients.jedis.UnifiedJedis; @@ -28,12 +26,11 @@ public class InitialUtils { @Override public Void unifiedJedisTask(UnifiedJedis unifiedJedis) { // This is more portable than INFO
- String info = new String((byte[]) unifiedJedis.sendCommand(Protocol.Command.INFO)); for (String s : info.split("\r\n")) { if (s.startsWith("redis_version:")) { String version = s.split(":")[1]; - plugin.logInfo(version + " <- redis version"); + plugin.logInfo("Redis server version: " + version); if (!RedisUtil.isRedisVersionRight(version)) { plugin.logFatal("Your version of Redis (" + version + ") is not at least version 3.0 RedisBungee requires a newer version of Redis."); throw new RuntimeException("Unsupported Redis version detected"); @@ -62,7 +59,7 @@ public class InitialUtils { } catch (IOException e) { throw new RuntimeException(e); } - plugin.logInfo("crash file was deleted"); + plugin.logInfo("crash file was deleted continuing RedisBungee startup "); } else if (unifiedJedis.hexists("heartbeats", plugin.getConfiguration().getProxyId())) { try { long value = Long.parseLong(unifiedJedis.hget("heartbeats", plugin.getConfiguration().getProxyId())); @@ -81,7 +78,7 @@ public class InitialUtils { } private static void logImposter(RedisBungeePlugin plugin) { - plugin.logFatal("You have launched a possible impostor Velocity / Bungeecord instance. Another instance is already running."); + plugin.logFatal("You have launched a possible impostor Velocity / Bungeecord instance. Another instance is already running."); plugin.logFatal("For data consistency reasons, RedisBungee will now disable itself."); plugin.logFatal("If this instance is coming up from a crash, create a file in your RedisBungee plugins directory with the name 'restarted_from_crash.txt' and RedisBungee will not perform this check."); }