SteamWar/BungeeCore
Archiviert
13
2

Update VerifyCommand
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed

Dieser Commit ist enthalten in:
yoyosource 2022-06-16 12:18:15 +02:00
Ursprung 8a21d5c93d
Commit 99807470ec

Datei anzeigen

@ -23,27 +23,25 @@ import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.bot.AuthManager;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.command.SWCommand;
import jdk.nashorn.internal.runtime.Property;
import net.dv8tion.jda.api.entities.Member;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.Base64;
public class VerifyCommand extends BasicCommand {
public class VerifyCommand extends SWCommand {
public VerifyCommand() {
super("verify", "");
}
@Override
public void execute(CommandSender sender, String[] strings) {
if(strings.length < 1) {
Message.send("VERIFY_USAGE", sender);
return;
super("verify");
}
@Register(description = "VERIFY_USAGE")
public void genericCommand(ProxiedPlayer sender, String code) {
byte[] bytes;
try {
bytes = Base64.getDecoder().decode(strings[0]);
bytes = Base64.getDecoder().decode(code);
} catch (IllegalArgumentException e) {
Message.send("VERIFY_INVALID", sender);
return;
@ -54,7 +52,7 @@ public class VerifyCommand extends BasicCommand {
return;
}
if(bytes[0] == 'D' && bytes[1] == 'C') {
Member member = AuthManager.connectAuth(SteamwarUser.get(sender.getName()), strings[0]);
Member member = AuthManager.connectAuth(SteamwarUser.get(sender.getName()), code);
if(member != null) {
BungeeCore.log(sender.getName() + " Verified with Discorduser: " + member.getIdLong());
Message.send("VERIFY_SUCCESS", sender, member.getUser().getAsTag());