diff --git a/bin/web/assets/img/background.png b/bin/web/assets/img/background.png index a2fae17b..ea97ac81 100644 Binary files a/bin/web/assets/img/background.png and b/bin/web/assets/img/background.png differ diff --git a/src/servers/Server_Zone/Actor/PlayerSql.cpp b/src/servers/Server_Zone/Actor/PlayerSql.cpp index d8cf4194..8a6f7b54 100644 --- a/src/servers/Server_Zone/Actor/PlayerSql.cpp +++ b/src/servers/Server_Zone/Actor/PlayerSql.cpp @@ -82,7 +82,7 @@ bool Core::Entity::Player::load( uint32_t charId, Core::SessionPtr pSession ) "cd.CFPenaltyUntil, " "cd.OpeningSequence, " "cd.GMRank, " - "cd.EquipDisplayFlags " + "cd.EquipDisplayFlags" "FROM charabase AS c " " INNER JOIN charadetail AS cd " " ON c.CharacterId = cd.CharacterId " diff --git a/src/servers/Server_Zone/Network/GameConnection.cpp b/src/servers/Server_Zone/Network/GameConnection.cpp index b46612a9..a89d1bfe 100644 --- a/src/servers/Server_Zone/Network/GameConnection.cpp +++ b/src/servers/Server_Zone/Network/GameConnection.cpp @@ -389,6 +389,13 @@ 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 + { + g_log.error( "[" + std::string(id) + "] Session INVALID, disconnecting" ); + Disconnect(); + return; + } + // if not set, set the session for this connection if( !m_pSession && session ) m_pSession = session; @@ -423,8 +430,6 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets: sendSinglePacket( &pPe ); } - - break; } diff --git a/src/servers/Server_Zone/Session.cpp b/src/servers/Server_Zone/Session.cpp index a5dbb463..d1daddd7 100644 --- a/src/servers/Server_Zone/Session.cpp +++ b/src/servers/Server_Zone/Session.cpp @@ -9,6 +9,7 @@ Core::Session::Session( uint32_t sessionId ) : m_sessionId( sessionId ) + , m_isValid( false ) , m_lastDataTime( static_cast< uint32_t >( time( nullptr ) ) ) { @@ -50,7 +51,12 @@ bool Core::Session::loadPlayer() m_pPlayer = Entity::PlayerPtr( new Entity::Player() ); if( !m_pPlayer->load( m_sessionId, shared_from_this() ) ) + { + m_isValid = false; return false; + } + + m_isValid = true; return true; @@ -80,6 +86,11 @@ uint32_t Core::Session::getLastDataTime() const return m_lastDataTime; } +bool Core::Session::isValid() const +{ + return m_isValid; +} + void Core::Session::updateLastDataTime() { m_lastDataTime = static_cast< uint32_t >( time( nullptr ) ); diff --git a/src/servers/Server_Zone/Session.h b/src/servers/Server_Zone/Session.h index d1aba601..66b81090 100644 --- a/src/servers/Server_Zone/Session.h +++ b/src/servers/Server_Zone/Session.h @@ -35,6 +35,8 @@ namespace Core { void update(); + bool isValid() const; + Entity::PlayerPtr getPlayer() const; private: @@ -44,6 +46,8 @@ namespace Core { uint32_t m_lastDataTime; + bool m_isValid; + Network::GameConnectionPtr m_pZoneConnection; Network::GameConnectionPtr m_pChatConnection;