Exemple #1
0
        public LauncherData(string workingDir)
        {
            dataCenterConfig = new ConfigXmlDocument();
            dataCenterConfig.Load(System.IO.Path.Combine(workingDir, "TurbineLauncher.exe.config"));
            gameName         = GetAppSetting(dataCenterConfig, "DataCenter.GameName");
            dataCenterServer = GetAppSetting(dataCenterConfig, "Launcher.DataCenterService.GLS");

            GLSDatacenterInfoServer svc = new GLSDatacenterInfoServer();

            svc.Url = dataCenterServer;
            Datacenter[] dc = svc.GetDatacenters(gameName);
            dataCenter = dc[0];

            dataCenterConfig = new ConfigXmlDocument();
            dataCenterConfig.Load(dataCenter.LauncherConfigurationServer);
            dataCenterSettings = new Dictionary <string, string>();
            foreach (XmlNode node in dataCenterConfig["configuration"]["appSettings"].ChildNodes)
            {
                if (node.Attributes != null)
                {
                    dataCenterSettings.Add(node.Attributes["key"].Value, node.Attributes["value"].Value);
                }
            }

            worlds = dataCenter.Worlds.ToDictionary(w => w.Name, w => w);
        }
Exemple #2
0
        private void LoadWorlds()
        {
            try
            {
                GLSDatacenterInfoServer svc         = new GLSDatacenterInfoServer();
                Datacenter[]            dc          = svc.GetDatacenters(Settings.Game);
                List <Datacenter>       dataCenters = dc.ToList();
                worlds = dataCenters[0].Worlds.ToList();
                cbServer.DataSource = worlds;

                if (!string.IsNullOrEmpty(Settings.DefaultServer))
                {
                    cbServer.SelectedIndex = cbServer.FindStringExact(Settings.DefaultServer);
                }

                ConfigXmlDocument cxd = new ConfigXmlDocument();
                cxd.Load(dataCenters[0].LauncherConfigurationServer);
                dataCenterSettings = new Dictionary <string, string>();
                foreach (XmlNode node in cxd["configuration"]["appSettings"].ChildNodes)
                {
                    if (node.Attributes != null)
                    {
                        dataCenterSettings.Add(node.Attributes["key"].Value, node.Attributes["value"].Value);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error getting datacenters\n" + ex.Message);
            }

            GetServerStatuses();
        }