mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
Added build time to version info, cleanup manifest files;
This commit is contained in:
parent
498edb4138
commit
0a2f312da7
19 changed files with 243 additions and 205 deletions
|
|
@ -1,3 +0,0 @@
|
|||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
SplashScreen-Image: splash.jpg
|
||||
|
|
@ -194,11 +194,13 @@
|
|||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${manifest.file}</manifestFile>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<mainClass>mage.client.MageFrame</mainClass>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<SplashScreen-Image>splash.jpg</SplashScreen-Image>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,5 @@
|
|||
|
||||
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.decks.Deck;
|
||||
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.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
|
||||
*/
|
||||
|
|
@ -93,7 +93,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
private static final Preferences PREFS = Preferences.userNodeForPackage(MageFrame.class);
|
||||
private JLabel title;
|
||||
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 static MagePane activeFrame;
|
||||
private static boolean liteMode = false;
|
||||
|
|
@ -760,7 +760,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
prepareAndShowTablesPane();
|
||||
return true;
|
||||
} else {
|
||||
showMessage("Unable to connect to server");
|
||||
showMessage("Unable connect to server");
|
||||
}
|
||||
} finally {
|
||||
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
SplashScreen-Image: splash.jpg
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
package mage.client.game;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.swing.*;
|
||||
import mage.client.components.MageUI;
|
||||
import mage.interfaces.MageClient;
|
||||
import mage.interfaces.callback.ClientCallback;
|
||||
|
|
@ -13,6 +10,10 @@ import mage.utils.MageVersion;
|
|||
import org.apache.log4j.Logger;
|
||||
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.
|
||||
*
|
||||
|
|
@ -30,7 +31,7 @@ public class MultiConnectTest {
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,5 @@
|
|||
|
||||
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.cards.decks.DeckCardLists;
|
||||
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.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
|
||||
*/
|
||||
|
|
@ -94,37 +90,38 @@ public class SessionImpl implements Session {
|
|||
return remoting.run();
|
||||
} catch (MalformedURLException ex) {
|
||||
logger.fatal("", ex);
|
||||
client.showMessage("Unable to connect to server. " + ex.getMessage());
|
||||
client.showMessage("Unable connect to server. " + ex.getMessage());
|
||||
} catch (UndeclaredThrowableException ex) {
|
||||
String addMessage = "";
|
||||
Throwable cause = ex.getCause();
|
||||
if (cause instanceof InvocationFailureException) {
|
||||
InvocationFailureException exep = (InvocationFailureException) cause;
|
||||
if (exep.getCause() instanceof IOException) {
|
||||
if (exep.getCause().getMessage().startsWith("Field hash null is not available on current")) {
|
||||
addMessage = "Probabaly the server version is not compatible to the client. ";
|
||||
if (exep.getCause().getMessage().startsWith("Field hash null is not available on current")
|
||||
|| exep.getCause().getMessage().endsWith("end of file")) {
|
||||
addMessage = "Probably the server version is not compatible with the client. ";
|
||||
}
|
||||
}
|
||||
} else if (cause instanceof NoSuchMethodException) {
|
||||
// NoSuchMethodException is thrown on an invocation of an unknow JBoss remoting
|
||||
// method, so it's likely to be because of a version incompatibility.
|
||||
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()) {
|
||||
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) {
|
||||
logger.fatal("", ex);
|
||||
String addMessage = "";
|
||||
if (ex.getMessage() != null && ex.getMessage().startsWith("Unable to perform invocation")) {
|
||||
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) {
|
||||
if (!canceled) {
|
||||
client.showMessage("Unable to connect to server. " + ex.getMessage());
|
||||
client.showMessage("Unable connect to server. " + ex.getMessage());
|
||||
}
|
||||
disconnect(false);
|
||||
} catch (CannotConnectException ex) {
|
||||
|
|
@ -132,11 +129,11 @@ public class SessionImpl implements Session {
|
|||
handleCannotConnectException(ex);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
logger.fatal("Unable to connect to server - ", t);
|
||||
logger.fatal("Unable connect to server - ", t);
|
||||
if (!canceled) {
|
||||
disconnect(false);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Unable to connect to server.\n");
|
||||
sb.append("Unable connect to server.\n");
|
||||
for (StackTraceElement element : t.getStackTrace()) {
|
||||
sb.append(element.toString()).append('\n');
|
||||
}
|
||||
|
|
@ -442,7 +439,7 @@ public class SessionImpl implements Session {
|
|||
|
||||
t = t.getCause();
|
||||
}
|
||||
client.showMessage("Unable to connect to server. " + message);
|
||||
client.showMessage("Unable connect to server. " + message);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("StackTrace", t);
|
||||
}
|
||||
|
|
|
|||
50
Mage.Common/src/main/java/mage/utils/JarVersion.java
Normal file
50
Mage.Common/src/main/java/mage/utils/JarVersion.java
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,6 @@ package mage.utils;
|
|||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
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_MINOR = 4;
|
||||
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_INFO = "";
|
||||
|
||||
private final int major;
|
||||
private final int minor;
|
||||
private final int patch;
|
||||
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.minor = minor;
|
||||
this.patch = patch;
|
||||
this.minorPatch = minorPatch;
|
||||
this.info = info;
|
||||
this.editionInfo = editionInfo;
|
||||
|
||||
// build time
|
||||
this.buildTime = showBuildTime ? JarVersion.getBuildTime(sourceClass) : "";
|
||||
}
|
||||
|
||||
public int getMajor() {
|
||||
|
|
@ -50,7 +57,8 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
|
|||
|
||||
@Override
|
||||
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
|
||||
|
|
@ -64,7 +72,7 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
|
|||
if (patch != o.patch) {
|
||||
return patch - o.patch;
|
||||
}
|
||||
return info.compareTo(o.info);
|
||||
return editionInfo.compareTo(o.editionInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@
|
|||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${manifest.file}</manifestFile>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<mainClass>mage.server.console.ConsoleFrame</mainClass>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,3 @@
|
|||
|
||||
|
||||
/*
|
||||
* ConsoleFrame.java
|
||||
*
|
||||
* Created on May 13, 2011, 2:39:10 PM
|
||||
*/
|
||||
|
||||
package mage.server.console;
|
||||
|
||||
import mage.interfaces.MageClient;
|
||||
|
|
@ -25,7 +17,6 @@ import java.util.concurrent.TimeUnit;
|
|||
import java.util.prefs.Preferences;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
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 ConnectDialog connectDialog;
|
||||
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();
|
||||
|
||||
/**
|
||||
* @return the session
|
||||
*/
|
||||
|
|
@ -54,7 +46,9 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
|
|||
return version;
|
||||
}
|
||||
|
||||
/** Creates new form ConsoleFrame */
|
||||
/**
|
||||
* Creates new form ConsoleFrame
|
||||
*/
|
||||
public ConsoleFrame() {
|
||||
|
||||
addWindowListener(new WindowAdapter() {
|
||||
|
|
@ -100,7 +94,8 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
|
|||
btnSendMessage.setEnabled(false);
|
||||
}
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
/**
|
||||
* This method is called from within the constructor to
|
||||
* initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is
|
||||
* always regenerated by the Form Editor.
|
||||
|
|
@ -206,8 +201,7 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
|
|||
if (SwingUtilities.isEventDispatchThread()) {
|
||||
setStatusText(message);
|
||||
enableButtons();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
setStatusText(message);
|
||||
enableButtons();
|
||||
|
|
@ -221,8 +215,7 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
|
|||
consolePanel1.stop();
|
||||
setStatusText("Not connected");
|
||||
disableButtons();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
consolePanel1.stop();
|
||||
setStatusText("Not connected");
|
||||
|
|
@ -235,8 +228,7 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
|
|||
public void showMessage(final String message) {
|
||||
if (SwingUtilities.isEventDispatchThread()) {
|
||||
JOptionPane.showMessageDialog(this, message);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
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) {
|
||||
if (SwingUtilities.isEventDispatchThread()) {
|
||||
JOptionPane.showMessageDialog(this, message, "Error", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(getFrame(), message, "Error", JOptionPane.ERROR_MESSAGE));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
|
|
@ -258,7 +258,6 @@
|
|||
<configuration>
|
||||
<generatePackage>mage.server.util.config</generatePackage>
|
||||
<schemaDirectory>./src/main/xml-resources/jaxb/Config/</schemaDirectory>
|
||||
<arguments>-Xcommons-lang</arguments>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,5 @@
|
|||
|
||||
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.cards.decks.DeckCardLists;
|
||||
import mage.cards.repository.CardInfo;
|
||||
|
|
@ -43,6 +38,11 @@ import mage.view.ChatMessage.MessageColor;
|
|||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
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
|
||||
*/
|
||||
|
|
@ -1307,8 +1307,8 @@ public class MageServerImpl implements MageServer {
|
|||
logger.error("Session not found : " + sessionId);
|
||||
return null;
|
||||
} else {
|
||||
UUID userId = session.get().getUserId();
|
||||
return GameManager.instance.getGameView(gameId, userId, playerId);
|
||||
//UUID userId = session.get().getUserId();
|
||||
return GameManager.instance.getGameView(gameId, playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,5 @@
|
|||
|
||||
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.Sets;
|
||||
import mage.cards.repository.CardScanner;
|
||||
|
|
@ -39,13 +32,20 @@ import org.jboss.remoting.transporter.TransporterClient;
|
|||
import org.jboss.remoting.transporter.TransporterServer;
|
||||
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
|
||||
*/
|
||||
public final class Main {
|
||||
|
||||
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 fastDBModeArg = "-fastDbMode=";
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
<version>1.4.32</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-stats</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>XMage Stats Web Service</name>
|
||||
|
|
|
|||
|
|
@ -189,9 +189,9 @@ public class MageBase {
|
|||
} catch (MageException ex) {
|
||||
logger.log(Level.SEVERE, null, 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) {
|
||||
logger.log(Level.SEVERE, "Unable to connect to server - ", ex);
|
||||
logger.log(Level.SEVERE, "Unable connect to server - ", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import org.apache.log4j.Logger;
|
|||
public class SimpleMageClient implements MageClient {
|
||||
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
4
pom.xml
4
pom.xml
|
|
@ -29,6 +29,7 @@
|
|||
<!-- <compilerArgument>-Xlint:all</compilerArgument> -->
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
|
|
@ -36,6 +37,8 @@
|
|||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- default manifest settings (parent) -->
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
|
|
@ -43,6 +46,7 @@
|
|||
<archive>
|
||||
<manifestEntries>
|
||||
<Built-By>MageTeam</Built-By>
|
||||
<Build-Time>${maven.build.timestamp}</Build-Time>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue