Names are limited to 32 characters.

This commit is contained in:
Shank 2011-06-05 03:28:48 -06:00
parent 9a68676392
commit c7d69f42fd
2 changed files with 9 additions and 4 deletions

View file

@ -95,9 +95,9 @@ namespace TShockAPI
Tools.SendMessage(ply, lineTwo, new float[] { 255f, 255f, 0f });
string lineThree = "";
lineThree += "InvMultiplier : " + ConfigurationManager.invasionMultiplier + ", ";
lineThree += "SpawnProtect : " + ConfigurationManager.spawnProtect + ", ";
lineThree += "SpawnProtectR : " + ConfigurationManager.spawnProtectRadius + ", ";
lineThree += "DefaultMaxSpawns : " + ConfigurationManager.defaultMaxSpawns + ", ";
lineThree += "ProtectS : " + ConfigurationManager.spawnProtect + ", ";
lineThree += "ProtectR : " + ConfigurationManager.spawnProtectRadius + ", ";
lineThree += "DMS : " + ConfigurationManager.defaultMaxSpawns + ", ";
lineThree += "SpawnRate: " + ConfigurationManager.defaultSpawnRate + ", ";
Tools.SendMessage(ply, lineThree, new float[] { 255f, 255f, 0f});
}

View file

@ -459,6 +459,11 @@ namespace TShockAPI
{
if (Main.netMode != 2) { return; }
string ip = Tools.GetRealIP((Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint)));
if (Tools.FindPlayer(ply).Length > 32)
{
Tools.Kick(ply, "Your name was too long.");
Tools.Broadcast(ip + " was kicked because their name exceeded 32 characters.");
}
if (FileTools.CheckBanned(ip))
{
Tools.Kick(ply, "You are banned.");
@ -733,7 +738,7 @@ namespace TShockAPI
{
for (int i = 0; i < 44; i++)
{
if (Main.player[plr].inventory[i].stack > Main.player[plr].inventory[i].maxStack)
if (Main.player[plr].inventory[i].stack > 255)
return true;
}
return false;