From 078100aac8a1042c015f0c2be2f79f756926f65b Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 25 Feb 2016 16:01:13 -0500 Subject: [PATCH 1/7] chore(logging): output active handles per 10 minutes --- package.json | 1 + website/src/server.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/package.json b/package.json index ea497f587d..01f8d6bd83 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "version": "0.0.0-152", "main": "./website/src/server.js", "dependencies": { + "active-handles": "^1.1.0", "amazon-payments": "0.0.4", "amplitude": "^2.0.3", "async": "~0.9.0", diff --git a/website/src/server.js b/website/src/server.js index 494febfb97..f95a89323d 100644 --- a/website/src/server.js +++ b/website/src/server.js @@ -10,6 +10,7 @@ var isProd = nconf.get('NODE_ENV') === 'production'; var isDev = nconf.get('NODE_ENV') === 'development'; var DISABLE_LOGGING = nconf.get('DISABLE_REQUEST_LOGGING'); var cores = +nconf.get("WEB_CONCURRENCY") || 0; +var activeHandles = require('active-handles'); if (cores!==0 && cluster.isMaster && (isDev || isProd)) { // Fork workers. If config.json has CORES=x, use that - otherwise, use all cpus-1 (production) @@ -161,4 +162,10 @@ if (cores!==0 && cluster.isMaster && (isDev || isProd)) { }); module.exports = server; + + var activeHandleInterval = setInterval(logHandles,600000); + + function logHandles() { + activeHandles.print(); + } } From bff5258a56e44dd2f17fe8d7577223e08fc1c223 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 25 Feb 2016 16:11:02 -0500 Subject: [PATCH 2/7] fix(logging): get interval from env var --- website/src/server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/src/server.js b/website/src/server.js index f95a89323d..3df980b201 100644 --- a/website/src/server.js +++ b/website/src/server.js @@ -163,7 +163,8 @@ if (cores!==0 && cluster.isMaster && (isDev || isProd)) { module.exports = server; - var activeHandleInterval = setInterval(logHandles,600000); + var logHandlesInterval = +nconf.get('LOG_HANDLES_INTERVAL') || 60000; + var activeHandleInterval = setInterval(logHandles, logHandlesInterval); function logHandles() { activeHandles.print(); From a698559c0468d1dcbdf8098cd57ae573fbc0d04d Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Fri, 26 Feb 2016 13:28:44 -0500 Subject: [PATCH 3/7] fix(log-handles): don't log verbose code --- website/src/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/server.js b/website/src/server.js index 3df980b201..bf803385bb 100644 --- a/website/src/server.js +++ b/website/src/server.js @@ -167,6 +167,6 @@ if (cores!==0 && cluster.isMaster && (isDev || isProd)) { var activeHandleInterval = setInterval(logHandles, logHandlesInterval); function logHandles() { - activeHandles.print(); + activeHandles.print({highlight:false}); } } From c761944c3536a4c4647dde8d2f890d11fa5547d9 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Wed, 2 Mar 2016 10:22:46 -0500 Subject: [PATCH 4/7] feat(logging): timestamp active handles output --- website/src/server.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/src/server.js b/website/src/server.js index bf803385bb..80d9cd68e7 100644 --- a/website/src/server.js +++ b/website/src/server.js @@ -11,6 +11,7 @@ var isDev = nconf.get('NODE_ENV') === 'development'; var DISABLE_LOGGING = nconf.get('DISABLE_REQUEST_LOGGING'); var cores = +nconf.get("WEB_CONCURRENCY") || 0; var activeHandles = require('active-handles'); +var moment = require('moment'); if (cores!==0 && cluster.isMaster && (isDev || isProd)) { // Fork workers. If config.json has CORES=x, use that - otherwise, use all cpus-1 (production) @@ -167,6 +168,7 @@ if (cores!==0 && cluster.isMaster && (isDev || isProd)) { var activeHandleInterval = setInterval(logHandles, logHandlesInterval); function logHandles() { + console.log(moment().format()); activeHandles.print({highlight:false}); } } From af38e83e365135a3782f600d2546c51a021ae446 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Wed, 2 Mar 2016 11:30:49 -0500 Subject: [PATCH 5/7] fix(logging): don't log without env var --- website/src/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/server.js b/website/src/server.js index 80d9cd68e7..8fc8cce0b1 100644 --- a/website/src/server.js +++ b/website/src/server.js @@ -164,8 +164,8 @@ if (cores!==0 && cluster.isMaster && (isDev || isProd)) { module.exports = server; - var logHandlesInterval = +nconf.get('LOG_HANDLES_INTERVAL') || 60000; - var activeHandleInterval = setInterval(logHandles, logHandlesInterval); + var logHandlesInterval = +nconf.get('LOG_HANDLES_INTERVAL'); + if (logHandlesInterval) { var activeHandleInterval = setInterval(logHandles, logHandlesInterval); } function logHandles() { console.log(moment().format()); From 56e53cc95f35e80675628ea2d2c88565fd0340f0 Mon Sep 17 00:00:00 2001 From: Alys Date: Thu, 3 Mar 2016 08:30:49 +1000 Subject: [PATCH 6/7] fix Burst of Flames / fireball skill - was doing too much boss damage; add human-friendly names to skills for ease of searching --- common/script/content/spells.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/common/script/content/spells.js b/common/script/content/spells.js index 9a58e85394..aae94aecb5 100644 --- a/common/script/content/spells.js +++ b/common/script/content/spells.js @@ -35,6 +35,7 @@ let spells = {}; spells.wizard = { fireball: { + // Burst of Flames text: t('spellWizardFireballText'), mana: 10, lvl: 11, @@ -45,13 +46,14 @@ spells.wizard = { bonus *= Math.ceil((target.value < 0 ? 1 : target.value + 1) * 0.075); user.stats.exp += diminishingReturns(bonus, 75); if (!user.party.quest.progress) user.party.quest.progress = 0; - user.party.quest.progress.up += Math.ceil(user._statsComputed.int * 9.1); + user.party.quest.progress.up += Math.ceil(user._statsComputed.int * 0.1); // TODO change, pass req to spell? let req = {language: user.preferences.language}; user.fns.updateStats(user.stats, req); }, }, mpheal: { + // Ethereal Surge text: t('spellWizardMPHealText'), mana: 30, lvl: 12, @@ -67,6 +69,7 @@ spells.wizard = { }, }, earth: { + // Earthquake text: t('spellWizardEarthText'), mana: 35, lvl: 13, @@ -81,6 +84,7 @@ spells.wizard = { }, }, frost: { + // Chilling Frost text: t('spellWizardFrostText'), mana: 40, lvl: 14, @@ -94,6 +98,7 @@ spells.wizard = { spells.warrior = { smash: { + // Brutal Smash text: t('spellWarriorSmashText'), mana: 10, lvl: 11, @@ -107,6 +112,7 @@ spells.warrior = { }, }, defensiveStance: { + // Defensive Stance text: t('spellWarriorDefensiveStanceText'), mana: 25, lvl: 12, @@ -119,6 +125,7 @@ spells.warrior = { }, }, valorousPresence: { + // Valorous Prescence text: t('spellWarriorValorousPresenceText'), mana: 20, lvl: 13, @@ -133,6 +140,7 @@ spells.warrior = { }, }, intimidate: { + // Intimidating Gaze text: t('spellWarriorIntimidateText'), mana: 15, lvl: 14, @@ -150,6 +158,7 @@ spells.warrior = { spells.rogue = { pickPocket: { + // Pickpocket text: t('spellRoguePickPocketText'), mana: 10, lvl: 11, @@ -161,6 +170,7 @@ spells.rogue = { }, }, backStab: { + // Backstab text: t('spellRogueBackStabText'), mana: 15, lvl: 12, @@ -176,6 +186,7 @@ spells.rogue = { }, }, toolsOfTrade: { + // Tools of the Trade text: t('spellRogueToolsOfTradeText'), mana: 25, lvl: 13, @@ -190,6 +201,7 @@ spells.rogue = { }, }, stealth: { + // Stealth text: t('spellRogueStealthText'), mana: 45, lvl: 14, @@ -204,6 +216,7 @@ spells.rogue = { spells.healer = { heal: { + // Healing Light text: t('spellHealerHealText'), mana: 15, lvl: 11, @@ -215,6 +228,7 @@ spells.healer = { }, }, brightness: { + // Searing Brightness text: t('spellHealerBrightnessText'), mana: 15, lvl: 12, @@ -229,6 +243,7 @@ spells.healer = { }, }, protectAura: { + // Protective Aura text: t('spellHealerProtectAuraText'), mana: 30, lvl: 13, @@ -243,6 +258,7 @@ spells.healer = { }, }, heallAll: { + // Blessing text: t('spellHealerHealAllText'), mana: 25, lvl: 14, From c3107ad3fb49b16430bb2a1ef7984e115ae2c223 Mon Sep 17 00:00:00 2001 From: Alys Date: Thu, 3 Mar 2016 13:35:55 +1000 Subject: [PATCH 7/7] improve commenting style --- common/script/content/spells.js | 48 +++++++++++---------------------- 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/common/script/content/spells.js b/common/script/content/spells.js index aae94aecb5..6acc2f25a6 100644 --- a/common/script/content/spells.js +++ b/common/script/content/spells.js @@ -34,8 +34,7 @@ function calculateBonus (value, stat, crit = 1, statScale = 0.5) { let spells = {}; spells.wizard = { - fireball: { - // Burst of Flames + fireball: { // Burst of Flames text: t('spellWizardFireballText'), mana: 10, lvl: 11, @@ -52,8 +51,7 @@ spells.wizard = { user.fns.updateStats(user.stats, req); }, }, - mpheal: { - // Ethereal Surge + mpheal: { // Ethereal Surge text: t('spellWizardMPHealText'), mana: 30, lvl: 12, @@ -68,8 +66,7 @@ spells.wizard = { }); }, }, - earth: { - // Earthquake + earth: { // Earthquake text: t('spellWizardEarthText'), mana: 35, lvl: 13, @@ -83,8 +80,7 @@ spells.wizard = { }); }, }, - frost: { - // Chilling Frost + frost: { // Chilling Frost text: t('spellWizardFrostText'), mana: 40, lvl: 14, @@ -97,8 +93,7 @@ spells.wizard = { }; spells.warrior = { - smash: { - // Brutal Smash + smash: { // Brutal Smash text: t('spellWarriorSmashText'), mana: 10, lvl: 11, @@ -111,8 +106,7 @@ spells.warrior = { user.party.quest.progress.up += diminishingReturns(bonus, 55, 70); }, }, - defensiveStance: { - // Defensive Stance + defensiveStance: { // Defensive Stance text: t('spellWarriorDefensiveStanceText'), mana: 25, lvl: 12, @@ -124,8 +118,7 @@ spells.warrior = { user.stats.buffs.con += Math.ceil(diminishingReturns(bonus, 40, 200)); }, }, - valorousPresence: { - // Valorous Prescence + valorousPresence: { // Valorous Prescence text: t('spellWarriorValorousPresenceText'), mana: 20, lvl: 13, @@ -139,8 +132,7 @@ spells.warrior = { }); }, }, - intimidate: { - // Intimidating Gaze + intimidate: { // Intimidating Gaze text: t('spellWarriorIntimidateText'), mana: 15, lvl: 14, @@ -157,8 +149,7 @@ spells.warrior = { }; spells.rogue = { - pickPocket: { - // Pickpocket + pickPocket: { // Pickpocket text: t('spellRoguePickPocketText'), mana: 10, lvl: 11, @@ -169,8 +160,7 @@ spells.rogue = { user.stats.gp += diminishingReturns(bonus, 25, 75); }, }, - backStab: { - // Backstab + backStab: { // Backstab text: t('spellRogueBackStabText'), mana: 15, lvl: 12, @@ -185,8 +175,7 @@ spells.rogue = { user.fns.updateStats(user.stats, req); }, }, - toolsOfTrade: { - // Tools of the Trade + toolsOfTrade: { // Tools of the Trade text: t('spellRogueToolsOfTradeText'), mana: 25, lvl: 13, @@ -200,8 +189,7 @@ spells.rogue = { }); }, }, - stealth: { - // Stealth + stealth: { // Stealth text: t('spellRogueStealthText'), mana: 45, lvl: 14, @@ -215,8 +203,7 @@ spells.rogue = { }; spells.healer = { - heal: { - // Healing Light + heal: { // Healing Light text: t('spellHealerHealText'), mana: 15, lvl: 11, @@ -227,8 +214,7 @@ spells.healer = { if (user.stats.hp > 50) user.stats.hp = 50; }, }, - brightness: { - // Searing Brightness + brightness: { // Searing Brightness text: t('spellHealerBrightnessText'), mana: 15, lvl: 12, @@ -242,8 +228,7 @@ spells.healer = { }); }, }, - protectAura: { - // Protective Aura + protectAura: { // Protective Aura text: t('spellHealerProtectAuraText'), mana: 30, lvl: 13, @@ -257,8 +242,7 @@ spells.healer = { }); }, }, - heallAll: { - // Blessing + heallAll: { // Blessing text: t('spellHealerHealAllText'), mana: 25, lvl: 14,