From 8875146be3fe6bfcbbd8b5ca9794e9683d4b78fe Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 20 Mar 2020 07:43:02 +0700 Subject: [PATCH] [FEATURE] feature support --- .../GetAvailabilityAuthRequestEvent.java | 17 +++++++++++++++++ .../launcher/request/auth/AuthRequest.java | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java index 684d0485..36d89dfa 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java @@ -40,12 +40,29 @@ public enum AuthType OTHER } } + public enum ServerFeature + { + FEATURE_SUPPORT(1); + public final int val; + + ServerFeature(int val) { + this.val = val; + } + } @LauncherNetworkAPI public final List list; + @LauncherNetworkAPI + public final long features; public GetAvailabilityAuthRequestEvent(List list) { this.list = list; + this.features = ServerFeature.FEATURE_SUPPORT.val; + } + + public GetAvailabilityAuthRequestEvent(List list, long features) { + this.list = list; + this.features = features; } @Override diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java index 90af57d5..db0331eb 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/auth/AuthRequest.java @@ -49,6 +49,13 @@ public AuthRequest(String login, byte[] password) { authType = ConnectTypes.CLIENT; } + public AuthRequest(String login, byte[] password, String auth_id) { + this.login = VerifyHelper.verify(login, VerifyHelper.NOT_EMPTY, "Login can't be empty"); + this.password = new AuthECPassword(password.clone()); + this.auth_id = auth_id; + getSession = true; + authType = ConnectTypes.CLIENT; + } @Deprecated public AuthRequest(String login, byte[] password, HWID hwid, String auth_id) { this.login = VerifyHelper.verify(login, VerifyHelper.NOT_EMPTY, "Login can't be empty");