1
Fork 0
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:
Maru 2017-11-16 20:20:35 -02:00
commit ae6c44d8a5
3 changed files with 4 additions and 3 deletions

View file

@ -914,7 +914,6 @@ uint32_t Core::Entity::Player::getLastPing() const
return m_lastPing; return m_lastPing;
} }
void Core::Entity::Player::setVoiceId( uint8_t voiceId ) void Core::Entity::Player::setVoiceId( uint8_t voiceId )
{ {
m_voice = voiceId; m_voice = voiceId;

View file

@ -387,8 +387,7 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets:
} }
session = g_serverZone.getSession( playerId ); session = g_serverZone.getSession( playerId );
} }
else if( !session->isValid() || ( session->getPlayer() && session->getPlayer()->getLastPing() != 0 ) ) //TODO: Catch more things in lobby and send real errors
if( !session->isValid() ) //TODO: Catch more things in lobby and send real errors
{ {
g_log.error( "[" + std::string(id) + "] Session INVALID, disconnecting" ); g_log.error( "[" + std::string(id) + "] Session INVALID, disconnecting" );
Disconnect(); Disconnect();

View file

@ -280,16 +280,19 @@ void Core::ServerZone::mainLoop()
auto pPlayer = it->second->getPlayer(); auto pPlayer = it->second->getPlayer();
// remove session of players marked for removel ( logoff / kick )
if( pPlayer->isMarkedForRemoval() && diff > 1 ) if( pPlayer->isMarkedForRemoval() && diff > 1 )
{ {
it->second->close(); it->second->close();
// if( it->second.unique() ) // if( it->second.unique() )
{ {
g_log.info("[" + std::to_string(it->second->getId() ) + "] Session removal" );
it = this->m_sessionMap.erase( it ); it = this->m_sessionMap.erase( it );
continue; continue;
} }
} }
// remove sessions that simply timed out
if( diff > 20 ) if( diff > 20 )
{ {
g_log.info("[" + std::to_string(it->second->getId() ) + "] Session time out" ); g_log.info("[" + std::to_string(it->second->getId() ) + "] Session time out" );