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

Server Lobby boost scrapping ( does not link atm

This commit is contained in:
mordred 2018-10-24 23:39:11 +02:00
parent b153c81e2e
commit 28b5fd0714
6 changed files with 13 additions and 16 deletions

View file

@ -42,6 +42,8 @@ public:
return m_pInih->GetReal( "", name, defaultValue ); return m_pInih->GetReal( "", name, defaultValue );
else if constexpr (std::is_same_v<T, std::string>) else if constexpr (std::is_same_v<T, std::string>)
return m_pInih->Get( "", name, defaultValue ); return m_pInih->Get( "", name, defaultValue );
else if constexpr (std::is_same_v<T, bool>)
return m_pInih->GetBoolean( "", name, defaultValue );
else else
static_assert(always_false<T>::value, "non-exhaustive getter!"); static_assert(always_false<T>::value, "non-exhaustive getter!");
} }

View file

@ -9,7 +9,7 @@ file(GLOB SERVER_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}*.c*")
add_executable(sapphire_lobby ${SERVER_PUBLIC_INCLUDE_FILES} ${SERVER_SOURCE_FILES}) add_executable(sapphire_lobby ${SERVER_PUBLIC_INCLUDE_FILES} ${SERVER_SOURCE_FILES})
set_target_properties(sapphire_lobby PROPERTIES set_target_properties(sapphire_lobby PROPERTIES
CXX_STANDARD 14 CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS ON CXX_EXTENSIONS ON
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/" RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/"
@ -19,6 +19,6 @@ set_target_properties(sapphire_lobby PROPERTIES
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/" VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/"
) )
target_link_libraries(sapphire_lobby PRIVATE common) target_link_libraries( sapphire_lobby PRIVATE common )
cotire( sapphire_lobby ) cotire( sapphire_lobby )

View file

@ -11,8 +11,6 @@
#include <Crypt/blowfish.h> #include <Crypt/blowfish.h>
#include <Config/ConfigMgr.h> #include <Config/ConfigMgr.h>
#include <boost/property_tree/json_parser.hpp>
#include "ServerLobby.h" #include "ServerLobby.h"
#include "RestConnector.h" #include "RestConnector.h"
#include "LobbySession.h" #include "LobbySession.h"
@ -98,7 +96,7 @@ void Core::Network::GameConnection::OnRecv( std::vector< uint8_t >& buffer )
} }
void Core::Network::GameConnection::OnError( const boost::system::error_code& error ) void Core::Network::GameConnection::OnError( const asio::error_code& error )
{ {
g_log.info( "GameConnection closed: " + error.message() ); g_log.info( "GameConnection closed: " + error.message() );
} }
@ -500,7 +498,7 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets:
generateEncryptionKey( *reinterpret_cast< uint32_t* >( &inPacket.data[ 100 ] ), key_phrase ); generateEncryptionKey( *reinterpret_cast< uint32_t* >( &inPacket.data[ 100 ] ), key_phrase );
m_bEncryptionInitialized = true; m_bEncryptionInitialized = true;
auto pe1 = boost::make_shared< FFXIVRawPacket >( 0x0A, 0x290, 0, 0 ); auto pe1 = std::make_shared< FFXIVRawPacket >( 0x0A, 0x290, 0, 0 );
*reinterpret_cast< uint32_t* >( &pe1->data()[ 0 ] ) = 0xE0003C2A; *reinterpret_cast< uint32_t* >( &pe1->data()[ 0 ] ) = 0xE0003C2A;
BlowFish blowfish; BlowFish blowfish;
@ -523,7 +521,7 @@ void Core::Network::GameConnection::handlePackets( const Core::Network::Packets:
uint32_t id = *reinterpret_cast< uint32_t* >( &inPacket.data[ 0 ] ); uint32_t id = *reinterpret_cast< uint32_t* >( &inPacket.data[ 0 ] );
uint32_t timeStamp = *reinterpret_cast< uint32_t* >( &inPacket.data[ 4 ] ); uint32_t timeStamp = *reinterpret_cast< uint32_t* >( &inPacket.data[ 4 ] );
auto pe4 = boost::make_shared< FFXIVRawPacket >( 0x08, 0x18, 0, 0 ); auto pe4 = std::make_shared< FFXIVRawPacket >( 0x08, 0x18, 0, 0 );
*( unsigned int* ) ( &pe4->data()[ 0 ] ) = id; *( unsigned int* ) ( &pe4->data()[ 0 ] ) = id;
*( unsigned int* ) ( &pe4->data()[ 4 ] ) = timeStamp; *( unsigned int* ) ( &pe4->data()[ 4 ] ) = timeStamp;
sendSinglePacket( pe4 ); sendSinglePacket( pe4 );

View file

@ -8,6 +8,7 @@
#include <Network/PacketContainer.h> #include <Network/PacketContainer.h>
#include <Util/LockedQueue.h> #include <Util/LockedQueue.h>
#include <asio.hpp>
#include "LobbyPacketContainer.h" #include "LobbyPacketContainer.h"
#include "Forwards.h" #include "Forwards.h"
@ -51,7 +52,7 @@ public:
void OnRecv( std::vector< uint8_t >& buffer ) override; void OnRecv( std::vector< uint8_t >& buffer ) override;
void OnError( const boost::system::error_code& error ) override; void OnError( const asio::error_code& error ) override;
void sendError( uint64_t sequence, uint32_t errorcode, uint16_t messageId, uint32_t tmpId ); void sendError( uint64_t sequence, uint32_t errorcode, uint16_t messageId, uint32_t tmpId );

View file

@ -22,10 +22,7 @@
#include <thread> #include <thread>
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/foreach.hpp>
Core::Logger g_log; Core::Logger g_log;
Core::Network::RestConnector g_restConnector; Core::Network::RestConnector g_restConnector;
@ -37,7 +34,7 @@ ServerLobby::ServerLobby( const std::string& configPath ) :
m_configPath( configPath ), m_configPath( configPath ),
m_numConnections( 0 ) m_numConnections( 0 )
{ {
m_pConfig = boost::shared_ptr< ConfigMgr >( new ConfigMgr ); m_pConfig = std::shared_ptr< ConfigMgr >( new ConfigMgr );
} }
ServerLobby::~ServerLobby( void ) ServerLobby::~ServerLobby( void )

View file

@ -4,8 +4,7 @@
#define _CSERVERLOBBY_H_ #define _CSERVERLOBBY_H_
#include <map> #include <map>
#include <memory>
#include <boost/shared_ptr.hpp>
#include "Forwards.h" #include "Forwards.h"
@ -31,7 +30,7 @@ private:
uint16_t m_port; uint16_t m_port;
std::string m_ip; std::string m_ip;
boost::shared_ptr< ConfigMgr > m_pConfig; std::shared_ptr< ConfigMgr > m_pConfig;
public: public:
ServerLobby( const std::string& configPath ); ServerLobby( const std::string& configPath );
@ -47,7 +46,7 @@ public:
m_sessionMap[ std::string( sessionId ) ] = pSession; m_sessionMap[ std::string( sessionId ) ] = pSession;
} }
boost::shared_ptr< ConfigMgr > getConfig() const; std::shared_ptr< ConfigMgr > getConfig() const;
LobbySessionPtr getSession( char* sessionId ); LobbySessionPtr getSession( char* sessionId );