diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/HttpRequester.java b/LaunchServer/src/main/java/pro/gravit/launchserver/HttpRequester.java index 6228e0d6..ad57e971 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/HttpRequester.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/HttpRequester.java @@ -59,6 +59,7 @@ public HttpHelper.HttpOptional send(HttpRequest request, Cla return HttpHelper.send(httpClient, request, makeEH(clazz)); } + public static class SimpleErrorHandler implements HttpHelper.HttpJsonErrorHandler { private final Type type; diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java index 41258549..e929144d 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/HttpAuthCoreProvider.java @@ -1,5 +1,6 @@ package pro.gravit.launchserver.auth.core; +import com.google.gson.reflect.TypeToken; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import pro.gravit.launcher.ClientPermissions; @@ -232,14 +233,15 @@ public void addPublicKeyToHardwareInfo(UserHardware hardware, byte[] publicKey) } } + @SuppressWarnings({"unchecked", "rawtypes"}) @Override public Iterable getUsersByHardwareInfo(UserHardware hardware) { if (getUsersByHardwareInfoUrl == null) { return null; } try { - return requester.send(requester - .post(getUsersByHardwareInfoUrl, new HardwareRequest((HttpUserHardware) hardware), bearerToken), List.class).getOrThrow(); + return (List) (List) requester.send(requester + .post(getUsersByHardwareInfoUrl, new HardwareRequest((HttpUserHardware) hardware), bearerToken), GetHardwareListResponse.class).getOrThrow().list; } catch (IOException e) { logger.error(e); return null; @@ -354,6 +356,10 @@ public static class GetAuthDetailsResponse { public List details; } + public static class GetHardwareListResponse { + public List list; + } + public static class JoinServerRequest { public String username; public String accessToken;