转盘修复问题

back_recharge
duhui 2023-01-25 10:21:30 +08:00
parent 6bf86f81b0
commit c1fddebb22
1 changed files with 8 additions and 5 deletions

View File

@ -25,10 +25,7 @@ import rpc.protocols.CommonProto;
import rpc.protocols.MessageTypeProto;
import rpc.protocols.PlayerInfoProto;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.*;
/**
* Description:
@ -61,7 +58,11 @@ public class GetLuckWheelRandHandler extends BaseHandler<PlayerInfoProto.GetLuck
int[][] costmap = proto.getRepeated() ? sDialRewardSetting.getMultipleCostItem() : sDialRewardSetting.getCostItem();
int[][] realCost = LuckWheelActivity.getCost(luckWheelMission.getRefreshTime(), costmap);
boolean enough = ItemUtil.itemCost(user, realCost, reson, 0);
HashMap<Integer, Integer> costMap = new HashMap<>();
for (int[] ints : realCost) {
costMap.put(ints[0], ints[1]+costMap.getOrDefault(ints[0], 0));
}
boolean enough = ItemUtil.checkCost(user, costMap);
if (!enough) {
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}
@ -126,6 +127,8 @@ public class GetLuckWheelRandHandler extends BaseHandler<PlayerInfoProto.GetLuck
ChatLogic.getInstance().sendSysChatMessage(message, sysType, "0", 0, 0, 0, 0, 0);
}
}
ItemUtil.itemCost(user, realCost, reson, 0);
int dropReson = getRewardBIReason(activityId);
CommonProto.Drop.Builder drop = ItemUtil.drop(user, drops, dropReson);