1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 22:57:45 +00:00

Merge pull request #236 from GokuWeedLord/master

fix session disconnects & inventory opcodes
This commit is contained in:
Mordred 2018-02-01 17:48:40 +01:00 committed by GitHub
commit 3a9de03abc
5 changed files with 10 additions and 9 deletions

View file

@ -100,8 +100,8 @@ namespace Packets {
InventoryTransactionFinish = 0x017C, // updated 4.2 InventoryTransactionFinish = 0x017C, // updated 4.2
InventoryTransaction = 0x017D, // updated 4.2 InventoryTransaction = 0x017D, // updated 4.2
CurrencyCrystalInfo = 0x017E, // updated 4.2 CurrencyCrystalInfo = 0x017E, // updated 4.2
InventoryActionAck = 0x1139, InventoryActionAck = 0x0180, // updated 4.2?
UpdateInventorySlot = 0x0180, // updated 4.2 UpdateInventorySlot = 0x0181, // updated 4.2
EventPlay = 0x018E, // updated 4.2 EventPlay = 0x018E, // updated 4.2
EventStart = 0x0198, // updated 4.2 EventStart = 0x0198, // updated 4.2

View file

@ -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() )
{ {

View file

@ -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;

View file

@ -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()

View file

@ -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;