mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 23:27:45 +00:00
fix session disconnecting issue
This commit is contained in:
parent
1708e5d510
commit
13331c696e
4 changed files with 8 additions and 7 deletions
|
@ -269,7 +269,7 @@ void Core::ServerZone::mainLoop()
|
||||||
this_thread::sleep_for( chrono::milliseconds( 50 ) );
|
this_thread::sleep_for( chrono::milliseconds( 50 ) );
|
||||||
|
|
||||||
|
|
||||||
auto currTime = static_cast< uint32_t >( Util::getTimeSeconds() );
|
auto currTime = Util::getTimeSeconds();
|
||||||
|
|
||||||
g_territoryMgr.updateTerritoryInstances( currTime );
|
g_territoryMgr.updateTerritoryInstances( currTime );
|
||||||
|
|
||||||
|
@ -320,7 +320,8 @@ void Core::ServerZone::mainLoop()
|
||||||
// remove sessions that simply timed out
|
// 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" );
|
||||||
|
|
||||||
it->second->close();
|
it->second->close();
|
||||||
// if( it->second.unique() )
|
// if( it->second.unique() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace Core {
|
||||||
|
|
||||||
uint16_t m_port;
|
uint16_t m_port;
|
||||||
std::string m_ip;
|
std::string m_ip;
|
||||||
uint32_t m_lastDBPingTime;
|
int64_t m_lastDBPingTime;
|
||||||
|
|
||||||
bool m_bRunning;
|
bool m_bRunning;
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ uint32_t Core::Session::getId() const
|
||||||
return m_sessionId;
|
return m_sessionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Core::Session::getLastDataTime() const
|
int64_t Core::Session::getLastDataTime() const
|
||||||
{
|
{
|
||||||
return m_lastDataTime;
|
return m_lastDataTime;
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ bool Core::Session::isValid() const
|
||||||
|
|
||||||
void Core::Session::updateLastDataTime()
|
void Core::Session::updateLastDataTime()
|
||||||
{
|
{
|
||||||
m_lastDataTime = static_cast< uint32_t >( Util::getTimeSeconds() );
|
m_lastDataTime = Util::getTimeSeconds();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Core::Session::updateLastSqlTime()
|
void Core::Session::updateLastSqlTime()
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace Core {
|
||||||
Network::GameConnectionPtr getZoneConnection() const;
|
Network::GameConnectionPtr getZoneConnection() const;
|
||||||
Network::GameConnectionPtr getChatConnection() const;
|
Network::GameConnectionPtr getChatConnection() const;
|
||||||
|
|
||||||
uint32_t getLastDataTime() const;
|
int64_t getLastDataTime() const;
|
||||||
uint32_t getLastSqlTime() const;
|
uint32_t getLastSqlTime() const;
|
||||||
|
|
||||||
void updateLastDataTime();
|
void updateLastDataTime();
|
||||||
|
@ -48,7 +48,7 @@ namespace Core {
|
||||||
|
|
||||||
Entity::PlayerPtr m_pPlayer;
|
Entity::PlayerPtr m_pPlayer;
|
||||||
|
|
||||||
uint32_t m_lastDataTime;
|
int64_t m_lastDataTime;
|
||||||
|
|
||||||
uint32_t m_lastSqlTime;
|
uint32_t m_lastSqlTime;
|
||||||
bool m_isValid;
|
bool m_isValid;
|
||||||
|
|
Loading…
Add table
Reference in a new issue