Skip to content
Snippets Groups Projects
Commit ab248cf0 authored by echicken's avatar echicken
Browse files

Wait for user 1 to exist, then start doing things.

parent 09585d82
No related branches found
No related tags found
No related merge requests found
...@@ -114,8 +114,8 @@ var cleanUp = function() { ...@@ -114,8 +114,8 @@ var cleanUp = function() {
jsonClient.disconnect(); jsonClient.disconnect();
} }
if(system.lastuser < 1) while(system.lastuser < 1)
exit(); mswait(15000);
try { try {
initJson(); initJson();
......
...@@ -160,6 +160,9 @@ var pushLevels = function() { ...@@ -160,6 +160,9 @@ var pushLevels = function() {
// Set things up // Set things up
var init = function() { var init = function() {
while(system.lastuser < 1)
mswait(15000);
// Load the server config if it exists, or fake it if not // Load the server config if it exists, or fake it if not
if(file_exists(root + "server.ini")) { if(file_exists(root + "server.ini")) {
var f = new File(root + "server.ini"); var f = new File(root + "server.ini");
...@@ -228,9 +231,6 @@ var cleanUp = function() { ...@@ -228,9 +231,6 @@ var cleanUp = function() {
jsonClient.disconnect(); jsonClient.disconnect();
} }
if(system.lastuser < 1)
exit();
// Try to do things, log an error if necessary // Try to do things, log an error if necessary
try { try {
init(); init();
......
...@@ -100,6 +100,9 @@ var processUpdate = function(update) { ...@@ -100,6 +100,9 @@ var processUpdate = function(update) {
var init = function() { var init = function() {
while(system.lastuser < 1)
mswait(15000);
timer = new Timer(); timer = new Timer();
var f = new File(root + "service.ini"); var f = new File(root + "service.ini");
...@@ -176,9 +179,6 @@ var cleanUp = function() { ...@@ -176,9 +179,6 @@ var cleanUp = function() {
jsonClient.disconnect(); jsonClient.disconnect();
} }
if(system.lastuser < 1)
exit();
try { try {
init(); init();
main(); main();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment