mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-18 08:02:56 -04:00
Added config option to disable the preloading of the scripts
This commit is contained in:
@@ -104,7 +104,7 @@ public class CoreManager extends Manager {
|
||||
registerForIntent(ServerManagementIntent.TYPE);
|
||||
packetDebug = getConfig(ConfigFile.PRIMARY).getBoolean("PACKET-DEBUG", false);
|
||||
initializePacketOutput();
|
||||
Scripts.initialize(getConfig(ConfigFile.PRIMARY));
|
||||
initializeScripts();
|
||||
return galaxy != null && super.initialize();
|
||||
}
|
||||
|
||||
@@ -147,6 +147,19 @@ public class CoreManager extends Manager {
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeScripts() {
|
||||
Config c = getConfig(ConfigFile.PRIMARY);
|
||||
if (!c.getBoolean("LOAD-SCRIPTS", true)) {
|
||||
System.out.println("CoreManager: Not preloading scripts. Reason: disabled");
|
||||
return;
|
||||
}
|
||||
System.out.println("CoreManager: Initializing scripts...");
|
||||
long start = System.nanoTime();
|
||||
Scripts.initialize(getConfig(ConfigFile.PRIMARY));
|
||||
long end = System.nanoTime();
|
||||
System.out.println("CoreManager: Initialized scripts. Took " + (end-start)/1E6 + "ms");
|
||||
}
|
||||
|
||||
private void handleServerManagementIntent(ServerManagementIntent i) {
|
||||
switch(i.getEvent()) {
|
||||
case SHUTDOWN: initiateShutdownSequence(i); break;
|
||||
|
||||
Reference in New Issue
Block a user