[FIX] DiscordBotConsole

This commit is contained in:
Gravita 2022-04-10 22:14:55 +07:00
parent 89b800c124
commit 5e6ab3763e
4 changed files with 6 additions and 1 deletions

View file

@ -84,6 +84,7 @@ public boolean accept(Client client, AuthProviderPair pair, String extendedToken
if(client.permissions == null) client.permissions = new ClientPermissions(); if(client.permissions == null) client.permissions = new ClientPermissions();
client.permissions.addPerm("launchserver.checkserver"); client.permissions.addPerm("launchserver.checkserver");
client.permissions.addPerm(String.format("launchserver.profile.%s.show", info.serverName)); client.permissions.addPerm(String.format("launchserver.profile.%s.show", info.serverName));
client.setSerializableProperty("launchserver.serverName", info.serverName);
return true; return true;
} }
} }

View file

@ -1,5 +1,7 @@
package pro.gravit.launchserver.manangers.hook; package pro.gravit.launchserver.manangers.hook;
import pro.gravit.launchserver.auth.core.User;
import pro.gravit.launchserver.manangers.AuthManager;
import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.Client;
import pro.gravit.launchserver.socket.response.auth.AuthResponse; import pro.gravit.launchserver.socket.response.auth.AuthResponse;
import pro.gravit.launchserver.socket.response.auth.CheckServerResponse; import pro.gravit.launchserver.socket.response.auth.CheckServerResponse;
@ -12,6 +14,7 @@ public class AuthHookManager {
public final BiHookSet<AuthResponse.AuthContext, Client> preHook = new BiHookSet<>(); public final BiHookSet<AuthResponse.AuthContext, Client> preHook = new BiHookSet<>();
public final BiHookSet<AuthResponse.AuthContext, Client> postHook = new BiHookSet<>(); public final BiHookSet<AuthResponse.AuthContext, Client> postHook = new BiHookSet<>();
public final BiHookSet<CheckServerResponse, Client> checkServerHook = new BiHookSet<>(); public final BiHookSet<CheckServerResponse, Client> checkServerHook = new BiHookSet<>();
public final BiHookSet<AuthManager.CheckServerReport, Client> postCheckServerHook = new BiHookSet<>();
public final BiHookSet<JoinServerResponse, Client> joinServerHook = new BiHookSet<>(); public final BiHookSet<JoinServerResponse, Client> joinServerHook = new BiHookSet<>();
public final BiHookSet<SetProfileResponse, Client> setProfileHook = new BiHookSet<>(); public final BiHookSet<SetProfileResponse, Client> setProfileHook = new BiHookSet<>();
public final HookSet<RegContext> registraion = new HookSet<>(); public final HookSet<RegContext> registraion = new HookSet<>();

View file

@ -37,6 +37,7 @@ public void execute(ChannelHandlerContext ctx, Client pClient) {
} }
result.playerProfile = report.playerProfile; result.playerProfile = report.playerProfile;
result.uuid = report.uuid; result.uuid = report.uuid;
server.authHookManager.postCheckServerHook.hook(report, pClient);
logger.debug("checkServer: {} uuid: {} serverID: {}", result.playerProfile == null ? null : result.playerProfile.username, result.uuid, serverID); logger.debug("checkServer: {} uuid: {} serverID: {}", result.playerProfile == null ? null : result.playerProfile.username, result.uuid, serverID);
} catch (AuthException | HookException e) { } catch (AuthException | HookException e) {
sendError(e.getMessage()); sendError(e.getMessage());

@ -1 +1 @@
Subproject commit af6e144e4234851bfc5fd27b56584f510bc58bf6 Subproject commit 75fd808a24a390907333e62076ee8e1556424e6b