From d64a483bb62224be6346e55d0f12c5e46bd84a6f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 16 Jun 2022 12:19:23 +0200 Subject: [PATCH] Update WebregisterCommand --- .../commands/WebregisterCommand.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/WebregisterCommand.java b/src/de/steamwar/bungeecore/commands/WebregisterCommand.java index b26883c..6197f0f 100644 --- a/src/de/steamwar/bungeecore/commands/WebregisterCommand.java +++ b/src/de/steamwar/bungeecore/commands/WebregisterCommand.java @@ -21,31 +21,22 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.sql.SWException; -import net.md_5.bungee.api.CommandSender; +import de.steamwar.command.SWCommand; import net.md_5.bungee.api.connection.ProxiedPlayer; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; -public class WebregisterCommand extends BasicCommand { +public class WebregisterCommand extends SWCommand { public WebregisterCommand() { super("webregister", null, "web", "webpw"); } - @Override - public void execute(CommandSender sender, String[] args) { - if(!(sender instanceof ProxiedPlayer)) - return; - - ProxiedPlayer player = (ProxiedPlayer) sender; - if(args.length != 1){ - Message.send("WEB_USAGE", player); - return; - } - - ProcessBuilder pb = new ProcessBuilder("php", "/var/www/register.php", player.getName(), args[0]); + @Register(description = "WEB_USAGE") + public void genericCommand(ProxiedPlayer player, String email) { + ProcessBuilder pb = new ProcessBuilder("php", "/var/www/register.php", player.getName(), email); pb.redirectErrorStream(true); try { Process regProcess = pb.start();