mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 23:35:41 +00:00
Fix postPlayerAuth not running until after leaving
This commit is contained in:
parent
1c07cf83b2
commit
99a51808a0
@ -430,15 +430,9 @@ 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.";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NotAllowed && !NotAllowedWithReason) {
|
if (!NotAllowed && !NotAllowedWithReason && mServer.ClientCount() >= size_t(Application::Settings.getAsInt(Settings::Key::General_MaxPlayers)) && !BypassLimit) {
|
||||||
if (mServer.ClientCount() < size_t(Application::Settings.getAsInt(Settings::Key::General_MaxPlayers)) || BypassLimit) {
|
|
||||||
beammp_info("Identification success");
|
|
||||||
mServer.InsertClient(Client);
|
|
||||||
TCPClient(Client);
|
|
||||||
} else {
|
|
||||||
NotAllowedWithReason = true;
|
NotAllowedWithReason = true;
|
||||||
Reason = "Server full!";
|
Reason = "Server full!";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NotAllowedWithReason) {
|
if (NotAllowedWithReason) {
|
||||||
@ -451,6 +445,12 @@ std::shared_ptr<TClient> TNetwork::Authentication(TConnection&& RawConnection) {
|
|||||||
// the post event is not cancellable so we dont wait for it
|
// the post event is not cancellable so we dont wait for it
|
||||||
LuaAPI::MP::Engine->ReportErrors(PostFutures);
|
LuaAPI::MP::Engine->ReportErrors(PostFutures);
|
||||||
|
|
||||||
|
if (!NotAllowed && !NotAllowedWithReason) {
|
||||||
|
beammp_info("Identification success");
|
||||||
|
mServer.InsertClient(Client);
|
||||||
|
TCPClient(Client);
|
||||||
|
}
|
||||||
|
|
||||||
return Client;
|
return Client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user