/// <summary> /// 下注 /// </summary> public void DownBET(CBETItem _BetItem) { if (CBETManger._instance.m_cBetTop.m_cGameGold.m_iNum > m_lCurrentChip) { if (m_bIsBetTime) { CMusicManger_JSYS._instance.PlaySound("InputScore"); //获取游戏记录 NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_PLAY_BET); CMD_C_PlayBet playBet; playBet.nAnimalIndex = _BetItem.m_iBetID; playBet.lBetChip = m_lCurrentChip; byte[] dataBuffer = GameConvert.StructToByteArray <CMD_C_PlayBet>(playBet); int len = Marshal.SizeOf(typeof(CMD_C_PlayBet)); packet.AddBytes(dataBuffer, len); CGameEngine.Instance.Send(packet); } else { AddTiShi("非下注时间无法下注"); } } else { AddTiShi("金币不足,请充值"); } }
/// <summary> /// 启动按钮响应 /// </summary> public void StartBT_OnClick() { //第一次请求发牌 if (!UIManger.Instance.m_bIsUpdateCard) { if (CPokerPointsManger._instance.m_iBasePointBK == 0 && CPokerPointsManger._instance.m_iBasePoints == 0) { return; } if (CPokerPointsManger._instance.m_iBasePoints == UIManger.Instance.m_iGameStartPoint) { CPokerPointsManger._instance.m_iBasePoints = CPokerPointsManger._instance.m_iBasePointBK; } CPlayerInfo._instance.m_iBet = CPokerPointsManger._instance.m_iBasePoints; CPokerPointsManger._instance.m_iBasePointBK = CPokerPointsManger._instance.m_iBasePoints; m_bIsFirstInput = true; //请求发牌 NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_START_DEAL_JX); //压分 packet.AddLong(CPokerPointsManger._instance.m_iBasePoints); //此数据无效 packet.AddInt(0); GameEngine.Instance.Send(packet); SetButtonBt(m_gStartBT, true); SetButtonBt(m_gInputScoreBT, true); } //第二次请求发牌 else { NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_UPDATE_CARD_JX); packet.AddBytes(UIManger.Instance.m_cUpdateCard.cCard.cbCard, UIManger.Instance.m_cUpdateCard.cCard.cbCard.Length); for (int i = 0; i < UIManger.Instance.m_cUpdateCard.cCard.bBarter.Length; i++) { //牌的值 packet.AddBool(UIManger.Instance.m_cUpdateCard.cCard.bBarter[i]); } GameEngine.Instance.Send(packet); SetButtonBt(m_gStartBT, true); } SetButtonBt(m_gRecordBT, true); CBottomBTOnclick._instance.SetButtonBt(CBottomBTOnclick._instance.m_gMoreThanBT, true); CBottomBTOnclick._instance.m_bIsCompareFree = false; UIManger.Instance.m_bIsPlayingGame = true; }