From 3b1ed89717dbc3000219012ae1f113d673bdf54b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 28 Nov 2016 18:49:29 -0500 Subject: [PATCH] is it broken for no reason whatsoever?! --- .../metrics/output/GetLoginMetrics.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/alisolarflare/components/metrics/output/GetLoginMetrics.java b/src/alisolarflare/components/metrics/output/GetLoginMetrics.java index cd5dee8..ce6b76e 100644 --- a/src/alisolarflare/components/metrics/output/GetLoginMetrics.java +++ b/src/alisolarflare/components/metrics/output/GetLoginMetrics.java @@ -23,6 +23,7 @@ public class GetLoginMetrics extends ModCommand{ @Override public boolean OnCommand(Player player, String alias, String[] args) { + player.sendMessage("FIRED"); if (args.length == 1){ BufferedReader outputStream = null; try { @@ -40,12 +41,27 @@ public class GetLoginMetrics extends ModCommand{ } } catch (FileNotFoundException e) { TBMCCoreAPI.SendException(args[0] + " could not be found", e); + if (outputStream != null){ + try { + outputStream.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } } catch (IOException e1) { TBMCCoreAPI.SendException(args[0] + "encountered an I/O Exception!", e1); + if (outputStream != null){ + try { + outputStream.close(); + } catch (IOException e2) { + e2.printStackTrace(); + } + } + } + }else{ + for (String metric : module.playerLoginsFile.toArrayList()){ + player.sendMessage(metric); } - } - for (String metric : module.playerLoginsFile.toArrayList()){ - player.sendMessage(metric); } return true; }