Пример #1
0
  /**
   * 上阵/下阵
   *
   * @param msg
   * @param channel
   * @return
   */
  public ICodeAble changePos(Msg msg, Channel channel) {
    String userId = msg.getMsgHead().getFromID();

    PkAction_changePosReq req = msg.decodeBody(PkAction_changePosReq.class);
    this.pkService.changePos(userId, req.getUserHeroIdList());
    return MsgBuilder.EMPTY_BODY;
  }
Пример #2
0
  /**
   * 挑战结束
   *
   * @param msg
   * @param channel
   * @return
   */
  public ICodeAble endPkFight(Msg msg, Channel channel) {
    String userId = msg.getMsgHead().getFromID();

    PkAction_endPkFightReq req = msg.decodeBody(PkAction_endPkFightReq.class);
    PkAction_endPkFightRes res = this.pkService.endPkFight(userId, req.getFlag());
    return res;
  }
Пример #3
0
  /**
   * 获取用户竞技场兑换信息
   *
   * @param msg
   * @param channel
   * @return
   */
  public ICodeAble getUserPkMallInfo(Msg msg, Channel channel) {
    String userId = msg.getMsgHead().getFromID();

    List<PkMallBO> pkMallList = this.pkService.getUserPkMallInfo(userId);
    PkAction_getUserPkMallInfoRes res = new PkAction_getUserPkMallInfoRes();
    res.setPkMallList(pkMallList);
    return res;
  }
Пример #4
0
  /**
   * 兑换商品
   *
   * @param msg
   * @param channel
   * @return
   */
  public ICodeAble exchange(Msg msg, Channel channel) {
    String userId = msg.getMsgHead().getFromID();

    PkAction_exchangeReq req = msg.decodeBody(PkAction_exchangeReq.class);
    Map<String, Object> map = this.pkService.exchange(userId, req.getMallId());

    CommonGoodsBeanBO drop = (CommonGoodsBeanBO) map.get("dr");
    int honour = (int) map.get("hon");
    PkAction_exchangeRes res = new PkAction_exchangeRes();
    res.setDrop(drop);
    res.setHonour(honour);
    return res;
  }
Пример #5
0
  /**
   * 换一批
   *
   * @param msg
   * @param channel
   * @return
   */
  public ICodeAble refreshChallenger(Msg msg, Channel channel) {
    String userId = msg.getMsgHead().getFromID();

    PkAction_refreshChallengerRes res = this.pkService.refreshChallenger(userId);
    return res;
  }
Пример #6
0
  /**
   * 获取用户竞技场信息
   *
   * @param msg
   * @param channel
   * @return
   */
  public ICodeAble getUserPkInfo(Msg msg, Channel channel) {
    String userId = msg.getMsgHead().getFromID();

    PkAction_getUserPkInfoRes res = this.pkService.getUserPkInfo(userId);
    return res;
  }
Пример #7
0
  /**
   * 进入pk(第一次进入时)
   *
   * @param msg
   * @param channel
   * @return
   */
  public ICodeAble enterPk(Msg msg, Channel channel) {
    String userId = msg.getMsgHead().getFromID();

    PkAction_enterPkRes res = this.pkService.enterPk(userId);
    return res;
  }
Пример #8
0
  /**
   * 购买挑战次数
   *
   * @param msg
   * @param channel
   * @return
   */
  public ICodeAble buyChallengeTimes(Msg msg, Channel channel) {
    String userId = msg.getMsgHead().getFromID();

    this.pkService.buyChallengeTimes(userId);
    return MsgBuilder.EMPTY_BODY;
  }
Пример #9
0
  /**
   * 刷新商品
   *
   * @param msg
   * @param channel
   * @return
   */
  public ICodeAble refreshMall(Msg msg, Channel channel) {
    String userId = msg.getMsgHead().getFromID();

    this.pkService.refreshMall(userId);
    return MsgBuilder.EMPTY_BODY;
  }