mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 14:37:44 +00:00
Merge branch 'SQL_REWRITE_OWN' of https://github.com/SapphireMordred/Sapphire into SQL_REWRITE_OWN
This commit is contained in:
commit
ae6c44d8a5
3 changed files with 4 additions and 3 deletions
|
@ -914,7 +914,6 @@ uint32_t Core::Entity::Player::getLastPing() const
|
|||
return m_lastPing;
|
||||
}
|
||||
|
||||
|
||||
void Core::Entity::Player::setVoiceId( uint8_t voiceId )
|
||||
{
|
||||
m_voice = voiceId;
|
||||
|
|
|
@ -387,8 +387,7 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets:
|
|||
}
|
||||
session = g_serverZone.getSession( playerId );
|
||||
}
|
||||
|
||||
if( !session->isValid() ) //TODO: Catch more things in lobby and send real errors
|
||||
else if( !session->isValid() || ( session->getPlayer() && session->getPlayer()->getLastPing() != 0 ) ) //TODO: Catch more things in lobby and send real errors
|
||||
{
|
||||
g_log.error( "[" + std::string(id) + "] Session INVALID, disconnecting" );
|
||||
Disconnect();
|
||||
|
|
|
@ -280,16 +280,19 @@ void Core::ServerZone::mainLoop()
|
|||
|
||||
auto pPlayer = it->second->getPlayer();
|
||||
|
||||
// remove session of players marked for removel ( logoff / kick )
|
||||
if( pPlayer->isMarkedForRemoval() && diff > 1 )
|
||||
{
|
||||
it->second->close();
|
||||
// if( it->second.unique() )
|
||||
{
|
||||
g_log.info("[" + std::to_string(it->second->getId() ) + "] Session removal" );
|
||||
it = this->m_sessionMap.erase( it );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// remove sessions that simply timed out
|
||||
if( diff > 20 )
|
||||
{
|
||||
g_log.info("[" + std::to_string(it->second->getId() ) + "] Session time out" );
|
||||
|
|
Loading…
Add table
Reference in a new issue