mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-08-17 00:36:55 +00:00
move postPlayerAuth later again, after client insert
This commit is contained in:
parent
8f9db10474
commit
86b37e8ae1
@ -437,15 +437,10 @@ std::shared_ptr<TClient> TNetwork::Authentication(TConnection&& RawConnection) {
|
|||||||
ClientKick(*Client, Reason);
|
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 (!Allowed) {
|
if (!Allowed) {
|
||||||
return {};
|
return {};
|
||||||
}
|
} else if (mServer.ClientCount() < size_t(Application::Settings.getAsInt(Settings::Key::General_MaxPlayers))) {
|
||||||
|
|
||||||
if (mServer.ClientCount() < size_t(Application::Settings.getAsInt(Settings::Key::General_MaxPlayers))) {
|
|
||||||
beammp_info("Identification success");
|
beammp_info("Identification success");
|
||||||
mServer.InsertClient(Client);
|
mServer.InsertClient(Client);
|
||||||
TCPClient(Client);
|
TCPClient(Client);
|
||||||
@ -453,6 +448,10 @@ std::shared_ptr<TClient> TNetwork::Authentication(TConnection&& RawConnection) {
|
|||||||
ClientKick(*Client, "Server full!");
|
ClientKick(*Client, "Server full!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
return Client;
|
return Client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user