mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[FIX] Фикс авторизации сервера и проверки лаунчера
This commit is contained in:
parent
9ea4c051d5
commit
2937d70866
2 changed files with 8 additions and 1 deletions
|
@ -35,7 +35,12 @@ public AuthResponse(String login, String password, int authid, OshiHWID hwid) {
|
|||
}
|
||||
|
||||
public int authid;
|
||||
public ConnectTypes type;
|
||||
public OshiHWID hwid;
|
||||
enum ConnectTypes
|
||||
{
|
||||
SERVER,CLIENT
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
|
@ -51,7 +56,7 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client
|
|||
AuthProvider.authError(LaunchServer.server.config.authRejectString);
|
||||
return;
|
||||
}
|
||||
if (!clientData.checkSign) {
|
||||
if (type == ConnectTypes.SERVER &&!clientData.checkSign) {
|
||||
AuthProvider.authError("Don't skip Launcher Update");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client
|
|||
byte[] hash = LaunchServer.server.launcherBinary.getBytes().getDigest();
|
||||
if (hash == null) service.sendObjectAndClose(ctx, new Result(true, JAR_URL));
|
||||
if (Arrays.equals(bytes, hash)) {
|
||||
client.checkSign = true;
|
||||
service.sendObject(ctx, new Result(false, JAR_URL));
|
||||
} else {
|
||||
service.sendObjectAndClose(ctx, new Result(true, JAR_URL));
|
||||
|
@ -40,6 +41,7 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client
|
|||
byte[] hash = LaunchServer.server.launcherEXEBinary.getBytes().getDigest();
|
||||
if (hash == null) service.sendObjectAndClose(ctx, new Result(true, EXE_URL));
|
||||
if (Arrays.equals(bytes, hash)) {
|
||||
client.checkSign = true;
|
||||
service.sendObject(ctx, new Result(false, EXE_URL));
|
||||
} else {
|
||||
service.sendObjectAndClose(ctx, new Result(true, EXE_URL));
|
||||
|
|
Loading…
Reference in a new issue