Add greload command and option to disable metrics.

This commit is contained in:
md_5 2012-12-23 13:57:19 +11:00
parent aba35a3b2b
commit b0faea5254
3 changed files with 27 additions and 1 deletions

View File

@ -89,6 +89,7 @@ public class BungeeCord
{
commandMap.put("greload",new CommandReload());
commandMap.put("end", new CommandEnd());
commandMap.put("glist", new CommandList());
commandMap.put("server", new CommandServer());
@ -194,7 +195,10 @@ public class BungeeCord
saveThread.start();
$().info("Listening on " + addr);
new Metrics().start();
if (config.metricsEnabled)
{
new Metrics().start();
}
}
/**

View File

@ -132,6 +132,7 @@ public class Configuration
* UUID for Metrics.
*/
public String statsUuid = UUID.randomUUID().toString();
public boolean metricsEnabled = true;
/**
* Load the configuration and save default values.

View File

@ -0,0 +1,21 @@
package net.md_5.bungee.command;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.ChatColor;
import net.md_5.bungee.Permission;
public class CommandReload extends Command
{
@Override
public void execute(CommandSender sender, String[] args)
{
if (getPermission(sender) != Permission.ADMIN)
{
sender.sendMessage(ChatColor.RED + "You do not have permission to execute this command!");
return;
}
BungeeCord.instance.config.load();
sender.sendMessage(ChatColor.GREEN + "Reloaded config, please restart if you have any issues");
}
}