forked from 2009Scape/Server
fixup
This commit is contained in:
parent
4b21a1fec7
commit
79aec97f54
4 changed files with 3 additions and 90 deletions
|
|
@ -1,4 +1,4 @@
|
|||
@echo off
|
||||
@title World 1
|
||||
java -server -Xms512m -Xmx1536m -XX:NewSize=32m -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:+AggressiveOpts -cp bin;data/libs/*;data/libs/slf4j/*; org.crandor.Main server1.properties
|
||||
java -server -Xms512m -Xmx1536m -XX:NewSize=32m -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:+AggressiveOpts -cp bin;data/libs/*;data/libs/slf4j/*; org.crandor.Server server1.properties
|
||||
pause
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
@echo off
|
||||
@title World 2
|
||||
java -server -Xms1024m -Xmx1536m -XX:NewSize=32m -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:+AggressiveOpts -cp bin;data/libs/*;data/libs/slf4j/*; org.crandor.Main server2.properties
|
||||
java -server -Xms1024m -Xmx1536m -XX:NewSize=32m -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:+AggressiveOpts -cp bin;data/libs/*;data/libs/slf4j/*; org.crandor.Server server2.properties
|
||||
pause
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
@echo off
|
||||
@title World 3
|
||||
java -server -Xms1024m -Xmx1536m -XX:NewSize=32m -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:+AggressiveOpts -cp bin;data/libs/*;data/libs/slf4j/*; org.crandor.Main server3.properties
|
||||
java -server -Xms1024m -Xmx1536m -XX:NewSize=32m -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:+AggressiveOpts -cp bin;data/libs/*;data/libs/slf4j/*; org.crandor.Server server3.properties
|
||||
pause
|
||||
|
|
|
|||
|
|
@ -1,87 +0,0 @@
|
|||
package org.crandor;
|
||||
|
||||
import org.crandor.game.system.SystemLogger;
|
||||
import org.crandor.game.system.SystemShutdownHook;
|
||||
import org.crandor.game.system.mysql.SQLManager;
|
||||
import org.crandor.game.world.GameSettings;
|
||||
import org.crandor.game.world.GameWorld;
|
||||
import org.crandor.gui.ConsoleFrame;
|
||||
import org.crandor.net.NioReactor;
|
||||
import org.crandor.net.amsc.WorldCommunicator;
|
||||
import org.crandor.tools.TimeStamp;
|
||||
import org.crandor.tools.backup.AutoBackup;
|
||||
|
||||
import java.net.BindException;
|
||||
|
||||
/**
|
||||
* The main class, for those that are unable to read the class' name.
|
||||
* @author Emperor
|
||||
* @author Vexia
|
||||
*
|
||||
*/
|
||||
public final class Main{
|
||||
|
||||
/**
|
||||
* The time stamp of when the server started running.
|
||||
*/
|
||||
public static long startTime;
|
||||
|
||||
/**
|
||||
* The NIO reactor.
|
||||
*/
|
||||
public static NioReactor reactor;
|
||||
|
||||
private static AutoBackup backup;
|
||||
|
||||
/**
|
||||
* The main method, in this method we load background utilities such as
|
||||
* cache and our world, then end with starting networking.
|
||||
* @param args The arguments cast on runtime.
|
||||
* @throws Throwable When an exception occurs.
|
||||
*/
|
||||
public static void main(String... args) throws Throwable {
|
||||
if (args.length > 0) {
|
||||
GameWorld.setSettings(GameSettings.parse(args));
|
||||
}
|
||||
if (GameWorld.getSettings().isGui()) {
|
||||
ConsoleFrame.getInstance().init();
|
||||
}
|
||||
startTime = System.currentTimeMillis();
|
||||
final TimeStamp t = new TimeStamp();
|
||||
// backup = new AutoBackup();
|
||||
GameWorld.prompt(true);
|
||||
SQLManager.init();
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(new SystemShutdownHook()));
|
||||
SystemLogger.log("Starting NIO reactor...");
|
||||
|
||||
try {
|
||||
reactor = NioReactor.configure(43594 + GameWorld.getSettings().getWorldId());
|
||||
} catch (BindException e) {
|
||||
System.out.println("Port " + 43594 + GameWorld.getSettings().getWorldId() + " is already in use!");
|
||||
throw e;
|
||||
}
|
||||
|
||||
WorldCommunicator.connect();
|
||||
reactor.start();
|
||||
SystemLogger.log(GameWorld.getName() + " flags " + GameWorld.getSettings().toString());
|
||||
SystemLogger.log(GameWorld.getName() + " started in " + t.duration(false, "") + " milliseconds.");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the startTime.
|
||||
* @return the startTime
|
||||
*/
|
||||
public static long getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the bastartTime.
|
||||
* @param startTime the startTime to set.
|
||||
*/
|
||||
public static void setStartTime(long startTime) {
|
||||
Main.startTime = startTime;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue