From a259a02306e29fcb8208b18d086c79e2a77b3c44 Mon Sep 17 00:00:00 2001 From: Zack Piispanen Date: Sat, 23 Jun 2012 14:40:06 -0400 Subject: [PATCH] added prefix to rest manager added region method again --- TShockAPI/DB/RegionManager.cs | 15 +++++++++++++++ TShockAPI/Rest/RestManager.cs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/TShockAPI/DB/RegionManager.cs b/TShockAPI/DB/RegionManager.cs index b3eef5fe..31519726 100644 --- a/TShockAPI/DB/RegionManager.cs +++ b/TShockAPI/DB/RegionManager.cs @@ -283,6 +283,21 @@ namespace TShockAPI.DB return regions; } + public List InAreaRegion(int x, int y) + { + List regions = new List() { }; + foreach (Region region in Regions) + { + if (x >= region.Area.Left && x <= region.Area.Right && + y >= region.Area.Top && y <= region.Area.Bottom && + region.DisableBuild) + { + regions.Add(region); + } + } + return regions; + } + public static List ListIDs(string MergedIDs) { return MergedIDs.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).ToList(); diff --git a/TShockAPI/Rest/RestManager.cs b/TShockAPI/Rest/RestManager.cs index 160dad55..42035802 100644 --- a/TShockAPI/Rest/RestManager.cs +++ b/TShockAPI/Rest/RestManager.cs @@ -510,7 +510,7 @@ namespace TShockAPI {"ip", player.IP}, {"group", player.Group.Name}, {"position", player.TileX + "," + player.TileY}, - {"inventory", string.Join(", ", activeItems.Select(p => (p.name + ":" + p.stack)))}, + {"inventory", string.Join(", ", activeItems.Select(p => (String.Format( "({0}){1}:{2}", p.prefix, p.name, p.stack))))}, {"buffs", string.Join(", ", player.TPlayer.buffType)} }; }