From 5e6ab3763e380b2769e2b2c7a50a891ddbbdb261 Mon Sep 17 00:00:00 2001 From: Gravita Date: Sun, 10 Apr 2022 22:14:55 +0700 Subject: [PATCH] [FIX] DiscordBotConsole --- .../java/pro/gravit/launchserver/manangers/AuthManager.java | 1 + .../gravit/launchserver/manangers/hook/AuthHookManager.java | 3 +++ .../launchserver/socket/response/auth/CheckServerResponse.java | 1 + modules | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java index f494f990..a419b494 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/AuthManager.java @@ -84,6 +84,7 @@ public boolean accept(Client client, AuthProviderPair pair, String extendedToken if(client.permissions == null) client.permissions = new ClientPermissions(); client.permissions.addPerm("launchserver.checkserver"); client.permissions.addPerm(String.format("launchserver.profile.%s.show", info.serverName)); + client.setSerializableProperty("launchserver.serverName", info.serverName); return true; } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/hook/AuthHookManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/hook/AuthHookManager.java index a8f97153..2947cbcd 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/hook/AuthHookManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/hook/AuthHookManager.java @@ -1,5 +1,7 @@ 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.response.auth.AuthResponse; import pro.gravit.launchserver.socket.response.auth.CheckServerResponse; @@ -12,6 +14,7 @@ public class AuthHookManager { public final BiHookSet preHook = new BiHookSet<>(); public final BiHookSet postHook = new BiHookSet<>(); public final BiHookSet checkServerHook = new BiHookSet<>(); + public final BiHookSet postCheckServerHook = new BiHookSet<>(); public final BiHookSet joinServerHook = new BiHookSet<>(); public final BiHookSet setProfileHook = new BiHookSet<>(); public final HookSet registraion = new HookSet<>(); 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 9d41b9f0..dad489fe 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 @@ -37,6 +37,7 @@ public void execute(ChannelHandlerContext ctx, Client pClient) { } result.playerProfile = report.playerProfile; 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); } catch (AuthException | HookException e) { sendError(e.getMessage()); diff --git a/modules b/modules index af6e144e..75fd808a 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit af6e144e4234851bfc5fd27b56584f510bc58bf6 +Subproject commit 75fd808a24a390907333e62076ee8e1556424e6b