[Server] Split up handshake handling into multiple functions for debug

Unfortunately, the handshake attempt limit implemented in 4ebfcc4a21 for 0.7 and then ported over to 0.6 in a3a341fee6 does not appear to work properly, which is why gathering more information on it is important.
0.6.3
David Cernat 7 years ago
parent c132dc70d2
commit 34893ff631

@ -116,8 +116,12 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
if (!player->isHandshaked())
{
player->incrementHandshakeAttempts();
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Have not completed handshake with player %d", player->getId());
if (player->handshakeAttempts() > 5)
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Attempts so far: %i", player->getHandshakeAttempts());
if (player->getHandshakeAttempts() > 5)
kickPlayer(player->guid);
return;
}

@ -100,9 +100,14 @@ void Player::setHandshake()
handshakeCounter = numeric_limits<int>::max();
}
int Player::handshakeAttempts()
void Player::incrementHandshakeAttempts()
{
return handshakeCounter++;
handshakeCounter++;
}
int Player::getHandshakeAttempts()
{
return handshakeCounter;
}

@ -58,7 +58,8 @@ public:
void setId(unsigned short id);
bool isHandshaked();
int handshakeAttempts();
int getHandshakeAttempts();
void incrementHandshakeAttempts();
void setHandshake();
void setLoadState(int state);
@ -73,8 +74,8 @@ public:
private:
CellController::TContainer cells;
int handshakeCounter;
int loadState;
int handshakeCounter;
};

Loading…
Cancel
Save