From 5488be08573e2216ed8b93ccbbf5dd1ebab41cc1 Mon Sep 17 00:00:00 2001 From: Zack Piispanen Date: Mon, 16 Mar 2015 12:50:38 -0400 Subject: [PATCH] Clean up some spaces in FileTools, and make the motd format a const. --- TShockAPI/FileTools.cs | 48 ++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/TShockAPI/FileTools.cs b/TShockAPI/FileTools.cs index 65e2d56d..c820294e 100644 --- a/TShockAPI/FileTools.cs +++ b/TShockAPI/FileTools.cs @@ -25,33 +25,35 @@ namespace TShockAPI { public class FileTools { - /// - /// Path to the file containing the rules. - /// + private const string MotdFormat = + "This server is running TShock for Terraria.\n Type /help for a list of commands.\n%255,000,000%Current map: %map%\nCurrent players: %players%"; + /// + /// Path to the file containing the rules. + /// internal static string RulesPath { get { return Path.Combine(TShock.SavePath, "rules.txt"); } } - /// - /// Path to the file containing the message of the day. - /// + /// + /// Path to the file containing the message of the day. + /// internal static string MotdPath { get { return Path.Combine(TShock.SavePath, "motd.txt"); } } - /// - /// Path to the file containing the whitelist. - /// + /// + /// Path to the file containing the whitelist. + /// internal static string WhitelistPath { get { return Path.Combine(TShock.SavePath, "whitelist.txt"); } } - /// - /// Path to the file containing the config. - /// + /// + /// Path to the file containing the config. + /// internal static string ConfigPath { get { return Path.Combine(TShock.SavePath, "config.json"); } @@ -65,20 +67,20 @@ namespace TShockAPI get { return Path.Combine(TShock.SavePath, "sscconfig.json"); } } - /// - /// Creates an empty file at the given path. - /// - /// The path to the file. + /// + /// Creates an empty file at the given path. + /// + /// The path to the file. public static void CreateFile(string file) { File.Create(file).Close(); } - /// - /// Creates a file if the files doesn't already exist. - /// - /// The path to the files - /// The data to write to the file. + /// + /// Creates a file if the files doesn't already exist. + /// + /// The path to the files + /// The data to write to the file. public static void CreateIfNot(string file, string data = "") { if (!File.Exists(file)) @@ -98,8 +100,8 @@ namespace TShockAPI } CreateIfNot(RulesPath, "Respect the admins!\nDon't use TNT!"); - CreateIfNot(MotdPath, - "This server is running TShock for Terraria.\n Type /help for a list of commands.\n%255,000,000%Current map: %map%\nCurrent players: %players%"); + CreateIfNot(MotdPath, MotdFormat); + CreateIfNot(WhitelistPath); if (File.Exists(ConfigPath)) {