mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +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 int authid;
|
||||||
|
public ConnectTypes type;
|
||||||
public OshiHWID hwid;
|
public OshiHWID hwid;
|
||||||
|
enum ConnectTypes
|
||||||
|
{
|
||||||
|
SERVER,CLIENT
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getType() {
|
public String getType() {
|
||||||
|
@ -51,7 +56,7 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client
|
||||||
AuthProvider.authError(LaunchServer.server.config.authRejectString);
|
AuthProvider.authError(LaunchServer.server.config.authRejectString);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!clientData.checkSign) {
|
if (type == ConnectTypes.SERVER &&!clientData.checkSign) {
|
||||||
AuthProvider.authError("Don't skip Launcher Update");
|
AuthProvider.authError("Don't skip Launcher Update");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client
|
||||||
byte[] hash = LaunchServer.server.launcherBinary.getBytes().getDigest();
|
byte[] hash = LaunchServer.server.launcherBinary.getBytes().getDigest();
|
||||||
if (hash == null) service.sendObjectAndClose(ctx, new Result(true, JAR_URL));
|
if (hash == null) service.sendObjectAndClose(ctx, new Result(true, JAR_URL));
|
||||||
if (Arrays.equals(bytes, hash)) {
|
if (Arrays.equals(bytes, hash)) {
|
||||||
|
client.checkSign = true;
|
||||||
service.sendObject(ctx, new Result(false, JAR_URL));
|
service.sendObject(ctx, new Result(false, JAR_URL));
|
||||||
} else {
|
} else {
|
||||||
service.sendObjectAndClose(ctx, new Result(true, JAR_URL));
|
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();
|
byte[] hash = LaunchServer.server.launcherEXEBinary.getBytes().getDigest();
|
||||||
if (hash == null) service.sendObjectAndClose(ctx, new Result(true, EXE_URL));
|
if (hash == null) service.sendObjectAndClose(ctx, new Result(true, EXE_URL));
|
||||||
if (Arrays.equals(bytes, hash)) {
|
if (Arrays.equals(bytes, hash)) {
|
||||||
|
client.checkSign = true;
|
||||||
service.sendObject(ctx, new Result(false, EXE_URL));
|
service.sendObject(ctx, new Result(false, EXE_URL));
|
||||||
} else {
|
} else {
|
||||||
service.sendObjectAndClose(ctx, new Result(true, EXE_URL));
|
service.sendObjectAndClose(ctx, new Result(true, EXE_URL));
|
||||||
|
|
Loading…
Reference in a new issue