public override void Load() { var nonSharedPath = Path.Combine(Server.Get.Files.ConfigDirectory, "SCP914Recipes.syml"); var path = File.Exists(nonSharedPath) ? nonSharedPath : Path.Combine(Server.Get.Files.SharedConfigDirectory, "SCP914Recipes.syml"); SYMLConfig = new SYML(path); //Wait 3 Seconds so that the Game has enough time to load the default Values Timing.CallDelayed(3f, () => { DefaultConfig.Scp914Recipes = Map.Get.Scp914.Recipes.ToList(); ReloadConfigs(); }); }
public void SaveSchematic(SynapseSchematic schematic, string fileName) { if (IsIDRegistered(schematic.ID)) { return; } AddSchematic(schematic); var syml = new SYML(Path.Combine(Server.Get.Files.SchematicDirectory, fileName + ".syml")); var section = new ConfigSection { Section = schematic.Name }; section.Import(schematic); syml.Sections.Add(schematic.Name, section); syml.Store(); }
internal void Load() { var list = Schematics.ToList(); foreach (var schematic in list.ToList()) { if (schematic.reload) { list.Remove(schematic); } } Schematics = list.AsReadOnly(); foreach (var file in Directory.GetFiles(Server.Get.Files.SchematicDirectory, "*.syml")) { try { var syml = new SYML(file); syml.Load(); if (syml.Sections.Count == 0) { continue; } var section = syml.Sections.First().Value; var schematic = section.LoadAs <SynapseSchematic>(); if (IsIDRegistered(schematic.ID)) { continue; } AddSchematic(schematic); } catch (Exception ex) { Logger.Get.Error($"Synapse-Schematic: Loading Schematic failed - path: {file}\n{ex}"); } } }
internal void Init() { _permissionSYML = new SYML(Server.Get.Files.PermissionFile); Reload(); }
public SynapseTranslation(string path) { translationSYML = new SYML(path); translationSYML.Load(); }