Esempio n. 1
0
        public static CASCConfig LoadLocalStorageConfig(string basePath)
        {
            var config = new CASCConfig {
                OnlineMode = false, BasePath = basePath
            };

            string buildInfoPath = Path.Combine(basePath, ".build.info");

            using (Stream buildInfoStream = new FileStream(buildInfoPath, FileMode.Open))
            {
                config._BuildInfo = KeyValueConfig.ReadVerBarConfig(buildInfoStream);
            }

            string buildKey     = config._BuildInfo["Build Key"][0];
            string buildCfgPath = Path.Combine(basePath, "Data\\config\\", buildKey.Substring(0, 2), buildKey.Substring(2, 2), buildKey);

            using (Stream stream = new FileStream(buildCfgPath, FileMode.Open))
            {
                config._BuildConfig = KeyValueConfig.ReadKeyValueConfig(stream);
            }

            string cdnKey     = config._BuildInfo["CDN Key"][0];
            string cdnCfgPath = Path.Combine(basePath, "Data\\config\\", cdnKey.Substring(0, 2), cdnKey.Substring(2, 2), cdnKey);

            using (Stream stream = new FileStream(cdnCfgPath, FileMode.Open))
            {
                config._CDNConfig = KeyValueConfig.ReadKeyValueConfig(stream);
            }

            return(config);
        }
Esempio n. 2
0
        public static CASCConfig LoadOnlineStorageConfig()
        {
            var config = new CASCConfig {
                OnlineMode = true
            };

            using (var cdnsStream = CDNHandler.OpenFileDirect("http://us.patch.battle.net/wow_beta/cdns"))
            {
                config._CDNData = KeyValueConfig.ReadVerBarConfig(cdnsStream);
            }

            using (var versionsStream = CDNHandler.OpenFileDirect("http://us.patch.battle.net/wow_beta/versions"))
            {
                config._VersionsData = KeyValueConfig.ReadVerBarConfig(versionsStream);
            }

            string buildKey = config._VersionsData["BuildConfig"][0];

            using (Stream stream = CDNHandler.OpenConfigFileDirect(config.CDNUrl, buildKey))
            {
                config._BuildConfig = KeyValueConfig.ReadKeyValueConfig(stream);
            }

            string cdnKey = config._VersionsData["CDNConfig"][0];

            using (Stream stream = CDNHandler.OpenConfigFileDirect(config.CDNUrl, cdnKey))
            {
                config._CDNConfig = KeyValueConfig.ReadKeyValueConfig(stream);
            }
            return(config);
        }