From df89ee058f3f857a1b6cc9c3be6729b8ebb42e48 Mon Sep 17 00:00:00 2001 From: Chris Kearney <chris@kearneymail.com> Date: Mon, 17 Aug 2015 21:57:31 -0700 Subject: [PATCH] hoping this timestamp thing works --- src/main/java/com/comandante/creeper/Main.java | 11 +++++------ .../creeper/server/CreeperAuthenticationHandler.java | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/comandante/creeper/Main.java b/src/main/java/com/comandante/creeper/Main.java index e2058d3c..b13ba6f8 100644 --- a/src/main/java/com/comandante/creeper/Main.java +++ b/src/main/java/com/comandante/creeper/Main.java @@ -41,20 +41,19 @@ public class Main { final public static MetricRegistry metrics = new MetricRegistry(); - final public static String CREEPER_VERSION = getCreeperVersion(); - final public static Set<Character> vowels = new HashSet<Character>(Arrays.asList('a', 'e', 'i', 'o', 'u')); public static String getCreeperVersion() { Properties props = new Properties(); try { - props.load(Main.class.getResourceAsStream("resources/build.properties")); - } catch (IOException e) { + props.load(Main.class.getResourceAsStream("/build.properties")); + } catch (Exception e) { log.error("Problem reading build properties file.", e); return "0"; } - String someProperty = props.getProperty("build.version"); - return someProperty; + String buildVersion = props.getProperty("build.version"); + String buildTimestamp = props.getProperty("build.timestamp"); + return buildVersion + " " + buildTimestamp; } public static void main(String[] args) throws Exception { diff --git a/src/main/java/com/comandante/creeper/server/CreeperAuthenticationHandler.java b/src/main/java/com/comandante/creeper/server/CreeperAuthenticationHandler.java index b7176629..efd8a6ca 100644 --- a/src/main/java/com/comandante/creeper/server/CreeperAuthenticationHandler.java +++ b/src/main/java/com/comandante/creeper/server/CreeperAuthenticationHandler.java @@ -134,7 +134,7 @@ public class CreeperAuthenticationHandler extends SimpleChannelUpstreamHandler { } else { creeperSession.setAuthed(true); creeperSession.setState(CreeperSession.State.authed); - e.getChannel().write("Welcome to creeper. (version: " + Main.CREEPER_VERSION + ")\r\n"); + e.getChannel().write("Welcome to creeper. (version: " + Main.getCreeperVersion() + ")\r\n"); } } -- GitLab