This commit is contained in:
Master 2024-07-04 08:48:25 +08:00
parent 03a212f36a
commit b1ed6ba969
3 changed files with 16 additions and 12 deletions

View File

@ -82,14 +82,14 @@ export const combineInventoryChanges = (InventoryChanges: IInventoryChanges, del
InventoryChanges[key] = delta[key]; InventoryChanges[key] = delta[key];
} else if (Array.isArray(delta[key])) { } else if (Array.isArray(delta[key])) {
const left = InventoryChanges[key] as object[]; const left = InventoryChanges[key] as object[];
const right: object[] = delta[key] as object[]; const right: object[] = delta[key];
for (const item of right) { for (const item of right) {
left.push(item); left.push(item);
} }
} else { } else {
console.assert(key.substring(-3) == "Bin"); console.assert(key.substring(-3) == "Bin");
const left = InventoryChanges[key] as IBinChanges; const left = InventoryChanges[key] as IBinChanges;
const right: IBinChanges = delta[key] as IBinChanges; const right: IBinChanges = delta[key];
left.count += right.count; left.count += right.count;
left.platinum += right.platinum; left.platinum += right.platinum;
left.Slots += right.Slots; left.Slots += right.Slots;

View File

@ -105,20 +105,24 @@ export const giveKeyChainTriggeredItems = async (accountId: string, keyChain: st
if (itemType in ExportRecipes) { if (itemType in ExportRecipes) {
return { return {
Recipes: [{ Recipes: [
ItemType: itemType, {
ItemCount: 1 ItemType: itemType,
}] ItemCount: 1
}
]
}; };
} }
if (itemType in ExportResources) { if (itemType in ExportResources) {
return { return {
WishlistChanges: [itemType], WishlistChanges: [itemType],
MiscItems: [{ MiscItems: [
ItemType: itemType, {
ItemCount: 1 ItemType: itemType,
}] ItemCount: 1
}
]
}; };
} }

View File

@ -47,7 +47,7 @@ export interface IInboxReponseClient {
url?: string; url?: string;
highPriority: boolean; highPriority: boolean;
lowPrioNewPlayers?: boolean; lowPrioNewPlayers?: boolean;
CrossPlatform?: boolean CrossPlatform?: boolean;
date: IMongoDate; date: IMongoDate;
r: boolean; r: boolean;
countedAtt?: ICountedAttDatabase[]; countedAtt?: ICountedAttDatabase[];