33 lines
1.2 KiB
Java
33 lines
1.2 KiB
Java
package pro.gravit.launchserver.socket.response.secure;
|
|
|
|
import io.netty.channel.ChannelHandlerContext;
|
|
import pro.gravit.launcher.base.events.request.SecurityReportRequestEvent;
|
|
import pro.gravit.launchserver.auth.protect.interfaces.SecureProtectHandler;
|
|
import pro.gravit.launchserver.modules.events.security.SecurityReportModuleEvent;
|
|
import pro.gravit.launchserver.socket.Client;
|
|
import pro.gravit.launchserver.socket.response.SimpleResponse;
|
|
|
|
public class SecurityReportResponse extends SimpleResponse {
|
|
public String reportType;
|
|
public String smallData;
|
|
public String largeData;
|
|
public byte[] smallBytes;
|
|
public byte[] largeBytes;
|
|
|
|
@Override
|
|
public String getType() {
|
|
return "securityReport";
|
|
}
|
|
|
|
@Override
|
|
public void execute(ChannelHandlerContext ctx, Client client) {
|
|
if (!(server.config.protectHandler instanceof SecureProtectHandler secureProtectHandler)) {
|
|
sendError("Method not allowed");
|
|
} else {
|
|
SecurityReportRequestEvent event = secureProtectHandler.onSecurityReport(this, client);
|
|
server.modulesManager.invokeEvent(new SecurityReportModuleEvent(event, this, client));
|
|
sendResult(event);
|
|
}
|
|
}
|
|
}
|