diff --git a/config.js.example b/config.js.example index 3f5398e..75717c9 100644 --- a/config.js.example +++ b/config.js.example @@ -7,5 +7,7 @@ module.exports = { auth: { // If both username and password is set, HTTP Basic Auth will be used username: '', // Username for HTTP Basic Auth password: '', // Password for HTTP Basic Auth - } + }, + prefix: "", // Prefix to all server names + suffix: "", // Suffix to all server names }; diff --git a/lib/server.js b/lib/server.js index 9b4c013..c752e03 100644 --- a/lib/server.js +++ b/lib/server.js @@ -18,6 +18,18 @@ var queryTypes = { ofpresistance: 'operationflashpoint', }; +var createServerTitle = function(title) { + if (config.prefix) { + title = config.prefix + title; + } + + if (config.suffix) { + title = title + config.suffix; + } + + return title; +}; + var Server = function (path, type, options) { this.path = path; this.type = type; @@ -69,7 +81,7 @@ Server.prototype.start = function() { disableVoN: this.von ? 0 : 1, game: config.game, headlessClients: this.headless ? ["127.0.0.1"] : null, - hostname: this.title, + hostname: createServerTitle(this.title), localClient: this.headless ? ["127.0.0.1"] : null, mods: this.mods, password: this.password,