From 9b03617c80be5c7ec76b7508df8c55a18f25f29c Mon Sep 17 00:00:00 2001 From: Exslims Date: Tue, 28 Mar 2017 18:26:18 +0400 Subject: [PATCH] Minor improvements before release --- .../java/com/mercury/platform/core/MercuryConstants.java | 4 ++-- .../com/mercury/platform/core/misc/SoundNotifier.java | 8 ++++---- .../mercury/platform/core/utils/error/ErrorHandler.java | 6 +++--- .../java/com/mercury/platform/shared/MessageParser.java | 2 ++ app-core/src/main/resources/log4j2.xml | 4 ++-- .../mercury/platform/ui/frame/ScalableComponentFrame.java | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/app-core/src/main/java/com/mercury/platform/core/MercuryConstants.java b/app-core/src/main/java/com/mercury/platform/core/MercuryConstants.java index 26698f87..d8a26021 100644 --- a/app-core/src/main/java/com/mercury/platform/core/MercuryConstants.java +++ b/app-core/src/main/java/com/mercury/platform/core/MercuryConstants.java @@ -1,7 +1,7 @@ package com.mercury.platform.core; public class MercuryConstants { - public static final String APP_VERSION = "1.0.0.8"; + public static final String APP_VERSION = "1.0.1.0"; public static final String SERVER_HOST = "exslims.ddns.net"; - public static final int PORT = 5556; + public static final int PORT = 5555; } diff --git a/app-core/src/main/java/com/mercury/platform/core/misc/SoundNotifier.java b/app-core/src/main/java/com/mercury/platform/core/misc/SoundNotifier.java index e47b22a0..ada6a075 100644 --- a/app-core/src/main/java/com/mercury/platform/core/misc/SoundNotifier.java +++ b/app-core/src/main/java/com/mercury/platform/core/misc/SoundNotifier.java @@ -52,10 +52,10 @@ private void play(String wavPath){ try (AudioInputStream stream = AudioSystem.getAudioInputStream(classLoader.getResource(wavPath))) { Clip clip = AudioSystem.getClip(); clip.open(stream); - double gain = .5D; - float db = (float) (Math.log(gain) / Math.log(10.0) * 20.0); - FloatControl gainControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN); - gainControl.setValue(db); +// double gain = .5D; +// float db = (float) (Math.log(gain) / Math.log(10.0) * 20.0); +// FloatControl gainControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN); +// gainControl.setValue(db); clip.start(); } catch (Exception e) { logger.error("Cannot start playing wav file: ",e); diff --git a/app-core/src/main/java/com/mercury/platform/core/utils/error/ErrorHandler.java b/app-core/src/main/java/com/mercury/platform/core/utils/error/ErrorHandler.java index 5e044f2f..7457f913 100644 --- a/app-core/src/main/java/com/mercury/platform/core/utils/error/ErrorHandler.java +++ b/app-core/src/main/java/com/mercury/platform/core/utils/error/ErrorHandler.java @@ -6,8 +6,8 @@ public class ErrorHandler { private Logger logger = LogManager.getLogger(ErrorHandler.class.getSimpleName()); public ErrorHandler(){ -// Thread.setDefaultUncaughtExceptionHandler((thread, throwable) -> { -// logger.error(throwable.fillInStackTrace()); -// }); + Thread.setDefaultUncaughtExceptionHandler((thread, throwable) -> { + logger.error(throwable.fillInStackTrace()); + }); } } diff --git a/app-core/src/main/java/com/mercury/platform/shared/MessageParser.java b/app-core/src/main/java/com/mercury/platform/shared/MessageParser.java index 91fb25fd..a0f43c86 100644 --- a/app-core/src/main/java/com/mercury/platform/shared/MessageParser.java +++ b/app-core/src/main/java/com/mercury/platform/shared/MessageParser.java @@ -50,6 +50,7 @@ public Message parse(String fullMessage){ message.setCurrForSaleTitle(poeTradeCurrencyMatcher.group(5)); message.setCurCount(Double.parseDouble(poeTradeCurrencyMatcher.group(6))); message.setCurrency(poeTradeCurrencyMatcher.group(8)); + message.setLeague(poeTradeCurrencyMatcher.group(9)); message.setOffer(poeTradeCurrencyMatcher.group(10)); return message; } @@ -61,6 +62,7 @@ public Message parse(String fullMessage){ message.setItemName(poeTradeNoBuyoutMatcher.group(3)); message.setCurCount(0d); message.setCurrency("???"); + message.setLeague(poeTradeNoBuyoutMatcher.group(4)); if(poeTradeNoBuyoutMatcher.group(6) != null) { message.setTabName(poeTradeNoBuyoutMatcher.group(6)); message.setLeft(Integer.parseInt(poeTradeNoBuyoutMatcher.group(7))); diff --git a/app-core/src/main/resources/log4j2.xml b/app-core/src/main/resources/log4j2.xml index 840972fc..58cd0484 100644 --- a/app-core/src/main/resources/log4j2.xml +++ b/app-core/src/main/resources/log4j2.xml @@ -1,5 +1,5 @@ - + @@ -9,7 +9,7 @@ - + diff --git a/app-ui/src/main/java/com/mercury/platform/ui/frame/ScalableComponentFrame.java b/app-ui/src/main/java/com/mercury/platform/ui/frame/ScalableComponentFrame.java index dab01626..37ae41f5 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/frame/ScalableComponentFrame.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/frame/ScalableComponentFrame.java @@ -11,7 +11,7 @@ import javax.swing.*; import java.awt.*; import java.util.Map; - +//todo need generalization public abstract class ScalableComponentFrame extends ComponentFrame implements HasUI{ protected Container mainContainer; private ScaleState scaleState = ScaleState.DEFAULT;