Merge branch 'master' of github.com:TShock/TShock

This commit is contained in:
high 2011-06-14 22:52:37 -04:00
commit fc2d04ad9f
4 changed files with 36 additions and 13 deletions

View file

@ -228,6 +228,31 @@ namespace TShockAPI
}
e.Handled = true;
}
if (text.StartsWith("exit"))
{
for (int player = 0; player < Main.maxPlayers; player++)
{
if (Main.player[player].active)
{
Tools.ForceKick(player, "Server shutting down!");
}
}
}
if (text.StartsWith("playing"))
{
int count = 0;
for (int i = 0; i < Main.maxPlayers; i++)
{
if (Main.player[i].active)
{
count++;
Console.WriteLine(string.Format("{0} ({1}) [{2}]", Main.player[i].name,
Netplay.serverSock[i].tcpClient.Client.RemoteEndPoint, Players[i].Group.Name));
}
}
Console.WriteLine(string.Format("{0} players connected.", count));
e.Handled = true;
}
}
public override void DeInitialize()
@ -608,9 +633,10 @@ namespace TShockAPI
if (Main.netMode != 2)
return;
Log.Info(string.Format("{0} ({1}) from '{2}' group joined.", Players[who].Name, Tools.GetPlayerIP(who), Players[who].Group.Name));
TSPlayer player = Players[who];
Log.Info(string.Format("{0} ({1}) from '{2}' group joined.", player.Name, Tools.GetPlayerIP(who), player.Group.Name));
Tools.ShowMOTD(who);
Tools.ShowFileToUser(player, "motd.txt");
if (HackedHealth(who))
{
Tools.HandleCheater(who, "Hacked health.");
@ -642,7 +668,7 @@ namespace TShockAPI
if (tsplr.Group.HasPermission("adminchat") && !text.StartsWith("/"))
{
Tools.Broadcast(ConfigurationManager.AdminChatPrefix + "<" + Main.player[ply].name + "> " + text, (byte)ConfigurationManager.AdminChatRGB[0], (byte)ConfigurationManager.AdminChatRGB[1], (byte)ConfigurationManager.AdminChatRGB[2]);
Tools.Broadcast(ConfigurationManager.AdminChatPrefix + "<" + tsplr.Name + "> " + text, (byte)ConfigurationManager.AdminChatRGB[0], (byte)ConfigurationManager.AdminChatRGB[1], (byte)ConfigurationManager.AdminChatRGB[2]);
e.Handled = true;
return;
}