Add greload command and option to disable metrics.
This commit is contained in:
parent
aba35a3b2b
commit
b0faea5254
@ -89,6 +89,7 @@ public class BungeeCord
|
|||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
commandMap.put("greload",new CommandReload());
|
||||||
commandMap.put("end", new CommandEnd());
|
commandMap.put("end", new CommandEnd());
|
||||||
commandMap.put("glist", new CommandList());
|
commandMap.put("glist", new CommandList());
|
||||||
commandMap.put("server", new CommandServer());
|
commandMap.put("server", new CommandServer());
|
||||||
@ -194,8 +195,11 @@ public class BungeeCord
|
|||||||
saveThread.start();
|
saveThread.start();
|
||||||
$().info("Listening on " + addr);
|
$().info("Listening on " + addr);
|
||||||
|
|
||||||
|
if (config.metricsEnabled)
|
||||||
|
{
|
||||||
new Metrics().start();
|
new Metrics().start();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroy this proxy instance cleanly by kicking all users, saving the
|
* Destroy this proxy instance cleanly by kicking all users, saving the
|
||||||
|
@ -132,6 +132,7 @@ public class Configuration
|
|||||||
* UUID for Metrics.
|
* UUID for Metrics.
|
||||||
*/
|
*/
|
||||||
public String statsUuid = UUID.randomUUID().toString();
|
public String statsUuid = UUID.randomUUID().toString();
|
||||||
|
public boolean metricsEnabled = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the configuration and save default values.
|
* Load the configuration and save default values.
|
||||||
|
21
src/main/java/net/md_5/bungee/command/CommandReload.java
Normal file
21
src/main/java/net/md_5/bungee/command/CommandReload.java
Normal 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");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user