Ejemplo n.º 1
0
 private void OnReload(ReloadEventArgs args)
 {
     Settings = SupplySettings.Read(PVP_CONFIG_PATH);
     if (Settings == null)
     {
         Console.WriteLine("Config is null.");
         Settings = new SupplySettings(new List <SupplySet>(), new List <MapData>());
     }
 }
Ejemplo n.º 2
0
        public AutoSupplyMain(Main game)
            : base(game)
        {
            Settings = SupplySettings.Read(PVP_CONFIG_PATH);
            if (Settings == null)
            {
                Console.WriteLine("Config is null.");
                Settings = new SupplySettings(new List <SupplySet>(), new List <MapData>());
            }

            Instance = this;
        }
Ejemplo n.º 3
0
 public static SupplySettings Read(string filePath)
 {
     if (!File.Exists(filePath))
     {
         Console.WriteLine(USE_DEFAULT_CONFIG_MESSAGE);
         var settings = new SupplySettings(new List <SupplySet>(), new List <MapData>());
         return(settings);
     }
     using (var fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read))
     {
         return(Read(fs));
     }
 }