XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

chore: push missing ceres junction challenge (#4444)

for some unknown reason some users have problem with it Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4444 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>

ebab38ae
AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
提交于

代码差异

2 个文件 +33 -9
Modified src/services/inventoryService.ts +16 -0
@@ -3175,6 +3175,22 @@ export const cleanupInventory = (inventory: TInventoryDatabaseDocument): void =>
3175 3175 inventory.WeeklyGuildVaultBonusInfo = [inventory.WeeklyGuildVaultBonusInfo];
3176 3176 }
3177 3177
3178 if (inventory.PeriodicMissionCompletions.some(x => x.tag.startsWith("TreasureHunt"))) {
3179 const challenge = inventory.ChallengeProgress.find(x => x.Name == "MCCompleteTreasureHunt");
3180 if (challenge) {
3181 if (challenge.Progress != 1) {
3182 challenge.Progress = 1;
3183 logger.debug("fixed broken MCCompleteTreasureHunt challenge");
3184 }
3185 } else {
3186 inventory.ChallengeProgress.push({
3187 Name: "MCCompleteTreasureHunt",
3188 Progress: 1
3189 });
3190 logger.debug("pushed MCCompleteTreasureHunt challenge because we alredy completed Treasure Hunt in past");
3191 }
3192 }
3193
3178 3194 for (const challenge of inventory.ChallengeProgress) {
3179 3195 if (challenge.Completed?.length === 0) {
3180 3196 challenge.Completed = undefined;
Modified src/services/missionInventoryUpdateService.ts +17 -9
@@ -277,17 +277,25 @@ export const addMissionInventoryUpdates = async (
277 277 }
278 278 }
279 279 if (inventoryUpdates.RewardInfo) {
280 if (inventoryUpdates.RewardInfo.periodicMissionTag && !inventory.alertsRepeatable) {
280 if (inventoryUpdates.RewardInfo.periodicMissionTag) {
281 281 const tag = inventoryUpdates.RewardInfo.periodicMissionTag;
282 const existingCompletion = inventory.PeriodicMissionCompletions.find(completion => completion.tag === tag);
282 if (!inventory.alertsRepeatable) {
283 const existingCompletion = inventory.PeriodicMissionCompletions.find(
284 completion => completion.tag === tag
285 );
283 286
284 if (existingCompletion) {
285 existingCompletion.date = new Date();
286 } else {
287 inventory.PeriodicMissionCompletions.push({
288 tag: tag,
289 date: new Date()
290 });
287 if (existingCompletion) {
288 existingCompletion.date = new Date();
289 } else {
290 inventory.PeriodicMissionCompletions.push({
291 tag: tag,
292 date: new Date()
293 });
294 }
295 }
296 if (tag.startsWith("TreasureHunt")) {
297 // client supposed send it at its own, but some of them have problem with that
298 await addChallenges(buildLabel, inventory, [{ Name: "MCCompleteTreasureHunt", Progress: 1 }]);
291 299 }
292 300 }
293 301 if (inventoryUpdates.RewardInfo.NemesisAbandonedRewards) {