mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 16:41:46 +03:00
Исправление title при AuthServerRequest
This commit is contained in:
parent
f7bd4a5941
commit
dab963a2eb
3 changed files with 13 additions and 3 deletions
|
@ -52,7 +52,6 @@ public void reply() throws Exception {
|
|||
requestError("ServerPassword decryption error");
|
||||
return;
|
||||
}
|
||||
if(client.length() == 0) requestError("Request error. You is cheater?");
|
||||
// Authenticate
|
||||
debug("ServerLogin: '%s', Password: '%s'", login, echo(password.length()));
|
||||
AuthProviderResult result;
|
||||
|
|
|
@ -31,6 +31,7 @@ private Result(PlayerProfile pp, String accessToken) {
|
|||
|
||||
private final byte[] encryptedPassword;
|
||||
private final int auth_id;
|
||||
private final String title;
|
||||
|
||||
@LauncherAPI
|
||||
public AuthServerRequest(LauncherConfig config, String login, byte[] encryptedPassword) {
|
||||
|
@ -38,6 +39,7 @@ public AuthServerRequest(LauncherConfig config, String login, byte[] encryptedPa
|
|||
this.login = VerifyHelper.verify(login, VerifyHelper.NOT_EMPTY, "Login can't be empty");
|
||||
this.encryptedPassword = encryptedPassword.clone();
|
||||
auth_id = 0;
|
||||
title = "";
|
||||
}
|
||||
@LauncherAPI
|
||||
public AuthServerRequest(LauncherConfig config, String login, byte[] encryptedPassword, int auth_id) {
|
||||
|
@ -45,6 +47,15 @@ public AuthServerRequest(LauncherConfig config, String login, byte[] encryptedPa
|
|||
this.login = VerifyHelper.verify(login, VerifyHelper.NOT_EMPTY, "Login can't be empty");
|
||||
this.encryptedPassword = encryptedPassword.clone();
|
||||
this.auth_id = auth_id;
|
||||
title = "";
|
||||
}
|
||||
@LauncherAPI
|
||||
public AuthServerRequest(LauncherConfig config, String login, byte[] encryptedPassword, int auth_id,String title) {
|
||||
super(config);
|
||||
this.login = VerifyHelper.verify(login, VerifyHelper.NOT_EMPTY, "Login can't be empty");
|
||||
this.encryptedPassword = encryptedPassword.clone();
|
||||
this.auth_id = auth_id;
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@LauncherAPI
|
||||
|
@ -64,7 +75,7 @@ public Integer getType() {
|
|||
@Override
|
||||
protected Boolean requestDo(HInput input, HOutput output) throws IOException {
|
||||
output.writeString(login, SerializeLimits.MAX_LOGIN);
|
||||
output.writeString(Launcher.profile.getTitle(), SerializeLimits.MAX_CLIENT);
|
||||
output.writeString(title, SerializeLimits.MAX_CLIENT);
|
||||
output.writeInt(auth_id);
|
||||
output.writeByteArray(encryptedPassword, SecurityHelper.CRYPTO_MAX_LENGTH);
|
||||
output.flush();
|
||||
|
|
|
@ -44,7 +44,7 @@ public static void main(String[] args) throws Throwable {
|
|||
config = new Config(TextConfigReader.read(reader, true));
|
||||
}
|
||||
LauncherConfig cfg = new LauncherConfig(config.address, config.port, SecurityHelper.toPublicRSAKey(IOHelper.read(Paths.get("public.key"))),new HashMap<>(),config.projectname);
|
||||
Boolean auth = new AuthServerRequest(cfg,config.login,SecurityHelper.newRSAEncryptCipher(cfg.publicKey).doFinal(IOHelper.encode(config.password))).request();
|
||||
Boolean auth = new AuthServerRequest(cfg,config.login,SecurityHelper.newRSAEncryptCipher(cfg.publicKey).doFinal(IOHelper.encode(config.password)),0,config.title).request();
|
||||
|
||||
ProfilesRequest.Result result = new ProfilesRequest(cfg).request();
|
||||
Launcher.setConfig(cfg);
|
||||
|
|
Loading…
Reference in a new issue