Added invasion enable option

Invasions can be toggled in options.cfg for users with
low-end machines that are not suited for calculation-intense server
operation.
This commit is contained in:
CharonInferar
2014-08-11 00:13:52 +02:00
parent 95120b25e1
commit 7e8d5e256b
2 changed files with 12 additions and 0 deletions
+3
View File
@@ -8,3 +8,6 @@ CLEAN.ODB.FOLDERS=0
# Set to 1 to have all players spawn in the desert with no NPCs around
DO.ISOLATION.TESTS=0
# Set to 1 to enable GCW invasions
ENABLE.INVASIONS=0
+9
View File
@@ -66,6 +66,7 @@ import services.sui.SUIWindow.Trigger;
import main.NGECore;
import engine.clients.Client;
import engine.resources.common.CRC;
import engine.resources.config.Config;
import engine.resources.container.Traverser;
import engine.resources.objects.SWGObject;
import engine.resources.scene.Planet;
@@ -138,6 +139,14 @@ public class InvasionService implements INetworkDispatch {
public InvasionService(final NGECore core) {
this.core = core;
Config options = new Config();
options.setFilePath("options.cfg");
boolean optionsConfigLoaded = options.loadConfigFile();
if (optionsConfigLoaded && options.getInt("ENABLE.INVASIONS") == 0){
return;
}
// Utility code
// Executors.newSingleThreadScheduledExecutor().schedule(() -> {