diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java index 0124074e..9112a9e2 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/AuthResponse.java @@ -130,7 +130,7 @@ public void execute(ChannelHandlerContext ctx, Client clientData) throws Excepti } if (server.config.protectHandler.allowGetAccessToken(context)) { UUID uuid = pair.handler.auth(aresult); - result.playerProfile = ProfileByUUIDResponse.getProfile(server, uuid, aresult.username, client, clientData.auth.textureProvider); + result.playerProfile = ProfileByUUIDResponse.getProfile(uuid, aresult.username, client, clientData.auth.textureProvider); LogHelper.debug("Auth: %s accessToken %s uuid: %s", login, result.accessToken, uuid.toString()); } sendResult(result); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/CheckServerResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/CheckServerResponse.java index f660672e..3068eb08 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/CheckServerResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/CheckServerResponse.java @@ -26,7 +26,7 @@ public void execute(ChannelHandlerContext ctx, Client pClient) { server.authHookManager.checkServerHook.hook(this, pClient); result.uuid = pClient.auth.handler.checkServer(username, serverID); if (result.uuid != null) - result.playerProfile = ProfileByUUIDResponse.getProfile(server, result.uuid, username, client, pClient.auth.textureProvider); + result.playerProfile = ProfileByUUIDResponse.getProfile(result.uuid, username, client, pClient.auth.textureProvider); LogHelper.debug("checkServer: %s uuid: %s serverID: %s", result.playerProfile.username, result.uuid.toString(), serverID); } catch (AuthException | HookException e) { sendError(e.getMessage()); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/BatchProfileByUsername.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/BatchProfileByUsername.java index bdb16f23..9e8e58a2 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/BatchProfileByUsername.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/BatchProfileByUsername.java @@ -32,7 +32,7 @@ public void execute(ChannelHandlerContext ctx, Client client) throws Exception { LogHelper.warning("Client auth is null. Using default."); uuid = server.config.getAuthProviderPair().handler.usernameToUUID(list[i].username); } else uuid = client.auth.handler.usernameToUUID(list[i].username); - result.playerProfiles[i] = ProfileByUUIDResponse.getProfile(server, uuid, list[i].username, list[i].client, client.auth.textureProvider); + result.playerProfiles[i] = ProfileByUUIDResponse.getProfile(uuid, list[i].username, list[i].client, client.auth.textureProvider); } sendResult(result); } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUUIDResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUUIDResponse.java index c782c297..754196fb 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUUIDResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUUIDResponse.java @@ -7,7 +7,7 @@ import pro.gravit.launcher.events.request.ProfileByUUIDRequestEvent; import pro.gravit.launcher.profiles.PlayerProfile; import pro.gravit.launcher.profiles.Texture; -import pro.gravit.launchserver.LaunchServer; +import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.auth.texture.TextureProvider; import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.response.SimpleResponse; @@ -17,7 +17,7 @@ public class ProfileByUUIDResponse extends SimpleResponse { public UUID uuid; public String client; - public static PlayerProfile getProfile(LaunchServer server, UUID uuid, String username, String client, TextureProvider textureProvider) { + public static PlayerProfile getProfile(UUID uuid, String username, String client, TextureProvider textureProvider) { // Get skin texture Texture skin; try { @@ -48,10 +48,19 @@ public String getType() { @Override public void execute(ChannelHandlerContext ctx, Client client) throws Exception { String username; + AuthProviderPair pair; if (client.auth == null) { LogHelper.warning("Client auth is null. Using default."); - username = server.config.getAuthProviderPair().handler.uuidToUsername(uuid); - } else username = client.auth.handler.uuidToUsername(uuid); - sendResult(new ProfileByUUIDRequestEvent(getProfile(server, uuid, username, this.client, client.auth.textureProvider))); + pair = server.config.getAuthProviderPair(); + } else { + pair = client.auth; + } + if(pair == null) + { + sendError("ProfileByUUIDResponse: AuthProviderPair is null"); + return; + } + username = pair.handler.uuidToUsername(uuid); + sendResult(new ProfileByUUIDRequestEvent(getProfile(uuid, username, this.client, client.auth.textureProvider))); } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUsername.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUsername.java index 0f303e1c..3f625e1f 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUsername.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/profile/ProfileByUsername.java @@ -24,6 +24,6 @@ public void execute(ChannelHandlerContext ctx, Client client) throws Exception { LogHelper.warning("Client auth is null. Using default."); uuid = server.config.getAuthProviderPair().handler.usernameToUUID(username); } else uuid = client.auth.handler.usernameToUUID(username); - sendResult(new ProfileByUsernameRequestEvent(ProfileByUUIDResponse.getProfile(server, uuid, username, this.client, client.auth.textureProvider))); + sendResult(new ProfileByUsernameRequestEvent(ProfileByUUIDResponse.getProfile(uuid, username, this.client, client.auth.textureProvider))); } } diff --git a/Launcher/src/main/java/pro/gravit/launcher/hwid/OshiHWIDProvider.java b/Launcher/src/main/java/pro/gravit/launcher/hwid/OshiHWIDProvider.java index ccbdd898..922c5aaa 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/hwid/OshiHWIDProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/hwid/OshiHWIDProvider.java @@ -67,13 +67,6 @@ public String getHWDisk() { } } - public String getSoundCardInfo() { - for (SoundCard soundcard : hardware.getSoundCards()) { - return soundcard.getName(); - } - return ""; - } - public String getMacAddr() { for (NetworkIF networkIF : hardware.getNetworkIFs()) { for (String ipv4 : networkIF.getIPv4addr()) { @@ -119,9 +112,6 @@ public void printHardwareInformation() { LogHelper.subDebug("IPv4: %s", ipv4); } } - for (SoundCard soundcard : hardware.getSoundCards()) { - LogHelper.debug("SoundCard %s", soundcard.getName()); - } CentralProcessor processor = hardware.getProcessor(); LogHelper.debug("Processor Model: %s ID: %s", processor.getModel(), processor.getProcessorID()); } catch (Throwable e) { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java index de2de7d2..139b63d6 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java @@ -3,7 +3,6 @@ import java.io.IOException; import java.lang.reflect.Type; import java.net.URI; -import java.util.HashMap; import java.util.HashSet; import javax.net.ssl.SSLException; @@ -30,7 +29,7 @@ public class ClientWebSocketService extends ClientJSONPoint { public static ProviderMap requests = new ProviderMap<>(); private HashSet handlers; - public ClientWebSocketService(String address, int i) throws SSLException { + public ClientWebSocketService(String address) throws SSLException { super(createURL(address)); handlers = new HashSet<>(); this.gson = Launcher.gsonManager.gson; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StandartClientWebSocketService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StandartClientWebSocketService.java index 79453c73..d7123b27 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StandartClientWebSocketService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StandartClientWebSocketService.java @@ -7,21 +7,18 @@ import javax.net.ssl.SSLException; -import com.google.gson.GsonBuilder; - import pro.gravit.launcher.events.request.ErrorRequestEvent; import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.RequestException; import pro.gravit.launcher.request.WebSocketEvent; -import pro.gravit.utils.helper.CommonHelper; import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.LogHelper; public class StandartClientWebSocketService extends ClientWebSocketService { public WaitEventHandler waitEventHandler = new WaitEventHandler(); - public StandartClientWebSocketService(String address, int i) throws SSLException { - super(address, i); + public StandartClientWebSocketService(String address) throws SSLException { + super(address); } public class RequestFuture implements Future { @@ -109,7 +106,7 @@ public RequestFuture asyncSendRequest(WebSocketRequest request) throws IOExcepti public static StandartClientWebSocketService initWebSockets(String address, boolean async) { StandartClientWebSocketService service; try { - service = new StandartClientWebSocketService(address, 5000); + service = new StandartClientWebSocketService(address); } catch (SSLException e) { throw new SecurityException(e); } diff --git a/modules b/modules index bd42367c..8b32ca34 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit bd42367cf2ecab28b18521a35bcdc0f4f6b7b647 +Subproject commit 8b32ca34fefc7896a276d91d22c309276128d3a4