add postPlayerAuth

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

View File

@ -423,6 +423,18 @@ std::shared_ptr<TClient> TNetwork::Authentication(TConnection&& RawConnection) {
Reason = "No guests are allowed on this server! To join, sign up at: forum.beammp.com."; Reason = "No guests are allowed on this server! To join, sign up at: forum.beammp.com.";
} }
bool Allowed = true;
if (NotAllowed) {
Allowed = false;
}
if (NotAllowedWithReason) {
Allowed = false;
}
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) { if (NotAllowed) {
ClientKick(*Client, "you are not allowed on the server!"); ClientKick(*Client, "you are not allowed on the server!");
return {}; return {};