mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Фикс JoinServerRequest
This commit is contained in:
parent
a9bba37df7
commit
468ff01f9f
1 changed files with 7 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
import io.netty.channel.ChannelHandlerContext;
|
||||
import ru.gravit.launcher.events.request.ErrorRequestEvent;
|
||||
import ru.gravit.launcher.events.request.JoinServerRequestEvent;
|
||||
import ru.gravit.launchserver.LaunchServer;
|
||||
import ru.gravit.launchserver.auth.AuthException;
|
||||
import ru.gravit.launchserver.socket.Client;
|
||||
import ru.gravit.launchserver.socket.websocket.WebSocketService;
|
||||
|
@ -23,7 +24,12 @@ public String getType() {
|
|||
public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) {
|
||||
boolean success;
|
||||
try {
|
||||
success = client.auth.handler.joinServer(username, accessToken, serverID);
|
||||
if(client.auth == null)
|
||||
{
|
||||
LogHelper.warning("Client auth is null. Using default.");
|
||||
success = LaunchServer.server.config.getAuthProviderPair().handler.joinServer(username, accessToken, serverID);
|
||||
}
|
||||
else success = client.auth.handler.joinServer(username, accessToken, serverID);
|
||||
} catch (AuthException e) {
|
||||
service.sendObject(ctx, new ErrorRequestEvent(e.getMessage()));
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue