Beispiel #1
0
        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);
        }