Skip to content

Commit

Permalink
Network: Do not disconnect session when packet cooldown is triggered
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Feb 11, 2024
1 parent 95e9881 commit d993ab4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/game/Server/WorldSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ bool WorldSocket::ProcessIncomingData()
{
auto now = std::chrono::time_point_cast<std::chrono::milliseconds>(Clock::now());
if (now < self->m_lastPacket[opcode]) // packet on cooldown
{
self->ProcessIncomingData();
return;
}
else // start cooldown and allow execution
self->m_lastPacket[opcode] = now + std::chrono::milliseconds(WorldSocket::m_packetCooldowns[opcode]);
}
Expand Down

0 comments on commit d993ab4

Please sign in to comment.