diff --git a/lib/manager.js b/lib/manager.js index 8b7aa38..e616394 100644 --- a/lib/manager.js +++ b/lib/manager.js @@ -81,6 +81,12 @@ Manager.prototype.load = (function () { } catch(e) { console.error("Manager load error: " + e); } + + self.getServers().map(function (server) { + if (server.auto_start) { + server.start(); + } + }); }); }); @@ -96,6 +102,7 @@ Manager.prototype.save = (function () { this.serversArr.forEach(function (server) { data.push({ admin_password: server.admin_password, + auto_start: server.auto_start, battle_eye: server.battle_eye, headless: server.headless, max_players: server.max_players, diff --git a/lib/server.js b/lib/server.js index 7a4a163..47385b7 100644 --- a/lib/server.js +++ b/lib/server.js @@ -41,6 +41,7 @@ Server.prototype = new events.EventEmitter(); Server.prototype.update = function (options) { this.admin_password = options.admin_password; + this.auto_start = options.auto_start; this.battle_eye = options.battle_eye; this.headless = options.headless; this.max_players = options.max_players; @@ -227,6 +228,7 @@ Server.prototype.stop = function(cb) { Server.prototype.toJSON = function () { return { admin_password: this.admin_password, + auto_start: this.auto_start, battle_eye: this.battle_eye, headless: this.headless, id: this.id, diff --git a/public/js/app/models/server.js b/public/js/app/models/server.js index 4c84b3c..aa40c2f 100644 --- a/public/js/app/models/server.js +++ b/public/js/app/models/server.js @@ -9,6 +9,7 @@ define(function (require) { return Backbone.Model.extend({ defaults: { admin_password: '', + auto_start: false, battle_eye: false, headless: false, max_players: null, diff --git a/public/js/app/views/servers/form.js b/public/js/app/views/servers/form.js index dc42aae..ff360a7 100644 --- a/public/js/app/views/servers/form.js +++ b/public/js/app/views/servers/form.js @@ -20,6 +20,7 @@ define(function (require) { serialize : function() { return { admin_password: this.$("form .admin-password").val(), + auto_start: this.$("form .auto-start").prop("checked"), battle_eye: this.$("form .battle-eye").prop("checked"), headless: this.$("form .headless").prop("checked"), max_players: this.$("form .max-players").val(), diff --git a/public/js/tpl/servers/form.html b/public/js/tpl/servers/form.html index bae2c9e..f98ad4d 100644 --- a/public/js/tpl/servers/form.html +++ b/public/js/tpl/servers/form.html @@ -35,6 +35,16 @@ +
+
+
+ +
+
+
+