fixed useless query for being useless. Added in code that checks the list of groups and not the db itself.

TSDEV-49
This commit is contained in:
Zack Piispanen 2011-07-22 17:33:59 -04:00
parent 15af989826
commit 987d9e793b

View file

@ -132,26 +132,12 @@ namespace TShockAPI.DB
return true; return true;
try foreach (Group g in groups)
{ {
using (var com = database.CreateCommand()) if (g.Name.Equals(group))
{ return true;
com.CommandText = "SELECT * FROM Grouplist WHERE GroupName=@groupname"; }
com.AddParameter("@groupname", group);
using (var reader = com.ExecuteReader())
{
while (reader.Read())
if (reader.Get<string>("GroupName") == group)
return true;
reader.Close();
}
}
}
catch (Exception ex)
{
Log.Error(ex.ToString());
}
return false; return false;
} }