Task【ID1006213】【新战斗版本】大闹天宫(猎妖之路功能优化)
parent
74eb0a0aea
commit
24c347f308
|
@ -18,7 +18,7 @@ import com.ljsd.jieling.util.MessageUtil;
|
|||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description: 领取层级礼盒
|
||||
* Description: TOFIX 删除猎妖之路的原层数宝箱奖励功能。改为通关奖励
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/1/7 16:23
|
||||
*/
|
||||
|
@ -30,27 +30,38 @@ public class TakeLayRewardHandler extends BaseHandler<Expedition.TakeExpeditionB
|
|||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, Expedition.TakeExpeditionBoxRewardRequest proto) throws Exception {
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
int lay = proto.getLay();
|
||||
//check condition
|
||||
if(user.getExpeditionManager().getLay()<=lay){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("条件未达成"));
|
||||
}
|
||||
//check cfg
|
||||
Map<Integer,int[][]> boxMap = PlayStaticConfig.getExpeditioonRewardBoxMap();
|
||||
if(null ==boxMap||!boxMap.containsKey(lay)){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
if(user.getExpeditionManager().getRewardBox().contains(lay)){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("已领取"));
|
||||
}
|
||||
user.getExpeditionManager().addRewardBox(lay);
|
||||
//drop
|
||||
int[][] reward = boxMap.get(lay);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, reward, BIReason.EXPEDITION_BOX_REWARD);
|
||||
//notify
|
||||
Expedition.TakeExpeditionBoxRewardResponse builder = Expedition.TakeExpeditionBoxRewardResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_TAKE_BOXREWARD_RESONSE_VALUE, builder, true);
|
||||
// User user = UserManager.getUser(iSession.getUid());
|
||||
// int lay = proto.getLay();
|
||||
// //check condition
|
||||
// if(user.getExpeditionManager().getLay()<=lay){
|
||||
// throw new ErrorCodeException(ErrorCode.newDefineCode("条件未达成"));
|
||||
// }
|
||||
// //check cfg
|
||||
// Map<Integer,int[][]> boxMap = PlayStaticConfig.getExpeditioonRewardBoxMap();
|
||||
// if(null ==boxMap||!boxMap.containsKey(lay)){
|
||||
// throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
// }
|
||||
// if(user.getExpeditionManager().getRewardBox().contains(lay)){
|
||||
// throw new ErrorCodeException(ErrorCode.newDefineCode("已领取"));
|
||||
// }
|
||||
// user.getExpeditionManager().addRewardBox(lay);
|
||||
// //drop
|
||||
// int[][] reward = boxMap.get(lay);
|
||||
// CommonProto.Drop.Builder drop = ItemUtil.drop(user, reward, BIReason.EXPEDITION_BOX_REWARD);
|
||||
// //notify
|
||||
// Expedition.TakeExpeditionBoxRewardResponse builder = Expedition.TakeExpeditionBoxRewardResponse.newBuilder().setDrop(drop).build();
|
||||
// MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_TAKE_BOXREWARD_RESONSE_VALUE, builder, true);
|
||||
|
||||
throw new ErrorCodeException("修改中");
|
||||
|
||||
//TODO 检查并 领奖
|
||||
|
||||
//TODO 通关全部 提示文字
|
||||
|
||||
//TODO 通知前端下一层leve 可以是多个 让玩家选择
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue