SteamWar/BungeeCore
Archiviert
13
2

Merge pull request 'Update WebregisterCommand' (#408) from CommandWebregister into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #408
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2022-06-16 13:33:09 +02:00
Commit d6e941bf72

Datei anzeigen

@ -21,31 +21,22 @@ package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.SWException; 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 net.md_5.bungee.api.connection.ProxiedPlayer;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
public class WebregisterCommand extends BasicCommand { public class WebregisterCommand extends SWCommand {
public WebregisterCommand() { public WebregisterCommand() {
super("webregister", null, "web", "webpw"); super("webregister", null, "web", "webpw");
} }
@Override @Register(description = "WEB_USAGE")
public void execute(CommandSender sender, String[] args) { public void genericCommand(ProxiedPlayer player, String email) {
if(!(sender instanceof ProxiedPlayer)) ProcessBuilder pb = new ProcessBuilder("php", "/var/www/register.php", player.getName(), email);
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]);
pb.redirectErrorStream(true); pb.redirectErrorStream(true);
try { try {
Process regProcess = pb.start(); Process regProcess = pb.start();