Esempio n. 1
0
        public LocalGameClientLocalization(string textSettingsFile, string textFolder)
        {
            _localizationDatabase = new LocalizationDatabase(textFolder);

            if (File.Exists(textSettingsFile))  // this file might not be existed on some game clients
            {
                using (var reader = new BigworldXmlReader(textSettingsFile))
                {
                    reader.ReadStartElement();
                    reader.ReadToNextSibling("clientLangID");
                    reader.ReadStartElement("clientLangID");
                    this.Language = reader.Value;
                }
            }
            else
            {
                this.Language = "en-us";
            }
        }
Esempio n. 2
0
        public static ModelVisual ReadFrom(Stream visualStream)
        {
            var visual = new ModelVisual();

            using (var visualReader = new BigworldXmlReader(visualStream))
            {
                visualReader.ReadStartElement();
                visual.Deserialize(visualReader);
                visualReader.ReadEndElement();
            }

            return(visual);
        }
Esempio n. 3
0
        private void Load()
        {
            using (
                var stream = new PackageStream(this.Database.PackageDatabase,
                                               this.Nation.GetPackageFileName(this.Key + ".xml")))
            {
                using (var reader = new BigworldXmlReader(stream))
                {
                    reader.ReadStartElement();
                    this.Deserialize(reader);
                    reader.ReadEndElement();
                }
            }

            this.BattleTiers     = BattleTierRules.Current.GetBattleTiers(this);
            this.CamouflageValue = CamouflageValues.Current.GetCamouflageValue(this);

            _isLoaded = true;
        }
Esempio n. 4
0
        private void LoadTankInfo()
        {
            Log.Info("loading tank info");

            this.TankInfoCollection = new List <TankInfo>();

            using (var stream = new PackageStream(this.Database.PackageDatabase, this.GetPackageFileName("list.xml")))
            {
                using (var reader = new BigworldXmlReader(stream))
                {
                    reader.ReadStartElement("FromStream");

                    while (reader.IsStartElement())
                    {
                        var tankInfo = new TankInfo(this);
                        tankInfo.Deserialize(reader);
                        this.TankInfoCollection.Add(tankInfo);
                    }

                    reader.ReadEndElement();
                }
            }
        }