diff --git a/bukkit/src/main/java/net/leaderos/plugin/modules/connect/ConnectModule.java b/bukkit/src/main/java/net/leaderos/plugin/modules/connect/ConnectModule.java index 67b26fc00..857289c4c 100644 --- a/bukkit/src/main/java/net/leaderos/plugin/modules/connect/ConnectModule.java +++ b/bukkit/src/main/java/net/leaderos/plugin/modules/connect/ConnectModule.java @@ -30,9 +30,10 @@ public void onEnable() { /** * Executes console command * @param command command to execute + * @param username username of player */ @Override - public void executeCommands(String command) { + public void executeCommands(String command, String username) { org.bukkit.Bukkit.getScheduler().runTask(Bukkit.getInstance(), () -> { org.bukkit.Bukkit.dispatchCommand(org.bukkit.Bukkit.getConsoleSender(), command); String msg = ChatUtil.replacePlaceholders(Bukkit.getInstance().getLangFile().getMessages().getConnect().getConnectExecutedCommand(), diff --git a/bungee/src/main/java/net/leaderos/bungee/modules/connect/ConnectModule.java b/bungee/src/main/java/net/leaderos/bungee/modules/connect/ConnectModule.java index 985c9002c..122aaac85 100644 --- a/bungee/src/main/java/net/leaderos/bungee/modules/connect/ConnectModule.java +++ b/bungee/src/main/java/net/leaderos/bungee/modules/connect/ConnectModule.java @@ -31,9 +31,10 @@ public void onEnable() { /** * Executes console command * @param command command to execute + * @param username username of player */ @Override - public void executeCommands(String command) { + public void executeCommands(String command, String username) { Bungee.getInstance().getProxy().getPluginManager().dispatchCommand( Bungee.getInstance().getProxy().getConsole(), command); String msg = ChatUtil.replacePlaceholders(Bungee.getInstance().getLangFile().getMessages().getConnect().getConnectExecutedCommand(), diff --git a/shared/src/main/java/net/leaderos/shared/modules/connect/socket/SocketClient.java b/shared/src/main/java/net/leaderos/shared/modules/connect/socket/SocketClient.java index 072f68f24..4cc498557 100644 --- a/shared/src/main/java/net/leaderos/shared/modules/connect/socket/SocketClient.java +++ b/shared/src/main/java/net/leaderos/shared/modules/connect/socket/SocketClient.java @@ -87,8 +87,11 @@ public SocketClient(String apiKey, String serverToken) throws URISyntaxException // Get the command String command = jsonItem.getString("command"); + // Get the username + String username = jsonItem.getString("username"); + // Execute the command - executeCommands(command); + executeCommands(command, username); } } @@ -110,8 +113,9 @@ public SocketClient(String apiKey, String serverToken) throws URISyntaxException /** * Executes commands on proxy and server modules * @param command command to execute + * @param username of player */ - public abstract void executeCommands(String command); + public abstract void executeCommands(String command, String username); /** * Joined room abstracted method for debug diff --git a/velocity/src/main/java/net/leaderos/velocity/modules/connect/ConnectModule.java b/velocity/src/main/java/net/leaderos/velocity/modules/connect/ConnectModule.java index 5f310aa0f..5d8920f30 100644 --- a/velocity/src/main/java/net/leaderos/velocity/modules/connect/ConnectModule.java +++ b/velocity/src/main/java/net/leaderos/velocity/modules/connect/ConnectModule.java @@ -32,9 +32,10 @@ public void onEnable() { /** * Executes console command * @param command command to execute + * @param username username of player */ @Override - public void executeCommands(String command) { + public void executeCommands(String command, String username) { Velocity.getInstance().getCommandManager() .executeImmediatelyAsync(Velocity.getInstance().getServer().getConsoleCommandSource(), command); Component msg = ChatUtil.replacePlaceholders(Velocity.getInstance().getLangFile().getMessages().getConnect().getConnectExecutedCommand(),