1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-03 01:07:47 +00:00

Merge pull request #39 from amibu01/master

Fixed a PS4 related oversight
This commit is contained in:
SapphireMordred 2017-08-11 13:01:38 +02:00 committed by GitHub
commit 8619b27a9e
2 changed files with 17 additions and 3 deletions

View file

@ -24,4 +24,8 @@
<Database>sapphire</Database> <Database>sapphire</Database>
</Mysql> </Mysql>
</General> </General>
<Parameters>
<!-- Do not disconnect players without a session - this should be definitely disabled unless you are testing on a PS4 -->
<AllowNoSessionConnect>false</AllowNoSessionConnect>
</Parameters>
</Settings> </Settings>

View file

@ -223,6 +223,16 @@ void Core::Network::GameConnection::enterWorld( FFXIVARR_PACKET_RAW& packet, uin
bool Core::Network::GameConnection::sendServiceAccountList( FFXIVARR_PACKET_RAW& packet, uint32_t tmpId ) bool Core::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] + 0x20 );
if( g_serverLobby.m_pConfig->getValue<bool>( "Settings.Parameters.AllowNoSessionConnect" ) && pSession == nullptr )
{
LobbySessionPtr session( new Core::LobbySession() );
session->setAccountID( 0 );
session->setSessionId( (uint8_t *)&packet.data[0] + 0x20 );
pSession = session;
g_log.Log( LoggingSeverity::info, "Allowed connection with no session: " + std::string( (char*)&packet.data[0] + 0x20 ) );
}
if( pSession != nullptr ) if( pSession != nullptr )
{ {
g_log.Log( LoggingSeverity::info, "Found session linked to accountId: " + std::to_string( pSession->getAccountID() ) ); g_log.Log( LoggingSeverity::info, "Found session linked to accountId: " + std::to_string( pSession->getAccountID() ) );