Added build time to version info, cleanup manifest files;

This commit is contained in:
Oleg Agafonov 2018-12-15 18:29:10 +04:00
parent 498edb4138
commit 0a2f312da7
19 changed files with 243 additions and 205 deletions

View file

@ -1,3 +0,0 @@
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
SplashScreen-Image: splash.jpg

View file

@ -194,11 +194,13 @@
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<configuration> <configuration>
<archive> <archive>
<manifestFile>${manifest.file}</manifestFile>
<manifest> <manifest>
<addClasspath>true</addClasspath> <addClasspath>true</addClasspath>
<mainClass>mage.client.MageFrame</mainClass> <mainClass>mage.client.MageFrame</mainClass>
</manifest> </manifest>
<manifestEntries>
<SplashScreen-Image>splash.jpg</SplashScreen-Image>
</manifestEntries>
</archive> </archive>
</configuration> </configuration>
</plugin> </plugin>

View file

@ -1,21 +1,5 @@
package mage.client; package mage.client;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.net.SocketException;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.prefs.Preferences;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import mage.cards.action.ActionCallback; import mage.cards.action.ActionCallback;
import mage.cards.decks.Deck; import mage.cards.decks.Deck;
import mage.cards.repository.CardRepository; import mage.cards.repository.CardRepository;
@ -67,6 +51,22 @@ import org.mage.plugins.card.images.DownloadPictures;
import org.mage.plugins.card.info.CardInfoPaneImpl; import org.mage.plugins.card.info.CardInfoPaneImpl;
import org.mage.plugins.card.utils.impl.ImageManagerImpl; import org.mage.plugins.card.utils.impl.ImageManagerImpl;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.net.SocketException;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.prefs.Preferences;
/** /**
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
@ -93,7 +93,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
private static final Preferences PREFS = Preferences.userNodeForPackage(MageFrame.class); private static final Preferences PREFS = Preferences.userNodeForPackage(MageFrame.class);
private JLabel title; private JLabel title;
private Rectangle titleRectangle; private Rectangle titleRectangle;
private static final MageVersion VERSION = new MageVersion(MageVersion.MAGE_VERSION_MAJOR, MageVersion.MAGE_VERSION_MINOR, MageVersion.MAGE_VERSION_PATCH, MageVersion.MAGE_VERSION_MINOR_PATCH, MageVersion.MAGE_VERSION_INFO); private static final MageVersion VERSION = new MageVersion(MageFrame.class);
private Connection currentConnection; private Connection currentConnection;
private static MagePane activeFrame; private static MagePane activeFrame;
private static boolean liteMode = false; private static boolean liteMode = false;
@ -760,7 +760,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
prepareAndShowTablesPane(); prepareAndShowTablesPane();
return true; return true;
} else { } else {
showMessage("Unable to connect to server"); showMessage("Unable connect to server");
} }
} finally { } finally {
setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); setCursor(new Cursor(Cursor.DEFAULT_CURSOR));

View file

@ -1,3 +0,0 @@
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
SplashScreen-Image: splash.jpg

View file

@ -1,8 +1,5 @@
package mage.client.game; package mage.client.game;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import javax.swing.*;
import mage.client.components.MageUI; import mage.client.components.MageUI;
import mage.interfaces.MageClient; import mage.interfaces.MageClient;
import mage.interfaces.callback.ClientCallback; import mage.interfaces.callback.ClientCallback;
@ -13,6 +10,10 @@ import mage.utils.MageVersion;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.junit.Ignore; import org.junit.Ignore;
import javax.swing.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
/** /**
* Test for emulating the connection from multi mage clients. * Test for emulating the connection from multi mage clients.
* *
@ -30,7 +31,7 @@ public class MultiConnectTest {
private static final CountDownLatch latch = new CountDownLatch(USER_CONNECT_COUNT); private static final CountDownLatch latch = new CountDownLatch(USER_CONNECT_COUNT);
private static final MageVersion version = new MageVersion(MageVersion.MAGE_VERSION_MAJOR, MageVersion.MAGE_VERSION_MINOR, MageVersion.MAGE_VERSION_PATCH, MageVersion.MAGE_VERSION_MINOR_PATCH, MageVersion.MAGE_VERSION_INFO); private static final MageVersion version = new MageVersion(MultiConnectTest.class);
private static volatile int connected; private static volatile int connected;

View file

@ -1,15 +1,5 @@
package mage.remote; package mage.remote;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.UndeclaredThrowableException;
import java.net.*;
import java.util.*;
import java.util.concurrent.TimeUnit;
import mage.MageException; import mage.MageException;
import mage.cards.decks.DeckCardLists; import mage.cards.decks.DeckCardLists;
import mage.cards.repository.CardInfo; import mage.cards.repository.CardInfo;
@ -38,6 +28,12 @@ import org.jboss.remoting.transport.bisocket.Bisocket;
import org.jboss.remoting.transport.socket.SocketWrapper; import org.jboss.remoting.transport.socket.SocketWrapper;
import org.jboss.remoting.transporter.TransporterClient; import org.jboss.remoting.transporter.TransporterClient;
import java.io.*;
import java.lang.reflect.UndeclaredThrowableException;
import java.net.*;
import java.util.*;
import java.util.concurrent.TimeUnit;
/** /**
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
@ -94,37 +90,38 @@ public class SessionImpl implements Session {
return remoting.run(); return remoting.run();
} catch (MalformedURLException ex) { } catch (MalformedURLException ex) {
logger.fatal("", ex); logger.fatal("", ex);
client.showMessage("Unable to connect to server. " + ex.getMessage()); client.showMessage("Unable connect to server. " + ex.getMessage());
} catch (UndeclaredThrowableException ex) { } catch (UndeclaredThrowableException ex) {
String addMessage = ""; String addMessage = "";
Throwable cause = ex.getCause(); Throwable cause = ex.getCause();
if (cause instanceof InvocationFailureException) { if (cause instanceof InvocationFailureException) {
InvocationFailureException exep = (InvocationFailureException) cause; InvocationFailureException exep = (InvocationFailureException) cause;
if (exep.getCause() instanceof IOException) { if (exep.getCause() instanceof IOException) {
if (exep.getCause().getMessage().startsWith("Field hash null is not available on current")) { if (exep.getCause().getMessage().startsWith("Field hash null is not available on current")
addMessage = "Probabaly the server version is not compatible to the client. "; || exep.getCause().getMessage().endsWith("end of file")) {
addMessage = "Probably the server version is not compatible with the client. ";
} }
} }
} else if (cause instanceof NoSuchMethodException) { } else if (cause instanceof NoSuchMethodException) {
// NoSuchMethodException is thrown on an invocation of an unknow JBoss remoting // NoSuchMethodException is thrown on an invocation of an unknow JBoss remoting
// method, so it's likely to be because of a version incompatibility. // method, so it's likely to be because of a version incompatibility.
addMessage = "The following method is not available in the server, probably the " addMessage = "The following method is not available in the server, probably the "
+ "server version is not compatible to the client: " + cause.getMessage(); + "server version is not compatible with the client: " + cause.getMessage();
} }
if (addMessage.isEmpty()) { if (addMessage.isEmpty()) {
logger.fatal("", ex); logger.fatal("", ex);
} }
client.showMessage("Unable to connect to server. " + addMessage + (ex.getMessage() != null ? ex.getMessage() : "")); client.showMessage("Unable connect to server. " + addMessage + (ex.getMessage() != null ? ex.getMessage() : ""));
} catch (IOException ex) { } catch (IOException ex) {
logger.fatal("", ex); logger.fatal("", ex);
String addMessage = ""; String addMessage = "";
if (ex.getMessage() != null && ex.getMessage().startsWith("Unable to perform invocation")) { if (ex.getMessage() != null && ex.getMessage().startsWith("Unable to perform invocation")) {
addMessage = "Maybe the server version is not compatible. "; addMessage = "Maybe the server version is not compatible. ";
} }
client.showMessage("Unable to connect to server. " + addMessage + ex.getMessage() != null ? ex.getMessage() : ""); client.showMessage("Unable connect to server. " + addMessage + ex.getMessage() != null ? ex.getMessage() : "");
} catch (MageVersionException ex) { } catch (MageVersionException ex) {
if (!canceled) { if (!canceled) {
client.showMessage("Unable to connect to server. " + ex.getMessage()); client.showMessage("Unable connect to server. " + ex.getMessage());
} }
disconnect(false); disconnect(false);
} catch (CannotConnectException ex) { } catch (CannotConnectException ex) {
@ -132,11 +129,11 @@ public class SessionImpl implements Session {
handleCannotConnectException(ex); handleCannotConnectException(ex);
} }
} catch (Throwable t) { } catch (Throwable t) {
logger.fatal("Unable to connect to server - ", t); logger.fatal("Unable connect to server - ", t);
if (!canceled) { if (!canceled) {
disconnect(false); disconnect(false);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("Unable to connect to server.\n"); sb.append("Unable connect to server.\n");
for (StackTraceElement element : t.getStackTrace()) { for (StackTraceElement element : t.getStackTrace()) {
sb.append(element.toString()).append('\n'); sb.append(element.toString()).append('\n');
} }
@ -442,7 +439,7 @@ public class SessionImpl implements Session {
t = t.getCause(); t = t.getCause();
} }
client.showMessage("Unable to connect to server. " + message); client.showMessage("Unable connect to server. " + message);
if (logger.isTraceEnabled()) { if (logger.isTraceEnabled()) {
logger.trace("StackTrace", t); logger.trace("StackTrace", t);
} }

View file

@ -0,0 +1,50 @@
package mage.utils;
import org.apache.log4j.Logger;
import java.net.URL;
import java.time.Instant;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
/**
* @author JayDi85
*/
public class JarVersion {
private static final Logger logger = Logger.getLogger(JarVersion.class);
private static final String JAR_BUILD_TIME_FROM_CLASSES = "runtime";
private static final String JAR_BUILD_TIME_ERROR = "n/a";
public static String getBuildTime(Class clazz) {
// build time info inserted by maven on jar build phase (see root pom.xml)
String className = clazz.getSimpleName() + ".class";
String classPath = clazz.getResource(className).toString();
// https://stackoverflow.com/a/1273432/1276632
String manifestPath;
if (classPath.startsWith("jar")) {
// jar source
manifestPath = classPath.substring(0, classPath.lastIndexOf("!") + 1) + "/META-INF/MANIFEST.MF";
} else {
// dir source (e.g. IDE's debug)
// it's can be generated by runtime, but need extra code and performance: https://stackoverflow.com/questions/34674073/how-to-generate-manifest-mf-file-during-compile-phase
// manifestPath = classPath.substring(0, classPath.lastIndexOf("/" + className)) + "/META-INF/MANIFEST.MF";
return JAR_BUILD_TIME_FROM_CLASSES;
}
try {
Manifest manifest = new Manifest(new URL(manifestPath).openStream());
Attributes attr = manifest.getMainAttributes();
String buildTime = attr.getValue("Build-Time");
Instant instant = Instant.parse(buildTime);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm").withZone(ZoneOffset.UTC);
return formatter.format(instant);
} catch (Throwable e) {
logger.error("Can't read build time in jar manifest for class " + clazz.getName() + " and path " + manifestPath, e);
return JAR_BUILD_TIME_ERROR;
}
}
}

