Pass output into more event functions
This commit is contained in:
parent
f7a16e15f9
commit
fea17cf3db
@ -155,27 +155,30 @@ export class InventoryCallbacks
|
|||||||
pmcData: IPmcData,
|
pmcData: IPmcData,
|
||||||
body: IInventoryCreateMarkerRequestData,
|
body: IInventoryCreateMarkerRequestData,
|
||||||
sessionID: string,
|
sessionID: string,
|
||||||
|
output: IItemEventRouterResponse,
|
||||||
): IItemEventRouterResponse
|
): IItemEventRouterResponse
|
||||||
{
|
{
|
||||||
return this.inventoryController.createMapMarker(pmcData, body, sessionID);
|
return this.inventoryController.createMapMarker(pmcData, body, sessionID, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public deleteMapMarker(
|
public deleteMapMarker(
|
||||||
pmcData: IPmcData,
|
pmcData: IPmcData,
|
||||||
body: IInventoryDeleteMarkerRequestData,
|
body: IInventoryDeleteMarkerRequestData,
|
||||||
sessionID: string,
|
sessionID: string,
|
||||||
|
output: IItemEventRouterResponse,
|
||||||
): IItemEventRouterResponse
|
): IItemEventRouterResponse
|
||||||
{
|
{
|
||||||
return this.inventoryController.deleteMapMarker(pmcData, body, sessionID);
|
return this.inventoryController.deleteMapMarker(pmcData, body, sessionID, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public editMapMarker(
|
public editMapMarker(
|
||||||
pmcData: IPmcData,
|
pmcData: IPmcData,
|
||||||
body: IInventoryEditMarkerRequestData,
|
body: IInventoryEditMarkerRequestData,
|
||||||
sessionID: string,
|
sessionID: string,
|
||||||
|
output: IItemEventRouterResponse,
|
||||||
): IItemEventRouterResponse
|
): IItemEventRouterResponse
|
||||||
{
|
{
|
||||||
return this.inventoryController.editMapMarker(pmcData, body, sessionID);
|
return this.inventoryController.editMapMarker(pmcData, body, sessionID, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Handle OpenRandomLootContainer */
|
/** Handle OpenRandomLootContainer */
|
||||||
@ -183,9 +186,10 @@ export class InventoryCallbacks
|
|||||||
pmcData: IPmcData,
|
pmcData: IPmcData,
|
||||||
body: IOpenRandomLootContainerRequestData,
|
body: IOpenRandomLootContainerRequestData,
|
||||||
sessionID: string,
|
sessionID: string,
|
||||||
|
output: IItemEventRouterResponse,
|
||||||
): IItemEventRouterResponse
|
): IItemEventRouterResponse
|
||||||
{
|
{
|
||||||
return this.inventoryController.openRandomLootContainer(pmcData, body, sessionID);
|
return this.inventoryController.openRandomLootContainer(pmcData, body, sessionID, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public redeemProfileReward(
|
public redeemProfileReward(
|
||||||
|
@ -812,6 +812,7 @@ export class InventoryController
|
|||||||
pmcData: IPmcData,
|
pmcData: IPmcData,
|
||||||
request: IInventoryCreateMarkerRequestData,
|
request: IInventoryCreateMarkerRequestData,
|
||||||
sessionID: string,
|
sessionID: string,
|
||||||
|
output: IItemEventRouterResponse,
|
||||||
): IItemEventRouterResponse
|
): IItemEventRouterResponse
|
||||||
{
|
{
|
||||||
// Get map from inventory
|
// Get map from inventory
|
||||||
@ -823,7 +824,6 @@ export class InventoryController
|
|||||||
mapItem.upd.Map.Markers.push(request.mapMarker);
|
mapItem.upd.Map.Markers.push(request.mapMarker);
|
||||||
|
|
||||||
// sync with client
|
// sync with client
|
||||||
const output = this.eventOutputHolder.getOutput(sessionID);
|
|
||||||
output.profileChanges[sessionID].items.change.push(mapItem);
|
output.profileChanges[sessionID].items.change.push(mapItem);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
@ -840,6 +840,7 @@ export class InventoryController
|
|||||||
pmcData: IPmcData,
|
pmcData: IPmcData,
|
||||||
request: IInventoryDeleteMarkerRequestData,
|
request: IInventoryDeleteMarkerRequestData,
|
||||||
sessionID: string,
|
sessionID: string,
|
||||||
|
output: IItemEventRouterResponse,
|
||||||
): IItemEventRouterResponse
|
): IItemEventRouterResponse
|
||||||
{
|
{
|
||||||
// Get map from inventory
|
// Get map from inventory
|
||||||
@ -853,7 +854,6 @@ export class InventoryController
|
|||||||
mapItem.upd.Map.Markers = markers;
|
mapItem.upd.Map.Markers = markers;
|
||||||
|
|
||||||
// sync with client
|
// sync with client
|
||||||
const output = this.eventOutputHolder.getOutput(sessionID);
|
|
||||||
output.profileChanges[sessionID].items.change.push(mapItem);
|
output.profileChanges[sessionID].items.change.push(mapItem);
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
@ -869,6 +869,7 @@ export class InventoryController
|
|||||||
pmcData: IPmcData,
|
pmcData: IPmcData,
|
||||||
request: IInventoryEditMarkerRequestData,
|
request: IInventoryEditMarkerRequestData,
|
||||||
sessionID: string,
|
sessionID: string,
|
||||||
|
output: IItemEventRouterResponse,
|
||||||
): IItemEventRouterResponse
|
): IItemEventRouterResponse
|
||||||
{
|
{
|
||||||
// Get map from inventory
|
// Get map from inventory
|
||||||
@ -880,7 +881,6 @@ export class InventoryController
|
|||||||
mapItem.upd.Map.Markers[indexOfExistingNote] = request.mapMarker;
|
mapItem.upd.Map.Markers[indexOfExistingNote] = request.mapMarker;
|
||||||
|
|
||||||
// sync with client
|
// sync with client
|
||||||
const output = this.eventOutputHolder.getOutput(sessionID);
|
|
||||||
output.profileChanges[sessionID].items.change.push(mapItem);
|
output.profileChanges[sessionID].items.change.push(mapItem);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
@ -908,10 +908,9 @@ export class InventoryController
|
|||||||
pmcData: IPmcData,
|
pmcData: IPmcData,
|
||||||
body: IOpenRandomLootContainerRequestData,
|
body: IOpenRandomLootContainerRequestData,
|
||||||
sessionID: string,
|
sessionID: string,
|
||||||
|
output: IItemEventRouterResponse,
|
||||||
): IItemEventRouterResponse
|
): IItemEventRouterResponse
|
||||||
{
|
{
|
||||||
const output = this.eventOutputHolder.getOutput(sessionID);
|
|
||||||
|
|
||||||
/** Container player opened in their inventory */
|
/** Container player opened in their inventory */
|
||||||
const openedItem = pmcData.Inventory.items.find((item) => item._id === body.item);
|
const openedItem = pmcData.Inventory.items.find((item) => item._id === body.item);
|
||||||
const containerDetailsDb = this.itemHelper.getItem(openedItem._tpl);
|
const containerDetailsDb = this.itemHelper.getItem(openedItem._tpl);
|
||||||
|
@ -85,13 +85,13 @@ export class InventoryItemEventRouter extends ItemEventRouterDefinition
|
|||||||
case ItemEventActions.APPLY_INVENTORY_CHANGES:
|
case ItemEventActions.APPLY_INVENTORY_CHANGES:
|
||||||
return this.inventoryCallbacks.sortInventory(pmcData, body, sessionID);
|
return this.inventoryCallbacks.sortInventory(pmcData, body, sessionID);
|
||||||
case ItemEventActions.CREATE_MAP_MARKER:
|
case ItemEventActions.CREATE_MAP_MARKER:
|
||||||
return this.inventoryCallbacks.createMapMarker(pmcData, body, sessionID);
|
return this.inventoryCallbacks.createMapMarker(pmcData, body, sessionID, output);
|
||||||
case ItemEventActions.DELETE_MAP_MARKER:
|
case ItemEventActions.DELETE_MAP_MARKER:
|
||||||
return this.inventoryCallbacks.deleteMapMarker(pmcData, body, sessionID);
|
return this.inventoryCallbacks.deleteMapMarker(pmcData, body, sessionID, output);
|
||||||
case ItemEventActions.EDIT_MAP_MARKER:
|
case ItemEventActions.EDIT_MAP_MARKER:
|
||||||
return this.inventoryCallbacks.editMapMarker(pmcData, body, sessionID);
|
return this.inventoryCallbacks.editMapMarker(pmcData, body, sessionID, output);
|
||||||
case ItemEventActions.OPEN_RANDOM_LOOT_CONTAINER:
|
case ItemEventActions.OPEN_RANDOM_LOOT_CONTAINER:
|
||||||
return this.inventoryCallbacks.openRandomLootContainer(pmcData, body, sessionID);
|
return this.inventoryCallbacks.openRandomLootContainer(pmcData, body, sessionID, output);
|
||||||
case ItemEventActions.HIDEOUT_QTE_EVENT:
|
case ItemEventActions.HIDEOUT_QTE_EVENT:
|
||||||
return this.hideoutCallbacks.handleQTEEvent(pmcData, body, sessionID);
|
return this.hideoutCallbacks.handleQTEEvent(pmcData, body, sessionID);
|
||||||
case ItemEventActions.REDEEM_PROFILE_REWARD:
|
case ItemEventActions.REDEEM_PROFILE_REWARD:
|
||||||
|
Loading…
Reference in New Issue
Block a user