chore: Remove temporary code

This commit is contained in:
Blade Barringer
2016-06-05 08:56:57 -05:00
parent e7c9fc70d4
commit ac24fb31fb
3 changed files with 1 additions and 24 deletions

View File

@@ -392,17 +392,6 @@ api.scoreTask = {
let wasCompleted = task.completed;
// TEMPORARY, remove once collection migration completes
if (typeof user.party.quest.progress.collect === 'object') {
let totalItemsFound = _.reduce(user.party.quest.progress.collect, (total, amount) => {
return total + amount;
}, 0);
user.party.quest.progress.collect = totalItemsFound;
} else if (!user.party.quest.progress.collect) {
user.party.quest.progress.collect = 0;
}
let [delta] = common.ops.scoreTask({task, user, direction}, req);
// Drop system (don't run on the client, as it would only be discarded since ops are sent to the API, not the results)
if (direction === 'up') user.fns.randomDrop({task, delta}, req);

View File

@@ -587,17 +587,6 @@ schema.statics.processQuestProgress = async function processQuestProgress (user,
if (!_isOnQuest(user, progress, group)) return;
// TEMPORARY, remove once collection migration completes
if (typeof progress.collect === 'object') {
let totalItemsFound = _.reduce(progress.collect, (total, amount) => {
return total + amount;
}, 0);
progress.collect = totalItemsFound;
} else if (!progress.collect) {
progress.collect = 0;
}
let quest = shared.content.quests[group.quest.key];
if (!quest) return; // TODO should this throw an error instead?

View File

@@ -376,8 +376,7 @@ export let schema = new Schema({
progress: {
up: {type: Number, default: 0},
down: {type: Number, default: 0},
// TEMPORARY - Switch type to Number after migration
collect: {type: Schema.Types.Mixed, default: 0},
collect: {type: Number, default: 0},
},
completed: String, // When quest is done, we move it from key => completed, and it's a one-time flag (for modal) that they unset by clicking "ok" in browser
RSVPNeeded: {type: Boolean, default: false}, // Set to true when invite is pending, set to false when quest invite is accepted or rejected, quest starts, or quest is cancelled