View file

@ -3,7 +3,6 @@ package mage.utils;
import java.io.Serializable; import java.io.Serializable;
/** /**
*
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class MageVersion implements Serializable, Comparable<MageVersion> { public class MageVersion implements Serializable, Comparable<MageVersion> {
@ -14,22 +13,30 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
public final static int MAGE_VERSION_MAJOR = 1; public final static int MAGE_VERSION_MAJOR = 1;
public final static int MAGE_VERSION_MINOR = 4; public final static int MAGE_VERSION_MINOR = 4;
public final static int MAGE_VERSION_PATCH = 32; public final static int MAGE_VERSION_PATCH = 32;
public final static String MAGE_EDITION_INFO = ""; // set "-beta" for 1.4.32-betaV0
public final static String MAGE_VERSION_MINOR_PATCH = "V0"; public final static String MAGE_VERSION_MINOR_PATCH = "V0";
public final static String MAGE_VERSION_INFO = "";
private final int major; private final int major;
private final int minor; private final int minor;
private final int patch; private final int patch;
private final String minorPatch; // doesn't matter for compatibility private final String minorPatch; // doesn't matter for compatibility
private final String buildTime;
private String editionInfo;
private final boolean showBuildTime = true;
private String info = ""; public MageVersion(Class sourceClass) {
this(MAGE_VERSION_MAJOR, MAGE_VERSION_MINOR, MAGE_VERSION_PATCH, MAGE_VERSION_MINOR_PATCH, MAGE_EDITION_INFO, sourceClass);
}
public MageVersion(int major, int minor, int patch, String minorPatch, String info) { public MageVersion(int major, int minor, int patch, String minorPatch, String editionInfo, Class sourceClass) {
this.major = major; this.major = major;
this.minor = minor; this.minor = minor;
this.patch = patch; this.patch = patch;
this.minorPatch = minorPatch; this.minorPatch = minorPatch;
this.info = info; this.editionInfo = editionInfo;
// build time
this.buildTime = showBuildTime ? JarVersion.getBuildTime(sourceClass) : "";
} }
public int getMajor() { public int getMajor() {
@ -50,7 +57,8 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
@Override @Override
public String toString() { public String toString() {
return major + "." + minor + '.' + patch + info + minorPatch; // 1.4.32-betaV0 (build: time)
return major + "." + minor + '.' + patch + editionInfo + minorPatch + (!this.buildTime.isEmpty() ? " (build: " + this.buildTime + ")" : "");
} }
@Override @Override
@ -64,7 +72,7 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
if (patch != o.patch) { if (patch != o.patch) {
return patch - o.patch; return patch - o.patch;
} }
return info.compareTo(o.info); return editionInfo.compareTo(o.editionInfo);
} }
} }

View file

@ -53,7 +53,6 @@
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<configuration> <configuration>
<archive> <archive>
<manifestFile>${manifest.file}</manifestFile>
<manifest> <manifest>
<addClasspath>true</addClasspath> <addClasspath>true</addClasspath>
<mainClass>mage.server.console.ConsoleFrame</mainClass> <mainClass>mage.server.console.ConsoleFrame</mainClass>

View file

@ -1,11 +1,3 @@
/*
* ConsoleFrame.java
*
* Created on May 13, 2011, 2:39:10 PM
*/
package mage.server.console; package mage.server.console;
import mage.interfaces.MageClient; import mage.interfaces.MageClient;
@ -25,7 +17,6 @@ import java.util.concurrent.TimeUnit;
import java.util.prefs.Preferences; import java.util.prefs.Preferences;
/** /**
*
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class ConsoleFrame extends javax.swing.JFrame implements MageClient { public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
@ -35,9 +26,10 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
private static Session session; private static Session session;
private ConnectDialog connectDialog; private ConnectDialog connectDialog;
private static final Preferences prefs = Preferences.userNodeForPackage(ConsoleFrame.class); private static final Preferences prefs = Preferences.userNodeForPackage(ConsoleFrame.class);
private static final MageVersion version = new MageVersion(MageVersion.MAGE_VERSION_MAJOR, MageVersion.MAGE_VERSION_MINOR, MageVersion.MAGE_VERSION_PATCH, MageVersion.MAGE_VERSION_MINOR_PATCH, MageVersion.MAGE_VERSION_INFO); private static final MageVersion version = new MageVersion(ConsoleFrame.class);
private static final ScheduledExecutorService pingTaskExecutor = Executors.newSingleThreadScheduledExecutor(); private static final ScheduledExecutorService pingTaskExecutor = Executors.newSingleThreadScheduledExecutor();
/** /**
* @return the session * @return the session
*/ */
@ -54,7 +46,9 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
return version; return version;
} }
/** Creates new form ConsoleFrame */ /**
* Creates new form ConsoleFrame
*/
public ConsoleFrame() { public ConsoleFrame() {
addWindowListener(new WindowAdapter() { addWindowListener(new WindowAdapter() {
@ -100,7 +94,8 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
btnSendMessage.setEnabled(false); btnSendMessage.setEnabled(false);
} }
/** This method is called from within the constructor to /**
* This method is called from within the constructor to
* initialize the form. * initialize the form.
* WARNING: Do NOT modify this code. The content of this method is * WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor. * always regenerated by the Form Editor.
@ -206,8 +201,7 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
if (SwingUtilities.isEventDispatchThread()) { if (SwingUtilities.isEventDispatchThread()) {
setStatusText(message); setStatusText(message);
enableButtons(); enableButtons();
} } else {
else {
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
setStatusText(message); setStatusText(message);
enableButtons(); enableButtons();
@ -221,8 +215,7 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
consolePanel1.stop(); consolePanel1.stop();
setStatusText("Not connected"); setStatusText("Not connected");
disableButtons(); disableButtons();
} } else {
else {
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
consolePanel1.stop(); consolePanel1.stop();
setStatusText("Not connected"); setStatusText("Not connected");
@ -235,8 +228,7 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
public void showMessage(final String message) { public void showMessage(final String message) {
if (SwingUtilities.isEventDispatchThread()) { if (SwingUtilities.isEventDispatchThread()) {
JOptionPane.showMessageDialog(this, message); JOptionPane.showMessageDialog(this, message);
} } else {
else {
SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(getFrame(), message)); SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(getFrame(), message));
} }
} }
@ -245,8 +237,7 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
public void showError(final String message) { public void showError(final String message) {
if (SwingUtilities.isEventDispatchThread()) { if (SwingUtilities.isEventDispatchThread()) {
JOptionPane.showMessageDialog(this, message, "Error", JOptionPane.ERROR_MESSAGE); JOptionPane.showMessageDialog(this, message, "Error", JOptionPane.ERROR_MESSAGE);
} } else {
else {
SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(getFrame(), message, "Error", JOptionPane.ERROR_MESSAGE)); SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(getFrame(), message, "Error", JOptionPane.ERROR_MESSAGE));
} }
} }

View file

@ -1,3 +0,0 @@
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build

View file

@ -258,7 +258,6 @@
<configuration> <configuration>
<generatePackage>mage.server.util.config</generatePackage> <generatePackage>mage.server.util.config</generatePackage>
<schemaDirectory>./src/main/xml-resources/jaxb/Config/</schemaDirectory> <schemaDirectory>./src/main/xml-resources/jaxb/Config/</schemaDirectory>
<arguments>-Xcommons-lang</arguments>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>

View file

@ -1,10 +1,5 @@
package mage.server; package mage.server;
import java.security.SecureRandom;
import java.util.*;
import java.util.concurrent.ExecutorService;
import javax.management.timer.Timer;
import mage.MageException; import mage.MageException;
import mage.cards.decks.DeckCardLists; import mage.cards.decks.DeckCardLists;
import mage.cards.repository.CardInfo; import mage.cards.repository.CardInfo;
@ -43,6 +38,11 @@ import mage.view.ChatMessage.MessageColor;
import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import javax.management.timer.Timer;
import java.security.SecureRandom;
import java.util.*;
import java.util.concurrent.ExecutorService;
/** /**
* @author BetaSteward_at_googlemail.com, noxx * @author BetaSteward_at_googlemail.com, noxx
*/ */
@ -1307,8 +1307,8 @@ public class MageServerImpl implements MageServer {
logger.error("Session not found : " + sessionId); logger.error("Session not found : " + sessionId);
return null; return null;
} else { } else {
UUID userId = session.get().getUserId(); //UUID userId = session.get().getUserId();
return GameManager.instance.getGameView(gameId, userId, playerId); return GameManager.instance.getGameView(gameId, playerId);
} }
} }
} }

