move postPlayerAuth to after kick

This commit is contained in:
Lion Kortlepel 2024-09-18 16:09:21 +02:00
parent afa5a04043
commit 8f9db10474
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B

View File

@ -431,15 +431,17 @@ std::shared_ptr<TClient> TNetwork::Authentication(TConnection&& RawConnection) {
Allowed = false;
}
if (NotAllowed) {
ClientKick(*Client, "you are not allowed on the server!");
} else if (NotAllowedWithReason) {
ClientKick(*Client, Reason);
}
auto PostFutures = LuaAPI::MP::Engine->TriggerEvent("postPlayerAuth", "", Allowed, Client->GetName(), Client->GetRoles(), Client->IsGuest(), Client->GetIdentifiers());
// the post event is not cancellable so we dont wait for it
LuaAPI::MP::Engine->ReportErrors(PostFutures);
if (NotAllowed) {
ClientKick(*Client, "you are not allowed on the server!");
return {};
} else if (NotAllowedWithReason) {
ClientKick(*Client, Reason);
if (!Allowed) {
return {};
}