示例#1
0
 public void testJipin(MgsPlayer p) {
   List<Integer> list = MyArrays.asList(1, 9, 11, 19, 21, 29, 31, 32, 33, 34, 35, 36, 37);
   List<Integer> list2 = MyArrays.asList(1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9);
   List<Integer> list3 = MyArrays.asList(31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 1);
   // 12,13,14,16,18,37
   List<Integer> list4 = MyArrays.asList(12, 12, 12, 12, 13, 1);
   p.setShoupai(MyArrays.asList(1));
 }
示例#2
0
  public void setBytes(ChannelBuffer buf) {
    super.setBytes(buf);

    if (this.getValues() != null && this.getValues().size() > 0) {
      this.skillId = this.getIntVaule(0);
      logger.info("ccmd11009  " + this.player.getName() + "   sillId:" + skillId);
    }

    Room r = this.player.getRoom();
    if (r.isInTuoguan(player)) {
      return;
    }

    this.touchedPai = this.player.getTouchedPai();
    int hupai = 0;
    boolean zimo = false;
    if (this.touchedPai == -1) // 放炮
    {
      if (r.getTimeFlag() != Room.TIME_DEALPAI) {
        return;
      }
      boolean flag = checkInDealArray(this.player);
      if (!flag) return;
      this.hu_type = CCMD11009.DIANPAO;
      this.dianpao = r.getCurPlayer();
      // 点炮
      // 抢杠
      hupai = r.getCurPaiId();
    } else // 自摸
    {
      this.hu_type = CCMD11009.ZIMO;
      zimo = true;
      hupai = touchedPai;
    }
    logger.info("ccmd11009   hu:" + this.player.getName() + "   hupaiid:" + hupai);
    //		hupai = 1;
    List<Integer> arr_sp = player.getShoupai();
    arr_sp = MyArrays.sort(arr_sp);
    hu = new Algorithm_Hu();
    hu.hupaiId = hupai;
    hu.isZimo = zimo;
    boolean b = hu.testHu(arr_sp);
    if (b == false) {
      System.out.println("");
    }
    if (hu_type == 0) b = false; // 错误
    if (b) {
      arr_sp.add(hupai);
      player.setShoupai(arr_sp);
      r.waitDeal_back(player, "胡", this);
    } else {
      logger.info("hupai fail  cmd11009:" + this.player.getAllPaiStr());
      CCMD11111 c111 = new CCMD11111();
      c111.auto_deal(this.player, "数据出错,本局已托管! 胡   " + hupai);
      this.player.getRoom().deal_pass(this.player); // 托管的触发:  1. 断线  2前后台数据判断不一致  3.主动托管
      this.player.getRoom().addTuoGuanQueue(player); // 让玩家断线
      //			this.player.closing();									//清理cache中缓存的玩家
      //			MgsCache.getInstance().removeCache(this.player);
    }
  }