diff --git a/pom.xml b/pom.xml
index 57901bf..ded2704 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
net.rubeta
LegacyPing
- 2.1
+ 2.2
jar
LegacyPing
diff --git a/src/main/java/net/rubeta/legacyping/ServerThread.java b/src/main/java/net/rubeta/legacyping/ServerThread.java
index ef59f93..8448a5f 100644
--- a/src/main/java/net/rubeta/legacyping/ServerThread.java
+++ b/src/main/java/net/rubeta/legacyping/ServerThread.java
@@ -21,6 +21,7 @@ public class ServerThread extends Thread {
private static final String DISCONNECT_REASON = "[\"\",{\"text\":\"This is b1.7.3 server. Visit \"}," +
"{\"text\":\"https://rubeta.net\",\"underlined\":true},{\"text\":\" for more information.\"}]";
private static final String SLOWSTACK_ID = "slowstack.tv";
+ private static final String MATSCAN_ID = "matscan";
private final AtomicBoolean working = new AtomicBoolean(false);
private final Server minecraftServer;
private final String version;
@@ -86,12 +87,16 @@ public class ServerThread extends Thread {
final int port = inputStream.readShort();
final int status = this.readVarInt(inputStream);
this.logger.info("Ping from " + socket.getRemoteSocketAddress() + " to " + hostname + ":" + port);
- boolean slowstack = hostname.equalsIgnoreCase(SLOWSTACK_ID);
if (status != 2) {
- if (slowstack) {
+ if (hostname.equalsIgnoreCase(SLOWSTACK_ID)) {
this.responseForModernPing(outputStream, MODERN_RESPONSE.replace(
"%motd%", "%motd% \nHello, slowstack.tv!"
));
+ } else if (hostname.equalsIgnoreCase(MATSCAN_ID)) {
+ this.responseForModernPing(outputStream, MODERN_RESPONSE
+ .replace("%motd%", "%motd% \nHello, matscan!")
+ .replace("%version%", "⚠ Error")
+ );
} else {
this.responseForModernPing(outputStream, MODERN_RESPONSE);
}
@@ -116,8 +121,10 @@ public class ServerThread extends Thread {
outputStream.writeLong(inputStream.readLong()); // timestamp
} catch (SocketTimeoutException | EOFException ignore) {
} catch (Exception ex) {
- this.logger.warning("An exception occurred while communicating with " + address);
- this.logger.log(Level.WARNING, "Exception in " + this.getName(), ex);
+ if (this.working.get()) {
+ this.logger.warning("An exception occurred while communicating with " + address);
+ this.logger.log(Level.WARNING, "Exception in " + this.getName(), ex);
+ }
}
}
}