static string FindOldHashPath(string name) { string path = PASS_FOLDER + name + ".dat"; if (File.Exists(path)) { return(path); } // Have to fallback on this for case sensitive file systems string[] files = AtomicIO.TryGetFiles(PASS_FOLDER, "*.dat"); if (files == null) { return(null); } foreach (string file in files) { if (file.CaselessEq(path)) { return(file); } } return(null); }
public static void AutoloadPlugins() { string[] files = AtomicIO.TryGetFiles("plugins", "*.dll"); if (files != null) { foreach (string path in files) { LoadPlugin(path, true); } } else { Directory.CreateDirectory("plugins"); } }
static void MessagePresets(Player p) { p.Message("&T/Env preset [type] &H- Applies an env preset on the map"); p.Message("&HPresets: &f{0}", EnvPreset.Presets.Join(pr => pr.Key)); string[] files = AtomicIO.TryGetFiles("presets", "*.env"); if (files == null) { return; } string all = files.Join(f => Path.GetFileNameWithoutExtension(f)); if (all.Length > 0) { p.Message("&HCustom presets: &f" + all); } }