Added unban/unbanip

Fixed banning when a player picks up lava/water
Fixed name check for real this time.
Fixed banning multiple times.
This commit is contained in:
high 2011-06-07 04:56:01 -04:00
parent b7a87866fe
commit 6371a301da
4 changed files with 94 additions and 45 deletions

View file

@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Net;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Terraria;
@ -206,7 +207,8 @@ namespace TShockAPI
{
Tools.Kick(e.Msg.whoAmI, "You are banned: " + ban.Reason);
}
if (Main.player[e.Msg.whoAmI].name.Length > 32)
string name = Encoding.ASCII.GetString(e.Msg.readBuffer, e.Index + 23, (e.Length - (e.Index + 23)) + e.Index - 1);
if (name.Length > 32)
{
Tools.Kick(e.Msg.whoAmI, "Name exceeded 32 characters.");
}
@ -467,6 +469,10 @@ namespace TShockAPI
byte liquid = br.ReadByte();
bool lava = br.ReadBoolean();
//The liquid was picked up.
if (liquid == 0)
return;
int plyX = Math.Abs((int)Main.player[e.Msg.whoAmI].position.X / 16);
int plyY = Math.Abs((int)Main.player[e.Msg.whoAmI].position.Y / 16);
int tileX = Math.Abs(x);