Exemple #1
0
  // 线上发送邮件,并刷新
  public final void wapOnlineHandle(final WapPayState payState) {
    if (payState.getState() == "true") {
      int chargedAmt = payState.getPayamt();
      player.addMoney(chargedAmt);
      String subject = "充值成功"; // 客户端现在显示不了长些的标题
      String content =
          "用户您好,您本次消费了"
              + payState.getRealmoney()
              + "元,我们刚刚为您的账号冲入"
              + payState.getPayamt()
              + "元宝,请在商城查收!";

      MailManager.getInstance().sendSysMail(player.getId(), subject, content, 0, null);

      // 刷新基本属性
      prepareBody();
      LuaService.callLuaFunction("fillAttributes", player);
      body.putShort((short) 0);
      sendMsg(player, MsgID.MsgID_Special_Train);

      Log.info(
          Log.STDOUT,
          "user id: "
              + player.getUserid()
              + "role id: "
              + player.getRoleid()
              + "role name: "
              + player.getName()
              + " 充值成功, 获得"
              + payState.getPayamt()
              + "元宝");
    } else {
      String subject = "充值失败";
      String content = null;
      if (Constants.ERRORCODE.get(payState.getWappaycode()) != null) {
        content = Constants.ERRORCODE.get(payState.getWappaycode());
      } else {
        content = Constants.ERRORCODE.get("0203");
      }

      MailManager.getInstance().sendSysMail(player.getId(), subject, content, 0, null);
      Log.info(
          Log.STDOUT,
          "user id: "
              + player.getUserid()
              + "role id: "
              + player.getRoleid()
              + "role name: "
              + player.getName()
              + " 充值失败, 错误原因"
              + Constants.ERRORCODE.get(payState.getWappaycode()));
    }
  }
Exemple #2
0
  /** @param buff */
  public final void merge(final Buff buff) {
    if (buff.effectProp != this.effectProp) return;

    if (buffLevel == buff.buffLevel) overduetime += buff.overduetime;
    else if (buffLevel < buff.buffLevel) copy(buff);
    else Log.error(Log.STDOUT, "addBuff", "当前buff等级高于使用Buff等级!");
  }
 @Override
 public final boolean readFromRs(final ResultSet rs) throws SQLException {
   while (rs.next()) {
     Mail mail = new Mail();
     mail.setMailId(rs.getLong(1));
     mail.setPayMail(rs.getBoolean(2));
     mail.setRead(rs.getBoolean(3));
     mail.setSenderId(rs.getInt(4));
     mail.setReceiverId(rs.getInt(5));
     mail.setSubject(rs.getString(6));
     mail.setContent(rs.getString(7));
     try {
       mail.setAttachment(Item.readItem(rs.getString(8)));
     } catch (Exception e) {
       Log.error(Log.ERROR, "SendMailListData.readFromRs", "邮件反序列化失败!", e);
     }
     mail.setGold(rs.getInt(9));
     mail.setPayGold(rs.getInt(10));
     mail.setSendTime(rs.getTimestamp(11).getTime());
     mail.setLevel(rs.getByte(12));
     mail.setReceiverName(rs.getString(13));
     sendMailList.add(mail);
   }
   return true;
 }
Exemple #4
0
  // 线下发送邮件
  public final void wapUnderlineHandle(final WapPayState payState) {
    if (payState.getState() == "true") {
      String subject = "充值成功"; // 客户端现在显示不了长些的标题
      String content =
          "用户您好,您本次消费了"
              + payState.getRealmoney()
              + "元,我们刚刚为您的账号冲入"
              + payState.getPayamt()
              + "元宝,请在商城查收!";

      MailManager.getInstance().sendSysMail(payState.getRoleid(), subject, content, 0, null);
      Log.info(
          Log.STDOUT,
          "user id: "
              + payState.getUserid()
              + "role id: "
              + payState.getRoleid()
              + " 充值成功, 获得"
              + payState.getPayamt()
              + "元宝");
    } else {
      String subject = "充值失败";
      String content = null;
      if (Constants.ERRORCODE.get(payState.getWappaycode()) != null) {
        content = Constants.ERRORCODE.get(payState.getWappaycode());
      } else {
        content = Constants.ERRORCODE.get("0203");
      }
      MailManager.getInstance().sendSysMail(payState.getRoleid(), subject, content, 0, null);
      Log.info(
          Log.STDOUT,
          "user id: "
              + payState.getUserid()
              + "role id: "
              + payState.getRoleid()
              + " 充值失败, 错误代码"
              + Constants.ERRORCODE.get(payState.getWappaycode()));
    }
  }