Beispiel #1
0
    public void ResetPlayerData(JoinRoomData jrd, bool bFirst)
    {
        byte serverSeat         = jrd.Seat;
        byte serverLauncherType = jrd.LauncherType;

        SceneObjMgr.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);
    }
Beispiel #2
0
    //命令处理
    //======================================================================
    public void PlayerJoin(NetCmdPack pack)
    {
        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);
        m_PlayerMgr.PlayerJoin(pd, clientSeat, ncp.rateIndex, clientLauncherType, launcherValid);//m_RoomRateIndex
    }
Beispiel #3
0
    public bool PlayerJoin(PlayerExtraData player, byte clientSeat, byte rateIdx, byte launcherType, bool valid)
    {
        if (m_PlayerList[clientSeat] != null)
        {
            LogMgr.Log("Seat palyer already exists:" + clientSeat.ToString());
            return(false);
        }
        ScenePlayer sp = new ScenePlayer();

        sp.Player     = player;
        sp.ClientSeat = clientSeat;
        sp.RateIndex  = rateIdx;
        sp.Launcher   = new Launcher(launcherType, valid, clientSeat, rateIdx);
        sp.Launcher.Init();
        m_PlayerList[clientSeat] = sp;

        if (clientSeat != MyClientSeat)
        {
            //获取头像
            if (player.playerData.ImgCrc < ConstValue.CUSTOM_HEADER)
            {
                sp.Launcher.SetPlayerImg(null, player.playerData.ImgCrc);
            }
            else
            {
                HeaderManager.Instance.GetPlayerHeader(player.playerData.ID, player.playerData.ImgCrc, HeaderOptType.HEADER_SCENE, clientSeat);
            }
        }
        else
        {
            SceneRuntime.LogicUI.GetSkillBar.UpdateData();
            SceneRuntime.LogicUI.UpdateSkillState();
        }
        //获取金币
        m_PlayerList[clientSeat].Launcher.UpdateUserGold(clientSeat);



        return(true);
    }