mirror of
https://github.com/correl/mage.git
synced 2024-12-25 19:25:41 +00:00
check for server property
This commit is contained in:
parent
681a030b8e
commit
7507a97712
1 changed files with 12 additions and 5 deletions
|
@ -85,7 +85,12 @@ public class Main {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Copier.setLoader(classLoader);
|
Copier.setLoader(classLoader);
|
||||||
String ip = config.getServerAddress();
|
setServerAddress(config.getServerAddress());
|
||||||
|
server = new ServerImpl(config.getPort(), config.getServerName(), testMode);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setServerAddress(String ip) {
|
||||||
try {
|
try {
|
||||||
if (ip.equals("localhost")) {
|
if (ip.equals("localhost")) {
|
||||||
ip = InetAddress.getLocalHost().getHostAddress();
|
ip = InetAddress.getLocalHost().getHostAddress();
|
||||||
|
@ -93,10 +98,12 @@ public class Main {
|
||||||
} catch (UnknownHostException ex) {
|
} catch (UnknownHostException ex) {
|
||||||
logger.log(Level.WARNING, "Could not get server address: ", ex);
|
logger.log(Level.WARNING, "Could not get server address: ", ex);
|
||||||
}
|
}
|
||||||
|
String ipParam = System.getProperty("server");
|
||||||
|
if (ipParam != null) {
|
||||||
|
ip = ipParam;
|
||||||
|
}
|
||||||
System.setProperty("java.rmi.server.hostname", ip);
|
System.setProperty("java.rmi.server.hostname", ip);
|
||||||
logger.info("MAGE server - using address " + ip);
|
logger.info("MAGE server - using address " + ip);
|
||||||
server = new ServerImpl(config.getPort(), config.getServerName(), testMode);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Class<?> loadPlugin(Plugin plugin) {
|
private static Class<?> loadPlugin(Plugin plugin) {
|
||||||
|
|
Loading…
Reference in a new issue