mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 09:01:08 +03:00
[FIX] GetHWIDCommand
This commit is contained in:
parent
467138ec2c
commit
1d4d9ae170
3 changed files with 41 additions and 1 deletions
|
@ -0,0 +1,40 @@
|
||||||
|
package ru.gravit.launchserver.command.auth;
|
||||||
|
|
||||||
|
import ru.gravit.launcher.HWID;
|
||||||
|
import ru.gravit.launchserver.LaunchServer;
|
||||||
|
import ru.gravit.launchserver.command.Command;
|
||||||
|
import ru.gravit.utils.helper.LogHelper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class GetHWIDCommand extends Command {
|
||||||
|
public GetHWIDCommand(LaunchServer server) {
|
||||||
|
super(server);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getArgsDescription() {
|
||||||
|
return "[username]";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUsageDescription() {
|
||||||
|
return "get HWID from username";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void invoke(String... args) throws Exception {
|
||||||
|
verifyArgs(args, 1);
|
||||||
|
List<HWID> target = server.config.hwidHandler.getHwid(args[0]);
|
||||||
|
for(HWID hwid : target)
|
||||||
|
{
|
||||||
|
if(hwid == null)
|
||||||
|
{
|
||||||
|
LogHelper.error("HWID %s: null", args[0]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
LogHelper.info("HWID %s: %s", args[0], hwid.toString());
|
||||||
|
}
|
||||||
|
LogHelper.info("Found %d HWID", target.size());
|
||||||
|
}
|
||||||
|
}
|
|
@ -48,6 +48,7 @@ public static void registerCommands(ru.gravit.utils.command.CommandHandler handl
|
||||||
handler.registerCommand("uuidToUsername", new UUIDToUsernameCommand(server));
|
handler.registerCommand("uuidToUsername", new UUIDToUsernameCommand(server));
|
||||||
handler.registerCommand("ban", new BanCommand(server));
|
handler.registerCommand("ban", new BanCommand(server));
|
||||||
handler.registerCommand("unban", new UnbanCommand(server));
|
handler.registerCommand("unban", new UnbanCommand(server));
|
||||||
|
handler.registerCommand("getHWID", new GetHWIDCommand(server));
|
||||||
|
|
||||||
//Register dump commands
|
//Register dump commands
|
||||||
handler.registerCommand("dumpSessions", new DumpSessionsCommand(server));
|
handler.registerCommand("dumpSessions", new DumpSessionsCommand(server));
|
||||||
|
|
|
@ -21,7 +21,6 @@ public String getUsageDescription() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void invoke(String... args) throws Exception {
|
public void invoke(String... args) throws Exception {
|
||||||
verifyArgs(args, 1);
|
|
||||||
LogHelper.info("Reload all config");
|
LogHelper.info("Reload all config");
|
||||||
server.reloadManager.reloadAll();
|
server.reloadManager.reloadAll();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue