@Override
 public Message execute(ActionContext context, C1008_MailTruePickReqMessage req) {
   C1003_MailAccessoryRespMessage resp = new C1003_MailAccessoryRespMessage();
   resp.setType(Status.FAILURE.getInnerCode());
   try {
     RoleInstance role = this.getCurrentRole(context);
     if (role == null) {
       return null;
     }
     String params = req.getParams();
     String mailId = params.split(Cat.comma)[1];
     resp.setMailId(mailId);
     Result result = GameContext.getMailApp().pickTrueMailAccessory(role, params);
     if (result.isIgnore()) {
       return null;
     }
     if (!result.isSuccess()) {
       resp.setInfo(result.getInfo());
       return resp;
     }
     resp.setType(Status.SUCCESS.getInnerCode());
     resp.setInfo(Status.Mail_Goods_Success.getTips());
   } catch (Exception e) {
     logger.error("MailTrueAccessoryAction", e);
   }
   return resp;
 }
예제 #2
0
 private void sendGoodsByMail(
     RoleInstance role, List<GoodsOperateBean> addList, OutputConsumeType ocType) {
   String title = GameContext.getI18n().getText(TextId.FALL_MAIL_TITLE);
   String content = GameContext.getI18n().getText(TextId.FALL_MAIL_CONTENT);
   GameContext.getMailApp()
       .sendMail(
           role.getRoleId(),
           title,
           content,
           MailSendRoleType.System.getName(),
           ocType.getType(),
           addList);
 }