Removed useless permissions class and finished loading groups

This commit is contained in:
Maverick Motherfucker 2011-06-03 22:06:18 -07:00
parent f5723ee834
commit 3774c30f7d
3 changed files with 30 additions and 3 deletions

View file

@ -50,6 +50,16 @@ namespace TShockAPI
}
return false;
}
public void NegatePermission(string permission)
{
negatedPermissions.Add(permission);
}
public void AddPermission(string permission)
{
permissions.Add(permission);
}
}
public class SuperAdminGroup : Group

View file

@ -60,7 +60,6 @@
<Compile Include="FileTools.cs" />
<Compile Include="Group.cs" />
<Compile Include="Log.cs" />
<Compile Include="Permission.cs" />
<Compile Include="Tools.cs" />
<Compile Include="TShock.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

View file

@ -338,11 +338,10 @@ namespace TShockAPI
string[] args = lines[i].Split(' ');
string name = args[0];
string parent = args[1];
Group group;
Group group = null;
if (parent.Equals("null"))
{
group = new Group(name);
groups.Add(group);
}
else
{
@ -355,6 +354,25 @@ namespace TShockAPI
}
}
}
if (group == null)
{
throw new System.Exception("Something in the groups.txt is fucked up");
}
else
{
for (int j = 2; j < args.Length; j++)
{
string permission = args[j];
if (permission.StartsWith("!"))
{
group.NegatePermission(args[j].Replace("!", ""));
}
else
{
group.AddPermission(args[j]);
}
}
}
}
}