From 634961e0ddf4b3dcdd3c29c2ebedf7e8bf847ea8 Mon Sep 17 00:00:00 2001 From: KrewsOrg Date: Tue, 10 Sep 2019 21:37:06 +0100 Subject: [PATCH] Pushed as RC-2. --- src/main/java/com/eu/habbo/Emulator.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/Emulator.java b/src/main/java/com/eu/habbo/Emulator.java index 12b0a3d6..7b2cfa5d 100644 --- a/src/main/java/com/eu/habbo/Emulator.java +++ b/src/main/java/com/eu/habbo/Emulator.java @@ -37,7 +37,7 @@ public final class Emulator { public final static int BUILD = 0; - public final static String PREVIEW = "RC-1"; + public final static String PREVIEW = "RC-2"; public static final String version = "Arcturus Morningstar" + " " + MAJOR + "." + MINOR + "." + BUILD + " " + PREVIEW; private static final String logo = @@ -48,7 +48,8 @@ public final class Emulator { " / /|_/ / __ \\/ ___/ __ \\/ / __ \\/ __ `/ ___/ __/ __ `/ ___/ \n" + " / / / / /_/ / / / / / / / / / / /_/ (__ ) /_/ /_/ / / \n" + "/_/ /_/\\____/_/ /_/ /_/_/_/ /_/\\__, /____/\\__/\\__,_/_/ \n" + - " /____/ \n"; + " /____/ \n" + + " 'RC Stands for Race Car.' \n" ; public static String build = ""; public static boolean isReady = false; public static boolean isShuttingDown = false; @@ -165,12 +166,19 @@ public final class Emulator { } private static void setBuild() { + if (Emulator.class.getProtectionDomain().getCodeSource() == null) { + build = "UNKNOWN"; + return; + } StringBuilder sb = new StringBuilder(); try { + String filepath = new File(Emulator.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getAbsolutePath(); MessageDigest md = MessageDigest.getInstance("MD5");// MD5 + FileInputStream fis = new FileInputStream(filepath); byte[] dataBytes = new byte[1024]; int nread = 0; + while ((nread = fis.read(dataBytes)) != -1) md.update(dataBytes, 0, nread); byte[] mdbytes = md.digest(); for (int i = 0; i < mdbytes.length; i++)