View file

@ -1,12 +1,5 @@
package mage.server; package mage.server;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.util.*;
import javax.management.MBeanServer;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
import mage.cards.Sets; import mage.cards.Sets;
import mage.cards.repository.CardScanner; import mage.cards.repository.CardScanner;
@ -39,13 +32,20 @@ import org.jboss.remoting.transporter.TransporterClient;
import org.jboss.remoting.transporter.TransporterServer; import org.jboss.remoting.transporter.TransporterServer;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import javax.management.MBeanServer;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.util.*;
/** /**
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public final class Main { public final class Main {
private static final Logger logger = Logger.getLogger(Main.class); private static final Logger logger = Logger.getLogger(Main.class);
private static final MageVersion version = new MageVersion(MageVersion.MAGE_VERSION_MAJOR, MageVersion.MAGE_VERSION_MINOR, MageVersion.MAGE_VERSION_PATCH, MageVersion.MAGE_VERSION_MINOR_PATCH, MageVersion.MAGE_VERSION_INFO); private static final MageVersion version = new MageVersion(Main.class);
private static final String testModeArg = "-testMode="; private static final String testModeArg = "-testMode=";
private static final String fastDBModeArg = "-fastDbMode="; private static final String fastDBModeArg = "-fastDbMode=";

View file

@ -9,7 +9,6 @@
<version>1.4.32</version> <version>1.4.32</version>
</parent> </parent>
<groupId>org.mage</groupId>
<artifactId>mage-stats</artifactId> <artifactId>mage-stats</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>XMage Stats Web Service</name> <name>XMage Stats Web Service</name>

View file

@ -189,9 +189,9 @@ public class MageBase {
} catch (MageException ex) { } catch (MageException ex) {
logger.log(Level.SEVERE, null, ex); logger.log(Level.SEVERE, null, ex);
} catch (RemoteException ex) { } catch (RemoteException ex) {
logger.log(Level.SEVERE, "Unable to connect to server - ", ex); logger.log(Level.SEVERE, "Unable connect to server - ", ex);
} catch (NotBoundException ex) { } catch (NotBoundException ex) {
logger.log(Level.SEVERE, "Unable to connect to server - ", ex); logger.log(Level.SEVERE, "Unable connect to server - ", ex);
} }
} }

View file

@ -16,7 +16,7 @@ import org.apache.log4j.Logger;
public class SimpleMageClient implements MageClient { public class SimpleMageClient implements MageClient {
private final UUID clientId; private final UUID clientId;
private static final MageVersion version = new MageVersion(MageVersion.MAGE_VERSION_MAJOR, MageVersion.MAGE_VERSION_MINOR, MageVersion.MAGE_VERSION_PATCH, MageVersion.MAGE_VERSION_MINOR_PATCH, MageVersion.MAGE_VERSION_INFO); private static final MageVersion version = new MageVersion(MageClient.class);
private static final Logger log = Logger.getLogger(SimpleMageClient.class); private static final Logger log = Logger.getLogger(SimpleMageClient.class);

View file

@ -1,3 +0,0 @@
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build

View file

@ -29,6 +29,7 @@
<!-- <compilerArgument>-Xlint:all</compilerArgument> --> <!-- <compilerArgument>-Xlint:all</compilerArgument> -->
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.7</version> <version>2.7</version>
@ -36,6 +37,8 @@
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
</configuration> </configuration>
</plugin> </plugin>
<!-- default manifest settings (parent) -->
<plugin> <plugin>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>2.5</version> <version>2.5</version>
@ -43,6 +46,7 @@
<archive> <archive>
<manifestEntries> <manifestEntries>
<Built-By>MageTeam</Built-By> <Built-By>MageTeam</Built-By>
<Build-Time>${maven.build.timestamp}</Build-Time>
</manifestEntries> </manifestEntries>
</archive> </archive>
</configuration> </configuration>