internal void initPlayScene(CMD_S_StatusPlay cs) { //struct CMD_S_StatusPlay //{ // //状态信息 // [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)PROTOCOL_PACKET.GAME_PLAYER)] // public byte[] cbPlayStatus; //用户状态 // public byte cbDynamicJoin; //动态加入 // public long lTurnMaxScore; //最大下注 // [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)PROTOCOL_PACKET.GAME_PLAYER)] // public long[] lTableScore; //下注数目 // public ushort wBankerUser; //庄家用户 // public long lWeekBonsesInfo; // public long lMoneyScore; // public tagSGetBonsesInfo BonsesInfo; // //扑克信息 // [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)PROTOCOL_PACKET.GAME_PLAYER)] // public byte[][] cbHandCardData;//桌面扑克 // [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)PROTOCOL_PACKET.GAME_PLAYER)] // public byte[] bOxCard; //牛牛数据 // //历史积分 // [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)PROTOCOL_PACKET.GAME_PLAYER)] // public long[] lTurnScore; //积分信息 // [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)PROTOCOL_PACKET.GAME_PLAYER)] // public long[] lCollectScore; //积分信息 // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)PROTOCOL_PACKET.SERVER_LEN)] // public string[] szGameRoomName; //房间名称 // public int bGameOption; //游戏配置 // public bool bUserLookTable; //锁桌信息 // public byte[] cbOxInfo; //}; long[] lTableScore = cs.lTableScore; //下注数目 ushort wBankerUser = cs.wBankerUser; //庄家用户 //显示玩家下注结果 if ((int)lTableScore[0] != 0) { FourBull.Messager.Broadcast(FourBullEvent.BetPosZero, (int)lTableScore[0]); } if ((int)lTableScore[1] != 0) { FourBull.Messager.Broadcast(FourBullEvent.BetPosOne, (int)lTableScore[1]); } if ((int)lTableScore[2] != 0) { FourBull.Messager.Broadcast(FourBullEvent.BetPosTwo, (int)lTableScore[2]); } if ((int)lTableScore[3] != 0) { FourBull.Messager.Broadcast(FourBullEvent.BetPosThree, (int)lTableScore[3]); } //显示庄家标识 if (0 == FourBullCommand.Instance.SwitchViewChairID(wBankerUser)) { FourBull.Messager.Broadcast(FourBullEvent.TablePosZeroPlayerIsBanker); } else if (1 == FourBullCommand.Instance.SwitchViewChairID(wBankerUser)) { FourBull.Messager.Broadcast(FourBullEvent.TablePosOnePlayerIsBanker); } else if (2 == FourBullCommand.Instance.SwitchViewChairID(wBankerUser)) { FourBull.Messager.Broadcast(FourBullEvent.TablePosTwoPlayerIsBanker); } else if (3 == FourBullCommand.Instance.SwitchViewChairID(wBankerUser)) { FourBull.Messager.Broadcast(FourBullEvent.TablePosThreePlayerIsBanker); } //struct CMD_S_SendCard //{ // [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)PROTOCOL_PACKET.GAME_PLAYER)] // public byte[][] cbCardData; //用户扑克 // public ushort wPlayerCount; //}; CMD_S_SendCard cardStruct = new CMD_S_SendCard(); cardStruct.cbCardData = cs.cbHandCardData; //发牌 FourBull.Messager.Broadcast(FourBullEvent.StartdealPoker, cardStruct); //摊牌结果 for (ushort index = 0; index < 4; index++) { if (0 == FourBullCommand.Instance.SwitchViewChairID(index)) { //未摊牌 if (cs.cbOxInfo[index] != 0xff) { FourBull.Messager.Broadcast(FourBullEvent.showCow, 0); } } else if (1 == FourBullCommand.Instance.SwitchViewChairID(index)) { if (cs.cbOxInfo[index] != 0xff) { FourBull.Messager.Broadcast(FourBullEvent.showCow, 1); } } else if (2 == FourBullCommand.Instance.SwitchViewChairID(index)) { if (cs.cbOxInfo[index] != 0xff) { FourBull.Messager.Broadcast(FourBullEvent.showCow, 2); } } else if (3 == FourBullCommand.Instance.SwitchViewChairID(index)) { if (cs.cbOxInfo[index] != 0xff) { FourBull.Messager.Broadcast(FourBullEvent.showCow, 3); } } } }
private void dealPoker(CMD_S_SendCard obj) { //CMD_S_SendCard //struct CMD_S_SendCard //{ // [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)PROTOCOL_PACKET.GAME_PLAYER)] // public byte[][] cbCardData; //用户扑克 // public ushort wPlayerCount; //}; for (int i = 0; i < FourBullGlobalConst.pokerTotalCount; i++) { if (pokerPool != null && pokerPool[i] != null) { pokerPool[i].SetActive(true); } } for (int i = 0; i < FourBullGlobalConst.pokerTotalCount; i++) { int tag = (int)(i % 5); int chairId = (int)FourBullCommand.Instance.SwitchViewChairID((ushort)(i/5)); PokerCard pokerInfo = new PokerCard(); pokerInfo.SetFront((int)(obj.cbCardData[i])); pokerInfoList[chairId,tag] = pokerInfo; } //将数据存储 FourBullPlayerData.getInstance().initData(pokerInfoList); StartCoroutine(StartDealPoke()); }