mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-27 21:09:40 +00:00
[Server] Split up handshake handling into multiple functions for debug
Unfortunately, the handshake attempt limit implemented in4ebfcc4a21
for 0.7 and then ported over to 0.6 ina3a341fee6
does not appear to work properly, which is why gathering more information on it is important.
This commit is contained in:
parent
c132dc70d2
commit
34893ff631
3 changed files with 15 additions and 5 deletions
|
@ -116,8 +116,12 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
||||||
|
|
||||||
if (!player->isHandshaked())
|
if (!player->isHandshaked())
|
||||||
{
|
{
|
||||||
|
player->incrementHandshakeAttempts();
|
||||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Have not completed handshake with player %d", player->getId());
|
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);
|
kickPlayer(player->guid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,9 +100,14 @@ void Player::setHandshake()
|
||||||
handshakeCounter = numeric_limits<int>::max();
|
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);
|
void setId(unsigned short id);
|
||||||
|
|
||||||
bool isHandshaked();
|
bool isHandshaked();
|
||||||
int handshakeAttempts();
|
int getHandshakeAttempts();
|
||||||
|
void incrementHandshakeAttempts();
|
||||||
void setHandshake();
|
void setHandshake();
|
||||||
|
|
||||||
void setLoadState(int state);
|
void setLoadState(int state);
|
||||||
|
@ -73,8 +74,8 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CellController::TContainer cells;
|
CellController::TContainer cells;
|
||||||
int handshakeCounter;
|
|
||||||
int loadState;
|
int loadState;
|
||||||
|
int handshakeCounter;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue