Ejemplo n.º 1
0
 private void Create()
 {
     log.InfoFormat("Creating new CKAN registry at {0}", path);
     registry = Registry.Empty();
     AscertainDefaultRepo();
     Save();
 }
Ejemplo n.º 2
0
        private void Load()
        {
            // Our registry needs to know our KSP install when upgrading from older
            // registry formats. This lets us encapsulate that to make it available
            // after deserialisation.
            var settings = new JsonSerializerSettings
            {
                Context = new System.Runtime.Serialization.StreamingContext(
                    System.Runtime.Serialization.StreamingContextStates.Other,
                    ksp
                    )
            };

            log.DebugFormat("Trying to load registry from {0}", path);
            string json = File.ReadAllText(path);
            log.Debug("Registry JSON loaded; parsing...");
            // A 0-byte registry.json file loads as null without exceptions
            registry = JsonConvert.DeserializeObject<Registry>(json, settings)
                ?? Registry.Empty();
            log.Debug("Registry loaded and parsed");
            ScanDlc();
            log.InfoFormat("Loaded CKAN registry at {0}", path);
        }
Ejemplo n.º 3
0
 private void Create()
 {
     log.InfoFormat("Creating new CKAN registry at {0}", path);
     registry = Registry.Empty();
     Save();
 }
Ejemplo n.º 4
0
 private void Create()
 {
     registry = Registry.Empty();
     log.DebugFormat("Creating new CKAN registry at {0}", path);
     Save();
 }
Ejemplo n.º 5
0
 private void Create()
 {
     registry = Registry.Empty(ksp.tryGetFactorioAuthData());
     log.DebugFormat("Creating new CFAN registry at {0}", path);
     Save();
 }