Fix the last sendtilesquare exploit, I hope.
This commit is contained in:
parent
16093fd9ca
commit
61b8885ba0
2 changed files with 298 additions and 288 deletions
|
|
@ -628,8 +628,7 @@ namespace TShockAPI.DB
|
|||
return true;
|
||||
}
|
||||
|
||||
return AllowedIDs.Contains(ply.UserID) || AllowedGroups.Contains(ply.Group.Name) || Owner == ply.UserAccountName ||
|
||||
ply.Group.HasPermission("manageregion");
|
||||
return AllowedIDs.Contains(ply.UserID) || AllowedGroups.Contains(ply.Group.Name) || Owner == ply.UserAccountName;
|
||||
}
|
||||
|
||||
public void setAllowedIDs(String ids)
|
||||
|
|
|
|||
|
|
@ -1249,6 +1249,7 @@ namespace TShockAPI
|
|||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.ToString());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
@ -1629,12 +1630,13 @@ namespace TShockAPI
|
|||
|
||||
if (TShock.CheckIgnores(args.Player))
|
||||
{
|
||||
args.Player.SendTileSquare(tileX, tileY);
|
||||
args.Player.SendTileSquare(tileX, tileY, size);
|
||||
return true;
|
||||
}
|
||||
|
||||
var tiles = new NetTile[size,size];
|
||||
|
||||
try
|
||||
{
|
||||
var tiles = new NetTile[size, size];
|
||||
for (int x = 0; x < size; x++)
|
||||
{
|
||||
for (int y = 0; y < size; y++)
|
||||
|
|
@ -1658,12 +1660,8 @@ namespace TShockAPI
|
|||
|
||||
var tile = Main.tile[realx, realy];
|
||||
var newtile = tiles[x, y];
|
||||
if (TShock.CheckTilePermission(args.Player, realx, realy))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// Server now has a range check built in
|
||||
if (TShock.CheckRangePermission(args.Player, realx, realy))
|
||||
if (TShock.CheckTilePermission(args.Player, realx, realy) ||
|
||||
TShock.CheckRangePermission(args.Player, realx, realy))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1720,6 +1718,11 @@ namespace TShockAPI
|
|||
{
|
||||
args.Player.SendTileSquare(tileX, tileY, size);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
args.Player.SendTileSquare(tileX, tileY, size);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1751,6 +1754,9 @@ namespace TShockAPI
|
|||
EditAction action = (EditAction)args.Data.ReadInt8();
|
||||
var tileX = args.Data.ReadInt32();
|
||||
var tileY = args.Data.ReadInt32();
|
||||
|
||||
try
|
||||
{
|
||||
var editData = args.Data.ReadInt8();
|
||||
EditType type = (action == EditAction.KillTile || action == EditAction.KillWall ||
|
||||
action == EditAction.KillTileNoItem)
|
||||
|
|
@ -1977,7 +1983,7 @@ namespace TShockAPI
|
|||
return true;
|
||||
}
|
||||
|
||||
if ((action == EditAction.PlaceTile || action == EditAction.PlaceWall ) && !args.Player.Group.HasPermission(Permissions.ignoreplacetiledetection))
|
||||
if ((action == EditAction.PlaceTile || action == EditAction.PlaceWall) && !args.Player.Group.HasPermission(Permissions.ignoreplacetiledetection))
|
||||
{
|
||||
args.Player.TilePlaceThreshold++;
|
||||
var coords = new Vector2(tileX, tileY);
|
||||
|
|
@ -1993,9 +1999,14 @@ namespace TShockAPI
|
|||
if (!args.Player.TilesDestroyed.ContainsKey(coords))
|
||||
args.Player.TilesDestroyed.Add(coords, Main.tile[tileX, tileY]);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
args.Player.SendTileSquare(tileX, tileY, 4);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For use with a PaintTile event
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue