From 2c5d8cfd30b059e3e5ea966ec9b40e0c7e1fe205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Dahlgren?= Date: Sun, 1 Oct 2017 04:11:34 +0200 Subject: [PATCH 1/3] Bump arma-server dependency to 0.0.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b17fe18..de8993e 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ ] }, "dependencies": { - "arma-server": "0.0.5", + "arma-server": "0.0.6", "async": "^0.9.0", "body-parser": "^1.17.1", "express": "^4.15.2", From af17f8a76ddffccd283da5f4d5abe0ec0c9bfbdd Mon Sep 17 00:00:00 2001 From: Moritz Schmidt Date: Sat, 30 Sep 2017 20:42:18 +0200 Subject: [PATCH 2/3] pass admins array from config to server config --- config.js.example | 1 + lib/server.js | 1 + 2 files changed, 2 insertions(+) diff --git a/config.js.example b/config.js.example index 7c2bb1a..1f86ddb 100644 --- a/config.js.example +++ b/config.js.example @@ -12,6 +12,7 @@ module.exports = { '@mod1', '@mod2', ], + admins: [], // add steam IDs here to enable #login without password auth: { // If both username and password is set, HTTP Basic Auth will be used. You may use an array to specify more than one user. username: '', // Username for HTTP Basic Auth password: '', // Password for HTTP Basic Auth diff --git a/lib/server.js b/lib/server.js index ecae88a..1fe3060 100644 --- a/lib/server.js +++ b/lib/server.js @@ -109,6 +109,7 @@ Server.prototype.getParameters = function () { Server.prototype.start = function () { var parameters = this.getParameters() var server = new ArmaServer.Server({ + admins: config.admins, battleEye: this.battle_eye ? 1 : 0, config: this.id, disableVoN: this.von ? 0 : 1, From 49ceacf8aead7e5da885009bc65f3f48303993a2 Mon Sep 17 00:00:00 2001 From: Moritz Schmidt Date: Sat, 30 Sep 2017 21:49:42 +0200 Subject: [PATCH 3/3] configure motd/forcedDifficulty per server --- lib/manager.js | 2 ++ lib/server.js | 6 ++++++ public/js/app/models/server.js | 2 ++ public/js/app/views/servers/form.js | 2 ++ public/js/tpl/servers/form.html | 24 ++++++++++++++++++++++++ 5 files changed, 36 insertions(+) diff --git a/lib/manager.js b/lib/manager.js index ea46a1f..5770dd8 100644 --- a/lib/manager.js +++ b/lib/manager.js @@ -104,9 +104,11 @@ Manager.prototype.save = function () { admin_password: server.admin_password, auto_start: server.auto_start, battle_eye: server.battle_eye, + forcedDifficulty: server.forcedDifficulty, max_players: server.max_players, missions: server.missions, mods: server.mods, + motd: server.motd, number_of_headless_clients: server.number_of_headless_clients, parameters: server.parameters, password: server.password, diff --git a/lib/server.js b/lib/server.js index 1fe3060..f29486e 100644 --- a/lib/server.js +++ b/lib/server.js @@ -48,9 +48,11 @@ Server.prototype.update = function (options) { this.admin_password = options.admin_password this.auto_start = options.auto_start this.battle_eye = options.battle_eye + this.forcedDifficulty = options.forcedDifficulty || null this.max_players = options.max_players this.missions = options.missions this.mods = options.mods || [] + this.motd = options.motd || null this.number_of_headless_clients = options.number_of_headless_clients || 0 this.password = options.password this.parameters = options.parameters @@ -114,11 +116,13 @@ Server.prototype.start = function () { config: this.id, disableVoN: this.von ? 0 : 1, game: config.game, + forcedDifficulty: this.forcedDifficulty || null, headlessClients: this.number_of_headless_clients > 0 ? ['127.0.0.1'] : null, hostname: createServerTitle(this.title), localClient: this.number_of_headless_clients > 0 ? ['127.0.0.1'] : null, missions: this.missions, mods: this.mods, + motd: (this.motd && this.motd.split('\n')) || null, parameters: parameters, password: this.password, passwordAdmin: this.admin_password, @@ -271,8 +275,10 @@ Server.prototype.toJSON = function () { auto_start: this.auto_start, battle_eye: this.battle_eye, id: this.id, + forcedDifficulty: this.forcedDifficulty, max_players: this.max_players, missions: this.missions, + motd: this.motd, mods: this.mods, number_of_headless_clients: this.number_of_headless_clients, parameters: this.parameters, diff --git a/public/js/app/models/server.js b/public/js/app/models/server.js index 8fe9fbb..3527e5c 100644 --- a/public/js/app/models/server.js +++ b/public/js/app/models/server.js @@ -11,8 +11,10 @@ define(function (require) { admin_password: '', auto_start: false, battle_eye: false, + forcedDifficulty: '', max_players: null, mods: [], + motd: '', number_of_headless_clients: 0, parameters: [], password: '', diff --git a/public/js/app/views/servers/form.js b/public/js/app/views/servers/form.js index f012e2e..21b309e 100644 --- a/public/js/app/views/servers/form.js +++ b/public/js/app/views/servers/form.js @@ -22,7 +22,9 @@ define(function (require) { admin_password: this.$("form .admin-password").val(), auto_start: this.$("form .auto-start").prop("checked"), battle_eye: this.$("form .battle-eye").prop("checked"), + forcedDifficulty: this.$("form .forcedDifficulty").val(), max_players: this.$("form .max-players").val(), + motd: this.$("form .motd").val(), number_of_headless_clients: this.$("form .headless-clients").val(), password: this.$("form .password").val(), persistent: this.$("form .persistent").prop("checked"), diff --git a/public/js/tpl/servers/form.html b/public/js/tpl/servers/form.html index 034d195..5489ba5 100644 --- a/public/js/tpl/servers/form.html +++ b/public/js/tpl/servers/form.html @@ -35,6 +35,30 @@ +
+ +
+ +

Message of the day. Shown to players when connected

+
+
+ +
+ +
+ +

Difficulty that is always used unless mission rotation states otherwise

+
+
+