Exemple #1
0
        /// <summary>
        /// Setup the content manager so it knows where to find various files.
        /// </summary>
        private void Init()
        {
            Inited = true;
            if (!TS1)
            {
                Audio.Init();
            }
            /** Scan system for files **/
            if (AllFiles == null)
            {
                LoadProgress = ContentLoadingProgress.ScanningFiles;
                var allFiles = new List <string>();
                if (Target != FSOEngineMode.TS1)
                {
                    _ScanFiles(BasePath, allFiles, BasePath);
                    AllFiles = allFiles.ToArray();
                }
            }

            var ts1AllFiles = new List <string>();
            var oldBase     = BasePath;

            if (TS1)
            {
                _ScanFiles(TS1BasePath, ts1AllFiles, TS1BasePath);
                TS1AllFiles = ts1AllFiles.ToArray();
            }

            LoadProgress = ContentLoadingProgress.InitGlobal;
            TS1Global?.Init();
            LoadProgress = ContentLoadingProgress.InitBCF;
            BCFGlobal?.Init();

            if (!TS1)
            {
                PIFFRegistry.Init(Path.Combine(FSOEnvironment.ContentDir, "Patch/"));
            }
            else
            {
                PIFFRegistry.Init(Path.Combine(FSOEnvironment.ContentDir, "TS1Patch/"));
            }

            LoadProgress = ContentLoadingProgress.InitAvatars;
            _archives    = new Dictionary <string, FAR3Archive>();
            if (Target != FSOEngineMode.TS1 && Mode == ContentMode.CLIENT)
            {
                UIGraphics.Init();
            }

            if (TS1)
            {
                ((TS1AvatarTextureProvider)AvatarTextures)?.Init();
                ((TS1BMFProvider)AvatarMeshes)?.Init();
                Jobs         = new TS1JobProvider(TS1Global);
                Neighborhood = new TS1NeighborhoodProvider(this);
            }
            else
            {
                if (Mode == ContentMode.CLIENT)
                {
                    AvatarHandgroups.Init();
                }
                AvatarBindings.Init();
                AvatarOutfits.Init();
                AvatarPurchasables.Init();
                AvatarCollections.Init();
                AvatarThumbnails.Init();
                ((AvatarTextureProvider)AvatarTextures)?.Init();
                ((AvatarAnimationProvider)AvatarAnimations).Init();
                ((AvatarSkeletonProvider)AvatarSkeletons).Init();
                ((AvatarAppearanceProvider)AvatarAppearances).Init();
                ((AvatarMeshProvider)AvatarMeshes)?.Init();
                CityMaps.Init();
                RackOutfits.Init();
                Ini.Init();
            }

            LoadProgress = ContentLoadingProgress.InitAudio;
            if (TS1)
            {
                Audio.Init();
            }

            InitWorld();
        }
Exemple #2
0
        /// <summary>
        /// Setup the content manager so it knows where to find various files.
        /// </summary>
        private void Init()
        {
            /** Scan system for files **/
            var allFiles = new List <string>();

            _ScanFiles(BasePath, allFiles);
            AllFiles = allFiles.ToArray();

            var ts1AllFiles = new List <string>();
            var oldBase     = BasePath;

            if (TS1)
            {
                BasePath = TS1BasePath;
                _ScanFiles(TS1BasePath, ts1AllFiles);
                BasePath    = oldBase;
                TS1AllFiles = ts1AllFiles.ToArray();
            }

            TS1Global?.Init();
            BCFGlobal?.Init();

            if (!TS1)
            {
                PIFFRegistry.Init(Path.Combine(FSOEnvironment.ContentDir, "Patch/"));
            }
            Archives = new Dictionary <string, FAR3Archive>();
            if (Mode == ContentMode.CLIENT)
            {
                UIGraphics.Init();
                AvatarHandgroups.Init();
            }

            AvatarBindings.Init();
            AvatarOutfits.Init();
            if (TS1)
            {
                ((TS1AvatarTextureProvider)AvatarTextures)?.Init();
                ((TS1BMFProvider)AvatarMeshes)?.Init();
                Jobs         = new TS1JobProvider(TS1Global);
                Neighborhood = new TS1NeighborhoodProvider(this);
            }
            else
            {
                ((AvatarTextureProvider)AvatarTextures)?.Init();
                ((AvatarAnimationProvider)AvatarAnimations).Init();
                ((AvatarSkeletonProvider)AvatarSkeletons).Init();
                ((AvatarAppearanceProvider)AvatarAppearances).Init();
                ((AvatarMeshProvider)AvatarMeshes)?.Init();
            }

            Audio.Init();
            AvatarPurchasables.Init();
            AvatarCollections.Init();
            Ini.Init();
            CityMaps.Init();
            RackOutfits.Init();

            DataDefinition = new TSODataDefinition();
            using (var stream = File.OpenRead(GetPath("TSOData_datadefinition.dat")))
            {
                DataDefinition.Read(stream);
            }

            AvatarThumbnails.Init();

            InitWorld();
        }