Killed the Obsolete SendMessage method

This commit is contained in:
ricky 2011-06-09 11:52:14 +10:00
parent e392e69a96
commit eb8d1e180f
4 changed files with 12 additions and 23 deletions

View file

@ -261,24 +261,24 @@ namespace TShockAPI
lineOne += "BanCheater : " + ConfigurationManager.banCheater + ", "; lineOne += "BanCheater : " + ConfigurationManager.banCheater + ", ";
lineOne += "KickGriefer : " + ConfigurationManager.kickGriefer + ", "; lineOne += "KickGriefer : " + ConfigurationManager.kickGriefer + ", ";
lineOne += "BanGriefer : " + ConfigurationManager.banGriefer; lineOne += "BanGriefer : " + ConfigurationManager.banGriefer;
Tools.SendMessage(ply, lineOne, 255f, 255f, 0f); Tools.SendMessage(ply, lineOne, Color.Yellow);
string lineTwo = ""; string lineTwo = "";
lineTwo += "BanTnt : " + ConfigurationManager.banTnt + ", "; lineTwo += "BanTnt : " + ConfigurationManager.banTnt + ", ";
lineTwo += "KickTnt : " + ConfigurationManager.kickTnt + ", "; lineTwo += "KickTnt : " + ConfigurationManager.kickTnt + ", ";
lineTwo += "BanBoom : " + ConfigurationManager.banBoom + ", "; lineTwo += "BanBoom : " + ConfigurationManager.banBoom + ", ";
lineTwo += "KickBoom : " + ConfigurationManager.kickBoom; lineTwo += "KickBoom : " + ConfigurationManager.kickBoom;
Tools.SendMessage(ply, lineTwo, 255f, 255f, 0f); Tools.SendMessage(ply, lineTwo, Color.Yellow);
string lineThree = ""; string lineThree = "";
lineThree += "InvMultiplier : " + ConfigurationManager.invasionMultiplier + ", "; lineThree += "InvMultiplier : " + ConfigurationManager.invasionMultiplier + ", ";
lineThree += "ProtectS : " + ConfigurationManager.spawnProtect + ", "; lineThree += "ProtectS : " + ConfigurationManager.spawnProtect + ", ";
lineThree += "ProtectR : " + ConfigurationManager.spawnProtectRadius + ", "; lineThree += "ProtectR : " + ConfigurationManager.spawnProtectRadius + ", ";
lineThree += "DMS : " + ConfigurationManager.defaultMaxSpawns + ", "; lineThree += "DMS : " + ConfigurationManager.defaultMaxSpawns + ", ";
lineThree += "SpawnRate: " + ConfigurationManager.defaultSpawnRate; lineThree += "SpawnRate: " + ConfigurationManager.defaultSpawnRate;
Tools.SendMessage(ply, lineThree, 255f, 255f, 0f); Tools.SendMessage(ply, lineThree, Color.Yellow);
string lineFour = ""; string lineFour = "";
lineFour += "MaxSlots : " + ConfigurationManager.maxSlots + ", "; lineFour += "MaxSlots : " + ConfigurationManager.maxSlots + ", ";
lineFour += "RangeChecks : " + ConfigurationManager.rangeChecks + ", "; lineFour += "RangeChecks : " + ConfigurationManager.rangeChecks + ", ";
Tools.SendMessage(ply, lineFour, 255f, 255f, 0f); Tools.SendMessage(ply, lineFour, Color.Yellow);
} }
public static void Kick(CommandArgs args) public static void Kick(CommandArgs args)
@ -823,19 +823,19 @@ namespace TShockAPI
tempstring += "/" + cmdlist[j].Name() + ", "; tempstring += "/" + cmdlist[j].Name() + ", ";
if (j == cmdlist.Count - 1) if (j == cmdlist.Count - 1)
{ {
Tools.SendMessage(ply, tempstring.TrimEnd(new[] { ' ', ',' }), new[] { 255f, 255f, 0f }); Tools.SendMessage(ply, tempstring.TrimEnd(new[] { ' ', ',' }), Color.Yellow);
break; break;
} }
if ((j + 1) % 5 == 0) if ((j + 1) % 5 == 0)
{ {
Tools.SendMessage(ply, tempstring.TrimEnd(new[] { ' ', ',' }), new[] { 255f, 255f, 0f }); Tools.SendMessage(ply, tempstring.TrimEnd(new[] { ' ', ',' }), Color.Yellow);
tempstring = ""; tempstring = "";
} }
} }
} }
if (cmdlist.Count > (15 * page)) if (cmdlist.Count > (15 * page))
{ {
Tools.SendMessage(ply, "Type /help " + (page + 1) + " for more commands.", new[] { 255f, 0f, 255f }); Tools.SendMessage(ply, "Type /help " + (page + 1) + " for more commands.", Color.Yellow);
} }
} }

