Increased 'impossible' range to hopefully prevent false bans.

This commit is contained in:
high 2011-06-08 11:58:20 -04:00
parent 451aa9c8ae
commit 205542d70b

View file

@ -280,7 +280,7 @@ namespace TShockAPI
int plyY = Math.Abs((int)Main.player[e.Msg.whoAmI].position.Y / 16); int plyY = Math.Abs((int)Main.player[e.Msg.whoAmI].position.Y / 16);
int tileX = Math.Abs(x); int tileX = Math.Abs(x);
int tileY = Math.Abs(y); int tileY = Math.Abs(y);
if (size > 5 || Math.Abs(plyX - tileX) > 12 || Math.Abs(plyY - tileY) > 12) if (size > 5 || Math.Abs(plyX - tileX) > 32 || Math.Abs(plyY - tileY) > 32)
{ {
Log.Debug(string.Format("SendTileSquare(PlyXY:{0}_{1}, TileXY:{2}_{3}, Result:{4}_{5}, Size:{6})", Log.Debug(string.Format("SendTileSquare(PlyXY:{0}_{1}, TileXY:{2}_{3}, Result:{4}_{5}, Size:{6})",
plyX, plyY, plyX, plyY,
@ -310,7 +310,7 @@ namespace TShockAPI
return Tools.Kick(e.Msg.whoAmI, "Using dirt rod"); return Tools.Kick(e.Msg.whoAmI, "Using dirt rod");
} }
if ((Math.Abs(plyX - tileX) > 8) || (Math.Abs(plyY - tileY) > 8)) if ((Math.Abs(plyX - tileX) > 32) || (Math.Abs(plyY - tileY) > 32))
{ {
Log.Debug(string.Format("TilePlaced(PlyXY:{0}_{1}, TileXY:{2}_{3}, Result:{4}_{5}, Type:{6})", Log.Debug(string.Format("TilePlaced(PlyXY:{0}_{1}, TileXY:{2}_{3}, Result:{4}_{5}, Type:{6})",
plyX, plyY, plyX, plyY,
@ -373,7 +373,17 @@ namespace TShockAPI
bool HandlePlayerUpdate(MemoryStream data, GetDataEventArgs e) bool HandlePlayerUpdate(MemoryStream data, GetDataEventArgs e)
{ {
byte plr = e.Msg.readBuffer[e.Index]; byte plr = data.ReadInt8();
byte control = data.ReadInt8();
byte item = data.ReadInt8();
float posx = data.ReadSingle();
float posy = data.ReadSingle();
float velx = data.ReadSingle();
float vely = data.ReadSingle();
if (Main.verboseNetplay)
Debug.WriteLine("Update: {{{0},{1}}} {{{2}, {3}}}", (int)posx, (int)posy, (int)velx, (int)vely);
if (plr != e.Msg.whoAmI) if (plr != e.Msg.whoAmI)
{ {
return Tools.HandleGriefer(e.Msg.whoAmI, "Update Player abuse"); return Tools.HandleGriefer(e.Msg.whoAmI, "Update Player abuse");
@ -460,7 +470,7 @@ namespace TShockAPI
{ {
Tools.SendMessage(e.Msg.whoAmI, "You do not have permission to use lava", Color.Red); Tools.SendMessage(e.Msg.whoAmI, "You do not have permission to use lava", Color.Red);
Tools.SendLogs(Main.player[e.Msg.whoAmI].name + " tried using lava", Color.Red); Tools.SendLogs(Main.player[e.Msg.whoAmI].name + " tried using lava", Color.Red);
return true; return true;
} }
if (!lava && !players[e.Msg.whoAmI].group.HasPermission("canwater")) if (!lava && !players[e.Msg.whoAmI].group.HasPermission("canwater"))
@ -481,7 +491,7 @@ namespace TShockAPI
)); ));
return Tools.HandleGriefer(e.Msg.whoAmI, "Manipulating liquid without bucket."); ; return Tools.HandleGriefer(e.Msg.whoAmI, "Manipulating liquid without bucket."); ;
} }
if ((Math.Abs(plyX - tileX) > 6) || (Math.Abs(plyY - tileY) > 6)) if ((Math.Abs(plyX - tileX) > 32) || (Math.Abs(plyY - tileY) > 32))
{ {
Log.Debug(string.Format("Liquid(PlyXY:{0}_{1}, TileXY:{2}_{3}, Result:{4}_{5}, Amount:{6})", Log.Debug(string.Format("Liquid(PlyXY:{0}_{1}, TileXY:{2}_{3}, Result:{4}_{5}, Amount:{6})",
plyX, plyY, plyX, plyY,