|
|
|
@ -8,6 +8,8 @@
|
|
|
|
|
TPlayers Players::players;
|
|
|
|
|
TSlots Players::slots;
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
void Players::deletePlayer(RakNet::RakNetGUID guid)
|
|
|
|
|
{
|
|
|
|
|
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Deleting player with guid %lu", guid.g);
|
|
|
|
@ -69,7 +71,7 @@ unsigned short Players::getLastPlayerId()
|
|
|
|
|
|
|
|
|
|
Player::Player(RakNet::RakNetGUID guid) : BasePlayer(guid)
|
|
|
|
|
{
|
|
|
|
|
handshakeState = false;
|
|
|
|
|
handshakeCounter = 0;
|
|
|
|
|
loadState = NOTLOADED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -88,16 +90,22 @@ void Player::setId(unsigned short id)
|
|
|
|
|
this->id = id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Player::isHandshaked()
|
|
|
|
|
{
|
|
|
|
|
return handshakeCounter == numeric_limits<int>::max();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Player::setHandshake()
|
|
|
|
|
{
|
|
|
|
|
handshakeState = true;
|
|
|
|
|
handshakeCounter = numeric_limits<int>::max();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Player::isHandshaked()
|
|
|
|
|
int Player::handshakeAttempts()
|
|
|
|
|
{
|
|
|
|
|
return handshakeState;
|
|
|
|
|
return handshakeCounter++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Player::setLoadState(int state)
|
|
|
|
|
{
|
|
|
|
|
loadState = state;
|
|
|
|
|