diff --git a/GameServer/src/org/moparscape/msc/config/Config.java b/GameServer/src/org/moparscape/msc/config/Config.java
index e37be83..c0ad0a2 100644
--- a/GameServer/src/org/moparscape/msc/config/Config.java
+++ b/GameServer/src/org/moparscape/msc/config/Config.java
@@ -32,6 +32,8 @@ public class Config {
public static String[] pmods, mods, admins;
public static String UNUSED_IP;
public static int IP_BAN_REMOVAL_DELAY;
+ public static int GARBAGE_COLLECT_INTERVAL;
+ public static int SAVE_INTERVAL;
static {
loadEnv();
@@ -82,6 +84,9 @@ public class Config {
UNUSED_IP = props.getProperty("unused-ip");
IP_BAN_REMOVAL_DELAY = Integer.parseInt(props.getProperty("ip-ban-removal-delay"));
+ GARBAGE_COLLECT_INTERVAL = Integer.parseInt(props.getProperty("garbage-collect-interval"));
+ SAVE_INTERVAL = Integer.parseInt(props.getProperty("save-interval"));
+
props.clear();
Constants.GameServer.MOTD = "@yel@Welcome to @whi@" + Config.SERVER_NAME + "@yel@ - World @whi@" + (Config.SERVER_NUM == 0 ? 2 : Config.SERVER_NUM) + " (" + (Config.members ? "P2P" : "F2P") + ")";
diff --git a/GameServer/src/org/moparscape/msc/gs/core/GameEngine.java b/GameServer/src/org/moparscape/msc/gs/core/GameEngine.java
index c1fcdf0..ef136e5 100644
--- a/GameServer/src/org/moparscape/msc/gs/core/GameEngine.java
+++ b/GameServer/src/org/moparscape/msc/gs/core/GameEngine.java
@@ -16,6 +16,7 @@ import java.util.GregorianCalendar;
import java.util.TimeZone;
import org.apache.mina.common.IoSession;
+import org.moparscape.msc.config.Config;
import org.moparscape.msc.config.Constants;
import org.moparscape.msc.config.Formulae;
import org.moparscape.msc.gs.Instance;
@@ -308,7 +309,7 @@ public final class GameEngine extends Thread {
}
time = System.currentTimeMillis();
- eventHandler.add(new DelayedEvent(null, 300000 * 10 * 2) { // Ran every
+ eventHandler.add(new DelayedEvent(null, Config.GARBAGE_COLLECT_INTERVAL) { // Ran every
// 50*2
// minutes
@Override
@@ -320,12 +321,12 @@ public final class GameEngine extends Thread {
}).start();
}
});
- eventHandler.add(new DelayedEvent(null, 300000) { // 5 min
+ eventHandler.add(new DelayedEvent(null, Config.SAVE_INTERVAL) { // 5 min
public void run() {
world.dbKeepAlive();
long now = GameEngine.getTime();
for (Player p : world.getPlayers()) {
- if (now - p.getLastSaveTime() >= 900000) {
+ if (now - p.getLastSaveTime() >= Config.SAVE_INTERVAL) {
p.save();
p.setLastSaveTime(now);
}
diff --git a/GameServer/world.xml b/GameServer/world.xml
index 97abe46..427d995 100644
--- a/GameServer/world.xml
+++ b/GameServer/world.xml
@@ -29,4 +29,9 @@
192.168.0.255
1800000
+
+
+ 6000000
+
+ 300000