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

@ -131,27 +131,13 @@ namespace TShockAPI.DB
if (group == "superadmin")
return true;
try
{
using (var com = database.CreateCommand())
{
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)
foreach (Group g in groups)
{
Log.Error(ex.ToString());
if (g.Name.Equals(group))
return true;
}
return false;
}