//换桌 public void SendUserSwitchDesk() { NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCommand.MDM_GF_FRAME, SubCommand.SUB_GF_USER_READY); Send(packet); }
/// <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("金币不足,请充值"); } }
private void ReadyGo() { long boboScore = o_BoBoScore.GetComponent <cx_number>().m_iNum; scenegame.transform.GetComponent <UIGame>().currentBoboshu = boboScore; scenegame.transform.Find("repeat_boboshu").gameObject.SetActive(true); scenegame.transform.Find("repeat_boboshu").transform.Find("boboScore").GetComponent <cx_number>().m_iNum = boboScore; //合法性判断 if (boboScore > MaxBoboNum) { boboScore = MaxBoboNum; } if (boboScore < MinBoboNum) { boboScore = MinBoboNum; } NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_USER_INVEST); packet.AddLong(boboScore); UIGame.SendMsgToServer(packet); UIGame.o_player_allinvert.SetActive(true); gameObject.SetActive(false); }
public void SendUserReadyReq() { //用户准备 NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCommand.MDM_GF_FRAME, SubCommand.SUB_GF_USER_READY); Send(packet); }
/// <summary> /// 比倍得分 /// </summary> public void CompareGetScore_Onclick() { //圧大 NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_COMPARE_GS); packet.AddInt(0); GameEngine.Instance.Send(packet); }
public void SendNoticeMessage(string strMsg) { //发送消息 NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCommand.MDM_GR_SYSTEM, SubCommand.SUB_GR_MESSAGE); packet.AddUShort((ushort)0); packet.AddUShort((ushort)strMsg.Length); packet.AddString(strMsg, StringHelper.GetStringLength(strMsg)); Send(packet); }
public void SendUserSetting() { //是否允许旁观设置 NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCommand.MDM_GF_FRAME, SubCommand.SUB_GF_INFO); packet.Addbyte(0); packet.AddUInt(0); packet.AddUInt(0); Send(packet); }
public void BigBT_Onclick() { //圧大 NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_COMPARE_XZ); packet.AddInt(2); GameEngine.Instance.Send(packet); SetButtonBt(m_gBigBT, true); SetButtonBt(m_gLittleBT, true); }
public void SendChatMessage(uint dwTargetID, string strMsg, uint emotion) { //发送消息 NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCommand.MDM_GF_FRAME, SubCommand.SUB_GF_USER_CHAT); packet.AddUShort((ushort)StringHelper.GetStringLength(strMsg)); packet.AddUInt(emotion); packet.AddUInt(MySelf.ID); packet.AddUInt(dwTargetID); packet.AddString(strMsg, StringHelper.GetStringLength(strMsg)); Send(packet); }
/// <summary> /// 游戏记录 /// </summary> public void RecordBT_Onclick() { if (m_bIsGetRecord) { //获取游戏记录 NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_GET_RECORD); GameEngine.Instance.Send(packet); m_fWorkTime = 0; m_bIsGetRecord = false; } SetRecordShowHide(m_iCurrentIndex + 1); }
/// <summary> /// 启动比倍 /// </summary> public void Compare_Onclick() { CMusicManger._instance.PlaySound("CompareBT"); m_gCompare.SetActive(true); m_bIsOpenComPare = true; CCompareManger._instance.ShowWindow(); UIManger.Instance.m_bIsGetscore = false; if (!m_bIsCompareFree) { int tempIndex = 10 - UIManger.Instance.m_cUpdateCard.bCardType; int tempType = UIManger.Instance.m_iPeiLvType; if (CPlayerInfo._instance.m_iRoomTimes == 0) { CPlayerInfo._instance.m_iRoomTimes = 1; } int tempscore = (int)((UIManger.Instance.m_lAllScore - CPlayerInfo._instance.m_iGold) / (long)CPlayerInfo._instance.m_iRoomTimes); CCompareManger._instance.SetCompareCard(tempscore); CCompareManger._instance.SetCurrentCompare(0); CCompareManger._instance.SetHistoryCard(); SetAllBTFalse(); SetButtonBt(m_gBigBT, false); SetButtonBt(m_gLittleBT, false); SetButtonBt(m_gMoreThanBT, true); } else { if (CPlayerInfo._instance.m_iCreditNum >= CPokerPointsManger._instance.m_iBasePointBK && CPlayerInfo._instance.m_iCreditNum > 0) { //空闲状态请求比倍 NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_COMPARE_FREE); packet.AddInt(CPokerPointsManger._instance.m_iBasePointBK); GameEngine.Instance.Send(packet); SetAllBTFalse(); CPlayerInfo._instance.m_iGold -= CPokerPointsManger._instance.m_iBasePointBK * CPlayerInfo._instance.m_iRoomTimes; CPlayerInfo._instance.m_iCreditNum = (int)(CPlayerInfo._instance.m_iGold / CPlayerInfo._instance.m_iRoomTimes); } else { CNomaney._instance.ShowWindow(); } } CCompareManger._instance.m_gBig.SetActive(true); CCompareManger._instance.m_gBig.GetComponent <CBigSmallAnimation>().RectAnimarion(); CCompareManger._instance.m_gSmall.SetActive(true); CCompareManger._instance.m_gSmall.GetComponent <CBigSmallAnimation>().RectAnimarion(); CPushAnimation._instance.gameObject.SetActive(false); CCompareManger._instance.m_bIsWinPushDouble = false; UIManger.Instance.m_bIsPlayingGame = true; }
/// <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; }
//清除 public void ClearBT_OnClick() { if (m_bIsBetTime) { //获取游戏记录 NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_BET_CLEAR); packet.AddInt(0); CGameEngine.Instance.Send(packet); } else { AddTiShi("非下注时间无法下注"); } }
/// <summary> /// 续压 /// </summary> public void ContinueBET() { if (CBETManger._instance.m_cBetTop.m_cGameGold.m_iNum > 0) { if (m_bIsBetTime) { CMusicManger_JSYS._instance.PlaySound("InputScore"); //发送续压 NPacket packet = NPacketPool.GetEnablePacket(); packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_CONTINUE_BET); CGameEngine.Instance.Send(packet); } else { AddTiShi("非下注时间无法下注"); } } else { AddTiShi("金币不足,请充值"); } }