1
Fork 0
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:
NotAdam 2019-03-26 18:15:23 +11:00
parent 142b5571b6
commit c4f443fa8d

View file

@ -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 )
{
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 )
{
auto session = make_LobbySession();
session->setAccountID( 0 );
session->setSessionId( ( uint8_t* ) &packet.data[ 0 ] + 0x20 );
session->setSessionId( ( uint8_t* ) &packet.data[ 0 ] + 0x22 );
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 )
@ -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( Util::binaryToHexDump( packet.data.data(), packet.data.size() ) );
switch( *reinterpret_cast< uint16_t* >( &packet.data[ 2 ] ) )
{
case ClientVersionInfo:
@ -451,7 +453,7 @@ void Sapphire::Network::GameConnection::generateEncryptionKey( uint32_t key, con
m_baseKey[ 2 ] = 0x34;
m_baseKey[ 3 ] = 0x12;
memcpy( m_baseKey + 0x04, &key, 4 );
m_baseKey[ 8 ] = 0x30;
m_baseKey[ 8 ] = 0xC6;
m_baseKey[ 9 ] = 0x11;
memcpy( ( char* ) m_baseKey + 0x0C, keyPhrase.c_str(), keyPhrase.size() );
Sapphire::Util::md5( m_baseKey, m_encKey, 0x2C );