diff --git a/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/BungeeServerTracker.java b/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/BungeeServerTracker.java index cd14d83c..f50ec4a7 100644 --- a/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/BungeeServerTracker.java +++ b/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/BungeeServerTracker.java @@ -13,7 +13,7 @@ import org.bukkit.scheduler.BukkitRunnable; import com.gmail.filoghost.holographicdisplays.HolographicDisplays; import com.gmail.filoghost.holographicdisplays.bridge.bungeecord.serverpinger.ServerAddress; import com.gmail.filoghost.holographicdisplays.bridge.bungeecord.serverpinger.ServerPinger; -import com.gmail.filoghost.holographicdisplays.bridge.bungeecord.serverpinger.ServerStatus; +import com.gmail.filoghost.holographicdisplays.bridge.bungeecord.serverpinger.PingResponse; import com.gmail.filoghost.holographicdisplays.disk.Configuration; import com.gmail.filoghost.holographicdisplays.util.DebugHandler; @@ -159,7 +159,7 @@ public class BungeeServerTracker { boolean displayOffline = false; try { - ServerStatus data = pinger.fetchData(entry.getValue(), Configuration.pingerTimeout); + PingResponse data = pinger.fetchData(entry.getValue(), Configuration.pingerTimeout); if (data.isOnline()) { serverInfo.setOnline(true); serverInfo.setOnlinePlayers(data.getOnlinePlayers()); diff --git a/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerStatus.java b/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/PingResponse.java similarity index 87% rename from HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerStatus.java rename to HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/PingResponse.java index 83987fe3..afa46889 100644 --- a/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerStatus.java +++ b/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/PingResponse.java @@ -4,21 +4,21 @@ import java.lang.String; import org.json.simple.JSONObject; -public class ServerStatus +public class PingResponse { private boolean isOnline; private String motd; private int onlinePlayers; private int maxPlayers; - public ServerStatus(boolean isOnline, String motd, int onlinePlayers, int maxPlayers) { + public PingResponse(boolean isOnline, String motd, int onlinePlayers, int maxPlayers) { this.isOnline = isOnline; this.motd = motd; this.onlinePlayers = onlinePlayers; this.maxPlayers = maxPlayers; } - public ServerStatus(JSONObject json) { + public PingResponse(JSONObject json) { isOnline = true; motd = ((String) json.get("description")); diff --git a/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerPinger.java b/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerPinger.java index 05c691f6..2a65aea7 100644 --- a/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerPinger.java +++ b/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerPinger.java @@ -13,6 +13,6 @@ public abstract class ServerPinger { // For 1.6 and lower public static final ServerPinger PRE_NETTY_REWRITE = new ServerPingerPreNetty(); - public abstract ServerStatus fetchData(final ServerAddress serverAddress, int timeout) throws SocketTimeoutException, UnknownHostException, IOException, Exception; + public abstract PingResponse fetchData(final ServerAddress serverAddress, int timeout) throws SocketTimeoutException, UnknownHostException, IOException, Exception; } diff --git a/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerPingerPostNetty.java b/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerPingerPostNetty.java index d8e733fb..63615270 100644 --- a/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerPingerPostNetty.java +++ b/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerPingerPostNetty.java @@ -14,7 +14,7 @@ import org.json.simple.JSONValue; final class ServerPingerPostNetty extends ServerPinger { @Override - public ServerStatus fetchData(final ServerAddress serverAddress, int timeout) throws SocketTimeoutException, UnknownHostException, IOException, Exception { + public PingResponse fetchData(final ServerAddress serverAddress, int timeout) throws SocketTimeoutException, UnknownHostException, IOException, Exception { Socket socket = null; DataOutputStream dataOut = null; @@ -43,7 +43,7 @@ final class ServerPingerPostNetty extends ServerPinger { final byte[] responseData = new byte[PacketUtils.readVarInt(dataIn)]; dataIn.readFully(responseData); final String jsonString = new String(responseData, PacketUtils.UTF8); - return new ServerStatus((JSONObject) JSONValue.parse(jsonString)); + return new PingResponse((JSONObject) JSONValue.parse(jsonString)); } finally { PacketUtils.closeQuietly(dataOut); diff --git a/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerPingerPreNetty.java b/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerPingerPreNetty.java index 0d5e2aff..88987dec 100644 --- a/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerPingerPreNetty.java +++ b/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/ServerPingerPreNetty.java @@ -13,7 +13,7 @@ import java.lang.String; final class ServerPingerPreNetty extends ServerPinger { @Override - public ServerStatus fetchData(final ServerAddress serverAddress, int timeout) throws SocketTimeoutException, UnknownHostException, IOException, Exception { + public PingResponse fetchData(final ServerAddress serverAddress, int timeout) throws SocketTimeoutException, UnknownHostException, IOException, Exception { Socket socket = null; DataOutputStream dataOut = null; @@ -33,7 +33,7 @@ final class ServerPingerPreNetty extends ServerPinger { dataIn.readFully(bytes); socket.close(); final String[] info = new String(bytes, PacketUtils.UTF16BE).split(String.valueOf('\0')); - final ServerStatus response = new ServerStatus(true, info[3], Integer.parseInt(info[4]), Integer.parseInt(info[5])); + final PingResponse response = new PingResponse(true, info[3], Integer.parseInt(info[4]), Integer.parseInt(info[5])); // String versionName = info[2]; // String protocol = info[1]; return response;