View file

@ -336,8 +336,7 @@ namespace TShockAPI
var flag = CheckSpawn(x, y); var flag = CheckSpawn(x, y);
if (flag) if (flag)
{ {
Tools.SendMessage(e.Msg.whoAmI, "Spawn protected from changes.", Tools.SendMessage(e.Msg.whoAmI, "Spawn protected from changes.", Color.Red);
new[] { 255f, 0f, 0f });
return true; return true;
} }
} }
@ -521,7 +520,7 @@ namespace TShockAPI
var flag = CheckSpawn(x, y); var flag = CheckSpawn(x, y);
if (flag) if (flag)
{ {
Tools.SendMessage(e.Msg.whoAmI, "The spawn is protected!", new[] { 255f, 0f, 0f }); Tools.SendMessage(e.Msg.whoAmI, "The spawn is protected!", Color.Red);
return true; return true;
} }
} }
@ -673,8 +672,6 @@ namespace TShockAPI
Console.WriteLine("This token will only display ONCE. This only works ONCE. If you don't use it and the server goes down, delete auth.lck."); Console.WriteLine("This token will only display ONCE. This only works ONCE. If you don't use it and the server goes down, delete auth.lck.");
FileTools.CreateFile(FileTools.SaveDir + "auth.lck"); FileTools.CreateFile(FileTools.SaveDir + "auth.lck");
} }
//ConfigurationManager.maxSlots = Main.maxPlayers - 1;
} }
private void OnUpdate(GameTime time) private void OnUpdate(GameTime time)

View file

@ -95,12 +95,6 @@ namespace TShockAPI
Log.Info("Broadcast: " + msg); Log.Info("Broadcast: " + msg);
} }
[Obsolete("STOP USING THIS")]
public static void SendMessage(int ply, string msg, float[] colors)
{
SendMessage(ply, msg, colors[0],colors[1],colors[2]);
}
/// <summary> /// <summary>
/// Sends a message out to a single player /// Sends a message out to a single player
/// </summary> /// </summary>
@ -357,10 +351,7 @@ namespace TShockAPI
{ {
try try
{ {
pC[0] = Clamp(Convert.ToInt32(pCc[0]), 255, 0); SendMessage(ply, foo, Clamp(Convert.ToInt32(pCc[0]), 255, 0), Clamp(Convert.ToInt32(pCc[1]), 255, 0), Clamp(Convert.ToInt32(pCc[2]), 255, 0));
pC[1] = Clamp(Convert.ToInt32(pCc[1]), 255, 0);
pC[2] = Clamp(Convert.ToInt32(pCc[2]), 255, 0);
SendMessage(ply, foo, pC);
continue; continue;
} }
catch (Exception e) catch (Exception e)

View file

@ -5,6 +5,7 @@ using System.Net;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Xna.Framework;
using Terraria; using Terraria;
namespace TShockAPI namespace TShockAPI
@ -64,7 +65,7 @@ namespace TShockAPI
Tools.SendMessage(i, "The server is out of date. To update, type /updatenow."); Tools.SendMessage(i, "The server is out of date. To update, type /updatenow.");
for (int j = 4; j < changes.Length; j++) for (int j = 4; j < changes.Length; j++)
{ {
Tools.SendMessage(i, changes[j], 255, 0, 0); Tools.SendMessage(i, changes[j], Color.Red);
} }
} }
} }