返回提交历史
Modified
src/services/purchaseService.ts
+5
-0
XFEstudio/XFESpaceNinjaServer
fix: limit booster pack purchases to a max quantity of 100 (#1189)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1189
adddc11b
代码差异
1 个文件
+5
-0
@@ -370,6 +370,11 @@ const handleBoosterPackPurchase = async (
370
370
BoosterPackItems: "",
371
371
InventoryChanges: {}
372
372
};
373
if (quantity > 100) {
374
throw new Error(
375
"attempt to roll over 100 booster packs in a single go. possible but unlikely to be desirable for the user or the server."
376
);
377
}
373
378
for (let i = 0; i != quantity; ++i) {
374
379
for (const weights of pack.rarityWeightsPerRoll) {
375
380
const result = getRandomWeightedRewardUc(pack.components, weights);