/rules now follows MOTD formatting rules.

Tools.ShowMOTD is deprecated, use Tools.ShowFileToUser instead.
This commit is contained in:
Shank 2011-06-14 02:15:18 -06:00
parent b8b4b6c8e8
commit 37d40374be
2 changed files with 12 additions and 15 deletions

View file

@ -342,15 +342,20 @@ namespace TShockAPI
}
return false;
}
/// <summary>
/// Shows a MOTD to the player
/// </summary>
/// <param name="ply">int player</param>
[Obsolete("Use ShowFileToUser(int ply, string file) instead.")]
public static void ShowMOTD(int ply)
{
ShowFileToUser(ply, "motd.txt");
}
/// <summary>
/// Shows a file to the user.
/// </summary>
/// <param name="ply">int player</param>
/// <param name="file">string filename reletave to savedir</param>
public static void ShowFileToUser(int ply, string file)
{
string foo = "";
TextReader tr = new StreamReader(FileTools.SaveDir + "motd.txt");
TextReader tr = new StreamReader(FileTools.SaveDir + file);
while ((foo = tr.ReadLine()) != null)
{
foo = foo.Replace("%map%", Main.worldName);