From c62a3865ddc1e25e77c6987109514acb4e57ea43 Mon Sep 17 00:00:00 2001 From: Gravit Date: Sun, 3 Mar 2019 16:41:47 +0700 Subject: [PATCH] [FEATURE] GetModulusCommand --- .../command/handler/CommandHandler.java | 1 + .../command/service/GetModulusCommand.java | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 LaunchServer/src/main/java/ru/gravit/launchserver/command/service/GetModulusCommand.java diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/CommandHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/CommandHandler.java index c3d18b6c..1da94327 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/CommandHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/CommandHandler.java @@ -124,6 +124,7 @@ protected CommandHandler(LaunchServer server) { registerCommand("serverStatus", new ServerStatusCommand(server)); registerCommand("checkInstall", new CheckInstallCommand(server)); registerCommand("multi", new MultiCommand(server)); + registerCommand("getModulus", new GetModulusCommand(server)); } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/GetModulusCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/GetModulusCommand.java new file mode 100644 index 00000000..3696791f --- /dev/null +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/GetModulusCommand.java @@ -0,0 +1,27 @@ +package ru.gravit.launchserver.command.service; + +import io.netty.handler.codec.base64.Base64; +import ru.gravit.launchserver.LaunchServer; +import ru.gravit.launchserver.command.Command; +import ru.gravit.utils.helper.LogHelper; + +public class GetModulusCommand extends Command { + public GetModulusCommand(LaunchServer server) { + super(server); + } + + @Override + public String getArgsDescription() { + return null; + } + + @Override + public String getUsageDescription() { + return null; + } + + @Override + public void invoke(String... args) throws Exception { + LogHelper.info("You publickey modulus: ", LaunchServer.server.publicKey.getModulus().toString(16)); + } +}