[FIX] Bad login (MySQL + HWID)

This commit is contained in:
Gravita 2022-03-30 16:39:48 +07:00
parent 8afa630546
commit 7bfa4ebdab
2 changed files with 10 additions and 2 deletions

View file

@ -93,17 +93,17 @@ public VerifySecureLevelKeyRequestEvent onSuccessVerify(Client client) {
}
client.trustLevel.hardwareInfo = hardware.getHardwareInfo();
authSupportHardware.connectUserAndHardware(client.sessionObject, hardware);
return new VerifySecureLevelKeyRequestEvent(false, false, createPublicKeyToken(client.username, client.trustLevel.publicKey), createHardwareToken(client.username, client.trustLevel.hardwareInfo));
} else {
logger.warn("AuthCoreProvider not supported hardware. HardwareInfo not checked!");
}
return new VerifySecureLevelKeyRequestEvent(false, false, createPublicKeyToken(client.username, client.trustLevel.publicKey));
}
return new VerifySecureLevelKeyRequestEvent(false, false, createPublicKeyToken(client.username, client.trustLevel.publicKey));
}
@Override
public boolean onJoinServer(String serverID, String username, Client client) {
return !enableHardwareFeature || (client.trustLevel != null && client.trustLevel.publicKey != null);
return !enableHardwareFeature || (client.trustLevel != null && client.trustLevel.hardwareInfo != null);
}
@Override

View file

@ -6,6 +6,7 @@ public class VerifySecureLevelKeyRequestEvent extends RequestEvent {
public boolean needHardwareInfo;
public boolean onlyStatisticInfo;
public String extendedToken;
public String hardwareExtendedToken;
public VerifySecureLevelKeyRequestEvent() {
}
@ -20,6 +21,13 @@ public VerifySecureLevelKeyRequestEvent(boolean needHardwareInfo, boolean onlySt
this.extendedToken = extendedToken;
}
public VerifySecureLevelKeyRequestEvent(boolean needHardwareInfo, boolean onlyStatisticInfo, String extendedToken, String hardwareExtendedToken) {
this.needHardwareInfo = needHardwareInfo;
this.onlyStatisticInfo = onlyStatisticInfo;
this.extendedToken = extendedToken;
this.hardwareExtendedToken = hardwareExtendedToken;
}
@Override
public String getType() {
return "verifySecureLevelKey";