forked from External/mage
Server statistics - server uptime in hours, games played count.
This commit is contained in:
parent
446c1517cf
commit
538dd696ad
3 changed files with 124 additions and 90 deletions
|
|
@ -45,6 +45,7 @@ import mage.server.game.PlayerFactory;
|
|||
import mage.server.tournament.TournamentFactory;
|
||||
import mage.server.util.PluginClassLoader;
|
||||
import mage.server.util.ConfigSettings;
|
||||
import mage.server.util.ServerMessagesUtil;
|
||||
import mage.server.util.config.Plugin;
|
||||
import mage.server.util.config.GamePlugin;
|
||||
import mage.utils.MageVersion;
|
||||
|
|
@ -122,6 +123,7 @@ public class Main {
|
|||
logger.info("Started MAGE server - listening on " + connection.toString());
|
||||
if (testMode)
|
||||
logger.info("MAGE server running in test mode");
|
||||
initStatistics();
|
||||
}
|
||||
else {
|
||||
logger.fatal("Unable to start MAGE server - another server is already started");
|
||||
|
|
@ -134,6 +136,10 @@ public class Main {
|
|||
|
||||
}
|
||||
|
||||
static void initStatistics() {
|
||||
ServerMessagesUtil.getInstance().setStartDate(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
static boolean isAlreadyRunning(InvokerLocator serverLocator) {
|
||||
Map<String, String> metadata = new HashMap<String, String>();
|
||||
metadata.put(SocketWrapper.WRITE_TIMEOUT, "2000");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue