mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FEATURE] Портирование ProfilesRequest
This commit is contained in:
parent
98354345a0
commit
be32df3e1e
3 changed files with 18 additions and 5 deletions
|
@ -99,9 +99,9 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client
|
|||
clientData.profile = p;
|
||||
}
|
||||
}
|
||||
if (clientData.profile == null) {
|
||||
throw new AuthException("You profile not found");
|
||||
}
|
||||
//if (clientData.profile == null) {
|
||||
// throw new AuthException("You profile not found");
|
||||
//}
|
||||
UUID uuid = LaunchServer.server.config.authHandler.auth(aresult);
|
||||
if(authType == ConnectTypes.CLIENT)
|
||||
LaunchServer.server.config.hwidHandler.check(hwid, aresult.username);
|
||||
|
|
|
@ -18,7 +18,7 @@ public String getType() {
|
|||
|
||||
@Override
|
||||
public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) throws Exception {
|
||||
if(!client.isAuth)
|
||||
if(!client.checkSign)
|
||||
{
|
||||
service.sendObject(ctx, new WebSocketService.ErrorResult("Access denied"));
|
||||
return;
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
import ru.gravit.launcher.profiles.ClientProfile;
|
||||
import ru.gravit.launcher.request.Request;
|
||||
import ru.gravit.launcher.request.RequestType;
|
||||
import ru.gravit.launcher.request.websockets.LegacyRequestBridge;
|
||||
import ru.gravit.launcher.request.websockets.RequestInterface;
|
||||
import ru.gravit.launcher.serialize.HInput;
|
||||
import ru.gravit.launcher.serialize.HOutput;
|
||||
|
||||
|
@ -14,7 +16,7 @@
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public final class ProfilesRequest extends Request<ProfilesRequestEvent> {
|
||||
public final class ProfilesRequest extends Request<ProfilesRequestEvent> implements RequestInterface {
|
||||
|
||||
@LauncherAPI
|
||||
public ProfilesRequest() {
|
||||
|
@ -31,6 +33,12 @@ public Integer getLegacyType() {
|
|||
return RequestType.PROFILES.getNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProfilesRequestEvent requestWebSockets() throws Exception
|
||||
{
|
||||
return (ProfilesRequestEvent) LegacyRequestBridge.sendRequest(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ProfilesRequestEvent requestDo(HInput input, HOutput output) throws Exception {
|
||||
output.writeBoolean(true);
|
||||
|
@ -46,4 +54,9 @@ protected ProfilesRequestEvent requestDo(HInput input, HOutput output) throws Ex
|
|||
// Return request result
|
||||
return new ProfilesRequestEvent(profiles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "profiles";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue