@Override
 public Message execute(ActionContext context, C2002_RoleRebornConfirmReqMessage reqMsg) {
   RoleInstance role = this.getCurrentRole(context);
   if (null == role) {
     return null;
   }
   String param = reqMsg.getParam();
   Result result = GameContext.getRoleRebornApp().rebornConfirm(role, param);
   if (!result.isSuccess()) {
     return new C0002_ErrorRespMessage(reqMsg.getCommandId(), result.getInfo());
   }
   C2001_RoleRebornRespMessage resp = new C2001_RoleRebornRespMessage();
   resp.setType(result.getResult());
   resp.setInfo(result.getInfo());
   return resp;
 }
 @Override
 public Message execute(ActionContext context, C2815_CardActivitySpendReqMessage reqMsg) {
   RoleInstance role = this.getCurrentRole(context);
   if (null == role) {
     return null;
   }
   Result result =
       GameContext.getRoleChoiceCardApp()
           .choiceCard(role, (byte) ChoiceFunType.ACTIVITY.ordinal(), reqMsg.getSpecificType());
   if (result.isIgnore()) {
     return null;
   }
   C2815_SpendActivityRespMessage respMsg = new C2815_SpendActivityRespMessage();
   respMsg.setSuccess(result.getResult());
   respMsg.setInfo(result.getInfo());
   return respMsg;
 }
示例#3
0
 @Override
 public Message execute(ActionContext context, C1655_PetStarUpReqMessage reqMsg) {
   RoleInstance role = this.getCurrentRole(context);
   if (null == role) {
     return null;
   }
   String roleId = role.getRoleId();
   RolePet rolePet = GameContext.getUserPetApp().getRolePet(roleId, reqMsg.getPetId());
   if (null == rolePet) {
     C0002_ErrorRespMessage message = new C0002_ErrorRespMessage();
     message.setInfo(GameContext.getI18n().getText(TextId.Pet_Not_Owned));
     return message;
   }
   Result result = GameContext.getPetApp().petStarUp(role, rolePet);
   C1655_PetStarUpRespMessage resp = new C1655_PetStarUpRespMessage();
   resp.setPetId(reqMsg.getPetId());
   resp.setInfo(result.getInfo());
   resp.setStatus(result.getResult());
   resp.setStarProgress(rolePet.getStarProgress());
   if (GameContext.getPetApp().isPetMaxStar(rolePet)) {
     resp.setFullStar((byte) 1);
   }
   return resp;
 }