Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public void OnPlayerJoin(IEvent iEvent)
        {
            Debug.Log("CMD_PLAYER_JOIN");
            NetCmdPack       pack = iEvent.parameter as NetCmdPack;
            NetCmdPlayerJoin ncp  = (NetCmdPlayerJoin)pack.cmd;
            PlayerExtraData  pd   = new PlayerExtraData();

            pd.playerData.ID      = ncp.PlayerInfo.ID;
            pd.playerData.GoldNum = ncp.PlayerInfo.GoldNum;
            pd.playerData.ImgCrc  = ncp.PlayerInfo.ImgCrc;
            pd.playerData.Level   = ncp.PlayerInfo.Lvl;
            pd.playerData.Name    = ncp.PlayerInfo.Name;
            byte clientSeat = SceneRuntime.ServerToClientSeat(ncp.Seat);
            bool launcherValid;
            byte clientLauncherType;

            SceneRuntime.CheckLauncherValid(ncp.LauncherType, out clientLauncherType, out launcherValid);
            //PlayerManager.Instance.PlayerJoin(pd, clientSeat, ncp.rateIndex, clientLauncherType, launcherValid);
            m_PlayerMgr.PlayerJoin(pd, clientSeat, ncp.rateIndex, clientLauncherType, launcherValid);
        }
Ejemplo n.º 3
0
        public void ChangeLauncher(NetCmdPack pack)
        {
            //GlobalAudioMgr.Instance.PlayOrdianryMusic(Audio.OrdianryMusic.m_ChangeGun, false, true);
            NetCmdChangeLauncher ncc = (NetCmdChangeLauncher)pack.cmd;
            bool launcherValid;
            byte clientLauncherType;
            byte clientSeat = SceneRuntime.ServerToClientSeat(ncc.Seat);

            if (GetPlayer(clientSeat) == null)
            {
                return;
            }
            SceneRuntime.CheckLauncherValid(ncc.LauncherType, out clientLauncherType, out launcherValid);
            m_PlayerList[clientSeat].Launcher.ChangeLauncher(clientLauncherType, launcherValid);

            //change launcherType;
            if (m_MyClientSeat == clientSeat)
            {
                /*SceneRuntime.LogicUI.UpateLaunchData();
                 * SceneRuntime.LogicUI.UpdateSkillState();*/
                ModelManager.Instance.Get <SkillModel>().UpdateSkillState(ncc);
            }
        }