Add bypass for testing servers to skip tutorials

This commit is contained in:
samczsun 2016-05-17 21:53:30 -04:00 committed by Sam Sun
parent 08784d3f0a
commit c172d226c4
2 changed files with 17 additions and 5 deletions

View File

@ -10,14 +10,16 @@ public class FinishCommand extends CommandBase<TutorialManager>
{
public FinishCommand(TutorialManager plugin)
{
super(plugin, Rank.JNR_DEV, "finish", "end");
super(plugin, Rank.ALL, "finish", "end");
}
@Override
public void Execute(Player caller, String[] args)
{
Plugin.finishTutorial(caller);
boolean testServer = Plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
if (CommandCenter.Instance.GetClientManager().hasRank(caller, testServer ? Rank.ALL : Rank.JNR_DEV))
{
Plugin.finishTutorial(caller);
}
}
}

View File

@ -13,7 +13,7 @@ public class TutorialCommand extends MultiCommandBase<TutorialManager>
{
public TutorialCommand(TutorialManager plugin)
{
super(plugin, Rank.JNR_DEV, "tutorial", "tut");
super(plugin, Rank.ALL, "tutorial", "tut");
AddCommand(new StartCommand(plugin));
AddCommand(new FinishCommand(plugin));
@ -24,4 +24,14 @@ public class TutorialCommand extends MultiCommandBase<TutorialManager>
{
UtilPlayer.message(caller, F.main("Tutorial", "/tutorial start <name>"));
}
@Override
public void Execute(Player caller, String[] args)
{
boolean testServer = Plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
if (CommandCenter.GetClientManager().hasRank(caller, testServer ? Rank.ALL : Rank.JNR_DEV))
{
super.Execute(caller, args);
}
}
}