From be6bdb781ac81e3e06e0a3dc2c4daac149cfd25f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Dahlgren?= Date: Fri, 16 Jan 2015 23:09:53 +0100 Subject: [PATCH] Manually select port for server in settings --- manager.js | 4 ++-- public/js/app/models/server.js | 1 + public/js/app/views/servers/form.js | 1 + public/js/tpl/servers/form.html | 8 ++++++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/manager.js b/manager.js index 72dad14..ca5aaca 100644 --- a/manager.js +++ b/manager.js @@ -20,14 +20,14 @@ Server.prototype.update = function (options) { this.admin_password = options.admin_password; this.battle_eye = options.battle_eye; this.max_players = options.max_players; - this.mods = options.mods; + this.mods = options.mods || []; this.password = options.password; this.persistent = options.persistent; + this.port = options.port || 2302; this.title = options.title; this.von = options.von; this.id = slug(this.title).replace('.', '-'); - this.port = 2302; }; Server.prototype.queryStatus = function() { diff --git a/public/js/app/models/server.js b/public/js/app/models/server.js index 1c4184c..874d49d 100644 --- a/public/js/app/models/server.js +++ b/public/js/app/models/server.js @@ -14,6 +14,7 @@ define(function (require) { mods: [], password: '', persistent: false, + port: 2302, state: null, title: '', von: false, diff --git a/public/js/app/views/servers/form.js b/public/js/app/views/servers/form.js index 10b14f4..06ab25a 100644 --- a/public/js/app/views/servers/form.js +++ b/public/js/app/views/servers/form.js @@ -24,6 +24,7 @@ define(function (require) { max_players: this.$("form .max-players").val(), password: this.$("form .password").val(), persistent: this.$("form .persistent").prop("checked"), + port: this.$("form .port").val(), title: this.$("form .title").val(), von: this.$("form .von").prop("checked"), }; diff --git a/public/js/tpl/servers/form.html b/public/js/tpl/servers/form.html index d00557c..c86a08e 100644 --- a/public/js/tpl/servers/form.html +++ b/public/js/tpl/servers/form.html @@ -6,6 +6,14 @@ +
+ +
+ +

Server will use the designated port and the three following ports

+
+
+