diff --git a/MCGalaxy/Config/ConfigElement.cs b/MCGalaxy/Config/ConfigElement.cs index d664a5330..dcdde4a51 100644 --- a/MCGalaxy/Config/ConfigElement.cs +++ b/MCGalaxy/Config/ConfigElement.cs @@ -93,14 +93,6 @@ namespace MCGalaxy } } - public static void SerialiseSimple(ConfigElement[] elements, string path, object instance) { - using (StreamWriter w = FileIO.CreateGuarded(path)) - { - w.WriteLine("#Settings file"); - SerialiseElements(elements, w, instance); - } - } - public static void SerialiseElements(ConfigElement[] elements, TextWriter w, object instance) { foreach (ConfigElement elem in elements) { diff --git a/MCGalaxy/Games/RoundsGame/RoundsGameConfig.cs b/MCGalaxy/Games/RoundsGame/RoundsGameConfig.cs index 24000beec..dfca159c6 100644 --- a/MCGalaxy/Games/RoundsGame/RoundsGameConfig.cs +++ b/MCGalaxy/Games/RoundsGame/RoundsGameConfig.cs @@ -38,7 +38,12 @@ namespace MCGalaxy.Games protected void SaveTo(ConfigElement[] cfg, string propsDir, string map) { string path = propsDir + map + ".properties"; if (!Directory.Exists(propsDir)) Directory.CreateDirectory(propsDir); - ConfigElement.SerialiseSimple(cfg, path, this); + + using (StreamWriter w = FileIO.CreateGuarded(path)) + { + w.WriteLine("#Game settings file"); + ConfigElement.SerialiseElements(cfg, w, this); + } } /// Saves this configuration to disc. diff --git a/MCGalaxy/Server/ServerProperties.cs b/MCGalaxy/Server/ServerProperties.cs index f7c4fcb40..57d4bfe5e 100644 --- a/MCGalaxy/Server/ServerProperties.cs +++ b/MCGalaxy/Server/ServerProperties.cs @@ -121,7 +121,7 @@ namespace MCGalaxy public static void Save() { try { lock (saveLock) { - using (StreamWriter w = new StreamWriter(Paths.ServerPropsFile)) + using (StreamWriter w = FileIO.CreateGuarded(Paths.ServerPropsFile)) SaveProps(w); } } catch (Exception ex) {