From 01513a2992ffe59ebec6795a9f555c33ec82206b Mon Sep 17 00:00:00 2001 From: mao154 Date: Sun, 13 Dec 2020 21:24:37 +0100 Subject: [PATCH 1/3] fixed setTimeout --- game/client_types/player.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/game/client_types/player.js b/game/client_types/player.js index 5f5b6ca..85a4583 100644 --- a/game/client_types/player.js +++ b/game/client_types/player.js @@ -48,7 +48,7 @@ module.exports = function(treatmentName, settings, stager, setup, gameRoom) { } node.game.lastDepartureTime = departure; node.game.decisionMade(decision); - setTimeout(function() { + node.timer.setTimeout(function() { W.getElementById('decision').click(); }, 2000); }; @@ -292,7 +292,5 @@ module.exports = function(treatmentName, settings, stager, setup, gameRoom) { console.log('PHANTOMJS EXITING'); } }); - -}; - +}; From ee4349349d68ff22401a54c1451b284905c49c13 Mon Sep 17 00:00:00 2001 From: mao154 Date: Sun, 13 Dec 2020 21:37:33 +0100 Subject: [PATCH 2/3] fixed const, let --- game/client_types/autoplay.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/game/client_types/autoplay.js b/game/client_types/autoplay.js index 6099286..16ea25b 100644 --- a/game/client_types/autoplay.js +++ b/game/client_types/autoplay.js @@ -10,11 +10,11 @@ module.exports = function(treatmentName, settings, stager, setup, gameRoom) { - var ngc = require('nodegame-client'); - - var game, stager; - - game = gameRoom.getClientType('player'); + const ngc = require('nodegame-client'); + + var stager; + + let game = gameRoom.getClientType('player'); game.nodename = 'autoplay'; game.env.allowTimeup = true; @@ -42,7 +42,7 @@ module.exports = function(treatmentName, settings, stager, setup, gameRoom) { } } }); - + // Gameover will be executed only in 'auto' mode. stager.setOnGameOver(function() { @@ -51,10 +51,6 @@ module.exports = function(treatmentName, settings, stager, setup, gameRoom) { window.close(); }, 60000); }); - + return game; }; - - - - From 0a9472cfe938c78044b077eba2c50d2b159ff465 Mon Sep 17 00:00:00 2001 From: mao154 Date: Sun, 13 Dec 2020 21:37:53 +0100 Subject: [PATCH 3/3] fixed const --- game/client_types/player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/client_types/player.js b/game/client_types/player.js index 85a4583..d76b99a 100644 --- a/game/client_types/player.js +++ b/game/client_types/player.js @@ -10,8 +10,8 @@ * http://www.nodegame.org * --- */ -var ngc = require('nodegame-client'); -var stepRules = ngc.stepRules; +const ngc = require('nodegame-client'); +const stepRules = ngc.stepRules; module.exports = function(treatmentName, settings, stager, setup, gameRoom) {