From 2368d8c47cc180c96b48530c76cdb7b1168235c6 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Tue, 12 Mar 2019 13:18:53 -0400 Subject: [PATCH 01/92] 4.3.3 --- CHANGELOG | 3 +++ bin/nodegame-installer.js | 2 +- package.json | 32 ++++++++++++++++---------------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6f96feb1..89ab75ca 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,9 @@ # current - Installer checks better for -v and -h options. +# 4.3.3 +- Updated package.json to fix the version numbers of v4 + # 4.3.2 - Re-enabled support for games without treatment description (bug introduced in 4.3.0) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index e555b0c6..22205b47 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -36,7 +36,7 @@ const MAIN_MODULE = 'nodegame'; // All stable versions. const STABLE_VERSIONS = [ '3.5.1', '4.0.0', '4.0.4', '4.1.5', - '4.2.0', '4.3.2' ]; + '4.2.0', '4.3.2', '4.3.3' ]; // Installer default version. const INSTALLER_VERSION = STABLE_VERSIONS[STABLE_VERSIONS.length-1]; diff --git a/package.json b/package.json index b7649b44..f982448e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "4.3.2", + "version": "4.3.3", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ @@ -18,23 +18,23 @@ "node": ">= 6.0.0" }, "dependencies": { - "commander": "*", - "fs-extra": "*", + "commander": "2.19.0", + "fs-extra": "7.0.1", "smoosh": "0.4.0", - "nodegame-server": "*", - "nodegame-client": "*", - "nodegame-window": "*", - "nodegame-widgets": "*", - "nodegame-requirements": "*", - "nodegame-game-template": "*", - "nodegame-monitor": "*", + "nodegame-server": "^4.2.2", + "nodegame-client": "^4.1.1", + "nodegame-window": "^4.0.0", + "nodegame-widgets": "^4.1.0", + "nodegame-requirements": "^4.0.0", + "nodegame-game-template": "^4.2.2", + "nodegame-monitor": "^4.1.0", + "nodegame-generator": "^4.2.1", + "nodegame-mturk": "^4.2.0", + "ultimatum-game": "^4.0.3", + "JSUS": "1.1.0", + "NDDB": "1.18.1", "nodegame-db": "*", - "nodegame-mongodb": "*", - "nodegame-generator": "*", - "nodegame-mturk": "*", - "JSUS": "*", - "NDDB": "*", - "ultimatum-game": "*" + "nodegame-mongodb": "*" }, "devDependencies": { "mocha": ">= 0.3.0", From 15b9ccd11345041b867750424f7f393129bc5f4a Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Fri, 15 Mar 2019 11:57:45 -0400 Subject: [PATCH 02/92] 5.0.1 --- CHANGELOG | 6 ++++++ bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ca3d5fb7..d63a52a1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,11 @@ # nodeGame Changelog +# 5.0.1 +- Minor update to installer. +- Fixed VisualTimer.restart bug introduced in v5. +- Server does not scan hidden folders inside the games directory. +- Generator does not allow to create games starting with a dot. + # 5.0.0 - Updated installer, now installing latest versions of v3, v4, v5. - Updated installer, checks for node_modules folder above the current folder. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 2f4d6c30..7648ebcc 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.0.0' + v5: '5.0.1' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index edf06b7f..60a6a8fc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.0.0", + "version": "5.0.1", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From a4bdf5d28c8931bf9e8661e804d62b162eda9c86 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Tue, 19 Mar 2019 17:25:36 -0400 Subject: [PATCH 03/92] put back node_modules checks --- bin/nodegame-installer.js | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 7648ebcc..db217ed1 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -1,7 +1,7 @@ #!/usr/local/bin/node /** * # nodeGame Installer - * Copyright(c) 2011-2018 Stefano Balietti + * Copyright(c) 2011-2019 Stefano Balietti * MIT Licensed * * http://www.nodegame.org @@ -237,6 +237,20 @@ else doInstall(); function doInstall() { var sp; + + // Check if a node_modules folder exists above or two folders above. + if (fs.existsSync(path.resolve('..', 'node_modules')) || + fs.existsSync(path.resolve('..', '..', 'node_modules'))) { + + log('Attention! A "node_modules" folder was detected in a ' + + 'parent directory.'); + log('Installation cannot continue. Please move the "node_modules" '); + log('folder or try to install nodeGame on another directory.'); + log(); + installationFailed(); + return; + } + // Create spinner. log('Downloading and installing nodeGame packages.'); @@ -266,7 +280,22 @@ function doInstall() { return; } else { - if (verbose) logList(stdout.trim()); + if (verbose) { + log(); + logList(stdout.trim()); + } + if (!fs.existsSync(path.resolve(NODE_MODULES_DIR))) { + log(); + log(); + log('Doh! It looks like npm has a different default ' + + 'installation folder.'); + log('This can happen if you have a directory called '+ + '"node_modules" in any of '); + log('the parent folders. Please try using a ' + + 'different path.'); + installationFailed(); + return; + } log(); log('Done! Now some final magic...'); try { From 63d69e026a4b991d34e069a0ed01df00c160536c Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Mon, 1 Apr 2019 11:47:40 -0400 Subject: [PATCH 04/92] installer help improved --- bin/nodegame-installer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index db217ed1..292c9653 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -60,7 +60,7 @@ else if (p === '--list-versions') { console.log(' List of stable versions:'); for (let i in STABLE_VERSIONS) { if (STABLE_VERSIONS.hasOwnProperty(i)) { - console.log(' - ' + i + ': ' + STABLE_VERSIONS[i]); + console.log(' @' + i + ': ' + STABLE_VERSIONS[i]); } } return; @@ -680,7 +680,7 @@ function installationFailed() { function printHelp() { log(); - log('@ Install a specific version (>=3.5.1)'); + log('@ Install a specific version (v3, v4, v5)'); log('@dev Install latest nodeGame from git repos'); log(' --branch Checkout this branch on all git repos'); log(' --ssh Use ssh to get all git repos'); From 3793ec9714180682e985765d203736694c661813 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Mon, 1 Apr 2019 14:12:16 -0400 Subject: [PATCH 05/92] 5.1.0 --- CHANGELOG | 5 +++++ bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d63a52a1..22ad28a4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ # nodeGame Changelog +# 5.1.0 +- Minor update to installer. +- Widgets: CustomInput, and garbage collection. +- Window and Client: check frame height automatically. + # 5.0.1 - Minor update to installer. - Fixed VisualTimer.restart bug introduced in v5. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 292c9653..f6bde3d3 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.0.1' + v5: '5.1.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index 60a6a8fc..38b17914 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.0.1", + "version": "5.1.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 90917017e2093dd38d627e16de2791dd29078c3e Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Tue, 2 Apr 2019 16:17:26 -0400 Subject: [PATCH 06/92] improved servernode conf file --- conf/servernode.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/servernode.js b/conf/servernode.js index 54ad0e89..a218413b 100644 --- a/conf/servernode.js +++ b/conf/servernode.js @@ -12,8 +12,9 @@ module.exports = configure; function configure(servernode) { // Extra configuration goes here, e.g.: // servernode.port = 80; + // servernode.homePage = false; - // Default configuration set already in: + // See the full set of configuration options in: // node_modules/nodegame-server/conf/servernode.js return true; From fdf79776cfe4c0f51b7933f4a104843be11bb532 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Tue, 2 Apr 2019 16:17:54 -0400 Subject: [PATCH 07/92] mods --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 22ad28a4..20a3e635 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# current +- Improved servernode.js conf file. + # 5.1.0 - Minor update to installer. - Widgets: CustomInput, and garbage collection. From 2e2bdf5f55c5470759a4944150fa4f3615a09ec7 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Fri, 5 Apr 2019 11:14:35 -0400 Subject: [PATCH 08/92] minor help launcher fix --- launcher.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher.js b/launcher.js index 01953274..ef051e7e 100644 --- a/launcher.js +++ b/launcher.js @@ -113,11 +113,11 @@ program '(overwrites settings.js in test/ folder') .option('-k, --killServer', 'Kill server after all phantoms have reached game over') - .option('-a --auth [option]', + .option('-a, --auth [option]', 'Phantoms pass through /auth/. Options: createNew|new|' + 'nextAvailable|next|code|id:code&pwd:password|file:path/to/file. ' + 'Default: "new".') - .option('-w --wait [milliseconds]', + .option('-w, --wait [milliseconds]', 'Waits before connecting the next phantom. Default: 1000') From 5490735efcbfe35f9e3dc1560b9470b25ab4b4bb Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 17 Apr 2019 16:09:30 -0400 Subject: [PATCH 09/92] merged --- launcher.js | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/launcher.js b/launcher.js index ef051e7e..884793db 100644 --- a/launcher.js +++ b/launcher.js @@ -1,6 +1,6 @@ /** * # Launcher file for nodeGame Server - * Copyright(c) 2011-2018 Stefano Balietti + * Copyright(c) 2011-2019 Stefano Balietti * MIT Licensed * * Load configuration options and start the server @@ -88,6 +88,8 @@ program 'Sets the configuration directory') .option('-l, --logDir ', 'Sets the log directory') + .option('-L, --logLevel ', + 'Sets the log level. Values: error(default)|warn|info|silly') .option('-g, --gamesDir ', 'Sets the games directory') .option('-d, --debug', @@ -98,6 +100,9 @@ program 'Rebuilds the specified components', list) .option('-s, --ssl [path-to-ssl-dir]', 'Starts the server with SSL encryption') + .option('-f, --default [channel]', + 'Sets the default channel') + // Connect phantoms. @@ -109,14 +114,13 @@ program .option('-t, --clientType ', 'Sets the client type of connecting phantoms (default: autoplay)') .option('-T, --runTests', - 'Run tests after all phantoms have reached game over ' + - '(overwrites settings.js in test/ folder') + 'Run tests after all phantoms are game-over ' + + '(overwrites settings.js in test/)') .option('-k, --killServer', - 'Kill server after all phantoms have reached game over') + 'Kill server after all phantoms are game-over') .option('-a, --auth [option]', - 'Phantoms pass through /auth/. Options: createNew|new|' + - 'nextAvailable|next|code|id:code&pwd:password|file:path/to/file. ' + - 'Default: "new".') + 'Phantoms auth options. Values: new(default)|createNew|' + + 'nextAvailable|next|code|id:code&pwd:password|file:path/to/file.') .option('-w, --wait [milliseconds]', 'Waits before connecting the next phantom. Default: 1000') @@ -246,6 +250,14 @@ else if ('string' === typeof program.ssl) { if (!options.ssl) return; } +if (program['default']) { + options.defaultChannel = program['default']; +} + +if (program.logLevel) { + options.logLevel = program.logLevel; +} + if (program.nClients) { if (!program.phantoms) ignoredOptions.push('--nClients'); else { From d54d1bb307d574ca02028b16a0a6cd2d58ee293f Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 17 Apr 2019 16:12:48 -0400 Subject: [PATCH 10/92] proper log levels --- launcher.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/launcher.js b/launcher.js index 884793db..9247bd9f 100644 --- a/launcher.js +++ b/launcher.js @@ -89,7 +89,8 @@ program .option('-l, --logDir ', 'Sets the log directory') .option('-L, --logLevel ', - 'Sets the log level. Values: error(default)|warn|info|silly') + 'Sets the log level. Values: error(default)|warn|info|' + + 'verbose|debug|silly') .option('-g, --gamesDir ', 'Sets the games directory') .option('-d, --debug', From 55fe1037eb0b85c521b3e04eafcca25f50119ac0 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Mon, 6 May 2019 10:02:00 -0400 Subject: [PATCH 11/92] installer improvements, specially to handle parent node_modules --- bin/nodegame-installer.js | 144 ++++++++++++++++++++++++++++++++------ 1 file changed, 124 insertions(+), 20 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index f6bde3d3..e595bf97 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.1.0' + v5: '5.3.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); @@ -47,6 +47,10 @@ const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); // Installer default version. const INSTALLER_VERSION = 'v5'; +// If node_modules folders are detected, their paths (without node_modules) +// is stored in here. +var parentNodeModules; + // The actual version being installed, user can change it. var version = STABLE_VERSIONS[INSTALLER_VERSION]; @@ -79,6 +83,7 @@ var doNotMoveInstall = false; var yes; var branch; var warnings; +var dry; // User requested version. var requestedVersion = '@' + version; @@ -123,6 +128,9 @@ for (let i = 0; i < process.argv.length; i++) { else if (option === '--ssh') { doSSH = true; } + else if (option === '--dry') { + dry = true; + } } if ((doSSH || branch) && !isDev) { @@ -177,6 +185,13 @@ const GAMES_AVAILABLE_DIR = path.resolve(INSTALL_DIR, 'games_available'); const GAMES_ENABLED_DIR = path.resolve(INSTALL_DIR, 'games'); +// Making sure we do not slip out on an exception. + +process.on('uncaughtException', function(err) { + warn('A generic error occurred during the installation:\n' + err.stack); + installationFailed(); +}); + // Printing Info. // Print cool nodegame logo. @@ -208,11 +223,11 @@ if (fs.existsSync(NODE_MODULES_DIR)) { nodeModulesExisting = true; warn('node_modules directory already existing.'); if (!yes) { - confirm(' Continue? [y/n] ', function(ok) { + confirm('Continue? [y/n] ', function(ok) { if (ok) { process.stdin.destroy(); log(); - doInstall(); + checkParentNodeModules(); } else { log('Installation aborted.'); @@ -228,32 +243,68 @@ if (fs.existsSync(NODE_MODULES_DIR)) { } // Install. -if (isDev) checkGitExists(doInstall); -else doInstall(); +if (isDev) checkGitExists(checkParentNodeModules); +else checkParentNodeModules(); // Helper functions. /////////////////////////////////////////////////////////////////////////////// +function checkParentNodeModules(cb) { + parentNodeModules = getParentNodeModules(); + + // Check if a node_modules folder exists in any folder from the one above. + // to top /. + + if (parentNodeModules.length) { + let str; + str = 'A "node_modules" folder was detected in '; + str += parentNodeModules.length === 1 ? 'this parent directory: ' : + ' these parent directories: '; + warn(str); + parentNodeModules.forEach(dir => logList(dir)); + log(); + + log('You should quit the installation and manually move the parent'); + log('"node_modules" folder/s, or install nodeGame on another path.'); + log(); + log('You may also try to continue the installation, but this is not'); + log('recommended if another live node process is running from those ' + + 'folders.'); + log(); + confirm('Continue? [y/n] ', function(ok) { + if (ok) { + let res = renameParentNodeModules(parentNodeModules); + if (res !== true) { + err('Could not rename ' + res[0]); + installationFailed(); + } + log(); + doInstall(); + } + else { + log('Installation aborted.'); + return; + } + }); + } + else { + doInstall(); + } +} + function doInstall() { var sp; + + // Create spinner. + log('Downloading and installing nodeGame packages.'); - // Check if a node_modules folder exists above or two folders above. - if (fs.existsSync(path.resolve('..', 'node_modules')) || - fs.existsSync(path.resolve('..', '..', 'node_modules'))) { - - log('Attention! A "node_modules" folder was detected in a ' + - 'parent directory.'); - log('Installation cannot continue. Please move the "node_modules" '); - log('folder or try to install nodeGame on another directory.'); + if (dry) { log(); - installationFailed(); + warn('Dry run: aborting.'); return; } - // Create spinner. - log('Downloading and installing nodeGame packages.'); - if (!noSpinner) { sp = new Spinner(' This might take a few minutes %s '); sp.start(); @@ -277,6 +328,7 @@ function doInstall() { log(); logList(stderr.trim()); log(); + installationFailed(); return; } else { @@ -299,7 +351,7 @@ function doInstall() { log(); log('Done! Now some final magic...'); try { - someMagic(); + someMagic(cb); } catch(e) { // execFile( @@ -434,7 +486,7 @@ function printFinalInfo() { } -function someMagic() { +function someMagic(cb) { let mainNgDir = path.resolve(NODE_MODULES_DIR, MAIN_MODULE); // Check if log and private directories have been created. @@ -467,6 +519,9 @@ function someMagic() { // Generator. fixGenerator(); + // Restore any parent node_modules folder that was renamed. + restoreParentNodeModules(); + // Print final Information. printFinalInfo(); }); @@ -478,6 +533,9 @@ function someMagic() { // Generator. fixGenerator(); + // Restore any parent node_modules folder that was renamed. + restoreParentNodeModules(); + // Print final Information. printFinalInfo(); } @@ -631,7 +689,7 @@ function confirm(msg, callback) { output: process.stdout }); - rl.question(msg, function(input) { + rl.question(' ' + msg, function(input) { rl.close(); callback(/^y|yes|ok|true$/i.test(input)); }); @@ -661,6 +719,48 @@ function removeDirRecursiveSync(dir) { } }; +function getParentNodeModules() { + let tks = ROOT_DIR.split(path.sep); + let found = []; + let dirPath = tks[0]; + for (let i = 0 ; i < (tks.length - 1) ; i++) { + if (i !== 0) dirPath = path.join(dirPath, tks[i]); + if (fs.existsSync(path.join(dirPath, 'node_modules'))) { + found.push(dirPath); + } + } + return found; +} + +function renameParentNodeModules(parents, restore) { + let out = []; + for (let i = 0; i < parents.length; i++) { + try { + let f1 = path.join(parents[i], 'node_modules'); + let f2 = f1 + '_backup'; + // Add _bak or remove _bak from parent node_modules folders. + if (restore) fs.renameSync(f2, f1); + else fs.renameSync(f1, f2); + } + catch(e) { + out.push(parents[i]); + // If we are not restoring original folders, exit immediately. + if (!restore) return(out); + } + } + return true; +} + +function restoreParentNodeModules() { + if (!parentNodeModules || !parentNodeModules.length) return; + let res = renameParentNodeModules(parentNodeModules, true); + if (res !== true) { + log(); + warn('Could not restore parent "node_modules" folder in: '); + res.forEach(dir => logList(dir)); + } +} + function installationFailed() { log(); @@ -675,6 +775,9 @@ function installationFailed() { 'https://github.com/nodeGame/nodegame/issues'); log(' - send an email to info@nodegame.org'); log(); + + // Restore any parent node_modules folder that was renamed. + restoreParentNodeModules(); } @@ -689,6 +792,7 @@ function printHelp() { log(' if equals to node_modules, the npm structure'); log(' stays unchanged'); log('--no-spinner Does not start the spinner'); + log('--dry Does not actually install anything'); log('--list-versions Lists stable versions'); log('--version Print installer version'); log('--help Print this help'); From 514ea5c7e0aa6a9b3d0d50503ec1048ac06a994c Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Mon, 6 May 2019 10:03:37 -0400 Subject: [PATCH 12/92] 5.3.0 --- CHANGELOG | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 20a3e635..1bc7f408 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,9 @@ # nodeGame Changelog -# current +# 5.3.0 - Improved servernode.js conf file. +- Improved installer: --dry option. +- Improved installer: better handling of parent node_modules folders. # 5.1.0 - Minor update to installer. diff --git a/package.json b/package.json index 38b17914..bbd0dc83 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.1.0", + "version": "5.3.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 9b88dfd1edd74092f3c5dfad18d4c547ac091d74 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Mon, 6 May 2019 10:24:21 -0400 Subject: [PATCH 13/92] fixes-to-installer --- bin/nodegame-installer.js | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index e595bf97..2a7fa822 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -51,6 +51,11 @@ const INSTALLER_VERSION = 'v5'; // is stored in here. var parentNodeModules; +var rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); + // The actual version being installed, user can change it. var version = STABLE_VERSIONS[INSTALLER_VERSION]; @@ -221,8 +226,9 @@ if (fs.existsSync(INSTALL_DIR)) { // Check if node_modules exists (prompt continue?) if (fs.existsSync(NODE_MODULES_DIR)) { nodeModulesExisting = true; - warn('node_modules directory already existing.'); + warn('A "node_modules" folder was detected in this directory.'); if (!yes) { + log(); confirm('Continue? [y/n] ', function(ok) { if (ok) { process.stdin.destroy(); @@ -230,7 +236,7 @@ if (fs.existsSync(NODE_MODULES_DIR)) { checkParentNodeModules(); } else { - log('Installation aborted.'); + installationAborted(); log(); } }) @@ -260,7 +266,7 @@ function checkParentNodeModules(cb) { let str; str = 'A "node_modules" folder was detected in '; str += parentNodeModules.length === 1 ? 'this parent directory: ' : - ' these parent directories: '; + 'these parent directories: '; warn(str); parentNodeModules.forEach(dir => logList(dir)); log(); @@ -283,7 +289,7 @@ function checkParentNodeModules(cb) { doInstall(); } else { - log('Installation aborted.'); + installationAborted(); return; } }); @@ -351,7 +357,7 @@ function doInstall() { log(); log('Done! Now some final magic...'); try { - someMagic(cb); + someMagic(); } catch(e) { // execFile( @@ -487,6 +493,8 @@ function printFinalInfo() { function someMagic(cb) { + rl.close(); + let mainNgDir = path.resolve(NODE_MODULES_DIR, MAIN_MODULE); // Check if log and private directories have been created. @@ -510,7 +518,7 @@ function someMagic(cb) { fs.rmdirSync(NODE_MODULES_DIR); } } - + if (isDev) { getAllGitModules(function() { // Move games from node_modules. @@ -684,13 +692,7 @@ function copyGameFromNodeModules(game, enable) { } function confirm(msg, callback) { - var rl = readline.createInterface({ - input: process.stdin, - output: process.stdout - }); - rl.question(' ' + msg, function(input) { - rl.close(); callback(/^y|yes|ok|true$/i.test(input)); }); } @@ -761,8 +763,15 @@ function restoreParentNodeModules() { } } -function installationFailed() { +function installationAborted() { + rl.close(); + log(); + log('Installation aborted.'); +} +function installationFailed() { + rl.close(); + log(); log('Installation did not complete successfully.'); From eb7bd291ebe84e23761e18bef2852dda567387cb Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Mon, 6 May 2019 18:17:29 -0400 Subject: [PATCH 14/92] fixed installer --- bin/nodegame-installer.js | 106 +++++++++++++++++++++++--------------- 1 file changed, 64 insertions(+), 42 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 2a7fa822..1a91dc12 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -193,7 +193,8 @@ const GAMES_ENABLED_DIR = path.resolve(INSTALL_DIR, 'games'); // Making sure we do not slip out on an exception. process.on('uncaughtException', function(err) { - warn('A generic error occurred during the installation:\n' + err.stack); + warn('A generic error occurred during the installation:\n'); + log(err.stack) installationFailed(); }); @@ -212,14 +213,14 @@ if (parseInt(nodeVersion[0], 10) < 4) { err('node version >= 4.x is required.\n' + 'Please upgrade your Node.Js installation, ' + 'visit: http://nodejs.org'); - log(); + installationAborted(); return; } // Check if install dir exists (abort). if (fs.existsSync(INSTALL_DIR)) { err('installation directory already existing.'); - log(); + installationAborted(); return; } @@ -227,16 +228,21 @@ if (fs.existsSync(INSTALL_DIR)) { if (fs.existsSync(NODE_MODULES_DIR)) { nodeModulesExisting = true; warn('A "node_modules" folder was detected in this directory.'); + log(); + log('If you continue, it will become a subfolder of the nodeGame '); + log('installation. This might affect live node processes, as well as '); + log('other Node.JS packages relying on this node_modules folder. If '); + log('unsure, choose No and try to install nodeGame on another path.'); if (!yes) { log(); - confirm('Continue? [y/n] ', function(ok) { + confirm('Continue? [y/n]', function(ok) { if (ok) { - process.stdin.destroy(); + log(); log(); checkParentNodeModules(); } else { - installationAborted(); + installationAborted(true); log(); } }) @@ -257,42 +263,47 @@ else checkParentNodeModules(); /////////////////////////////////////////////////////////////////////////////// function checkParentNodeModules(cb) { - parentNodeModules = getParentNodeModules(); + parentNodeModules = getParentNodeModules(); // Check if a node_modules folder exists in any folder from the one above. // to top /. - if (parentNodeModules.length) { let str; str = 'A "node_modules" folder was detected in '; - str += parentNodeModules.length === 1 ? 'this parent directory: ' : + str += parentNodeModules.length === 1 ? 'a parent directory: ' : 'these parent directories: '; warn(str); parentNodeModules.forEach(dir => logList(dir)); log(); - - log('You should quit the installation and manually move the parent'); - log('"node_modules" folder/s, or install nodeGame on another path.'); - log(); - log('You may also try to continue the installation, but this is not'); - log('recommended if another live node process is running from those ' + - 'folders.'); + + str = 'If you continue, ' + (parentNodeModules.length === 1 ? + 'that folder' : 'those folders'); + log(str + ' will be temporarily renamed. This'); + log('might affect only live node processes. If unsure, choose No '); + log('and try to install nodeGame on another path.'); log(); - confirm('Continue? [y/n] ', function(ok) { - if (ok) { - let res = renameParentNodeModules(parentNodeModules); - if (res !== true) { - err('Could not rename ' + res[0]); - installationFailed(); + if (!yes) { + confirm('Continue? [y/n]', function(ok) { + if (ok) { + log(); + let res = renameParentNodeModules(parentNodeModules); + if (res !== true) { + err('Could not rename ' + res[0]); + installationFailed(); + } + log(); + doInstall(); } - log(); - doInstall(); - } - else { - installationAborted(); - return; - } - }); + else { + installationAborted(true); + return; + } + }); + } + else { + log('Continue? [y/n] --yes'); + log(); + } } else { doInstall(); @@ -301,13 +312,14 @@ function checkParentNodeModules(cb) { function doInstall() { var sp; - + // Create spinner. log('Downloading and installing nodeGame packages.'); if (dry) { log(); warn('Dry run: aborting.'); + closeRL(2); return; } @@ -391,6 +403,7 @@ function doInstall() { return; } } + return; }); } @@ -491,10 +504,14 @@ function printFinalInfo() { log(); } - -function someMagic(cb) { +function closeRL(code) { + // rl.clearLine(); rl.close(); + // if (force) process.stdin.destroy(); + process.exit(code); +} +function someMagic(cb) { let mainNgDir = path.resolve(NODE_MODULES_DIR, MAIN_MODULE); // Check if log and private directories have been created. @@ -518,7 +535,7 @@ function someMagic(cb) { fs.rmdirSync(NODE_MODULES_DIR); } } - + if (isDev) { getAllGitModules(function() { // Move games from node_modules. @@ -532,6 +549,8 @@ function someMagic(cb) { // Print final Information. printFinalInfo(); + + closeRL(0); }); } else { @@ -543,9 +562,11 @@ function someMagic(cb) { // Restore any parent node_modules folder that was renamed. restoreParentNodeModules(); - + // Print final Information. printFinalInfo(); + + closeRL(0); } } @@ -692,7 +713,7 @@ function copyGameFromNodeModules(game, enable) { } function confirm(msg, callback) { - rl.question(' ' + msg, function(input) { + rl.question(' ' + msg + ' ', function(input) { callback(/^y|yes|ok|true$/i.test(input)); }); } @@ -754,7 +775,7 @@ function renameParentNodeModules(parents, restore) { } function restoreParentNodeModules() { - if (!parentNodeModules || !parentNodeModules.length) return; + if (!parentNodeModules || !parentNodeModules.length) return; let res = renameParentNodeModules(parentNodeModules, true); if (res !== true) { log(); @@ -763,15 +784,15 @@ function restoreParentNodeModules() { } } -function installationAborted() { - rl.close(); +function installationAborted(byUser) { + let str = 'Installation aborted' + (byUser ? ' by user.' : '.'); log(); - log('Installation aborted.'); + log(str); + closeRL(1); + return; } function installationFailed() { - rl.close(); - log(); log('Installation did not complete successfully.'); @@ -787,6 +808,7 @@ function installationFailed() { // Restore any parent node_modules folder that was renamed. restoreParentNodeModules(); + closeRL(1); } From e5e1eb5d69db7392ce893d187004e92292b21b3d Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Tue, 7 May 2019 03:44:19 -0400 Subject: [PATCH 15/92] 5.3.1 --- CHANGELOG | 3 +++ bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1bc7f408..79ba7610 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 5.3.1 +- Minor fixes to installer. + # 5.3.0 - Improved servernode.js conf file. - Improved installer: --dry option. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 1a91dc12..b4c6d005 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.3.0' + v5: '5.3.1' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index bbd0dc83..890be0ad 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.3.0", + "version": "5.3.1", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From ce7f5262fabcb98f171811e66e3f097bedcaf989 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Sun, 12 May 2019 09:15:10 -0400 Subject: [PATCH 16/92] updated installer 5.4.0 --- bin/nodegame-installer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index b4c6d005..6a8e6eb7 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.3.1' + v5: '5.4.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); From 3b07b2a3bb5dba050899441fcb9084020abf4333 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Mon, 13 May 2019 07:29:21 -0400 Subject: [PATCH 17/92] 5.4.0 --- CHANGELOG | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 79ba7610..3cfc7ad1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 5.4.0 +- New release, updated server, widgets, window. + # 5.3.1 - Minor fixes to installer. diff --git a/package.json b/package.json index 890be0ad..9563b27d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.3.1", + "version": "5.4.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 12c8b130a3d7491431d2492e09613b9838f378f2 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Sun, 15 Dec 2019 00:20:33 +0100 Subject: [PATCH 18/92] 5.6.0 --- CHANGELOG | 3 +++ bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3cfc7ad1..f5382ca2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 5.6.0 +- New release, updated installer. + # 5.4.0 - New release, updated server, widgets, window. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 6a8e6eb7..237d14dc 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.4.0' + v5: '5.6.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index 9563b27d..85d17e8b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.4.0", + "version": "5.6.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 3ff4826c17154e5991ccf1742f54450d82a1ebd1 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Fri, 20 Dec 2019 14:55:09 +0100 Subject: [PATCH 19/92] 5.6.1 --- bin/nodegame-installer.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 237d14dc..77fa6014 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.6.0' + v5: '5.6.1' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index 85d17e8b..6d7896a4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.6.0", + "version": "5.6.1", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From eec33e793060e06a24c7e1e99114514c71802c08 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 9 Jan 2020 23:38:13 +0100 Subject: [PATCH 20/92] 5.6.2 --- CHANGELOG | 4 ++-- bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f5382ca2..8aa627b1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,12 +1,12 @@ # nodeGame Changelog -# 5.6.0 +# 5.6.0..2 - New release, updated installer. # 5.4.0 - New release, updated server, widgets, window. -# 5.3.1 +:# 5.3.1 - Minor fixes to installer. # 5.3.0 diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 77fa6014..b228be45 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.6.1' + v5: '5.6.2' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index 6d7896a4..f0614279 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.6.1", + "version": "5.6.2", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 78e2d490141f9dee4cdc271595c23fdd86d5f51c Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Fri, 10 Jan 2020 22:23:05 +0100 Subject: [PATCH 21/92] 5.6.3 --- CHANGELOG | 2 +- bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8aa627b1..73b298ad 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # nodeGame Changelog -# 5.6.0..2 +# 5.6.0-3 - New release, updated installer. # 5.4.0 diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index b228be45..f4d925c5 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.6.2' + v5: '5.6.3' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index f0614279..ef73cab5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.6.2", + "version": "5.6.3", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From c4f0afc0a979fbfabd3fe1b29032164b71c41f0d Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 16 Jan 2020 14:57:00 +0100 Subject: [PATCH 22/92] 5.6.4 --- CHANGELOG | 2 +- bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 73b298ad..a2c4bbaf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # nodeGame Changelog -# 5.6.0-3 +# 5.6.0-4 - New release, updated installer. # 5.4.0 diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index f4d925c5..1e8b92e8 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.6.3' + v5: '5.6.4' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index ef73cab5..d57a9a78 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.6.3", + "version": "5.6.4", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 987093ab446936ffd44a0e8b83593b18d3b86b52 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Fri, 17 Jan 2020 12:46:25 +0100 Subject: [PATCH 23/92] 5.6.5 --- CHANGELOG | 2 +- bin/nodegame-installer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a2c4bbaf..802298f3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # nodeGame Changelog -# 5.6.0-4 +# 5.6.0-5 - New release, updated installer. # 5.4.0 diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 1e8b92e8..47ad970f 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.6.4' + v5: '5.6.5' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); From cacd880f0702bf198bdabd3b2b057d05ac6147e8 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Fri, 17 Jan 2020 12:46:56 +0100 Subject: [PATCH 24/92] 5.6.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d57a9a78..0b6773a2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.6.4", + "version": "5.6.5", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From aa7b3bdcc9d767b010660b10c701d797195fd4c0 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Fri, 17 Jan 2020 12:49:41 +0100 Subject: [PATCH 25/92] 5.7.0 --- CHANGELOG | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 802298f3..5b9a6f5b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 5.7.0 +- GameRoom.computeBonus handles disconnected players in dump file. + # 5.6.0-5 - New release, updated installer. diff --git a/package.json b/package.json index 0b6773a2..ab87b7b6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.6.5", + "version": "5.7.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From eb65e403f0f4e637cf21eace529a7a9dc06830ef Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Fri, 17 Jan 2020 12:50:24 +0100 Subject: [PATCH 26/92] updated installer --- bin/nodegame-installer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 47ad970f..e730a7ed 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.6.5' + v5: '5.7.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); From ba7cb264ca4445da76fec544a7dfca0da748bb4d Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Tue, 21 Jan 2020 13:47:24 +0100 Subject: [PATCH 27/92] 5.8.0 --- CHANGELOG | 3 +++ bin/nodegame-installer.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 5b9a6f5b..98434e96 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 5.8.0 +- Game.stepBack. + # 5.7.0 - GameRoom.computeBonus handles disconnected players in dump file. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index e730a7ed..dfa445b4 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.7.0' + v5: '5.8.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); From ccfa36508c6ee603044abc79f35de0809be17570 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Tue, 21 Jan 2020 13:47:54 +0100 Subject: [PATCH 28/92] 5.8.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ab87b7b6..940387fd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.7.0", + "version": "5.8.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From e30df1239ad44d9c6136772001fdb1ef54ae68aa Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 29 Jan 2020 23:57:48 +0100 Subject: [PATCH 29/92] 5.8.1 --- CHANGELOG | 3 +++ bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 98434e96..fc9f64ce 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 5.8.1 +- New release, updated installer. + # 5.8.0 - Game.stepBack. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index dfa445b4..403109d9 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.8.0' + v5: '5.8.1' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index 940387fd..14db3967 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.8.0", + "version": "5.8.1", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From a584e6c0da3a1b64b3f804eb9cffcdfcb4af57c4 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Tue, 31 Mar 2020 18:59:44 +0200 Subject: [PATCH 30/92] 5.9.0 --- CHANGELOG | 3 +++ bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index fc9f64ce..e0913c67 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 5.9.0 +- New release, updated installer. + # 5.8.1 - New release, updated installer. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 403109d9..639a9397 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.8.1' + v5: '5.9.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index 14db3967..7b52c44d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.8.1", + "version": "5.9.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 4d712351c2788a9265d104d7d9dc6016e6097d38 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 1 Apr 2020 17:29:03 +0200 Subject: [PATCH 31/92] Better node_modules parent dir check with --yes option, option --no-parent-dir-check to skip it --- bin/nodegame-installer.js | 46 +++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 639a9397..ebe57d3d 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -86,6 +86,7 @@ var doSSH = false; var noSpinner = false; var doNotMoveInstall = false; var yes; +var noParentDirCheck; var branch; var warnings; var dry; @@ -121,6 +122,9 @@ for (let i = 0; i < process.argv.length; i++) { else if (option === '--yes') { yes = true; } + else if (option === '--no-parent-dir-check') { + noParentDirCheck = true; + } else if (option === '--branch') { branch = process.argv[i+1]; if (!branch) { @@ -267,7 +271,7 @@ function checkParentNodeModules(cb) { // Check if a node_modules folder exists in any folder from the one above. // to top /. - if (parentNodeModules.length) { + if (!noParentDirCheck && parentNodeModules.length) { let str; str = 'A "node_modules" folder was detected in '; str += parentNodeModules.length === 1 ? 'a parent directory: ' : @@ -283,26 +287,12 @@ function checkParentNodeModules(cb) { log('and try to install nodeGame on another path.'); log(); if (!yes) { - confirm('Continue? [y/n]', function(ok) { - if (ok) { - log(); - let res = renameParentNodeModules(parentNodeModules); - if (res !== true) { - err('Could not rename ' + res[0]); - installationFailed(); - } - log(); - doInstall(); - } - else { - installationAborted(true); - return; - } - }); + confirm('Continue? [y/n]', renameParentCb); } else { log('Continue? [y/n] --yes'); log(); + renameParentCb(true); } } else { @@ -712,9 +702,9 @@ function copyGameFromNodeModules(game, enable) { makeLink(gameDir, path.resolve(GAMES_ENABLED_DIR, game)); } -function confirm(msg, callback) { +function confirm(msg, callback, ...params) { rl.question(' ' + msg + ' ', function(input) { - callback(/^y|yes|ok|true$/i.test(input)); + callback(/^y|yes|ok|true$/i.test(input, ...params)); }); } @@ -755,6 +745,24 @@ function getParentNodeModules() { return found; } +// Need this wrapper because --yes option +function renameParentCb(ok) { + if (ok) { + log(); + let res = renameParentNodeModules(parentNodeModules); + if (res !== true) { + err('Could not rename "node_modules" folder in: ' + res[0]); + installationFailed(); + } + log(); + doInstall(); + } + else { + installationAborted(true); + return; + } +} + function renameParentNodeModules(parents, restore) { let out = []; for (let i = 0; i < parents.length; i++) { From 8af46d10861e74f6e005a9594720d15102fcac4d Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 29 Apr 2020 15:35:48 +0200 Subject: [PATCH 32/92] minor --- bin/nodegame-installer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index ebe57d3d..d15c276c 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -426,7 +426,7 @@ function printNodeGameInfo() { log(); log('creator: Stefano Balietti'); - log('website: http://nodegame.org'); + log('website: https://nodegame.org'); log('license: MIT'); log('mail: info@nodegame.org'); log('twitter: @nodegameorg'); From 894e2fa86bae0c51121d714bf0ceb84cc01c2562 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 29 Apr 2020 16:39:40 +0200 Subject: [PATCH 33/92] pull-all --- bin/legacy/pull-all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/legacy/pull-all.sh b/bin/legacy/pull-all.sh index 0fc564cc..816f4a64 100755 --- a/bin/legacy/pull-all.sh +++ b/bin/legacy/pull-all.sh @@ -10,7 +10,7 @@ echo_and_pull() { GAMES=(ultimatum) MODULES=(nodegame-client nodegame-server nodegame-window nodegame-widgets nodegame-requirements nodegame-game-template nodegame-monitor JSUS NDDB - shelf.js descil-mturk nodegame-db nodegame-mongodb nodegame-generator) + nodegame-db nodegame-mongodb nodegame-generator nodegame-mturk) # Change the current working directory to the parent directory of the script, # i.e. the nodegame directory. Using the below command instead of simply From 819566b385e03c5f837a4cb2a7d7d4e90c4de279 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 29 Apr 2020 17:33:53 +0200 Subject: [PATCH 34/92] pull-all --- bin/legacy/pull-all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/legacy/pull-all.sh b/bin/legacy/pull-all.sh index 816f4a64..5d1afd30 100755 --- a/bin/legacy/pull-all.sh +++ b/bin/legacy/pull-all.sh @@ -15,7 +15,7 @@ MODULES=(nodegame-client nodegame-server nodegame-window nodegame-widgets # Change the current working directory to the parent directory of the script, # i.e. the nodegame directory. Using the below command instead of simply # "cd .." makes sure that it does not matter from where the script is executed -cd "$(dirname "${BASH_SOURCE[0]}")/.." +# cd "$(dirname "${BASH_SOURCE[0]}")/.." echo_and_pull nodegame From 6c6c08fef30021d790b1012c378ad22f6b3c34a8 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Fri, 19 Jun 2020 15:52:18 +0200 Subject: [PATCH 35/92] fixed problem with some default parameters passed to servernode --- launcher.js | 94 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 40 deletions(-) diff --git a/launcher.js b/launcher.js index 9247bd9f..9cfa710a 100644 --- a/launcher.js +++ b/launcher.js @@ -1,6 +1,6 @@ /** * # Launcher file for nodeGame Server - * Copyright(c) 2011-2019 Stefano Balietti + * Copyright(c) 2011-2020 Stefano Balietti * MIT Licensed * * Load configuration options and start the server @@ -64,8 +64,8 @@ confFile = null; confDir = './conf'; logDir = './log'; gamesDir = './games'; -debug = false; -infoQuery = false; +debug = undefined; +infoQuery = undefined; nClients = 4; clientType = 'autoplay'; @@ -89,13 +89,12 @@ program .option('-l, --logDir ', 'Sets the log directory') .option('-L, --logLevel ', - 'Sets the log level. Values: error(default)|warn|info|' + - 'verbose|debug|silly') + 'Sets the log level. Values: error(default)|warn|info|silly') .option('-g, --gamesDir ', 'Sets the games directory') .option('-d, --debug', 'Enables the debug mode') - .option('-i, --infoQuery', + .option('-i, --infoQuery [false]', 'Enables getting information via query-string ?q=') .option('-b, --build [components]', 'Rebuilds the specified components', list) @@ -119,10 +118,10 @@ program '(overwrites settings.js in test/)') .option('-k, --killServer', 'Kill server after all phantoms are game-over') - .option('-a, --auth [option]', + .option('-a --auth [option]', 'Phantoms auth options. Values: new(default)|createNew|' + 'nextAvailable|next|code|id:code&pwd:password|file:path/to/file.') - .option('-w, --wait [milliseconds]', + .option('-w --wait [milliseconds]', 'Waits before connecting the next phantom. Default: 1000') @@ -160,36 +159,41 @@ else { // Adds a new game directory (Default is nodegame-server/games). servernode.gamesDirs.push(gamesDir); - // Sets the debug mode, exceptions will be thrown. - servernode.debug = debug; - // Can get information from /?q= - servernode.enableInfoQuery = infoQuery; + + // Sets the debug mode, exceptions will be thrown, if TRUE. + if ('undefined' !== typeof debug) { + servernode.debug = debug; + } + // Can get information from /?q=, if TRUE + if ('undefined' !== typeof infoQuery) { + servernode.enableInfoQuery = infoQuery; + } // Basepath (without trailing slash). // servernode.basepath = '/mybasepath'; return true; }, - http: function(http) { - // Special configuration for Express goes here. - return true; - }, - sio: function(sio) { - // Special configuration for Socket.Io goes here here. - // Might not work in Socket.IO 1.x (check). - - // sio.set('transports', ['xhr-polling']); - // sio.set('transports', ['jsonp-polling']); - - // sio.set('transports', [ - // 'websocket' - // , 'flashsocket' - // , 'htmlfile' - // , 'xhr-polling' - // , 'jsonp-polling' - // ]); - - return true; - } + // http: function(http) { + // // Special configuration for Express goes here. + // return true; + // }, + // sio: function(sio) { + // // Special configuration for Socket.Io goes here here. + // // Might not work in Socket.IO 1.x (check). + // + // // sio.set('transports', ['xhr-polling']); + // // sio.set('transports', ['jsonp-polling']); + // + // // sio.set('transports', [ + // // 'websocket' + // // , 'flashsocket' + // // , 'htmlfile' + // // , 'xhr-polling' + // // , 'jsonp-polling' + // // ]); + // + // return true; + // } }; // Validate other options. @@ -212,7 +216,17 @@ else { gamesDir = program.gamesDir; } if (program.debug) debug = true; - if (program.infoQuery) infoQuery = true; + + // Parse infoQuery. + if (program.infoQuery) { + if ('boolean' === typeof program.infoQuery) { + infoQuery = program.infoQuery; + } + else { + let i = program.infoQuery.toLowerCase(); + infoQuery = i === 'f' || i === 'false' || i === '0' ? false : true; + } + } } // Validate general options. @@ -375,10 +389,10 @@ if (program.build) { cssOnly = true; } } - + info = J.resolveModuleDir('nodegame-server', __dirname); info = require(path.resolve(info, 'bin', 'info.js')); - + if (!cssOnly) { out = 'nodegame-full.js'; @@ -390,7 +404,7 @@ if (program.build) { NDDB: 'NDDB', css: 'css' }; - + // Starting build. i = -1, len = program.build.length; for ( ; ++i < len ; ) { @@ -427,7 +441,7 @@ if (program.build) { console.log(info.serverDir.build + out + ' rebuilt.'); console.log(''); } - + if (cssAlso || cssOnly) { info.build.css(info.serverDir.css, function(err) { if (!err) { @@ -519,7 +533,7 @@ function startServer() { }; } - + startPhantom = function(i) { var str, config; str = 'Connecting phantom #' + (i+1) + '/' + nClients; @@ -554,7 +568,7 @@ function startServer() { phantoms = [], numFinished = 0; for (i = 0; i < nClients; ++i) { if (i > 0 && wait) { - (function(i) { + (function(i) { setTimeout(function() { startPhantom(i); }, wait * i); })(i); } From 33bedd5f939fcb9a7908229869a81b818bd02753 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 13 Aug 2020 13:29:44 +0200 Subject: [PATCH 36/92] 5.10.0 --- CHANGELOG | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index e0913c67..ed43fe00 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 5.10.0 +- New release, updated installer. + # 5.9.0 - New release, updated installer. diff --git a/package.json b/package.json index 7b52c44d..fb093aa3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.9.0", + "version": "5.10.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 557c465e71db0f4084949eff64fabcf5e50aa4c1 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 13 Aug 2020 13:32:33 +0200 Subject: [PATCH 37/92] 5.10.1 --- CHANGELOG | 3 +++ bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ed43fe00..f57138e5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 5.10.1 +- Now really updated installer, as claimed in 5.10.0 + # 5.10.0 - New release, updated installer. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index d15c276c..0cdaccf1 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.9.0' + v5: '5.10.1' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index fb093aa3..a882d446 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.10.0", + "version": "5.10.1", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From da5808a6ba6ab079bd586f7a4ae85fba9d24b275 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 20 Aug 2020 10:41:03 +0200 Subject: [PATCH 38/92] 5.11.0 --- CHANGELOG | 3 +++ bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f57138e5..eb92c925 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 5.11.0 +- Small update to client and bug fixes. + # 5.10.1 - Now really updated installer, as claimed in 5.10.0 diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 0cdaccf1..010df6a7 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -39,7 +39,7 @@ const MAIN_MODULE = 'nodegame'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.10.1' + v5: '5.11.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index a882d446..8181462f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.10.1", + "version": "5.11.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From f7b824b60f3b1f64a1bf22e998baba8b274b445b Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 16 Sep 2020 11:14:31 +0200 Subject: [PATCH 39/92] option --port in launcher --- CHANGELOG | 3 +++ launcher.js | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index eb92c925..fb0b1627 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 5.12.0 current +- Option --port to specify the port of the server in launcher. + # 5.11.0 - Small update to client and bug fixes. diff --git a/launcher.js b/launcher.js index 9cfa710a..073d845b 100644 --- a/launcher.js +++ b/launcher.js @@ -38,7 +38,7 @@ var confFile; // Other local options. var confDir, logDir, gamesDir, debug, infoQuery, runTests; -var nClients, clientType, killServer, auth, wait; +var nClients, clientType, killServer, auth, wait, port; var codesDb; var cert, key; @@ -102,6 +102,8 @@ program 'Starts the server with SSL encryption') .option('-f, --default [channel]', 'Sets the default channel') + .option('-P, --port [port]', + 'Sets the port of the server') @@ -269,6 +271,15 @@ if (program['default']) { options.defaultChannel = program['default']; } +if (program.port) { + port = J.isInt(program.port, 0); + if (!port) { + return printErr('--port ' + program.port + + ' is not a positive number.'); + } + options.port = port; +} + if (program.logLevel) { options.logLevel = program.logLevel; } From 55bfe74b49cc64e62f58efdb1329c15b70e3c467 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 21 Oct 2020 23:41:15 +0200 Subject: [PATCH 40/92] 6.0.0 --- CHANGELOG | 2 +- bin/nodegame-installer.js | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index fb0b1627..2e8b124e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # nodeGame Changelog -# 5.12.0 current +# 6.0.0 - Option --port to specify the port of the server in launcher. # 5.11.0 diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 010df6a7..75a33a8f 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -1,7 +1,7 @@ #!/usr/local/bin/node /** * # nodeGame Installer - * Copyright(c) 2011-2019 Stefano Balietti + * Copyright(c) 2011-2020 Stefano Balietti * MIT Licensed * * http://www.nodegame.org @@ -32,20 +32,22 @@ const warn = txt => { console.error(' Warning: ' + txt); }; -const MAIN_MODULE = 'nodegame'; +// const MAIN_MODULE = 'nodegame'; +const MAIN_MODULE = 'nodegame-test'; // All stable versions. // Versions below < 3 are not available. const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.11.0' + v5: '5.11.0', + v6: '6.0.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); // Installer default version. -const INSTALLER_VERSION = 'v5'; +const INSTALLER_VERSION = 'v6'; // If node_modules folders are detected, their paths (without node_modules) // is stored in here. From 1a8692c5a6fc7427b5d25ff5d8c111cdfbf4219e Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 28 Oct 2020 23:55:36 +0100 Subject: [PATCH 41/92] minor --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 8181462f..1736b11c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.11.0", + "version": "5.11.1", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ @@ -26,7 +26,6 @@ "nodegame-game-template": "^5.0.0", "nodegame-monitor": "^5.0.0", "nodegame-generator": "^5.0.0", - "nodegame-mturk": "^5.0.0", "ultimatum-game": "^5.0.0", "JSUS": ">= 1.1.0", "NDDB": ">= 1.18.1", From b070869c8280eb4ffaec940588cc479be94b24a6 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 29 Oct 2020 00:04:39 +0100 Subject: [PATCH 42/92] 5.12.2 (fixing version numbers for 5) --- CHANGELOG | 3 +++ package.json | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2e8b124e..5b2c4b9e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,9 @@ # 6.0.0 - Option --port to specify the port of the server in launcher. +# 5.11.2 +- Fixing version numbers. + # 5.11.0 - Small update to client and bug fixes. diff --git a/package.json b/package.json index 1736b11c..ab8794fe 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.11.1", + "version": "5.11.2", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ @@ -27,8 +27,9 @@ "nodegame-monitor": "^5.0.0", "nodegame-generator": "^5.0.0", "ultimatum-game": "^5.0.0", - "JSUS": ">= 1.1.0", - "NDDB": ">= 1.18.1", + "nodegame-mturk": "^5.0.0", + "JSUS": "^1.1.0", + "NDDB": "^1.18.1", "nodegame-db": "*", "nodegame-mongodb": "*", "commander": "*", From f8798b3a3514eebca908da17efd36e1de09d26d8 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 29 Oct 2020 00:17:23 +0100 Subject: [PATCH 43/92] minor --- bin/nodegame-installer.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 75a33a8f..4c26d3d8 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -40,7 +40,7 @@ const MAIN_MODULE = 'nodegame-test'; const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', - v5: '5.11.0', + v5: '5.11.2', v6: '6.0.0' }; diff --git a/package.json b/package.json index ab8794fe..7beaacae 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "5.11.2", + "version": "6.0.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 7616fb10f3f74118c4ec92b8d048b2bc24ae42f3 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 29 Oct 2020 00:23:22 +0100 Subject: [PATCH 44/92] updated package.json dependencies --- package.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 7beaacae..a3168437 100644 --- a/package.json +++ b/package.json @@ -18,18 +18,18 @@ "node": ">= 6.0.0" }, "dependencies": { - "nodegame-server": "^5.0.0", - "nodegame-client": "^5.0.0", - "nodegame-window": "^5.0.0", - "nodegame-widgets": "^5.0.0", - "nodegame-requirements": "^5.0.0", - "nodegame-game-template": "^5.0.0", - "nodegame-monitor": "^5.0.0", - "nodegame-generator": "^5.0.0", - "ultimatum-game": "^5.0.0", - "nodegame-mturk": "^5.0.0", + "nodegame-server": "^6.0.0", + "nodegame-client": "^6.0.0", + "nodegame-window": "^6.0.0", + "nodegame-widgets": "^6.0.0", + "nodegame-requirements": "^6.0.0", + "nodegame-game-template": "^6.0.0", + "nodegame-monitor": "^6.0.0", + "nodegame-generator": "^6.0.0", + "ultimatum-game": "^6.0.0", + "nodegame-mturk": "^6.0.0", "JSUS": "^1.1.0", - "NDDB": "^1.18.1", + "NDDB": "^2.0.0", "nodegame-db": "*", "nodegame-mongodb": "*", "commander": "*", From b06ba2c2f8ef1204e1cb820884fcf0a2f845e63c Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 29 Oct 2020 00:37:17 +0100 Subject: [PATCH 45/92] 6.0.1 --- CHANGELOG | 3 +++ bin/nodegame-installer.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5b2c4b9e..a3d9da4a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 6.0.1 +- Updated server. + # 6.0.0 - Option --port to specify the port of the server in launcher. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 4c26d3d8..b6805ec6 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -33,7 +33,7 @@ const warn = txt => { }; // const MAIN_MODULE = 'nodegame'; -const MAIN_MODULE = 'nodegame-test'; +const MAIN_MODULE = 'nodegame'; // All stable versions. // Versions below < 3 are not available. @@ -41,7 +41,7 @@ const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', v5: '5.11.2', - v6: '6.0.0' + v6: '6.0.1' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); From 919f69a257e12c17332ee88680dc3e422421a6f5 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 29 Oct 2020 00:46:38 +0100 Subject: [PATCH 46/92] 6.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3168437..c1336b71 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "6.0.0", + "version": "6.0.1", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From f6c51939b628999ae7be86ee1d82729b4cbc8d71 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 29 Oct 2020 10:26:19 +0100 Subject: [PATCH 47/92] 6.0.2 --- CHANGELOG | 4 ++++ bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a3d9da4a..a3083779 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # nodeGame Changelog +# 6.0.2 +- Fixed bug create-game missing private folder in stable version (thanks +jjensenius3). + # 6.0.1 - Updated server. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index b6805ec6..38626632 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -41,7 +41,7 @@ const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', v5: '5.11.2', - v6: '6.0.1' + v6: '6.0.2' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index c1336b71..b8be12a5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "6.0.1", + "version": "6.0.2", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 2426551dcb6dcbf0f3812493f25cffa2d00c3c5a Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Fri, 30 Oct 2020 16:07:46 +0100 Subject: [PATCH 48/92] 6.0.3 --- CHANGELOG | 3 +++ bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a3083779..9e6ec3fa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 6.0.3 +- Fixed corrupted build in 6.0.2 (thanks jjensenius3). + # 6.0.2 - Fixed bug create-game missing private folder in stable version (thanks jjensenius3). diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 38626632..8b56f3ee 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -41,7 +41,7 @@ const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', v5: '5.11.2', - v6: '6.0.2' + v6: '6.0.3' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index b8be12a5..2a8be7b5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "6.0.2", + "version": "6.0.3", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From d4a612cdb12f4f627abf3ea7ee4ffa0f7cf2d145 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 23 Dec 2020 00:46:46 +0100 Subject: [PATCH 49/92] minor in conf --- conf/http.js | 7 ++-- conf/loggers.js | 94 ++++++++++++++++++++++++++-------------------- conf/servernode.js | 9 +++-- conf/sio.js | 7 ++-- 4 files changed, 67 insertions(+), 50 deletions(-) diff --git a/conf/http.js b/conf/http.js index 5f5f9c17..c2e17367 100644 --- a/conf/http.js +++ b/conf/http.js @@ -1,7 +1,7 @@ /** * # http.js * - * Copyright(c) 2013 Stefano Balietti + * Copyright(c) 2020 Stefano Balietti * MIT Licensed * * Configuration file for ServerNode in nodegame-server. @@ -10,8 +10,9 @@ module.exports = configure; function configure(app, servernode) { - // Nothing extra to configure. - // Default configuration set already in: + + // Edit this file to modify the default configuration options in: // node_modules/nodegame-server/conf/http.js + return true; }; diff --git a/conf/loggers.js b/conf/loggers.js index 3d1e7eac..472aa322 100644 --- a/conf/loggers.js +++ b/conf/loggers.js @@ -1,46 +1,60 @@ +/** + * # servernode.js + * + * Copyright(c) 2020 Stefano Balietti + * MIT Licensed + * + * Configuration file for ServerNode in nodegame-server. + * --- + */ module.exports = configure; -var path = require('path'); +const path = require('path'); -function configure (loggers) { +function configure(loggers) { -// var config = { -// levels: { -// silly: 0, -// verbose: 1, -// info: 2, -// data: 3, -// warn: 4, -// debug: 5, -// error: 6 -// }, -// colors: { -// silly: 'magenta', -// verbose: 'cyan', -// info: 'green', -// data: 'grey', -// warn: 'yellow', -// debug: 'blue', -// error: 'red' -// } -// }; + // Edit this file to modify the default configuration options in: + // node_modules/nodegame-server/conf/loggers.js -// var rootDir = path.resolve(__dirname, '..'); -// var logDir = rootDir + '/log/'; -// -// loggers.add('ultimatumchannel', { -// console: { -// level: 'silly', -// colorize: true, -// }, -// file: { -// level: 'silly', -// timestamp: true, -// filename: logDir + 'channel', -// maxsize: 1000, -// maxFiles: 10, -// }, -// }); -// - return true; + // For instance: + + // let config = { + // levels: { + // silly: 0, + // verbose: 1, + // info: 2, + // data: 3, + // warn: 4, + // debug: 5, + // error: 6 + // }, + // colors: { + // silly: 'magenta', + // verbose: 'cyan', + // info: 'green', + // data: 'grey', + // warn: 'yellow', + // debug: 'blue', + // error: 'red' + // } + // }; + + // let rootDir = path.resolve(__dirname, '..'); + // let logDir = rootDir + '/log/'; + // + // loggers.add('ultimatumchannel', { + // console: { + // level: 'silly', + // colorize: true, + // }, + // file: { + // level: 'silly', + // timestamp: true, + // filename: logDir + 'channel', + // maxsize: 1000, + // maxFiles: 10, + // }, + // }); + + return true; } diff --git a/conf/servernode.js b/conf/servernode.js index a218413b..645c5f2c 100644 --- a/conf/servernode.js +++ b/conf/servernode.js @@ -1,7 +1,7 @@ /** * # servernode.js * - * Copyright(c) 2017 Stefano Balietti + * Copyright(c) 2020 Stefano Balietti * MIT Licensed * * Configuration file for ServerNode in nodegame-server. @@ -10,12 +10,13 @@ module.exports = configure; function configure(servernode) { + + // Edit this file to modify the default configuration options in: + // node_modules/nodegame-server/conf/servernode.js + // Extra configuration goes here, e.g.: // servernode.port = 80; // servernode.homePage = false; - // See the full set of configuration options in: - // node_modules/nodegame-server/conf/servernode.js - return true; } diff --git a/conf/sio.js b/conf/sio.js index 64012fa7..ba122f02 100644 --- a/conf/sio.js +++ b/conf/sio.js @@ -1,7 +1,7 @@ /** * # sio.js * - * Copyright(c) 2013 Stefano Balietti + * Copyright(c) 2020 Stefano Balietti * MIT Licensed * * Configuration file for the Socket.io server in nodegame-server. @@ -10,8 +10,9 @@ module.exports = configure; function configure(sio, servernode) { - // Nothing extra to configure. - // Default configuration set already in: + + // Edit this file to modify the default configuration options in: // node_modules/nodegame-server/conf/sio.js + return true; }; From 010dff5843f2810c2b476e3b55a272b887be0b29 Mon Sep 17 00:00:00 2001 From: shakty Date: Thu, 21 Jan 2021 11:21:09 +0100 Subject: [PATCH 50/92] Update pull-all.sh Updated pull-all (removed problematic packages on DO) --- bin/legacy/pull-all.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/legacy/pull-all.sh b/bin/legacy/pull-all.sh index 5d1afd30..8ff7dde8 100755 --- a/bin/legacy/pull-all.sh +++ b/bin/legacy/pull-all.sh @@ -10,14 +10,18 @@ echo_and_pull() { GAMES=(ultimatum) MODULES=(nodegame-client nodegame-server nodegame-window nodegame-widgets nodegame-requirements nodegame-game-template nodegame-monitor JSUS NDDB - nodegame-db nodegame-mongodb nodegame-generator nodegame-mturk) + nodegame-generator nodegame-mturk) + +## Removed modules for now. +## nodegame-db nodegame-mongodb # Change the current working directory to the parent directory of the script, # i.e. the nodegame directory. Using the below command instead of simply # "cd .." makes sure that it does not matter from where the script is executed # cd "$(dirname "${BASH_SOURCE[0]}")/.." -echo_and_pull nodegame +## Not yet. +## echo_and_pull nodegame for GAME in "${GAMES[@]}"; do ( From 8d1c18568fef912dca94c9f7e1bee1b8b85378d0 Mon Sep 17 00:00:00 2001 From: shakty Date: Thu, 21 Jan 2021 11:21:58 +0100 Subject: [PATCH 51/92] Update pull-all.sh --- bin/legacy/pull-all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/legacy/pull-all.sh b/bin/legacy/pull-all.sh index 8ff7dde8..b4779fff 100755 --- a/bin/legacy/pull-all.sh +++ b/bin/legacy/pull-all.sh @@ -7,7 +7,7 @@ echo_and_pull() { git pull || echo ' FAILED!' } -GAMES=(ultimatum) +GAMES=(ultimatum-game) MODULES=(nodegame-client nodegame-server nodegame-window nodegame-widgets nodegame-requirements nodegame-game-template nodegame-monitor JSUS NDDB nodegame-generator nodegame-mturk) From dfd7f76230df69015a8fa95c20dd68f147fe899e Mon Sep 17 00:00:00 2001 From: shakty Date: Thu, 21 Jan 2021 11:23:53 +0100 Subject: [PATCH 52/92] Update pull-all.sh Minor. --- bin/legacy/pull-all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/legacy/pull-all.sh b/bin/legacy/pull-all.sh index b4779fff..364f8961 100755 --- a/bin/legacy/pull-all.sh +++ b/bin/legacy/pull-all.sh @@ -20,7 +20,7 @@ MODULES=(nodegame-client nodegame-server nodegame-window nodegame-widgets # "cd .." makes sure that it does not matter from where the script is executed # cd "$(dirname "${BASH_SOURCE[0]}")/.." -## Not yet. +## Not yet, this fails, we just update the modules. ## echo_and_pull nodegame for GAME in "${GAMES[@]}"; do From 029a85cfe4e702751641226b93c9353a838fe55a Mon Sep 17 00:00:00 2001 From: shakty Date: Sun, 7 Feb 2021 11:22:29 +0100 Subject: [PATCH 53/92] pull-all simplified --- bin/legacy/pull-all.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/legacy/pull-all.sh b/bin/legacy/pull-all.sh index 5d1afd30..8ff7dde8 100755 --- a/bin/legacy/pull-all.sh +++ b/bin/legacy/pull-all.sh @@ -10,14 +10,18 @@ echo_and_pull() { GAMES=(ultimatum) MODULES=(nodegame-client nodegame-server nodegame-window nodegame-widgets nodegame-requirements nodegame-game-template nodegame-monitor JSUS NDDB - nodegame-db nodegame-mongodb nodegame-generator nodegame-mturk) + nodegame-generator nodegame-mturk) + +## Removed modules for now. +## nodegame-db nodegame-mongodb # Change the current working directory to the parent directory of the script, # i.e. the nodegame directory. Using the below command instead of simply # "cd .." makes sure that it does not matter from where the script is executed # cd "$(dirname "${BASH_SOURCE[0]}")/.." -echo_and_pull nodegame +## Not yet. +## echo_and_pull nodegame for GAME in "${GAMES[@]}"; do ( From 8a5f2a53a2f8473b03c9d6495107bfd23982e15b Mon Sep 17 00:00:00 2001 From: shakty Date: Sun, 7 Feb 2021 11:22:39 +0100 Subject: [PATCH 54/92] eslintrc --- .eslintrc.js | 232 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..c16c082c --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,232 @@ +var OFF = 0, WARN = 1, ERROR = 2; + +module.exports = exports = { + "env": { + "es6": true, + "node": true, + "browser": true + }, + + "extends": "eslint:recommended", + + // "ecmaFeatures": { + // // env=es6 doesn't include modules, which we are using + // "modules": true + // }, + // + + "rules": { + "no-console": "off" + }, + + "globals": { + "W": "writable", + "node": "writable", + "J": "writable", + "JSUS": "writable" + } + + // + // "rules": { + // // Possible Errors (overrides from recommended set) + // "no-extra-parens": ERROR, + // "no-unexpected-multiline": ERROR, + // // All JSDoc comments must be valid + // "valid-jsdoc": [ ERROR, { + // "requireReturn": false, + // "requireReturnDescription": false, + // "requireParamDescription": true, + // "prefer": { + // "return": "returns" + // } + // }], + // + // // Best Practices + // + // // Allowed a getter without setter, but all setters require getters + // "accessor-pairs": [ ERROR, { + // "getWithoutSet": false, + // "setWithoutGet": true + // }], + // "block-scoped-var": WARN, + // "consistent-return": ERROR, + // "curly": ERROR, + // "default-case": WARN, + // // the dot goes with the property when doing multiline + // "dot-location": [ WARN, "property" ], + // "dot-notation": WARN, + // "eqeqeq": [ ERROR, "smart" ], + // "guard-for-in": WARN, + // "no-alert": ERROR, + // "no-caller": ERROR, + // "no-case-declarations": WARN, + // "no-div-regex": WARN, + // "no-else-return": WARN, + // "no-empty-label": WARN, + // "no-empty-pattern": WARN, + // "no-eq-null": WARN, + // "no-eval": ERROR, + // "no-extend-native": ERROR, + // "no-extra-bind": WARN, + // "no-floating-decimal": WARN, + // "no-implicit-coercion": [ WARN, { + // "boolean": true, + // "number": true, + // "string": true + // }], + // "no-implied-eval": ERROR, + // "no-invalid-this": ERROR, + // "no-iterator": ERROR, + // "no-labels": WARN, + // "no-lone-blocks": WARN, + // "no-loop-func": ERROR, + // "no-magic-numbers": WARN, + // "no-multi-spaces": ERROR, + // "no-multi-str": WARN, + // "no-native-reassign": ERROR, + // "no-new-func": ERROR, + // "no-new-wrappers": ERROR, + // "no-new": ERROR, + // "no-octal-escape": ERROR, + // "no-param-reassign": ERROR, + // "no-process-env": WARN, + // "no-proto": ERROR, + // "no-redeclare": ERROR, + // "no-return-assign": ERROR, + // "no-script-url": ERROR, + // "no-self-compare": ERROR, + // "no-throw-literal": ERROR, + // "no-unused-expressions": ERROR, + // "no-useless-call": ERROR, + // "no-useless-concat": ERROR, + // "no-void": WARN, + // // Produce warnings when something is commented as TODO or FIXME + // "no-warning-comments": [ WARN, { + // "terms": [ "TODO", "FIXME" ], + // "location": "start" + // }], + // "no-with": WARN, + // "radix": WARN, + // "vars-on-top": ERROR, + // // Enforces the style of wrapped functions + // "wrap-iife": [ ERROR, "outside" ], + // "yoda": ERROR, + // + // // Strict Mode - for ES6, never use strict. + // "strict": [ ERROR, "never" ], + // + // // Variables + // "init-declarations": [ ERROR, "always" ], + // "no-catch-shadow": WARN, + // "no-delete-var": ERROR, + // "no-label-var": ERROR, + // "no-shadow-restricted-names": ERROR, + // "no-shadow": WARN, + // // We require all vars to be initialized (see init-declarations) + // // If we NEED a var to be initialized to undefined, + // // it needs to be explicit + // "no-undef-init": OFF, + // "no-undef": ERROR, + // "no-undefined": OFF, + // "no-unused-vars": WARN, + // // Disallow hoisting - let & const don't allow hoisting anyhow + // "no-use-before-define": ERROR, + // + // // Node.js and CommonJS + // "callback-return": [ WARN, [ "callback", "next" ]], + // "global-require": ERROR, + // "handle-callback-err": WARN, + // "no-mixed-requires": WARN, + // "no-new-require": ERROR, + // // Use path.concat instead + // "no-path-concat": ERROR, + // "no-process-exit": ERROR, + // "no-restricted-modules": OFF, + // "no-sync": WARN, + // + // // ECMAScript 6 support + // "arrow-body-style": [ ERROR, "always" ], + // "arrow-parens": [ ERROR, "always" ], + // "arrow-spacing": [ ERROR, { "before": true, "after": true }], + // "constructor-super": ERROR, + // "generator-star-spacing": [ ERROR, "before" ], + // "no-arrow-condition": ERROR, + // "no-class-assign": ERROR, + // "no-const-assign": ERROR, + // "no-dupe-class-members": ERROR, + // "no-this-before-super": ERROR, + // "no-var": WARN, + // "object-shorthand": [ WARN, "never" ], + // "prefer-arrow-callback": WARN, + // "prefer-spread": WARN, + // "prefer-template": WARN, + // "require-yield": ERROR, + // + // // Stylistic - everything here is a warning because of style. + // "array-bracket-spacing": [ WARN, "always" ], + // "block-spacing": [ WARN, "always" ], + // "brace-style": [ WARN, "1tbs", { "allowSingleLine": false } ], + // "camelcase": WARN, + // "comma-spacing": [ WARN, { "before": false, "after": true } ], + // "comma-style": [ WARN, "last" ], + // "computed-property-spacing": [ WARN, "never" ], + // "consistent-this": [ WARN, "self" ], + // "eol-last": WARN, + // "func-names": WARN, + // "func-style": [ WARN, "declaration" ], + // "id-length": [ WARN, { "min": 2, "max": 32 } ], + // "indent": [ WARN, 4 ], + // "jsx-quotes": [ WARN, "prefer-double" ], + // // "linebreak-style": [ WARN, "unix" ], + // "lines-around-comment": [ WARN, { "beforeBlockComment": true } ], + // "max-depth": [ WARN, 8 ], + // "max-len": [ WARN, 132 ], + // "max-nested-callbacks": [ WARN, 8 ], + // "max-params": [ WARN, 8 ], + // "new-cap": WARN, + // "new-parens": WARN, + // "no-array-constructor": WARN, + // "no-bitwise": OFF, + // "no-continue": OFF, + // "no-inline-comments": OFF, + // "no-lonely-if": WARN, + // "no-mixed-spaces-and-tabs": WARN, + // "no-multiple-empty-lines": WARN, + // "no-negated-condition": OFF, + // "no-nested-ternary": WARN, + // "no-new-object": WARN, + // "no-plusplus": OFF, + // "no-spaced-func": WARN, + // "no-ternary": OFF, + // "no-trailing-spaces": WARN, + // "no-underscore-dangle": WARN, + // "no-unneeded-ternary": WARN, + // "object-curly-spacing": [ WARN, "always" ], + // "one-var": OFF, + // "operator-assignment": [ WARN, "never" ], + // "operator-linebreak": [ WARN, "after" ], + // "padded-blocks": [ WARN, "never" ], + // "quote-props": [ WARN, "consistent-as-needed" ], + // // "quotes": [ WARN, "single" ], + // "require-jsdoc": [ WARN, { + // "require": { + // "FunctionDeclaration": true, + // "MethodDefinition": true, + // "ClassDeclaration": false + // } + // }], + // "semi-spacing": [ WARN, { "before": false, "after": true }], + // "semi": [ ERROR, "always" ], + // "sort-vars": OFF, + // "space-after-keywords": [ WARN, "always" ], + // "space-before-blocks": [ WARN, "always" ], + // "space-before-function-paren": [ WARN, "never" ], + // "space-before-keywords": [ WARN, "always" ], + // "space-in-parens": [ WARN, "never" ], + // "space-infix-ops": [ WARN, { "int32Hint": true } ], + // "space-return-throw-case": ERROR, + // "space-unary-ops": ERROR, + // "spaced-comment": [ WARN, "always" ], + // "wrap-regex": WARN + // } +}; From aefe63008698c0e508f6bd5ece93157f43764123 Mon Sep 17 00:00:00 2001 From: shakty Date: Sun, 7 Feb 2021 20:01:18 +0100 Subject: [PATCH 55/92] Fixed launcher for commander 7 --- launcher.js | 183 +++++++++++++++++++++++++-------------------------- package.json | 2 +- 2 files changed, 92 insertions(+), 93 deletions(-) diff --git a/launcher.js b/launcher.js index 073d845b..5d263f80 100644 --- a/launcher.js +++ b/launcher.js @@ -16,7 +16,7 @@ const path = require('path'); const exec = require('child_process').exec; const J = require('JSUS').JSUS; -var NDDB; +// TODO: refactor, eliminate var; check new Commander options. // Load commander. var program = require('commander'); @@ -129,22 +129,25 @@ program .parse(process.argv); +debugger +// User options (Commander >= 7). +let opts = program.opts(); -if (program.confFile) { - if (!fs.existsSync(program.ConfFile)) { - return printErr('--confFile ' + program.confFile + ' not found.'); +if (opts.confFile) { + if (!fs.existsSync(opts.confFile)) { + return printErr('--confFile ' + opts.confFile + ' not found.'); } - options = require(program.confFile); + options = require(opts.confFile); if ('object' !== typeof options) { - return printErr('--confFile ' + program.confFile + ' did not return ' + + return printErr('--confFile ' + opts.confFile + ' did not return ' + 'a configuration object.'); } - if (program.confDir) ignoredOptions.push('--confDir'); - if (program.logDir) ignoredOptions.push('--logDir'); - if (program.gamesDir) ignoredOptions.push('--gamesDir'); - if (program.debug) ignoredOptions.push('--debug'); - if (program.infoQuery) ignoredOptions.push('--infoQuery'); + if (opts.confDir) ignoredOptions.push('--confDir'); + if (opts.logDir) ignoredOptions.push('--logDir'); + if (opts.gamesDir) ignoredOptions.push('--gamesDir'); + if (opts.debug) ignoredOptions.push('--debug'); + if (opts.infoQuery) ignoredOptions.push('--infoQuery'); } else { @@ -199,33 +202,33 @@ else { }; // Validate other options. - if (program.confDir) { - if (!fs.existsSync(program.confDir)) { - return printErr('--confDir ' + program.confDir + ' not found.'); + if (opts.confDir) { + if (!fs.existsSync(opts.confDir)) { + return printErr('--confDir ' + opts.confDir + ' not found.'); } - confDir = program.confDir; + confDir = opts.confDir; } - if (program.logDir) { - if (!fs.existsSync(program.logDir)) { - return printErr('--logDir ' + program.logDir + ' not found.'); + if (opts.logDir) { + if (!fs.existsSync(opts.logDir)) { + return printErr('--logDir ' + opts.logDir + ' not found.'); } - logDir = program.logDir; + logDir = opts.logDir; } - if (program.gamesDir) { - if (!fs.existsSync(program.gamesDir)) { - return printErr('--gamesDir ' + program.gamesDir + ' not found.'); + if (opts.gamesDir) { + if (!fs.existsSync(opts.gamesDir)) { + return printErr('--gamesDir ' + opts.gamesDir + ' not found.'); } - gamesDir = program.gamesDir; + gamesDir = opts.gamesDir; } - if (program.debug) debug = true; + if (opts.debug) debug = true; // Parse infoQuery. - if (program.infoQuery) { - if ('boolean' === typeof program.infoQuery) { - infoQuery = program.infoQuery; + if (opts.infoQuery) { + if ('boolean' === typeof opts.infoQuery) { + infoQuery = opts.infoQuery; } else { - let i = program.infoQuery.toLowerCase(); + let i = opts.infoQuery.toLowerCase(); infoQuery = i === 'f' || i === 'false' || i === '0' ? false : true; } } @@ -233,10 +236,10 @@ else { // Validate general options. -if ('boolean' === typeof program.ssl) { +if ('boolean' === typeof opts.ssl) { options.ssl = true; } -else if ('string' === typeof program.ssl) { +else if ('string' === typeof opts.ssl) { options.ssl = (function(dir) { var ssl; @@ -263,7 +266,7 @@ else if ('string' === typeof program.ssl) { return ssl; - })(program.ssl); + })(opts.ssl); if (!options.ssl) return; } @@ -271,74 +274,74 @@ if (program['default']) { options.defaultChannel = program['default']; } -if (program.port) { - port = J.isInt(program.port, 0); +if (opts.port) { + port = J.isInt(opts.port, 0); if (!port) { - return printErr('--port ' + program.port + + return printErr('--port ' + opts.port + ' is not a positive number.'); } options.port = port; } -if (program.logLevel) { - options.logLevel = program.logLevel; +if (opts.logLevel) { + options.logLevel = opts.logLevel; } -if (program.nClients) { - if (!program.phantoms) ignoredOptions.push('--nClients'); +if (opts.nClients) { + if (!opts.phantoms) ignoredOptions.push('--nClients'); else { - nClients = parseInt(program.nClients, 10); + nClients = parseInt(opts.nClients, 10); if (isNaN(nClients)) { - return printErr('--nClients ' + program.nClients + + return printErr('--nClients ' + opts.nClients + ' is invalid.'); } } } -if (program.clientType) { - if (!program.phantoms) ignoredOptions.push('--clientType'); - else clientType = program.clientType; +if (opts.clientType) { + if (!opts.phantoms) ignoredOptions.push('--clientType'); + else clientType = opts.clientType; } -if (program.runTests) { - if (!program.runTests) ignoredOptions.push('--runTests'); - else runTests = program.runTests; +if (opts.runTests) { + if (!opts.runTests) ignoredOptions.push('--runTests'); + else runTests = opts.runTests; } -if (program.killServer) { - if (!program.phantoms) ignoredOptions.push('--killServer'); +if (opts.killServer) { + if (!opts.phantoms) ignoredOptions.push('--killServer'); else killServer = true; } -if (program.wait) { - if (!program.phantoms) { +if (opts.wait) { + if (!opts.phantoms) { ignoredOptions.push('--wait'); } else { - if (true === program.wait) { + if (true === opts.wait) { wait = 1000; } else { - wait = J.isInt(program.wait, 0); + wait = J.isInt(opts.wait, 0); if (false === wait) { printErr('--wait must be a positive number or undefined. ' + - 'Found:' + program.wait); + 'Found:' + opts.wait); process.exit(); } } } } -if (program.auth) { - if (!program.phantoms) { +if (opts.auth) { + if (!opts.phantoms) { ignoredOptions.push('--auth'); } - else if ('string' === typeof program.auth) { + else if ('string' === typeof opts.auth) { auth = (function(idIdx, pwdIdx) { var auth; - idIdx = program.auth.indexOf('id:'); + idIdx = opts.auth.indexOf('id:'); if (idIdx === 0) { - pwdIdx = program.auth.indexOf('&pwd:'); + pwdIdx = opts.auth.indexOf('&pwd:'); if (pwdIdx !== -1) { auth = { - id: program.auth.substr(3, (pwdIdx-3)), - pwd: program.auth.substr(pwdIdx+5) + id: opts.auth.substr(3, (pwdIdx-3)), + pwd: opts.auth.substr(pwdIdx+5) }; } else { @@ -347,67 +350,65 @@ if (program.auth) { process.exit(); } } - else if (program.auth === 'new') { + else if (opts.auth === 'new') { auth = 'createNew'; } - else if (program.auth === 'next') { + else if (opts.auth === 'next') { auth = 'nextAvailable'; } - else if (program.auth.indexOf('file:') === 0) { - NDDB = require('NDDB').NDDB; + else if (opts.auth.indexOf('file:') === 0) { + const NDDB = require('NDDB').NDDB; codesDb = new NDDB(); - codesDb.loadSync(program.auth.substr(5)); + codesDb.loadSync(opts.auth.substr(5)); if (!codesDb.size()) { - printErr('--auth no auth codes found: program.auth'); + printErr('--auth no auth codes found: opts.auth'); process.exit(); } codesDb = codesDb.db; } else { - auth = program.auth; + auth = opts.auth; } return auth; })(); } - else if ('boolean' === typeof program.auth) { + else if ('boolean' === typeof opts.auth) { auth = 'createNew'; } - else if ('number' === typeof program.auth || - 'object' === typeof program.auth) { + else if ('number' === typeof opts.auth || + 'object' === typeof opts.auth) { - auth = program.auth; + auth = opts.auth; } } // Rebuild server files as needed. -if (program.build) { +if (opts.build) { (function() { - var i, len, opts, modules; - var info, module, out; - var cssAlso, cssOnly; + let cssAlso, cssOnly; - len = program.build.length; + let len = opts.build.length; if (!len) { - program.build = [ 'client' ]; + opts.build = [ 'client' ]; } else if (len === 1) { - if (program.build[0] === 'all') { + if (opts.build[0] === 'all') { // Client will be done anyway. - program.build = [ 'window', 'widgets', 'JSUS', 'NDDB' ]; + opts.build = [ 'window', 'widgets', 'JSUS', 'NDDB' ]; } - else if (program.build[0] === 'css') { + else if (opts.build[0] === 'css') { cssOnly = true; } } - info = J.resolveModuleDir('nodegame-server', __dirname); + let info = J.resolveModuleDir('nodegame-server', __dirname); info = require(path.resolve(info, 'bin', 'info.js')); if (!cssOnly) { - out = 'nodegame-full.js'; + let out = 'nodegame-full.js'; - modules = { + let modules = { window: 'window', client: 'client', widgets: 'widgets', @@ -417,9 +418,9 @@ if (program.build) { }; // Starting build. - i = -1, len = program.build.length; + let i = -1; for ( ; ++i < len ; ) { - module = program.build[i]; + let module = opts.build[i]; if (!modules[module]) { throw new Error('unknown build component: ' + module); } @@ -436,9 +437,7 @@ if (program.build) { continue; } - opts = { all: true, clean: true }; - - info.build[module](opts); + info.build[module]({ all: true, clean: true }); console.log(''); } // Do client last. @@ -448,7 +447,7 @@ if (program.build) { output: out }); J.copyFile(path.resolve(info.modulesDir.client, 'build', out), - path.resolve(info.serverDir.build, 'nodegame-full.js')); + path.resolve(info.serverDir.build, out)); console.log(info.serverDir.build + out + ' rebuilt.'); console.log(''); } @@ -465,7 +464,7 @@ if (program.build) { startServer(); } - })(program.build); + })(); } else { startServer(); @@ -492,9 +491,9 @@ function startServer() { var numFinished; // If there are not bots to add returns. - if (!program.phantoms) return; + if (!opts.phantoms) return; - gameName = program.phantoms; + gameName = opts.phantoms; channel = sn.channels[gameName]; if (!channel) { printErr('channel ' + gameName + ' was not found.'); diff --git a/package.json b/package.json index 2a8be7b5..266b50c4 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "NDDB": "^2.0.0", "nodegame-db": "*", "nodegame-mongodb": "*", - "commander": "*", + "commander": "^7.0.0", "fs-extra": "*", "smoosh": "0.4.0" }, From 5923ca46d77ef30281743b44b4999fa4ba863179 Mon Sep 17 00:00:00 2001 From: shakty Date: Sun, 7 Feb 2021 20:02:19 +0100 Subject: [PATCH 56/92] 6.1.0 --- CHANGELOG | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 9e6ec3fa..fd9cf473 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # nodeGame Changelog +# 6.1.0 +- Fixed launcher for Commander v7. +- Updated server,client,window,widgets. + # 6.0.3 - Fixed corrupted build in 6.0.2 (thanks jjensenius3). diff --git a/package.json b/package.json index 266b50c4..4dd9ae7a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "6.0.3", + "version": "6.1.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 4a2b8dffc2ecc3a5d78e755d38588b9ee8dce058 Mon Sep 17 00:00:00 2001 From: shakty Date: Sun, 7 Feb 2021 20:02:47 +0100 Subject: [PATCH 57/92] updated installer --- bin/nodegame-installer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 8b56f3ee..29b5e24d 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -41,7 +41,7 @@ const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', v5: '5.11.2', - v6: '6.0.3' + v6: '6.1.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); From f4dad854de5f0c4c3ad5b4a17040c93150f6e5ab Mon Sep 17 00:00:00 2001 From: shakty Date: Sun, 7 Feb 2021 20:52:31 +0100 Subject: [PATCH 58/92] 6.1.1 --- CHANGELOG | 3 +++ bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index fd9cf473..c27c95de 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 6.1.1 +- Built widgets. + # 6.1.0 - Fixed launcher for Commander v7. - Updated server,client,window,widgets. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 29b5e24d..1a2a9e55 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -41,7 +41,7 @@ const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', v5: '5.11.2', - v6: '6.1.0' + v6: '6.1.1' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index 4dd9ae7a..74b1e455 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "6.1.0", + "version": "6.1.1", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 58a4c04df564125ca3d29b1e3a953c5f48a0de70 Mon Sep 17 00:00:00 2001 From: Stefano Baietti Date: Tue, 9 Feb 2021 15:29:12 +0100 Subject: [PATCH 59/92] removed debugger from launcher --- bin/nodegame-installer.js | 2 +- launcher.js | 1 - package.json | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 1a2a9e55..04adc507 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -41,7 +41,7 @@ const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', v5: '5.11.2', - v6: '6.1.1' + v6: '6.2.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/launcher.js b/launcher.js index 5d263f80..dae772b3 100644 --- a/launcher.js +++ b/launcher.js @@ -129,7 +129,6 @@ program .parse(process.argv); -debugger // User options (Commander >= 7). let opts = program.opts(); diff --git a/package.json b/package.json index 74b1e455..fe22d827 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "6.1.1", + "version": "6.2.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From c7129696a9ac6cb2a87b06ae343e4de948248fa1 Mon Sep 17 00:00:00 2001 From: Stefano Baietti Date: Tue, 9 Feb 2021 15:29:57 +0100 Subject: [PATCH 60/92] changelog --- CHANGELOG | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index c27c95de..b13901e3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # nodeGame Changelog +# 6.2.0 +- Removed debugger from launcher. +- Updated server with more options for WaitingRoom. + # 6.1.1 - Built widgets. From 04d0ef23c2d3ceb07734e3ddbbaf0d29d3edccce Mon Sep 17 00:00:00 2001 From: Stefano Baietti Date: Tue, 9 Feb 2021 15:47:24 +0100 Subject: [PATCH 61/92] 6.2.0 --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index b13901e3..df7ba249 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,7 @@ # nodeGame Changelog # 6.2.0 -- Removed debugger from launcher. +- Removed debugger from launcher.js. - Updated server with more options for WaitingRoom. # 6.1.1 From f15dfe6fa843b73d92de366e8c45780e09451036 Mon Sep 17 00:00:00 2001 From: Stefano Baietti Date: Wed, 10 Feb 2021 15:39:24 +0100 Subject: [PATCH 62/92] 6.2.1 --- CHANGELOG | 3 +++ bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index df7ba249..8cf0a307 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # nodeGame Changelog +# 6.2.1 +- New release, fixed support for images loaded in mainframe. + # 6.2.0 - Removed debugger from launcher.js. - Updated server with more options for WaitingRoom. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 04adc507..f552586d 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -41,7 +41,7 @@ const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', v5: '5.11.2', - v6: '6.2.0' + v6: '6.2.1' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index fe22d827..593ad5dc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "6.2.0", + "version": "6.2.1", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From a980ed8db6d03d9645450f18f261163af217aff1 Mon Sep 17 00:00:00 2001 From: shakty Date: Wed, 10 Feb 2021 16:05:45 +0100 Subject: [PATCH 63/92] 6.2.2 --- CHANGELOG | 2 +- bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8cf0a307..2fbfd7fa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # nodeGame Changelog -# 6.2.1 +# 6.2.2 - New release, fixed support for images loaded in mainframe. # 6.2.0 diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index f552586d..d7ff5393 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -41,7 +41,7 @@ const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', v5: '5.11.2', - v6: '6.2.1' + v6: '6.2.2' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index 593ad5dc..fc2ecdd4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "6.2.1", + "version": "6.2.2", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 67db78d405c5b4732cf486cf468a78492d4b13cb Mon Sep 17 00:00:00 2001 From: shakty Date: Wed, 10 Feb 2021 16:15:26 +0100 Subject: [PATCH 64/92] Fixed 'default' option in launcher for Commander 7 --- launcher.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher.js b/launcher.js index dae772b3..40e68c94 100644 --- a/launcher.js +++ b/launcher.js @@ -269,8 +269,8 @@ else if ('string' === typeof opts.ssl) { if (!options.ssl) return; } -if (program['default']) { - options.defaultChannel = program['default']; +if (opts['default']) { + options.defaultChannel = opts['default']; } if (opts.port) { From a789f8d2712f73e462a04f6b3cf779d56fae51f2 Mon Sep 17 00:00:00 2001 From: shakty Date: Wed, 10 Feb 2021 16:16:08 +0100 Subject: [PATCH 65/92] 6.2.3 --- CHANGELOG | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2fbfd7fa..fca75643 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ # nodeGame Changelog -# 6.2.2 +# 6.2.3 +- Fixed "default" option in launcher for Commander v7. - New release, fixed support for images loaded in mainframe. # 6.2.0 diff --git a/package.json b/package.json index fc2ecdd4..e44217d1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "6.2.2", + "version": "6.2.3", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From bae9ca1f6e72791166e11a3f3d24bfe738ea3270 Mon Sep 17 00:00:00 2001 From: shakty Date: Wed, 10 Feb 2021 16:18:20 +0100 Subject: [PATCH 66/92] 6.2.4 --- CHANGELOG | 2 +- bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index fca75643..6fab16ad 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # nodeGame Changelog -# 6.2.3 +# 6.2.4 (6.2.1-6.2.3 deprecated) - Fixed "default" option in launcher for Commander v7. - New release, fixed support for images loaded in mainframe. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index d7ff5393..3013004b 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -41,7 +41,7 @@ const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', v5: '5.11.2', - v6: '6.2.2' + v6: '6.2.4' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index e44217d1..ec917fd7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "6.2.3", + "version": "6.2.4", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 703133fa6b3c7b2d982cdffba6580b15da03e26d Mon Sep 17 00:00:00 2001 From: Stefano Balieti Date: Thu, 8 Apr 2021 11:19:41 +0200 Subject: [PATCH 67/92] no-games option in installer --- bin/nodegame-installer.js | 46 ++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 3013004b..9995dca3 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -93,6 +93,9 @@ var branch; var warnings; var dry; +// Add default games in games/ and games_available/. +var addGames = true; + // User requested version. var requestedVersion = '@' + version; @@ -142,6 +145,9 @@ for (let i = 0; i < process.argv.length; i++) { else if (option === '--dry') { dry = true; } + else if (option === '--no-games') { + addGames = false; + } } if ((doSSH || branch) && !isDev) { @@ -190,7 +196,6 @@ const NODEGAME_MODULES = [ 'JSUS', 'NDDB', 'ultimatum-game' ]; -const N_MODULES = NODEGAME_MODULES.length; const GAMES_AVAILABLE_DIR = path.resolve(INSTALL_DIR, 'games_available'); @@ -530,8 +535,11 @@ function someMagic(cb) { if (isDev) { getAllGitModules(function() { - // Move games from node_modules. - copyGameFromNodeModules('ultimatum-game'); + + if (addGames) { + // Move games from node_modules. + copyGameFromNodeModules('ultimatum-game'); + } // Generator. fixGenerator(); @@ -546,8 +554,11 @@ function someMagic(cb) { }); } else { - // Move games from node_modules. - copyGameFromNodeModules('ultimatum-game'); + + if (addGames) { + // Move games from node_modules. + copyGameFromNodeModules('ultimatum-game'); + } // Generator. fixGenerator(); @@ -568,17 +579,15 @@ function fixGenerator() { 'nodegame-generator', 'bin', 'nodegame'), path.resolve(INSTALL_DIR, 'bin', 'nodegame'), - 'file'); + 'file'); fs.writeFileSync(path.resolve(INSTALL_DIR_MODULES, - 'nodegame-generator', - 'conf', - 'generator.conf.json'), - JSON.stringify({ - author: "", - email: "", - ngDir: INSTALL_DIR - }, 4)); + 'nodegame-generator', 'conf', 'generator.conf.json'), + JSON.stringify({ + author: "", + email: "", + ngDir: INSTALL_DIR + }, 4)); } function getAllGitModules(cb) { @@ -732,7 +741,7 @@ function removeDirRecursiveSync(dir) { }); fs.rmdirSync(dir); } -}; +} function getParentNodeModules() { let tks = ROOT_DIR.split(path.sep); @@ -843,8 +852,6 @@ function printHelp() { // Kudos: cli-spinner package. function Spinner(text) { - var that; - that = this; this.spinners = [ "|/-\\", @@ -914,10 +921,10 @@ function Spinner(text) { readline.clearLine(stream, 0); readline.cursorTo(stream, 0); }; -}; +} function inArray(needle, haystack) { - var func, i, len; + var i, len; len = haystack.length; for (i = 0; i < len; i++) { if (needle === haystack[i]) { @@ -945,7 +952,6 @@ function _copyFileSync(src, dest, flag) { COPYFILE_FICLONE_FORCE, }; - const isNumber = (a) => typeof a === 'number'; const or = (a, b) => a | b; const getValue = (obj) => (key) => obj[key]; From 0ee509aa3ec76f38b9336195b5d68889997a8881 Mon Sep 17 00:00:00 2001 From: Stefano Balieti Date: Thu, 8 Apr 2021 11:21:58 +0200 Subject: [PATCH 68/92] updated help install --- bin/nodegame-installer.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 9995dca3..de3d598e 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -833,19 +833,20 @@ function installationFailed() { function printHelp() { log(); - log('@ Install a specific version (v3, v4, v5)'); - log('@dev Install latest nodeGame from git repos'); - log(' --branch Checkout this branch on all git repos'); - log(' --ssh Use ssh to get all git repos'); - log('--yes Answer yes to all questions'); - log('--install-dir Set the name of the installation directory;'); + log('@ Installs a specific version (v3, v4, v5, v6)'); + log('@dev Installs latest nodeGame from git repos'); + log('--branch Checkouts this branch on all git repos'); + log('--ssh Uses ssh to get all git repos'); + log('--yes Answers yes to all questions'); + log('--install-dir Sets the name of the installation directory;'); log(' if equals to node_modules, the npm structure'); log(' stays unchanged'); log('--no-spinner Does not start the spinner'); log('--dry Does not actually install anything'); log('--list-versions Lists stable versions'); - log('--version Print installer version'); - log('--help Print this help'); + log('--no-games Does not install default games'); + log('--version Prints installer version'); + log('--help Prints this help'); log(); } From ec18f405c3f03d765bdeb95cb3c085ded21f7f91 Mon Sep 17 00:00:00 2001 From: Stefano Balieti Date: Thu, 8 Apr 2021 11:25:17 +0200 Subject: [PATCH 69/92] fixed installer getting stuck on help and versions --- bin/nodegame-installer.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index de3d598e..720dd10f 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -53,11 +53,6 @@ const INSTALLER_VERSION = 'v6'; // is stored in here. var parentNodeModules; -var rl = readline.createInterface({ - input: process.stdin, - output: process.stdout -}); - // The actual version being installed, user can change it. var version = STABLE_VERSIONS[INSTALLER_VERSION]; @@ -81,6 +76,11 @@ else if (p === '--version' || p === '-v') { return; } +var rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); + var verbose = false; var nodeModulesExisting = false; var isDev = false; From 803598b3c44bc2aade7b07c38beaf2f84a8c15a9 Mon Sep 17 00:00:00 2001 From: Stefano Balieti Date: Thu, 8 Apr 2021 11:27:44 +0200 Subject: [PATCH 70/92] changelog --- CHANGELOG | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 6fab16ad..a9588b7b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ # nodeGame Changelog +# 6.3.0 +- Fixed installer getting stuck on versions and help. +- Added installer option --no-games to skip installing default games. +- New release. + # 6.2.4 (6.2.1-6.2.3 deprecated) - Fixed "default" option in launcher for Commander v7. - New release, fixed support for images loaded in mainframe. From 4a768af08c29e9c80bdc80bcc569e3df37e0ca3a Mon Sep 17 00:00:00 2001 From: Stefano Balieti Date: Thu, 8 Apr 2021 14:46:35 +0200 Subject: [PATCH 71/92] 6.3.0 --- bin/nodegame-installer.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 720dd10f..ddd51d99 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -41,7 +41,7 @@ const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', v5: '5.11.2', - v6: '6.2.4' + v6: '6.3.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index ec917fd7..f917fab8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "6.2.4", + "version": "6.3.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 3d967861e8c81ee42dac74a55e5aca8110a8ef42 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 26 Aug 2021 10:55:59 +0200 Subject: [PATCH 72/92] adding nodeGameRoot in launcher --- launcher.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/launcher.js b/launcher.js index 40e68c94..4a3ed5d5 100644 --- a/launcher.js +++ b/launcher.js @@ -479,6 +479,8 @@ function startServer() { // Add nodeGame version (might be higher than server version) to options. options.nodeGameVersion = version; + options.nodeGameRoot = __dirname; + // Start server, options parameter is optional. sn = new ServerNode(options); From e5afdbaf2f76bffe01ca4e8489fa5decc3c1dd32 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 26 Aug 2021 11:10:52 +0200 Subject: [PATCH 73/92] more robust paths --- launcher.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/launcher.js b/launcher.js index 4a3ed5d5..783ff51a 100644 --- a/launcher.js +++ b/launcher.js @@ -61,9 +61,9 @@ ignoredOptions = []; confFile = null; -confDir = './conf'; -logDir = './log'; -gamesDir = './games'; +confDir = path.resolve(__dirname, 'conf'); +logDir = path.resolve(__dirname, 'log'); +gamesDir = path.resolve(__dirname, 'games'); debug = undefined; infoQuery = undefined; From 55f90ebf3a379d8cea0ddcb55e75fc79769eecaa Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Tue, 31 Aug 2021 12:11:06 +0200 Subject: [PATCH 74/92] installer support alpha --- bin/nodegame-installer.js | 143 ++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 85 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index ddd51d99..4e768baf 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -33,7 +33,7 @@ const warn = txt => { }; // const MAIN_MODULE = 'nodegame'; -const MAIN_MODULE = 'nodegame'; +let MAIN_MODULE = 'nodegame'; // All stable versions. // Versions below < 3 are not available. @@ -81,6 +81,7 @@ var rl = readline.createInterface({ output: process.stdout }); +var alpha = false; var verbose = false; var nodeModulesExisting = false; var isDev = false; @@ -109,6 +110,13 @@ for (let i = 0; i < process.argv.length; i++) { isDev = true; requestedVersion = '@' + version; + + MAIN_MODULE = 'nodegame-test'; + + version = '7.0.4'; + requestedVersion = '@' + version; + + alpha = true; } else { version = STABLE_VERSIONS[requestedVersion]; @@ -158,7 +166,7 @@ if ((doSSH || branch) && !isDev) { // nodeGame version. const VERSION = isDev ? "v" + version + '-dev' : "v" + version; -const NODEGAME_AND_VERSION = 'nodegame-' + VERSION; +const NODEGAME_AND_VERSION = 'nodegame-' + VERSION + (alpha ? '-alpha' : ''); const ROOT_DIR = process.cwd() const NODE_MODULES_DIR = path.resolve(ROOT_DIR, 'node_modules'); @@ -220,8 +228,8 @@ printInstallInfo(); // Check node version is. var nodeVersion = process.versions.node.split('.'); -if (parseInt(nodeVersion[0], 10) < 4) { - err('node version >= 4.x is required.\n' + +if (parseInt(nodeVersion[0], 10) < 10) { + err('node version >= 10.x is required.\n' + 'Please upgrade your Node.Js installation, ' + 'visit: http://nodejs.org'); installationAborted(); @@ -273,7 +281,7 @@ else checkParentNodeModules(); // Helper functions. /////////////////////////////////////////////////////////////////////////////// -function checkParentNodeModules(cb) { +function checkParentNodeModules() { parentNodeModules = getParentNodeModules(); // Check if a node_modules folder exists in any folder from the one above. @@ -423,10 +431,18 @@ function checkGitExists(cb) { function printNodeGameInfo() { log(); - log('*********************************************** '); - log('** WELCOME TO NODEGAME INSTALLER v' + version + - ' ** '); - log('*********************************************** '); + if (alpha) { + log('***************************************************** '); + log('** WELCOME TO NODEGAME INSTALLER v' + version + + (alpha ? '-alpha' : '') + ' ** '); + log('***************************************************** '); + } + else { + log('*********************************************** '); + log('** WELCOME TO NODEGAME INSTALLER v' + version + ' ** '); + log('*********************************************** '); + } + log(); log('nodeGame: fast, scalable JavaScript for online, large-scale,'); log('multiplayer, real-time games and experiments in the browser.'); @@ -518,18 +534,27 @@ function someMagic(cb) { if (!fs.existsSync(path.resolve(mainNgDir, 'private'))) { fs.mkdirSync(path.resolve(mainNgDir, 'private')); } + if (!fs.existsSync(path.resolve(mainNgDir, 'export'))) { + fs.mkdirSync(path.resolve(mainNgDir, 'export')); + } if (!doNotMoveInstall) { // Move nodegame folder outside node_modules. fs.renameSync(mainNgDir, INSTALL_DIR); - // Old npms put already all modules under nodegame. - if (!fs.existsSync(INSTALL_DIR_MODULES)) { - fs.renameSync(NODE_MODULES_DIR, - INSTALL_DIR_MODULES); + try { + // Old npms put already all modules under nodegame. + if (!fs.existsSync(INSTALL_DIR_MODULES)) { + fs.renameSync(NODE_MODULES_DIR, + INSTALL_DIR_MODULES); + } + else if (!nodeModulesExisting) { + fs.rmdirSync(NODE_MODULES_DIR); + } } - else if (!nodeModulesExisting) { - fs.rmdirSync(NODE_MODULES_DIR); + catch(e) { + let keep = nodeModulesExisting; + moveFolderSync(NODE_MODULES_DIR, INSTALL_DIR_MODULES, keep); } } @@ -630,9 +655,9 @@ function getAllGitModules(cb) { fs.renameSync(nodeModulesCopy, nodeModulesPath); } // Copy pre-commit hook. - copyFileSync(gitPrecommitHook, - path.resolve(modulePath, '.git', 'hooks', - 'pre-commit')); + fs.copyFileSync(gitPrecommitHook, + path.resolve(modulePath, '.git', 'hooks', + 'pre-commit')); counter--; if (counter == 0 && cb) cb(); }); @@ -935,74 +960,22 @@ function inArray(needle, haystack) { return false; } +function moveFolderSync(from, to, copy) { + if (!fs.existsSync(to)) fs.mkdirSync(to); + fs.readdirSync(from).forEach(element => { + let fileFrom = path.join(from, element); + let fileTo = path.join(to, element); -// Kudos. Adapted from: -// https://github.com/coderaiser/ -// fs-copy-file-sync/blob/master/lib/fs-copy-file-sync.js -function _copyFileSync(src, dest, flag) { - const SIZE = 65536; - - const COPYFILE_EXCL = 1; - const COPYFILE_FICLONE = 2; - const COPYFILE_FICLONE_FORCE = 4; - - const constants = { - COPYFILE_EXCL, - COPYFILE_FICLONE, - COPYFILE_FICLONE_FORCE, - }; - - const or = (a, b) => a | b; - const getValue = (obj) => (key) => obj[key]; - - const getMaxMask = (obj) => Object - .keys(obj) - .map(getValue(obj)) - .reduce(or); - - const MAX_MASK = getMaxMask(constants); - const isExcl = (flags) => flags & COPYFILE_EXCL; - - - const writeFlag = isExcl(flag) ? 'wx' : 'w'; - - const { - size, - mode, - } = fs.statSync(src); - - const fdSrc = fs.openSync(src, 'r'); - const fdDest = fs.openSync(dest, writeFlag, mode); - - const length = size < SIZE ? size : SIZE; - - let pos = 0; - const peaceSize = size < SIZE ? 0 : size % SIZE; - const offset = 0; - - let buffer = Buffer.allocUnsafe(length); - for (let i = 0; length + pos + peaceSize <= size; i++, pos = length * i) { - fs.readSync(fdSrc, buffer, offset, length, pos); - fs.writeSync(fdDest, buffer, offset, length, pos); - } - - if (peaceSize) { - const length = peaceSize; - buffer = Buffer.allocUnsafe(length); - fs.readSync(fdSrc, buffer, offset, length, pos); - fs.writeSync(fdDest, buffer, offset, length, pos); - } - - fs.closeSync(fdSrc); - fs.closeSync(fdDest); -} + if (fs.lstatSync(fileFrom).isFile()) { + if (copy) fs.copyFileSync(fileFrom, fileTo); + else fs.renameSync(fileFrom, fileTo); + } + else { + moveFolderSync(fileFrom, fileTo); + } + }); + // ALl files moved, removed dir. + if (!copy) fs.rmdirSync(from); -function copyFileSync(from, to) { - if ('function' === typeof fs.copyFileSync) { - fs.copyFileSync(from, to); - } - else { - _copyFileSync(from, to); - } } From 1d360b56ff9b933bbd8d80dbe1f8153be85704cd Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Tue, 31 Aug 2021 12:19:18 +0200 Subject: [PATCH 75/92] dropped --phantoms --- launcher.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/launcher.js b/launcher.js index 783ff51a..4c9baac7 100644 --- a/launcher.js +++ b/launcher.js @@ -33,9 +33,6 @@ var sn; // ServerNode options. var options; -// Conf file for all variables. -var confFile; - // Other local options. var confDir, logDir, gamesDir, debug, infoQuery, runTests; var nClients, clientType, killServer, auth, wait, port; @@ -59,8 +56,6 @@ ignoredOptions = []; // Defaults. -confFile = null; - confDir = path.resolve(__dirname, 'conf'); logDir = path.resolve(__dirname, 'log'); gamesDir = path.resolve(__dirname, 'games'); @@ -110,7 +105,7 @@ program // Connect phantoms. .option('-p, --phantoms ', - 'Connect phantoms to the specified channel') + 'Connect phantoms to the specified channel **DISCONTINUED**') .option('-n, --nClients ', 'Sets the number of clients phantoms to connect (default: 4)') .option('-t, --clientType ', @@ -132,6 +127,12 @@ program // User options (Commander >= 7). let opts = program.opts(); +if (opts.phantoms) { + console.log('***Err: option --phantoms no longer supported. ' + + 'PhantomJS support discontinued.'); + return false; +} + if (opts.confFile) { if (!fs.existsSync(opts.confFile)) { return printErr('--confFile ' + opts.confFile + ' not found.'); From e5af730fe8ceda1090956dbbf5ff1b6d40e32154 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 20 Oct 2021 10:57:53 +0200 Subject: [PATCH 76/92] 7.0.0 --- CHANGELOG | 8 +++++++- package.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a9588b7b..553e90dc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,11 @@ # nodeGame Changelog +# 7.0.0 +- Dropped --phantoms option in launcher. +- More robust paths in launcher. +- Added nodeGameRoot path in launcher. +- Installer adapted to support alpha releases. + # 6.3.0 - Fixed installer getting stuck on versions and help. - Added installer option --no-games to skip installing default games. @@ -143,7 +149,7 @@ treatment for the game. # 2.0.2 - Fixed install.stable script. -- Fixing launcher options. +- Fixing launcher options. # 2.0.0 (current) - Added -s option to launcher. Starts the server in SSL mode. Can be empty (loads nodegame-server/ssl/), or a path to a SSL directory. diff --git a/package.json b/package.json index f917fab8..816f2b57 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "6.3.0", + "version": "7.0.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 168304851fae299de01cc2f40b708d240a4f720f Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 20 Oct 2021 11:06:03 +0200 Subject: [PATCH 77/92] updated-installer --- bin/nodegame-installer.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 4e768baf..2c0deefe 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -41,13 +41,14 @@ const STABLE_VERSIONS = { v3: '3.5.3', v4: '4.3.3', v5: '5.11.2', - v6: '6.3.0' + v6: '6.3.0', + v7: '7.0.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); // Installer default version. -const INSTALLER_VERSION = 'v6'; +const INSTALLER_VERSION = 'v7'; // If node_modules folders are detected, their paths (without node_modules) // is stored in here. @@ -110,13 +111,11 @@ for (let i = 0; i < process.argv.length; i++) { isDev = true; requestedVersion = '@' + version; - - MAIN_MODULE = 'nodegame-test'; - - version = '7.0.4'; - requestedVersion = '@' + version; - - alpha = true; + // For testing alpha versions. + // MAIN_MODULE = 'nodegame-test'; + // version = '7.0.4'; + // requestedVersion = '@' + version; + // alpha = true; } else { version = STABLE_VERSIONS[requestedVersion]; From 7f7cb19b99852189809d414365d557a07a9d496e Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 20 Oct 2021 11:08:37 +0200 Subject: [PATCH 78/92] updated v7 --- package.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 816f2b57..2fbc1765 100644 --- a/package.json +++ b/package.json @@ -15,19 +15,19 @@ "url": "https://github.com/nodeGame/nodegame.git" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 10.0.0" }, "dependencies": { - "nodegame-server": "^6.0.0", - "nodegame-client": "^6.0.0", - "nodegame-window": "^6.0.0", - "nodegame-widgets": "^6.0.0", - "nodegame-requirements": "^6.0.0", - "nodegame-game-template": "^6.0.0", - "nodegame-monitor": "^6.0.0", - "nodegame-generator": "^6.0.0", - "ultimatum-game": "^6.0.0", - "nodegame-mturk": "^6.0.0", + "nodegame-client": "^7.0.0", + "nodegame-server": "^7.0.0", + "nodegame-window": "^7.0.0", + "nodegame-widgets": "^7.0.0", + "nodegame-requirements": "^7.0.0", + "nodegame-game-template": "^7.0.0", + "nodegame-monitor": "^7.0.0", + "nodegame-generator": "^7.0.0", + "ultimatum-game": "^7.0.0", + "nodegame-mturk": "^7.0.0", "JSUS": "^1.1.0", "NDDB": "^2.0.0", "nodegame-db": "*", From 61cbf8613abb40f15df149cf60c2d722d7efaab6 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 20 Oct 2021 11:09:30 +0200 Subject: [PATCH 79/92] minor --- CHANGELOG | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 553e90dc..89bd5277 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # nodeGame Changelog -# 7.0.0 +# 7.0.1 - Dropped --phantoms option in launcher. - More robust paths in launcher. - Added nodeGameRoot path in launcher. diff --git a/package.json b/package.json index 2fbc1765..6a105396 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "7.0.0", + "version": "7.0.1", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 96fc4fd7af1c538cc0c69f54061931b76a550163 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 20 Oct 2021 11:09:56 +0200 Subject: [PATCH 80/92] 7.0.1 --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 89bd5277..70be548a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # nodeGame Changelog -# 7.0.1 +# 7.0.0 (.1) - Dropped --phantoms option in launcher. - More robust paths in launcher. - Added nodeGameRoot path in launcher. From 5cd8a91408e8ac0db3907af2bee338aeefd85a02 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 20 Oct 2021 11:10:29 +0200 Subject: [PATCH 81/92] 7.0.1 --- bin/nodegame-installer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 2c0deefe..ba462d33 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -42,7 +42,7 @@ const STABLE_VERSIONS = { v4: '4.3.3', v5: '5.11.2', v6: '6.3.0', - v7: '7.0.0' + v7: '7.0.1' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); From 215916b9475d52d80889a9728a913f8de2231ce4 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 20 Oct 2021 14:33:30 +0200 Subject: [PATCH 82/92] 7.0.2 --- bin/nodegame-installer.js | 3 +-- package.json | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index ba462d33..355c683e 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -458,13 +458,12 @@ function printNodeGameInfo() { } function printInstallInfo() { - let str; log(); log('----------------------------------------------'); log(); log('node version: ' + process.version); - str = 'nodeGame version: ' + VERSION; + let str = 'nodeGame version: ' + VERSION; if (branch) str += ' (' + branch + ')'; log(str); str = 'install directory: ' + INSTALL_DIR; diff --git a/package.json b/package.json index 6a105396..875b573a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "7.0.1", + "version": "7.0.2", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ @@ -29,7 +29,7 @@ "ultimatum-game": "^7.0.0", "nodegame-mturk": "^7.0.0", "JSUS": "^1.1.0", - "NDDB": "^2.0.0", + "NDDB": "^3.0.0", "nodegame-db": "*", "nodegame-mongodb": "*", "commander": "^7.0.0", From 204ed93d97091c92e15071e4061971175b38dbdf Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 20 Oct 2021 14:33:59 +0200 Subject: [PATCH 83/92] minor --- bin/nodegame-installer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 355c683e..a0696f86 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -42,7 +42,7 @@ const STABLE_VERSIONS = { v4: '4.3.3', v5: '5.11.2', v6: '6.3.0', - v7: '7.0.1' + v7: '7.0.2' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); From 944e369049f9134100eecff594bd3721cea5ff2d Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 20 Oct 2021 17:33:43 +0200 Subject: [PATCH 84/92] 7.0.3 --- CHANGELOG | 5 ++++- package.json | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 70be548a..560cfff8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,9 @@ # nodeGame Changelog -# 7.0.0 (.1) +# 7.0.3 +- Minor, installation fixes. + +# 7.0.0 - Dropped --phantoms option in launcher. - More robust paths in launcher. - Added nodeGameRoot path in launcher. diff --git a/package.json b/package.json index 875b573a..6aba8ee9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "7.0.2", + "version": "7.0.3", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ @@ -18,18 +18,18 @@ "node": ">= 10.0.0" }, "dependencies": { - "nodegame-client": "^7.0.0", - "nodegame-server": "^7.0.0", - "nodegame-window": "^7.0.0", - "nodegame-widgets": "^7.0.0", - "nodegame-requirements": "^7.0.0", - "nodegame-game-template": "^7.0.0", - "nodegame-monitor": "^7.0.0", - "nodegame-generator": "^7.0.0", - "ultimatum-game": "^7.0.0", - "nodegame-mturk": "^7.0.0", - "JSUS": "^1.1.0", - "NDDB": "^3.0.0", + "nodegame-client": ">=7.0.0", + "nodegame-server": ">=7.0.1", + "nodegame-window": ">=7.0.0", + "nodegame-widgets": ">=7.0.0", + "nodegame-requirements": ">=7.0.0", + "nodegame-game-template": ">=7.0.0", + "nodegame-monitor": ">=7.0.0", + "nodegame-generator": ">=7.0.0", + "ultimatum-game": ">=7.0.0", + "nodegame-mturk": ">=7.0.0", + "JSUS": ">=1.1.0", + "NDDB": ">=3.0.0", "nodegame-db": "*", "nodegame-mongodb": "*", "commander": "^7.0.0", From dfacda3b09db0a688844a43eae880fbb01b397c3 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Wed, 20 Oct 2021 17:34:26 +0200 Subject: [PATCH 85/92] installer --- bin/nodegame-installer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index a0696f86..31093be0 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -42,7 +42,7 @@ const STABLE_VERSIONS = { v4: '4.3.3', v5: '5.11.2', v6: '6.3.0', - v7: '7.0.2' + v7: '7.0.3' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); From 96da231ad25fb96278c4a59fd1e7bade9a394ede Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Sat, 23 Oct 2021 14:05:54 +0200 Subject: [PATCH 86/92] 7.0.4 --- CHANGELOG | 4 ++++ bin/nodegame-installer.js | 3 ++- launcher.js | 28 ++++++++++++++-------------- package.json | 2 +- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 560cfff8..d824d290 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # nodeGame Changelog +- 7.0.4 +- Updated installer. +- Minor fixes. + # 7.0.3 - Minor, installation fixes. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 31093be0..aea65496 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -965,7 +965,8 @@ function moveFolderSync(from, to, copy) { let fileFrom = path.join(from, element); let fileTo = path.join(to, element); - if (fs.lstatSync(fileFrom).isFile()) { + let stats = fs.lstatSync(fileFrom); + if (stats.isFile() || stats.isSymbolicLink()) { if (copy) fs.copyFileSync(fileFrom, fileTo); else fs.renameSync(fileFrom, fileTo); } diff --git a/launcher.js b/launcher.js index 4c9baac7..6251ed8e 100644 --- a/launcher.js +++ b/launcher.js @@ -106,20 +106,20 @@ program .option('-p, --phantoms ', 'Connect phantoms to the specified channel **DISCONTINUED**') - .option('-n, --nClients ', - 'Sets the number of clients phantoms to connect (default: 4)') - .option('-t, --clientType ', - 'Sets the client type of connecting phantoms (default: autoplay)') - .option('-T, --runTests', - 'Run tests after all phantoms are game-over ' + - '(overwrites settings.js in test/)') - .option('-k, --killServer', - 'Kill server after all phantoms are game-over') - .option('-a --auth [option]', - 'Phantoms auth options. Values: new(default)|createNew|' + - 'nextAvailable|next|code|id:code&pwd:password|file:path/to/file.') - .option('-w --wait [milliseconds]', - 'Waits before connecting the next phantom. Default: 1000') + // .option('-n, --nClients ', + // 'Sets the number of clients phantoms to connect (default: 4)') + // .option('-t, --clientType ', + // 'Sets the client type of connecting phantoms (default: autoplay)') + // .option('-T, --runTests', + // 'Run tests after all phantoms are game-over ' + + // '(overwrites settings.js in test/)') + // .option('-k, --killServer', + // 'Kill server after all phantoms are game-over') + // .option('-a --auth [option]', + // 'Phantoms auth options. Values: new(default)|createNew|' + + // 'nextAvailable|next|code|id:code&pwd:password|file:path/to/file.') + // .option('-w --wait [milliseconds]', + // 'Waits before connecting the next phantom. Default: 1000') .parse(process.argv); diff --git a/package.json b/package.json index 6aba8ee9..3876f4d5 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "dependencies": { "nodegame-client": ">=7.0.0", - "nodegame-server": ">=7.0.1", + "nodegame-server": ">=7.0.2", "nodegame-window": ">=7.0.0", "nodegame-widgets": ">=7.0.0", "nodegame-requirements": ">=7.0.0", From f07fe60d4df97d7e269a12467306ab90f483b0cd Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Sat, 23 Oct 2021 14:06:25 +0200 Subject: [PATCH 87/92] minor --- bin/nodegame-installer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index aea65496..fa76c752 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -42,7 +42,7 @@ const STABLE_VERSIONS = { v4: '4.3.3', v5: '5.11.2', v6: '6.3.0', - v7: '7.0.3' + v7: '7.0.4' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); From a54cbd3260403ee2ddd01b4784bb329abaf4e7bf Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Sat, 23 Oct 2021 14:06:50 +0200 Subject: [PATCH 88/92] 7.0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3876f4d5..b58feb7a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "7.0.3", + "version": "7.0.4", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From 0e567027706ad3ea2a94a107c4309295f9ffe45e Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Sat, 6 Nov 2021 23:22:40 +0100 Subject: [PATCH 89/92] 7.1.0 --- CHANGELOG | 5 ++++- bin/nodegame-installer.js | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d824d290..c0f95498 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,9 @@ # nodeGame Changelog -- 7.0.4 +# 7.1.0 +- New release, updated installer. + +# 7.0.4 - Updated installer. - Minor fixes. diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index fa76c752..eb568ccb 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -42,7 +42,7 @@ const STABLE_VERSIONS = { v4: '4.3.3', v5: '5.11.2', v6: '6.3.0', - v7: '7.0.4' + v7: '7.1.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); diff --git a/package.json b/package.json index b58feb7a..f11d9d6e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nodegame", "description": "Fast, scalable JavaScript for large-scale, online, multiplayer, real-time games and experiments.", - "version": "7.0.4", + "version": "7.1.0", "homepage": "http://nodegame.org", "author": "Stefano Balietti ", "contributors": [ From a172fd0a2b9e9187b4db3400ffbf0ca2d7905608 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Sat, 6 Nov 2021 23:27:21 +0100 Subject: [PATCH 90/92] minor --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f11d9d6e..a912f1f5 100644 --- a/package.json +++ b/package.json @@ -18,10 +18,10 @@ "node": ">= 10.0.0" }, "dependencies": { - "nodegame-client": ">=7.0.0", - "nodegame-server": ">=7.0.2", + "nodegame-client": ">=7.1.0", + "nodegame-server": ">=7.0.3", "nodegame-window": ">=7.0.0", - "nodegame-widgets": ">=7.0.0", + "nodegame-widgets": ">=7.0.2", "nodegame-requirements": ">=7.0.0", "nodegame-game-template": ">=7.0.0", "nodegame-monitor": ">=7.0.0", @@ -29,7 +29,7 @@ "ultimatum-game": ">=7.0.0", "nodegame-mturk": ">=7.0.0", "JSUS": ">=1.1.0", - "NDDB": ">=3.0.0", + "NDDB": ">=3.0.2", "nodegame-db": "*", "nodegame-mongodb": "*", "commander": "^7.0.0", From a17c69576a2e7d5d3c86e1d36ec5fb81cf7cd580 Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 21 Sep 2023 16:49:52 +0200 Subject: [PATCH 91/92] updating installer --- bin/nodegame-installer.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index eb568ccb..23ac717e 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -1,7 +1,7 @@ #!/usr/local/bin/node /** * # nodeGame Installer - * Copyright(c) 2011-2020 Stefano Balietti + * Copyright(c) 2011-2023 Stefano Balietti * MIT Licensed * * http://www.nodegame.org @@ -43,6 +43,7 @@ const STABLE_VERSIONS = { v5: '5.11.2', v6: '6.3.0', v7: '7.1.0' + // v8: '8.0.0' }; const AVAILABLE_VERSIONS = Object.keys(STABLE_VERSIONS).concat(['dev']); @@ -117,6 +118,13 @@ for (let i = 0; i < process.argv.length; i++) { // requestedVersion = '@' + version; // alpha = true; } + else if (requestedVersion === 'alpha') { + // For testing alpha versions. + isDev = true; + MAIN_MODULE = 'nodegame-test'; + requestedVersion = '@latest'; + alpha = true; + } else { version = STABLE_VERSIONS[requestedVersion]; if (!version) { From 8e0945c8036fe8fc7fe00157394a5466baf1eebd Mon Sep 17 00:00:00 2001 From: Stefano Balietti Date: Thu, 21 Sep 2023 16:51:44 +0200 Subject: [PATCH 92/92] minor --- bin/nodegame-installer.js | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/nodegame-installer.js b/bin/nodegame-installer.js index 23ac717e..91c0cfbf 100755 --- a/bin/nodegame-installer.js +++ b/bin/nodegame-installer.js @@ -120,7 +120,6 @@ for (let i = 0; i < process.argv.length; i++) { } else if (requestedVersion === 'alpha') { // For testing alpha versions. - isDev = true; MAIN_MODULE = 'nodegame-test'; requestedVersion = '@latest'; alpha = true;