mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-05 02:07:46 +00:00
fix sessionid being read incorrectly from version packet, fix lobby key
This commit is contained in:
parent
142b5571b6
commit
c4f443fa8d
1 changed files with 6 additions and 4 deletions
|
@ -236,15 +236,15 @@ void Sapphire::Network::GameConnection::enterWorld( FFXIVARR_PACKET_RAW& packet,
|
||||||
|
|
||||||
bool Sapphire::Network::GameConnection::sendServiceAccountList( FFXIVARR_PACKET_RAW& packet, uint32_t tmpId )
|
bool Sapphire::Network::GameConnection::sendServiceAccountList( FFXIVARR_PACKET_RAW& packet, uint32_t tmpId )
|
||||||
{
|
{
|
||||||
LobbySessionPtr pSession = g_serverLobby.getSession( ( char* ) &packet.data[ 0 ] + 0x20 );
|
LobbySessionPtr pSession = g_serverLobby.getSession( ( char* ) &packet.data[ 0 ] + 0x22 );
|
||||||
|
|
||||||
if( g_serverLobby.getConfig().allowNoSessionConnect && pSession == nullptr )
|
if( g_serverLobby.getConfig().allowNoSessionConnect && pSession == nullptr )
|
||||||
{
|
{
|
||||||
auto session = make_LobbySession();
|
auto session = make_LobbySession();
|
||||||
session->setAccountID( 0 );
|
session->setAccountID( 0 );
|
||||||
session->setSessionId( ( uint8_t* ) &packet.data[ 0 ] + 0x20 );
|
session->setSessionId( ( uint8_t* ) &packet.data[ 0 ] + 0x22 );
|
||||||
pSession = session;
|
pSession = session;
|
||||||
Logger::info( "Allowed connection with no session: {0}", std::string( ( char* ) &packet.data[ 0 ] + 0x20 ) );
|
Logger::info( "Allowed connection with no session: {0}", std::string( ( char* ) &packet.data[ 0 ] + 0x22 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pSession != nullptr )
|
if( pSession != nullptr )
|
||||||
|
@ -388,6 +388,8 @@ void Sapphire::Network::GameConnection::handleGamePacket( Packets::FFXIVARR_PACK
|
||||||
|
|
||||||
Logger::info( "OpCode [{0}]", *reinterpret_cast< uint16_t* >( &packet.data[ 2 ] ) );
|
Logger::info( "OpCode [{0}]", *reinterpret_cast< uint16_t* >( &packet.data[ 2 ] ) );
|
||||||
|
|
||||||
|
Logger::info( Util::binaryToHexDump( packet.data.data(), packet.data.size() ) );
|
||||||
|
|
||||||
switch( *reinterpret_cast< uint16_t* >( &packet.data[ 2 ] ) )
|
switch( *reinterpret_cast< uint16_t* >( &packet.data[ 2 ] ) )
|
||||||
{
|
{
|
||||||
case ClientVersionInfo:
|
case ClientVersionInfo:
|
||||||
|
@ -451,7 +453,7 @@ void Sapphire::Network::GameConnection::generateEncryptionKey( uint32_t key, con
|
||||||
m_baseKey[ 2 ] = 0x34;
|
m_baseKey[ 2 ] = 0x34;
|
||||||
m_baseKey[ 3 ] = 0x12;
|
m_baseKey[ 3 ] = 0x12;
|
||||||
memcpy( m_baseKey + 0x04, &key, 4 );
|
memcpy( m_baseKey + 0x04, &key, 4 );
|
||||||
m_baseKey[ 8 ] = 0x30;
|
m_baseKey[ 8 ] = 0xC6;
|
||||||
m_baseKey[ 9 ] = 0x11;
|
m_baseKey[ 9 ] = 0x11;
|
||||||
memcpy( ( char* ) m_baseKey + 0x0C, keyPhrase.c_str(), keyPhrase.size() );
|
memcpy( ( char* ) m_baseKey + 0x0C, keyPhrase.c_str(), keyPhrase.size() );
|
||||||
Sapphire::Util::md5( m_baseKey, m_encKey, 0x2C );
|
Sapphire::Util::md5( m_baseKey, m_encKey, 0x2C );
|
||||||
|
|
Loading…
Add table
Reference in a new issue