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/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 ecae88a..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 @@ -109,15 +111,18 @@ 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, 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, @@ -270,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/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", 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
+