mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-04 00:36:14 +00:00
add debug print on timeout kick
This commit is contained in:
parent
704e25636d
commit
e73d578797
@ -299,7 +299,7 @@ void TNetwork::Authentication(SOCKET TCPSock) {
|
|||||||
mServer.ForEachClient([&](const std::weak_ptr<TClient>& ClientPtr) -> bool {
|
mServer.ForEachClient([&](const std::weak_ptr<TClient>& ClientPtr) -> bool {
|
||||||
if (!ClientPtr.expired()) {
|
if (!ClientPtr.expired()) {
|
||||||
auto Cl = ClientPtr.lock();
|
auto Cl = ClientPtr.lock();
|
||||||
info("Client Iteration: Name -> " + Client->GetName() + ", Guest -> " + std::to_string(Client->IsGuest()) + ", Roles -> " + Client->GetRoles());
|
info("Client Iteration: Name -> " + Cl->GetName() + ", Guest -> " + std::to_string(Cl->IsGuest()) + ", Roles -> " + Cl->GetRoles());
|
||||||
if (Cl->GetName() == Client->GetName() && Cl->IsGuest() == Client->IsGuest()) {
|
if (Cl->GetName() == Client->GetName() && Cl->IsGuest() == Client->IsGuest()) {
|
||||||
info("New client matched with current iteration");
|
info("New client matched with current iteration");
|
||||||
info("Old client (" + Cl->GetName() + ") kicked: Reconnecting");
|
info("Old client (" + Cl->GetName() + ") kicked: Reconnecting");
|
||||||
|
@ -47,6 +47,7 @@ void TPPSMonitor::operator()() {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
for (auto& ClientToKick : TimedOutClients) {
|
for (auto& ClientToKick : TimedOutClients) {
|
||||||
|
debug("client " + std::string("(") + std::to_string(ClientToKick->GetID()) + ")" + ClientToKick->GetName() + " kicked due to timeout!");
|
||||||
Network().ClientKick(*ClientToKick, "Timeout (no ping for >10 seconds)");
|
Network().ClientKick(*ClientToKick, "Timeout (no ping for >10 seconds)");
|
||||||
}
|
}
|
||||||
TimedOutClients.clear();
|
TimedOutClients.clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user