whoops pushed in some test stuff that would break commands fixed removeItem ban tho, so its all good
This commit is contained in:
parent
347d701b7f
commit
a2f2ea1500
2 changed files with 4 additions and 14 deletions
|
|
@ -1193,18 +1193,13 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
if (args.Parameters.Count > 0)
|
if (args.Parameters.Count > 0)
|
||||||
{
|
{
|
||||||
/*String groupname = args.Parameters[0];
|
String groupname = args.Parameters[0];
|
||||||
args.Parameters.RemoveAt(0);
|
args.Parameters.RemoveAt(0);
|
||||||
String permissions = String.Join(",", args.Parameters );
|
String permissions = String.Join(",", args.Parameters );
|
||||||
|
|
||||||
String response = TShock.Groups.addGroup(groupname, permissions);
|
String response = TShock.Groups.addGroup(groupname, permissions);
|
||||||
if( response.Length > 0 )
|
if( response.Length > 0 )
|
||||||
args.Player.SendMessage(response, Color.Green);*/
|
args.Player.SendMessage(response, Color.Green);
|
||||||
|
|
||||||
TShock.Itembans.AddNewBan("Gold Coin");
|
|
||||||
Console.WriteLine(String.Join(",", TShock.Itembans.ItemBans));
|
|
||||||
TShock.Itembans.RemoveBan("Gold Coin");
|
|
||||||
Console.WriteLine(String.Join(",", TShock.Itembans.ItemBans));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -100,12 +100,8 @@ namespace TShockAPI.DB
|
||||||
|
|
||||||
public void RemoveBan(string itemname)
|
public void RemoveBan(string itemname)
|
||||||
{
|
{
|
||||||
if (ItemIsBanned(itemname))
|
if (!ItemIsBanned(itemname))
|
||||||
return;
|
return;
|
||||||
else
|
|
||||||
{
|
|
||||||
ItemBans.Remove(itemname);
|
|
||||||
}
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var com = database.CreateCommand())
|
using (var com = database.CreateCommand())
|
||||||
|
|
@ -113,12 +109,11 @@ namespace TShockAPI.DB
|
||||||
com.CommandText = "Delete FROM 'ItemBans' WHERE ItemName=@itemname;";
|
com.CommandText = "Delete FROM 'ItemBans' WHERE ItemName=@itemname;";
|
||||||
com.AddParameter("@itemname", Tools.GetItemByName(itemname)[0].name);
|
com.AddParameter("@itemname", Tools.GetItemByName(itemname)[0].name);
|
||||||
com.ExecuteNonQuery();
|
com.ExecuteNonQuery();
|
||||||
|
ItemBans.Remove(itemname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
ItemBans.Remove(itemname);
|
|
||||||
Log.Error(ex.ToString());
|
Log.Error(ex.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue