Kick client if we fail to send them a client event

This commit is contained in:
Lion Kortlepel 2022-03-31 16:50:00 +02:00
parent b97397132d
commit 81dbf747d5
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B

View File

@ -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;
} }
} }