diff --git a/README.md b/README.md index 45e5cfd..0e7a05a 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Install the module globally from NPM #### Options ``` -h, --help output usage information +--debug More verbose logging (e.g. stack traces) --filePatching Enable file patching --game [value] Game to launch --host [value] Server IP to join @@ -43,6 +44,7 @@ Install the module globally from NPM ``` -h, --help output usage information --config [value] Server config name +--debug More verbose logging (e.g. stack traces) --disableVoN [value] Disable VON --filePatching Enable file patching --game [value] Game to launch @@ -79,6 +81,7 @@ References, Option | Type | Default | Description --- | --- | --- | --- +debug | boolean | game default | More verbose logging (e.g. stack traces) filePatching | boolean | game default | Enable file patching game | string | 'arma3' | Which game engine to use host | string | game default | IP or hostname that client should connect to @@ -112,6 +115,7 @@ allowedLoadFileExtensions | array of strings | game default | Whitelisted file e allowedPreprocessFileExtensions | array of strings | game default | Whitelisted file extensions allowed battleEye | boolean | game default | Should BattleEye be enabled config | string | 'server.config' | Name of config file to be saved, stored in configs directory +debug | boolean | game default | More verbose logging (e.g. stack traces) disableVoN | boolean | game default | Should built in VoN be disabled doubleIdDetected | string | game default | Server side script to execute on duplicate client id filePatching | boolean | game default | Enable file patching diff --git a/bin/arma-headless b/bin/arma-headless index ebb9401..99f1d06 100755 --- a/bin/arma-headless +++ b/bin/arma-headless @@ -9,6 +9,7 @@ function list(val) { } program + .option('--debug', 'More verbose logging (e.g. stack traces)') .option('--filePatching', 'Enable file patching') .option('--game [value]', 'Game to launch') .option('--host [value]', 'Server IP to join') diff --git a/bin/arma-server b/bin/arma-server index 4e1f281..8e0976b 100755 --- a/bin/arma-server +++ b/bin/arma-server @@ -10,6 +10,7 @@ function list(val) { program .option('--config [value]', 'Server config name') + .option('--debug', 'More verbose logging (e.g. stack traces)') .option('--disableVoN [value]', 'Disable VON') .option('--filePatching', 'Enable file patching') .option('--game [value]', 'Game to launch') diff --git a/src/headless.js b/src/headless.js index 384fa89..140ff2f 100644 --- a/src/headless.js +++ b/src/headless.js @@ -14,6 +14,7 @@ var defaultPlatform = function () { var Headless = function (options) { this.options = _.defaults(options, { + debug: null, filePatching: null, game: 'arma3', host: null, @@ -109,6 +110,10 @@ Headless.prototype.start = function () { startParams.push('-filePatching') } + if (this.options.debug) { + startParams.push('-debug') + } + startParams.push('-client') return spawn(gamePath, startParams, options) diff --git a/src/server.js b/src/server.js index cc638aa..d3fa558 100644 --- a/src/server.js +++ b/src/server.js @@ -27,6 +27,7 @@ var Server = function (options) { allowedPreprocessFileExtensions: null, battleEye: null, config: 'server.config', + debug: null, disableVoN: null, doubleIdDetected: null, filePatching: null, @@ -140,6 +141,10 @@ Server.prototype.start = function () { startParams.push('-filePatching') } + if (this.options.debug) { + startParams.push('-debug') + } + startParams.push(this.makeConfigParameter()) return spawn(gamePath, startParams, options) diff --git a/templates/config.tpl b/templates/config.tpl index 4073f6c..8622caa 100644 --- a/templates/config.tpl +++ b/templates/config.tpl @@ -136,6 +136,12 @@ allowedHTMLLoadExtensions[] = { allowedFilePatching = <%= allowedFilePatching %>; <% } %> +<% if (debug !== null) { %> +// More verbose logging (e.g. stack traces) +// set to 1 to activate +debug = <%= debug %>; +<% } %> + <% if (onUserConnected !== null) { %> // Server Side Script to be executed upon user connected onUserConnected = "<%= onUserConnected %>";