|
|
@@ -348,6 +348,8 @@ async function trySynthesize() {
|
|
|
setSynthesisAmount(willCount - nSuccCount);
|
|
|
}
|
|
|
} else {
|
|
|
+ let nSuccCount = 0;
|
|
|
+ let nFailCount = 0;
|
|
|
for (let n = 0; n < nRuns; n++) {
|
|
|
let startTime = Date.now();
|
|
|
for (let i = 0; i < nExcuteCount; i++) {
|
|
|
@@ -361,8 +363,10 @@ async function trySynthesize() {
|
|
|
}
|
|
|
let errMsg = '';
|
|
|
if (retData && retData.code == 200) {
|
|
|
+ nSuccCount += 1;
|
|
|
errMsg = `序号[${+1}]使用材料[${getCombinationGoodsLstText(oneCombination)}]兑换成功`;
|
|
|
} else {
|
|
|
+ nFailCount += 1;
|
|
|
errMsg = `序号[${i + 1}]使用材料[${getCombinationGoodsLstText(oneCombination)}]${retData?.msg || '兑换失败'}`;
|
|
|
}
|
|
|
tipsText += `${errMsg}\n`;
|
|
|
@@ -372,6 +376,12 @@ async function trySynthesize() {
|
|
|
await magicJS.utils.sleep(ctrlMillSec - costTime);
|
|
|
}
|
|
|
}
|
|
|
+ if (nSuccCount >= willCount) {
|
|
|
+ tipsText += `由于兑换次数已达到配置的次数,该活动自动禁用\n`;
|
|
|
+ setActivityDisabled(activityId, true);
|
|
|
+ } else {
|
|
|
+ setSynthesisAmount(willCount - nSuccCount);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
magicJS.notification.appendNotifyInfo(tipsText);
|