From cb5a50f5403e0eadd46c9e41f2ca6e206e4ccc80 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 16 Jul 2011 18:21:39 -0600 Subject: [PATCH] /region allow now works (and adds users) --- TShockAPI/Commands.cs | 2 +- TShockAPI/DB/RegionManager.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 3493b1ef..5bc5e1df 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1433,7 +1433,7 @@ namespace TShockAPI } if ((playerID = TShock.Users.GetUserByName(playerName)) != null) { - if (TShock.Regions.AddNewUser(regionName, playerID)) + if (TShock.Regions.AddNewUser(regionName, playerName)) { args.Player.SendMessage("Added user " + playerName + " to " + regionName, Color.Yellow); } diff --git a/TShockAPI/DB/RegionManager.cs b/TShockAPI/DB/RegionManager.cs index cd268f5e..051dc18e 100644 --- a/TShockAPI/DB/RegionManager.cs +++ b/TShockAPI/DB/RegionManager.cs @@ -217,7 +217,7 @@ namespace TShockAPI.DB return SplitIDs; } - public bool AddNewUser(string regionName, User user) + public bool AddNewUser(string regionName, String userName) { string MergedIDs = string.Empty; @@ -236,9 +236,9 @@ namespace TShockAPI.DB } if (MergedIDs == string.Empty) - MergedIDs = user.ID.ToString(); + MergedIDs = userName; else - MergedIDs = MergedIDs + "," + user.ID; + MergedIDs = MergedIDs + "," + userName; com.CommandText = "UPDATE Regions SET UserIds=@ids"; com.AddParameter("@ids", MergedIDs);