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

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 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
Sainan <sainan@calamity.inc>
提交于

代码差异

1 个文件 +5 -0
Modified src/services/purchaseService.ts +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);