Exemplo n.º 1
0
        public Helper()
        {
            Settings = new Config();
            loadedServer = null;
            rcon = null;
            //Config laden bzw. erstellen...
            if (!File.Exists(configPath))
            {
                if (!Directory.Exists(Directory.GetParent(configPath).ToString()))
                    Directory.CreateDirectory(Directory.GetParent(configPath).ToString());

                SaveConfig();
            }
            else
            {
                LoadConfig();
            }
        }
Exemplo n.º 2
0
 public void LoadConfig()
 {
     TextReader reader = new StreamReader(configPath);
     XmlSerializer deserializer = new XmlSerializer(Settings.GetType(), new Type[] { typeof(ArkServer) });
     Settings = (Config)deserializer.Deserialize(reader);
     reader.Close();
 }