mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-04 00:36:14 +00:00
Kick client if we fail to send them a client event
This commit is contained in:
parent
b97397132d
commit
81dbf747d5
@ -112,7 +112,8 @@ bool LuaAPI::MP::TriggerClientEvent(int PlayerID, const std::string& EventName,
|
|||||||
}
|
}
|
||||||
auto c = MaybeClient.value().lock();
|
auto c = MaybeClient.value().lock();
|
||||||
if (!Engine->Network().Respond(*c, Packet, true)) {
|
if (!Engine->Network().Respond(*c, Packet, true)) {
|
||||||
beammp_lua_error("Respond failed");
|
beammp_lua_error("Respond failed, dropping client " + std::to_string(PlayerID));
|
||||||
|
Engine->Network().ClientKick(*c, "Disconnected after failing to receive packets");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user