Browse Source

Death tracking

tags/v0.3.2.16
Big Bad Waffle 4 years ago
parent
commit
c5fa80eb5e
4 changed files with 16 additions and 22 deletions
  1. +13
    -0
      src/server/components/auth.js
  2. +1
    -0
      src/server/components/player.js
  3. +1
    -11
      src/server/components/quests.js
  4. +1
    -11
      src/server/components/stats.js

+ 13
- 0
src/server/components/auth.js View File

@@ -305,6 +305,19 @@ module.exports = {
this.gaTracker = ga.connect(this.username);
},

track: function (category, action, label, value = 1) {
process.send({
method: 'track',
serverId: this.obj.serverId,
obj: {
category,
action,
label,
value
}
});
},

register: async function (msg) {
let credentials = msg.data;



+ 1
- 0
src/server/components/player.js View File

@@ -199,6 +199,7 @@ module.exports = {
}

obj.fireEvent('onAfterDeath', source);
obj.auth.track('combat', 'death', source.name, 1);

obj.spellbook.die();
obj.effects.die();


+ 1
- 11
src/server/components/quests.js View File

@@ -38,17 +38,7 @@ module.exports = {
if ((!quest) || (!quest.isReady))
return;

//Analytics Tracking
process.send({
method: 'track',
serverId: this.obj.serverId,
obj: {
category: 'quest',
action: 'complete',
label: quest.name,
value: 1
}
});
this.obj.auth.track('quest', 'complete', quest.name);

quest.complete();



+ 1
- 11
src/server/components/stats.js View File

@@ -333,17 +333,7 @@ module.exports = {
},

kill: function (target) {
//Analytics Tracking
process.send({
method: 'track',
serverId: this.obj.serverId,
obj: {
category: 'combat',
action: 'kill',
label: target.name,
value: 1
}
});
this.obj.auth.track('combat', 'kill', target.name);

if (target.player)
return;


Loading…
Cancel
Save