mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 17:11:39 +03:00
[FIX] Фикс привилений при авторизации
This commit is contained in:
parent
43de166d22
commit
a6686029a5
1 changed files with 11 additions and 2 deletions
|
@ -39,7 +39,7 @@ public AuthResponse(String login, String password, int authid, OshiHWID hwid) {
|
||||||
public OshiHWID hwid;
|
public OshiHWID hwid;
|
||||||
public enum ConnectTypes
|
public enum ConnectTypes
|
||||||
{
|
{
|
||||||
SERVER,CLIENT
|
SERVER,CLIENT,BOT
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -56,10 +56,19 @@ public void execute(WebSocketService service, ChannelHandlerContext ctx, Client
|
||||||
AuthProvider.authError(LaunchServer.server.config.authRejectString);
|
AuthProvider.authError(LaunchServer.server.config.authRejectString);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (authType == ConnectTypes.SERVER &&!clientData.checkSign) {
|
if (authType != ConnectTypes.CLIENT &&!clientData.checkSign) {
|
||||||
AuthProvider.authError("Don't skip Launcher Update");
|
AuthProvider.authError("Don't skip Launcher Update");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
clientData.permissions = LaunchServer.server.config.permissionsHandler.getPermissions(login);
|
||||||
|
if(authType == ConnectTypes.BOT && !clientData.permissions.canBot)
|
||||||
|
{
|
||||||
|
AuthProvider.authError("authType: BOT not allowed for this account");
|
||||||
|
}
|
||||||
|
if(authType == ConnectTypes.SERVER && !clientData.permissions.canServer)
|
||||||
|
{
|
||||||
|
AuthProvider.authError("authType: SERVER not allowed for this account");
|
||||||
|
}
|
||||||
ru.gravit.launchserver.response.auth.AuthResponse.AuthContext context = new ru.gravit.launchserver.response.auth.AuthResponse.AuthContext(0, login, password.length(), client, null, false);
|
ru.gravit.launchserver.response.auth.AuthResponse.AuthContext context = new ru.gravit.launchserver.response.auth.AuthResponse.AuthContext(0, login, password.length(), client, null, false);
|
||||||
AuthProvider provider = LaunchServer.server.config.authProvider[authid];
|
AuthProvider provider = LaunchServer.server.config.authProvider[authid];
|
||||||
LaunchServer.server.authHookManager.preHook(context, clientData);
|
LaunchServer.server.authHookManager.preHook(context, clientData);
|
||||||
|
|
Loading…
Reference in a new issue