public void OnJoinTable(IEvent iEvent) { NetCmdPack pack = iEvent.parameter as NetCmdPack; m_Jtable = (LC_Cmd_JoinTableResult)pack.cmd; Debug.Log("m_Jtable.Result::: " + m_Jtable.Result); if (m_Jtable.Result) { //在玩家身上设置玩家桌子ID PlayerRole.Instance.RoleInfo.RoleMe.SetTableTypeID(m_Jtable.bTableTypeID); //PlayerRole.Instance.RoleGameData.OnHandleRoleJoinTable();//表示玩家已经进入房间了 m_roomDate = new LinkRoomData(); m_roomDate.RoomID = m_Jtable.bTableTypeID; m_roomDate.BackgroundImage = m_Jtable.BackgroundImage; m_roomDate.LauncherType = m_Jtable.LauncherType; m_roomDate.Seat = m_Jtable.SeatID; m_roomDate.RateIndex = m_Jtable.RateIndex; m_roomDate.Energy = m_Jtable.Energy; //LogicManager.Instance.Forward(ncg); } else { Debug.LogError("连接桌子错误"); } }
public void ResetPlayerData(LinkRoomData jrd, bool bFirst) { byte serverSeat = jrd.Seat; byte serverLauncherType = jrd.LauncherType; SceneBoot.Instance.SwapBackgroundImage(jrd.BackgroundImage); m_RoomType = jrd.RoomID; m_RoomRateIndex = FishConfig.Instance.m_TableInfo.m_TableConfig[m_RoomType].MinRate; // ExtraSetting.RoomDataList[m_RoomType].RoomRateIdx; //管理器初始化 /*if (bFirst || SceneRuntime.BackgroundIndex != jrd.BackgroundImage) * { * m_EffectMgr.ClearBackEffect(); * m_EffectMgr.LoadBackEffect(jrd.BackgroundImage); * }*/ SceneRuntime.Inversion = serverSeat > 1; SceneRuntime.BackgroundIndex = jrd.BackgroundImage; m_PlayerMgr.MyClientSeat = SceneRuntime.ServerToClientSeat(serverSeat); PlayerMgr.ClearAllPlayer(); //加入自己 bool launcherValid; byte clientLauncherType; SceneRuntime.CheckLauncherValid( serverLauncherType, out clientLauncherType, out launcherValid); //获取自己的消息 RoleMe pMe = PlayerRole.Instance.RoleInfo.RoleMe; pMe.SetSeat(serverSeat); PlayerExtraData pPlayer = new PlayerExtraData(); pPlayer.playerData.GoldNum = (int)PlayerRole.Instance.GetPlayerGlobelBySeat(pMe.GetSeat()); pPlayer.playerData.ID = pMe.GetUserID(); pPlayer.playerData.ImgCrc = pMe.GetFaceID(); pPlayer.playerData.Level = (byte)pMe.GetLevel(); pPlayer.playerData.Name = pMe.GetNickName(); m_PlayerMgr.PlayerJoin(pPlayer, m_PlayerMgr.MyClientSeat, jrd.RateIndex, clientLauncherType, launcherValid); m_PlayerMgr.UpdateEnergy(jrd.Energy); }