public static BootstrapFile Read(string path) { using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) { BootstrapFile file = Read(fs); return(file); } }
public static void SetupConfig() { if (File.Exists(BootstrapPath)) { StarryboundServer.bootstrapConfig = BootstrapFile.Read(BootstrapPath); StarryboundServer.SavePath = StarryboundServer.bootstrapConfig.storageDirectory + Path.DirectorySeparatorChar + "starrybound"; } else { Console.WriteLine("[FATAL ERROR] bootstrap.config file could not be detected!"); Thread.Sleep(5000); Environment.Exit(7); } if (!Directory.Exists(StarryboundServer.SavePath)) { Directory.CreateDirectory(StarryboundServer.SavePath); } }