Skip to content

Commit

Permalink
feat: send UnlockableAddedToInventory to the client
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyFuller committed Aug 18, 2024
1 parent 11595ad commit a6a9327
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions components/menuData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
unlockOrderComparer,
uuidRegex,
} from "./utils"
import { contractSessions, getSession } from "./eventHandler"
import { contractSessions, enqueueEvent, getSession } from "./eventHandler"
import { getConfig, getVersionedConfig } from "./configSwizzleManager"
import { controller } from "./controller"
import { createLocationsData, getDestination } from "./menus/destinations"
Expand Down Expand Up @@ -320,7 +320,25 @@ menuDataRouter.get(
true,
)

// TODO: Enqueue events to unlock PRO1
// Send all the drops, we technically only need to send the pro1 drop, but this is best practise.
if (missionEndData.MissionReward.Drops.length) {
enqueueEvent(req.jwt.unique_name, {
Name: "UnlockableAddedToInventory",
Value: {
Items: missionEndData.MissionReward.Drops.map(
(drop) => {
return { UnlockableId: drop.Unlockable.Id }
},
),
},
Version: {
_Build: 61,
_Major: 6,
_Minor: 74,
_Revision: 0,
},
})
}

res.json({
template: getConfig("MissionRewardsTemplate", false),
Expand Down

0 comments on commit a6a9327

Please sign in to comment.