Fixed debugreg having the wrong permission
This commit is contained in:
parent
3ce05162cd
commit
ff102f7ea9
1 changed files with 6 additions and 6 deletions
|
|
@ -57,19 +57,19 @@ namespace TShockAPI
|
||||||
public string Name { get { return Names[0]; } }
|
public string Name { get { return Names[0]; } }
|
||||||
public List<string> Names { get; protected set; }
|
public List<string> Names { get; protected set; }
|
||||||
public bool DoLog { get; set; }
|
public bool DoLog { get; set; }
|
||||||
private string permission;
|
public string Permission { get; protected set; }
|
||||||
private CommandDelegate command;
|
private CommandDelegate command;
|
||||||
|
|
||||||
public Command(string permissionneeded, CommandDelegate cmd, params string[] names)
|
public Command(string permissionneeded, CommandDelegate cmd, params string[] names)
|
||||||
: this(cmd, names)
|
: this(cmd, names)
|
||||||
{
|
{
|
||||||
permission = permissionneeded;
|
Permission = permissionneeded;
|
||||||
}
|
}
|
||||||
public Command(CommandDelegate cmd, params string[] names)
|
public Command(CommandDelegate cmd, params string[] names)
|
||||||
{
|
{
|
||||||
if (names == null || names.Length < 1)
|
if (names == null || names.Length < 1)
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
permission = null;
|
Permission = null;
|
||||||
Names = new List<string>(names);
|
Names = new List<string>(names);
|
||||||
command = cmd;
|
command = cmd;
|
||||||
DoLog = true;
|
DoLog = true;
|
||||||
|
|
@ -77,7 +77,7 @@ namespace TShockAPI
|
||||||
|
|
||||||
public bool Run(string msg, TSPlayer ply, List<string> parms)
|
public bool Run(string msg, TSPlayer ply, List<string> parms)
|
||||||
{
|
{
|
||||||
if (!ply.Group.HasPermission(permission))
|
if (!ply.Group.HasPermission(Permission))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
@ -100,7 +100,7 @@ namespace TShockAPI
|
||||||
|
|
||||||
public bool CanRun(TSPlayer ply)
|
public bool CanRun(TSPlayer ply)
|
||||||
{
|
{
|
||||||
return ply.Group.HasPermission(permission);
|
return ply.Group.HasPermission(Permission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static class Commands
|
public static class Commands
|
||||||
|
|
@ -155,7 +155,7 @@ namespace TShockAPI
|
||||||
ChatCommands.Add(new Command(Permissions.editspawn, ToggleAntiBuild, "antibuild"));
|
ChatCommands.Add(new Command(Permissions.editspawn, ToggleAntiBuild, "antibuild"));
|
||||||
ChatCommands.Add(new Command(Permissions.editspawn, ProtectSpawn, "protectspawn"));
|
ChatCommands.Add(new Command(Permissions.editspawn, ProtectSpawn, "protectspawn"));
|
||||||
ChatCommands.Add(new Command(Permissions.manageregion, Region, "region"));
|
ChatCommands.Add(new Command(Permissions.manageregion, Region, "region"));
|
||||||
ChatCommands.Add(new Command(Permissions.editspawn, DebugRegions, "debugreg"));
|
ChatCommands.Add(new Command(Permissions.manageregion, DebugRegions, "debugreg"));
|
||||||
ChatCommands.Add(new Command(Help, "help"));
|
ChatCommands.Add(new Command(Help, "help"));
|
||||||
ChatCommands.Add(new Command(Playing, "playing", "online", "who"));
|
ChatCommands.Add(new Command(Playing, "playing", "online", "who"));
|
||||||
ChatCommands.Add(new Command(AuthToken, "auth"));
|
ChatCommands.Add(new Command(AuthToken, "auth"));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue