Minor achievement event improvements

This commit is contained in:
Bryan Ashby 2019-01-30 23:36:00 -07:00
parent 4bb4a06e66
commit 6aa6712edc
2 changed files with 7 additions and 2 deletions

View File

@ -211,9 +211,12 @@ class Achievements {
StatLog.incrementUserStat(info.client.user, UserProps.AchievementTotalCount, 1); StatLog.incrementUserStat(info.client.user, UserProps.AchievementTotalCount, 1);
StatLog.incrementUserStat(info.client.user, UserProps.AchievementTotalPoints, info.details.points); StatLog.incrementUserStat(info.client.user, UserProps.AchievementTotalPoints, info.details.points);
const cleanTitle = stripMciColorCodes(localInterruptItem.title);
const cleanText = stripMciColorCodes(localInterruptItem.achievText);
const recordData = [ const recordData = [
info.client.user.userId, info.achievementTag, getISOTimestampString(info.timestamp), info.matchField, info.client.user.userId, info.achievementTag, getISOTimestampString(info.timestamp), info.matchField,
stripMciColorCodes(localInterruptItem.title), stripMciColorCodes(localInterruptItem.achievText), info.details.points, cleanTitle, cleanText, info.details.points,
]; ];
UserDb.run( UserDb.run(
@ -231,6 +234,8 @@ class Achievements {
user : info.client.user, user : info.client.user,
achievementTag : info.achievementTag, achievementTag : info.achievementTag,
points : info.details.points, points : info.details.points,
title : cleanTitle,
text : cleanText,
} }
); );

View File

@ -23,5 +23,5 @@ module.exports = {
UserSendNodeMsg : 'codes.l33t.enigma.system.user_send_node_msg', // { ..., global } UserSendNodeMsg : 'codes.l33t.enigma.system.user_send_node_msg', // { ..., global }
UserStatSet : 'codes.l33t.enigma.system.user_stat_set', // { ..., statName, statValue } UserStatSet : 'codes.l33t.enigma.system.user_stat_set', // { ..., statName, statValue }
UserStatIncrement : 'codes.l33t.enigma.system.user_stat_increment', // { ..., statName, statIncrementBy, statValue } UserStatIncrement : 'codes.l33t.enigma.system.user_stat_increment', // { ..., statName, statIncrementBy, statValue }
UserAchievementEarned : 'codes.l33t.enigma.system.user_achievement_earned', // { ..., achievementTag, points } UserAchievementEarned : 'codes.l33t.enigma.system.user_achievement_earned', // { ..., achievementTag, points, title, text }
}; };