Trying to get the functionality to load all running scripts upon load to work

This commit is contained in:
Daniel Xie
2016-12-14 15:44:18 -06:00
parent 334c144bae
commit 7ec22480a2
5 changed files with 9 additions and 3 deletions
+5
View File
@@ -130,10 +130,15 @@ Reviver.constructors.Script = Script;
//Called when the game is loaded. Loads all running scripts (from all servers)
//into worker scripts so that they will start running
function loadAllRunningScripts() {
var count = 0;
console.log("AllServers.length: " + AllServers.length);
for (var i = 0; i < AllServers.length; i++) {
var server = AllServers[i];
console.log("Loading scripts from server " + server.hostname);
for (var j = 0; j < server.runningScripts.length; j++) {
count++;
addWorkerScript(server.runningScripts[j], server);
}
}
console.log("Loaded " + count.toString() + " running scripts");
}