mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 06:27:45 +00:00
merge config files and update config calls
This commit is contained in:
parent
dc46fea1b0
commit
d3872ef095
17 changed files with 219 additions and 157 deletions
58
bin/config/config.ini
Normal file
58
bin/config/config.ini
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
[Database]
|
||||||
|
Host = 127.0.0.1
|
||||||
|
Port = 3306
|
||||||
|
Database = sapphire
|
||||||
|
Username = root
|
||||||
|
Password =
|
||||||
|
SyncThreads = 2
|
||||||
|
AsyncThreads = 2
|
||||||
|
|
||||||
|
[GlobalParameters]
|
||||||
|
ServerSecret = default
|
||||||
|
DataPath = /mnt/c/Program Files (x86)/Steam/steamapps/common/FINAL FANTASY XIV Online/game/sqpack
|
||||||
|
|
||||||
|
[GlobalNetwork]
|
||||||
|
; Values definining how Users and other servers will access - these have to be set to your public IP when running a public server
|
||||||
|
ZoneHost = 127.0.0.1
|
||||||
|
ZonePort = 54992
|
||||||
|
|
||||||
|
LobbyHost = 127.0.0.1
|
||||||
|
LobbyPort = 54994
|
||||||
|
|
||||||
|
RestHost = 127.0.0.1
|
||||||
|
RestPort = 80
|
||||||
|
|
||||||
|
[Lobby]
|
||||||
|
WorldID = 67
|
||||||
|
AllowNoSessionConnect = false
|
||||||
|
WorldName = Sapphire
|
||||||
|
|
||||||
|
[LobbyNetwork]
|
||||||
|
ListenIp = 0.0.0.0
|
||||||
|
ListenPort = 54994
|
||||||
|
|
||||||
|
[CharacterCreation]
|
||||||
|
DefaultGMRank = 255
|
||||||
|
|
||||||
|
[RestNetwork]
|
||||||
|
ListenIp = 0.0.0.0
|
||||||
|
ListenPort = 80
|
||||||
|
|
||||||
|
[Scripts]
|
||||||
|
; where compiled script modules are located
|
||||||
|
Path = ./compiledscripts/
|
||||||
|
; relative to Path, where we copy and load modules from
|
||||||
|
CachePath = ./cache/
|
||||||
|
; whether we should detect changes to script modules and reload them
|
||||||
|
HotSwap = true
|
||||||
|
|
||||||
|
[Network]
|
||||||
|
DisconnectTimeout = 20
|
||||||
|
|
||||||
|
[ZoneNetwork]
|
||||||
|
ListenIp = 0.0.0.0
|
||||||
|
ListenPort = 54992
|
||||||
|
|
||||||
|
[General]
|
||||||
|
; Sent on login - each line must be shorter than 307 characters, split lines with ';'
|
||||||
|
MotD = Welcome to Sapphire!;This is a very good server;You can change these messages by editing General.MotD in config/zone.ini
|
58
bin/config/config.ini.default
Normal file
58
bin/config/config.ini.default
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
[Database]
|
||||||
|
Host = 127.0.0.1
|
||||||
|
Port = 3306
|
||||||
|
Database = sapphire
|
||||||
|
Username = sapphire
|
||||||
|
Password =
|
||||||
|
SyncThreads = 2
|
||||||
|
AsyncThreads = 2
|
||||||
|
|
||||||
|
[GlobalParameters]
|
||||||
|
ServerSecret = default
|
||||||
|
DataPath = C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack
|
||||||
|
|
||||||
|
[GlobalNetwork]
|
||||||
|
; Values definining how Users and other servers will access - these have to be set to your public IP when running a public server
|
||||||
|
ZoneHost = 127.0.0.1
|
||||||
|
ZonePort = 54992
|
||||||
|
|
||||||
|
LobbyHost = 127.0.0.1
|
||||||
|
LobbyPort = 54994
|
||||||
|
|
||||||
|
RestHost = 127.0.0.1
|
||||||
|
RestPort = 80
|
||||||
|
|
||||||
|
[Lobby]
|
||||||
|
WorldID = 67
|
||||||
|
AllowNoSessionConnect = false
|
||||||
|
WorldName = Sapphire
|
||||||
|
|
||||||
|
[LobbyNetwork]
|
||||||
|
ListenIp = 0.0.0.0
|
||||||
|
ListenPort = 54994
|
||||||
|
|
||||||
|
[CharacterCreation]
|
||||||
|
DefaultGMRank = 255
|
||||||
|
|
||||||
|
[RestNetwork]
|
||||||
|
ListenIp = 0.0.0.0
|
||||||
|
ListenPort = 80
|
||||||
|
|
||||||
|
[Scripts]
|
||||||
|
; where compiled script modules are located
|
||||||
|
Path = ./compiledscripts/
|
||||||
|
; relative to Path, where we copy and load modules from
|
||||||
|
CachePath = ./cache/
|
||||||
|
; whether we should detect changes to script modules and reload them
|
||||||
|
HotSwap = true
|
||||||
|
|
||||||
|
[Network]
|
||||||
|
DisconnectTimeout = 20
|
||||||
|
|
||||||
|
[ZoneNetwork]
|
||||||
|
ListenIp = 0.0.0.0
|
||||||
|
ListenPort = 54992
|
||||||
|
|
||||||
|
[General]
|
||||||
|
; Sent on login - each line must be shorter than 307 characters, split lines with ';'
|
||||||
|
MotD = Welcome to Sapphire!;This is a very good server;You can change these messages by editing General.MotD in config/zone.ini
|
|
@ -1,23 +0,0 @@
|
||||||
[Database]
|
|
||||||
Host = 127.0.0.1
|
|
||||||
Port = 3306
|
|
||||||
Database = sapphire
|
|
||||||
Username = root
|
|
||||||
Password =
|
|
||||||
SyncThreads = 2
|
|
||||||
AsyncThreads = 2
|
|
||||||
|
|
||||||
[GlobalParameters]
|
|
||||||
ServerSecret = default
|
|
||||||
DataPath = C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack
|
|
||||||
|
|
||||||
[GlobalNetwork]
|
|
||||||
; Values definining how Users and other servers will access - these have to be set to your public IP when running a public server
|
|
||||||
ZoneHost = 127.0.0.1
|
|
||||||
ZonePort = 54992
|
|
||||||
|
|
||||||
LobbyHost = 127.0.0.1
|
|
||||||
LobbyPort = 54994
|
|
||||||
|
|
||||||
RestHost = 127.0.0.1
|
|
||||||
RestPort = 80
|
|
|
@ -1,8 +0,0 @@
|
||||||
[Lobby]
|
|
||||||
WorldID = 67
|
|
||||||
AllowNoSessionConnect = false
|
|
||||||
WorldName = Sapphire
|
|
||||||
|
|
||||||
[LobbyNetwork]
|
|
||||||
ListenIp = 0.0.0.0
|
|
||||||
ListenPort = 54994
|
|
|
@ -1,6 +0,0 @@
|
||||||
[CharacterCreation]
|
|
||||||
DefaultGMRank = 255
|
|
||||||
|
|
||||||
[RestNetwork]
|
|
||||||
ListenIp = 0.0.0.0
|
|
||||||
ListenPort = 80
|
|
|
@ -1,18 +0,0 @@
|
||||||
[Scripts]
|
|
||||||
; where compiled script modules are located
|
|
||||||
Path = ./compiledscripts/
|
|
||||||
; relative to Path, where we copy and load modules from
|
|
||||||
CachePath = ./cache/
|
|
||||||
; whether we should detect changes to script modules and reload them
|
|
||||||
HotSwap = true
|
|
||||||
|
|
||||||
[Network]
|
|
||||||
DisconnectTimeout = 20
|
|
||||||
|
|
||||||
[ZoneNetwork]
|
|
||||||
ListenIp = 0.0.0.0
|
|
||||||
ListenPort = 54992
|
|
||||||
|
|
||||||
[General]
|
|
||||||
; Sent on login - each line must be shorter than 307 characters, split lines with ';'
|
|
||||||
MotD = Welcome to Sapphire!;This is a very good server;You can change these messages by editing General.MotD in config/zone.ini
|
|
|
@ -10,43 +10,44 @@
|
||||||
*/
|
*/
|
||||||
bool Core::ConfigMgr::loadConfig( const std::string& configName )
|
bool Core::ConfigMgr::loadConfig( const std::string& configName )
|
||||||
{
|
{
|
||||||
std::stringstream configStream;
|
// std::stringstream configStream;
|
||||||
|
|
||||||
// get global config
|
// get global config
|
||||||
auto configDir = std::experimental::filesystem::path( m_configFolderRoot );
|
auto configDir = std::experimental::filesystem::path( m_configFolderRoot );
|
||||||
|
|
||||||
if( !std::experimental::filesystem::exists( configDir ) )
|
// if( !std::experimental::filesystem::exists( configDir ) )
|
||||||
{
|
// {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
auto globalConfig = std::experimental::filesystem::path( configDir / m_globalConfigFile );
|
// auto globalConfig = std::experimental::filesystem::path( configDir / m_globalConfigFile );
|
||||||
if( !std::experimental::filesystem::exists( globalConfig ) )
|
// if( !std::experimental::filesystem::exists( globalConfig ) )
|
||||||
{
|
// {
|
||||||
if( !copyDefaultConfig( globalConfig.filename().string() ) )
|
// if( !copyDefaultConfig( globalConfig.filename().string() ) )
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
std::ifstream globalConfigFile( globalConfig.c_str() );
|
// std::ifstream globalConfigFile( globalConfig.c_str() );
|
||||||
configStream << globalConfigFile.rdbuf();
|
// configStream << globalConfigFile.rdbuf();
|
||||||
|
|
||||||
// add some newlines just in case there's no newline at the end of the global file
|
// // add some newlines just in case there's no newline at the end of the global file
|
||||||
configStream << "\n\n";
|
// configStream << "\n\n";
|
||||||
|
|
||||||
// get local config
|
// // get local config
|
||||||
auto localConfig = std::experimental::filesystem::path( configDir / configName );
|
// auto localConfig = ;
|
||||||
if( !std::experimental::filesystem::exists( localConfig ) )
|
// if( !std::experimental::filesystem::exists( localConfig ) )
|
||||||
{
|
// {
|
||||||
if( !copyDefaultConfig( localConfig.filename().string() ) )
|
// if( !copyDefaultConfig( localConfig.filename().string() ) )
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
std::ifstream configFile( localConfig.c_str() );
|
// std::ifstream configFile( localConfig.c_str() );
|
||||||
configStream << configFile.rdbuf();
|
// configStream << configFile.rdbuf();
|
||||||
|
|
||||||
// parse the trxee and we're fuckin done
|
// // parse the trxee and we're fuckin done
|
||||||
//boost::property_tree::read_ini( configStream, m_propTree );
|
// //boost::property_tree::read_ini( configStream, m_propTree );
|
||||||
|
|
||||||
m_pInih = std::unique_ptr< INIReader >( new INIReader( localConfig ) );
|
m_pInih = std::unique_ptr< INIReader >( new INIReader(
|
||||||
|
std::experimental::filesystem::path( configDir / configName ) ) );
|
||||||
|
|
||||||
if( m_pInih->ParseError() < 0 )
|
if( m_pInih->ParseError() < 0 )
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -20,30 +20,30 @@ public:
|
||||||
template<class T> struct always_false : std::false_type {};
|
template<class T> struct always_false : std::false_type {};
|
||||||
|
|
||||||
template< class T >
|
template< class T >
|
||||||
T getValue( const std::string& name, T defaultValue = T() )
|
T getValue( const std::string& section, const std::string& name, T defaultValue = T() )
|
||||||
{
|
{
|
||||||
if constexpr (std::is_same_v<T, uint32_t>)
|
if constexpr (std::is_same_v<T, uint32_t>)
|
||||||
return m_pInih->GetInteger( "", name, defaultValue );
|
return m_pInih->GetInteger( section, name, defaultValue );
|
||||||
else if constexpr (std::is_same_v<T, int32_t>)
|
else if constexpr (std::is_same_v<T, int32_t>)
|
||||||
return m_pInih->GetInteger( "", name, defaultValue );
|
return m_pInih->GetInteger( section, name, defaultValue );
|
||||||
else if constexpr (std::is_same_v<T, uint16_t>)
|
else if constexpr (std::is_same_v<T, uint16_t>)
|
||||||
return m_pInih->GetInteger( "", name, defaultValue );
|
return m_pInih->GetInteger( section, name, defaultValue );
|
||||||
else if constexpr (std::is_same_v<T, int16_t>)
|
else if constexpr (std::is_same_v<T, int16_t>)
|
||||||
return m_pInih->GetInteger( "", name, defaultValue );
|
return m_pInih->GetInteger( section, name, defaultValue );
|
||||||
else if constexpr (std::is_same_v<T, uint8_t>)
|
else if constexpr (std::is_same_v<T, uint8_t>)
|
||||||
return m_pInih->GetInteger( "", name, defaultValue );
|
return m_pInih->GetInteger( section, name, defaultValue );
|
||||||
else if constexpr (std::is_same_v<T, int8_t>)
|
else if constexpr (std::is_same_v<T, int8_t>)
|
||||||
return m_pInih->GetInteger( "", name, defaultValue );
|
return m_pInih->GetInteger( section, name, defaultValue );
|
||||||
else if constexpr (std::is_same_v<T, long>)
|
else if constexpr (std::is_same_v<T, long>)
|
||||||
return m_pInih->GetInteger( "", name, defaultValue );
|
return m_pInih->GetInteger( section, name, defaultValue );
|
||||||
else if constexpr (std::is_same_v<T, double>)
|
else if constexpr (std::is_same_v<T, double>)
|
||||||
return m_pInih->GetReal( "", name, defaultValue );
|
return m_pInih->GetReal( section, name, defaultValue );
|
||||||
else if constexpr (std::is_same_v<T, float>)
|
else if constexpr (std::is_same_v<T, float>)
|
||||||
return m_pInih->GetReal( "", name, defaultValue );
|
return m_pInih->GetReal( section, 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( section, name, defaultValue );
|
||||||
else if constexpr (std::is_same_v<T, bool>)
|
else if constexpr (std::is_same_v<T, bool>)
|
||||||
return m_pInih->GetBoolean( "", name, defaultValue );
|
return m_pInih->GetBoolean( section, name, defaultValue );
|
||||||
else
|
else
|
||||||
static_assert(always_false<T>::value, "non-exhaustive getter!");
|
static_assert(always_false<T>::value, "non-exhaustive getter!");
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ void default_resource_send( const HttpServer& server, const shared_ptr< HttpServ
|
||||||
|
|
||||||
auto m_pConfig = std::make_shared< Core::ConfigMgr >();
|
auto m_pConfig = std::make_shared< Core::ConfigMgr >();
|
||||||
HttpServer server;
|
HttpServer server;
|
||||||
std::string configPath( "rest.ini" );
|
std::string configPath( "config.ini" );
|
||||||
|
|
||||||
void reloadConfig()
|
void reloadConfig()
|
||||||
{
|
{
|
||||||
|
@ -143,7 +143,7 @@ bool loadSettings( int32_t argc, char* argv[] )
|
||||||
}
|
}
|
||||||
|
|
||||||
g_log.info( "Setting up generated EXD data" );
|
g_log.info( "Setting up generated EXD data" );
|
||||||
if( !g_exdDataGen.init( m_pConfig->getValue< std::string >( "GlobalParameters.DataPath", "" ) ) )
|
if( !g_exdDataGen.init( m_pConfig->getValue< std::string >( "GlobalParameters", "DataPath", "" ) ) )
|
||||||
{
|
{
|
||||||
g_log.fatal( "Error setting up generated EXD data " );
|
g_log.fatal( "Error setting up generated EXD data " );
|
||||||
return false;
|
return false;
|
||||||
|
@ -152,21 +152,21 @@ bool loadSettings( int32_t argc, char* argv[] )
|
||||||
Core::Db::DbLoader loader;
|
Core::Db::DbLoader loader;
|
||||||
|
|
||||||
Core::Db::ConnectionInfo info;
|
Core::Db::ConnectionInfo info;
|
||||||
info.password = m_pConfig->getValue< std::string >( "Database.Password", "" );
|
info.password = m_pConfig->getValue< std::string >( "Database", "Password", "" );
|
||||||
info.host = m_pConfig->getValue< std::string >( "Database.Host", "127.0.0.1" );
|
info.host = m_pConfig->getValue< std::string >( "Database", "Host", "127.0.0.1" );
|
||||||
info.database = m_pConfig->getValue< std::string >( "Database.Database", "sapphire" );
|
info.database = m_pConfig->getValue< std::string >( "Database", "Database", "sapphire" );
|
||||||
info.port = m_pConfig->getValue< uint16_t >( "Database.Port", 3306 );
|
info.port = m_pConfig->getValue< uint16_t >( "Database", "Port", 3306 );
|
||||||
info.user = m_pConfig->getValue< std::string >( "Database.Username", "root" );
|
info.user = m_pConfig->getValue< std::string >( "Database", "Username", "root" );
|
||||||
info.syncThreads = m_pConfig->getValue< uint8_t >( "Database.SyncThreads", 2 );
|
info.syncThreads = m_pConfig->getValue< uint8_t >( "Database", "SyncThreads", 2 );
|
||||||
info.asyncThreads = m_pConfig->getValue< uint8_t >( "Database.AsyncThreads", 2 );
|
info.asyncThreads = m_pConfig->getValue< uint8_t >( "Database", "AsyncThreads", 2 );
|
||||||
|
|
||||||
loader.addDb( g_charaDb, info );
|
loader.addDb( g_charaDb, info );
|
||||||
if( !loader.initDbs() )
|
if( !loader.initDbs() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
server.config.port = static_cast< uint16_t >( std::stoul(
|
server.config.port = static_cast< uint16_t >( std::stoul(
|
||||||
m_pConfig->getValue< std::string >( "RestNetwork.ListenPort", "80" ) ) );
|
m_pConfig->getValue< std::string >( "RestNetwork", "ListenPort", "80" ) ) );
|
||||||
server.config.address = m_pConfig->getValue< std::string >( "RestNetwork.ListenIp", "0.0.0.0" );
|
server.config.address = m_pConfig->getValue< std::string >( "RestNetwork", "ListenIp", "0.0.0.0" );
|
||||||
|
|
||||||
g_log.info( "Database: Connected to " + info.host + ":" + std::to_string( info.port ) );
|
g_log.info( "Database: Connected to " + info.host + ":" + std::to_string( info.port ) );
|
||||||
|
|
||||||
|
@ -270,9 +270,9 @@ void createAccount( shared_ptr< HttpServer::Response > response, shared_ptr< Htt
|
||||||
{
|
{
|
||||||
std::string json_string = "{\"sId\":\"" + sId +
|
std::string json_string = "{\"sId\":\"" + sId +
|
||||||
"\", \"lobbyHost\":\"" +
|
"\", \"lobbyHost\":\"" +
|
||||||
m_pConfig->getValue< std::string >( "GlobalNetwork.LobbyHost" ) +
|
m_pConfig->getValue< std::string >( "GlobalNetwork", "LobbyHost" ) +
|
||||||
"\", \"frontierHost\":\"" +
|
"\", \"frontierHost\":\"" +
|
||||||
m_pConfig->getValue< std::string >( "GlobalNetwork.RestHost" ) + "\"}";
|
m_pConfig->getValue< std::string >( "GlobalNetwork", "RestHost" ) + "\"}";
|
||||||
*response << buildHttpResponse( 200, json_string, JSON );
|
*response << buildHttpResponse( 200, json_string, JSON );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -304,9 +304,9 @@ void login( shared_ptr< HttpServer::Response > response, shared_ptr< HttpServer:
|
||||||
{
|
{
|
||||||
std::string json_string = "{\"sId\":\"" + sId +
|
std::string json_string = "{\"sId\":\"" + sId +
|
||||||
"\", \"lobbyHost\":\"" +
|
"\", \"lobbyHost\":\"" +
|
||||||
m_pConfig->getValue< std::string >( "GlobalNetwork.LobbyHost" ) +
|
m_pConfig->getValue< std::string >( "GlobalNetwork", "LobbyHost" ) +
|
||||||
"\", \"frontierHost\":\"" +
|
"\", \"frontierHost\":\"" +
|
||||||
m_pConfig->getValue< std::string >( "GlobalNetwork.RestHost" ) + "\"}";
|
m_pConfig->getValue< std::string >( "GlobalNetwork", "RestHost" ) + "\"}";
|
||||||
*response << buildHttpResponse( 200, json_string, JSON );
|
*response << buildHttpResponse( 200, json_string, JSON );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -337,7 +337,7 @@ void deleteCharacter( shared_ptr< HttpServer::Response > response, shared_ptr< H
|
||||||
|
|
||||||
int32_t accountId = g_sapphireAPI.checkSession( sId );
|
int32_t accountId = g_sapphireAPI.checkSession( sId );
|
||||||
|
|
||||||
if( m_pConfig->getValue< std::string >( "GlobalParameters.ServerSecret" ) != secret )
|
if( m_pConfig->getValue< std::string >( "GlobalParameters", "ServerSecret" ) != secret )
|
||||||
{
|
{
|
||||||
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
||||||
*response << buildHttpResponse( 403, json_string, JSON );
|
*response << buildHttpResponse( 403, json_string, JSON );
|
||||||
|
@ -378,7 +378,7 @@ void createCharacter( shared_ptr< HttpServer::Response > response, shared_ptr< H
|
||||||
|
|
||||||
if( result != -1 )
|
if( result != -1 )
|
||||||
{
|
{
|
||||||
if( m_pConfig->getValue< std::string >( "GlobalParameters.ServerSecret" ) != secret )
|
if( m_pConfig->getValue< std::string >( "GlobalParameters", "ServerSecret" ) != secret )
|
||||||
{
|
{
|
||||||
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
||||||
*response << buildHttpResponse( 403, json_string, JSON );
|
*response << buildHttpResponse( 403, json_string, JSON );
|
||||||
|
@ -386,7 +386,7 @@ void createCharacter( shared_ptr< HttpServer::Response > response, shared_ptr< H
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int32_t charId = g_sapphireAPI.createCharacter( result, name, finalJson, m_pConfig->getValue< uint8_t >(
|
int32_t charId = g_sapphireAPI.createCharacter( result, name, finalJson, m_pConfig->getValue< uint8_t >(
|
||||||
"CharacterCreation.DefaultGMRank", 255 ) );
|
"CharacterCreation", "DefaultGMRank", 255 ) );
|
||||||
|
|
||||||
std::string json_string = "{\"result\":\"" + std::to_string( charId ) + "\"}";
|
std::string json_string = "{\"result\":\"" + std::to_string( charId ) + "\"}";
|
||||||
*response << buildHttpResponse( 200, json_string, JSON );
|
*response << buildHttpResponse( 200, json_string, JSON );
|
||||||
|
@ -419,7 +419,7 @@ void insertSession( shared_ptr< HttpServer::Response > response, shared_ptr< Htt
|
||||||
uint32_t accountId = pt.get< uint32_t >( "accountId" );
|
uint32_t accountId = pt.get< uint32_t >( "accountId" );
|
||||||
std::string secret = pt.get< string >( "secret" );
|
std::string secret = pt.get< string >( "secret" );
|
||||||
// reloadConfig();
|
// reloadConfig();
|
||||||
if( m_pConfig->getValue< std::string >( "GlobalParameters.ServerSecret" ) != secret )
|
if( m_pConfig->getValue< std::string >( "GlobalParameters", "ServerSecret" ) != secret )
|
||||||
{
|
{
|
||||||
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
||||||
*response << buildHttpResponse( 403, json_string, JSON );
|
*response << buildHttpResponse( 403, json_string, JSON );
|
||||||
|
@ -453,7 +453,7 @@ void checkNameTaken( shared_ptr< HttpServer::Response > response, shared_ptr< Ht
|
||||||
|
|
||||||
// reloadConfig();
|
// reloadConfig();
|
||||||
|
|
||||||
if( m_pConfig->getValue< std::string >( "GlobalParameters.ServerSecret" ) != secret )
|
if( m_pConfig->getValue< std::string >( "GlobalParameters", "ServerSecret" ) != secret )
|
||||||
{
|
{
|
||||||
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
||||||
*response << buildHttpResponse( 403, json_string, JSON );
|
*response << buildHttpResponse( 403, json_string, JSON );
|
||||||
|
@ -491,7 +491,7 @@ void checkSession( shared_ptr< HttpServer::Response > response, shared_ptr< Http
|
||||||
|
|
||||||
if( result != -1 )
|
if( result != -1 )
|
||||||
{
|
{
|
||||||
if( m_pConfig->getValue< std::string >( "GlobalParameters.ServerSecret" ) != secret )
|
if( m_pConfig->getValue< std::string >( "GlobalParameters", "ServerSecret" ) != secret )
|
||||||
{
|
{
|
||||||
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
||||||
*response << buildHttpResponse( 403, json_string, JSON );
|
*response << buildHttpResponse( 403, json_string, JSON );
|
||||||
|
@ -528,7 +528,7 @@ void getNextCharId( shared_ptr< HttpServer::Response > response, shared_ptr< Htt
|
||||||
|
|
||||||
// reloadConfig();
|
// reloadConfig();
|
||||||
|
|
||||||
if( m_pConfig->getValue< std::string >( "GlobalParameters.ServerSecret" ) != secret )
|
if( m_pConfig->getValue< std::string >( "GlobalParameters", "ServerSecret" ) != secret )
|
||||||
{
|
{
|
||||||
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
||||||
*response << buildHttpResponse( 403, json_string, JSON );
|
*response << buildHttpResponse( 403, json_string, JSON );
|
||||||
|
@ -560,7 +560,7 @@ void getNextContentId( shared_ptr< HttpServer::Response > response, shared_ptr<
|
||||||
|
|
||||||
// reloadConfig();
|
// reloadConfig();
|
||||||
|
|
||||||
if( m_pConfig->getValue< std::string >( "GlobalParameters.ServerSecret" ) != secret )
|
if( m_pConfig->getValue< std::string >( "GlobalParameters", "ServerSecret" ) != secret )
|
||||||
{
|
{
|
||||||
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
||||||
*response << buildHttpResponse( 403, json_string, JSON );
|
*response << buildHttpResponse( 403, json_string, JSON );
|
||||||
|
@ -596,7 +596,7 @@ void getCharacterList( shared_ptr< HttpServer::Response > response, shared_ptr<
|
||||||
|
|
||||||
if( result != -1 )
|
if( result != -1 )
|
||||||
{
|
{
|
||||||
if( m_pConfig->getValue< std::string >( "GlobalParameters.ServerSecret" ) != secret )
|
if( m_pConfig->getValue< std::string >( "GlobalParameters", "ServerSecret" ) != secret )
|
||||||
{
|
{
|
||||||
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
std::string json_string = "{\"result\":\"invalid_secret\"}";
|
||||||
*response << buildHttpResponse( 403, json_string, JSON );
|
*response << buildHttpResponse( 403, json_string, JSON );
|
||||||
|
@ -783,8 +783,8 @@ int main( int argc, char* argv[] )
|
||||||
server.start();
|
server.start();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
g_log.info( "API server running on " + m_pConfig->getValue< std::string >( "RestNetwork.ListenIp", "0.0.0.0" ) + ":" +
|
g_log.info( "API server running on " + m_pConfig->getValue< std::string >( "RestNetwork", "ListenIp", "0.0.0.0" ) + ":" +
|
||||||
m_pConfig->getValue< std::string >( "RestNetwork.ListenPort", "80" ) );
|
m_pConfig->getValue< std::string >( "RestNetwork", "ListenPort", "80" ) );
|
||||||
|
|
||||||
//Wait for server to start so that the client can connect
|
//Wait for server to start so that the client can connect
|
||||||
this_thread::sleep_for( chrono::seconds( 1 ) );
|
this_thread::sleep_for( chrono::seconds( 1 ) );
|
||||||
|
|
|
@ -126,11 +126,11 @@ void Core::Network::GameConnection::getCharList( FFXIVARR_PACKET_RAW& packet, ui
|
||||||
serverListPacket->data().seq = 1;
|
serverListPacket->data().seq = 1;
|
||||||
serverListPacket->data().offset = 0;
|
serverListPacket->data().offset = 0;
|
||||||
serverListPacket->data().numServers = 1;
|
serverListPacket->data().numServers = 1;
|
||||||
serverListPacket->data().server[ 0 ].id = g_serverLobby.getConfig()->getValue< uint16_t >( "Lobby.WorldID", 1 );
|
serverListPacket->data().server[ 0 ].id = g_serverLobby.getConfig()->getValue< uint16_t >( "Lobby", "WorldID", 1 );
|
||||||
serverListPacket->data().server[ 0 ].index = 0;
|
serverListPacket->data().server[ 0 ].index = 0;
|
||||||
serverListPacket->data().final = 1;
|
serverListPacket->data().final = 1;
|
||||||
strcpy( serverListPacket->data().server[ 0 ].name,
|
strcpy( serverListPacket->data().server[ 0 ].name,
|
||||||
g_serverLobby.getConfig()->getValue< std::string >( "Lobby.WorldName", "Sapphire" ).c_str() );
|
g_serverLobby.getConfig()->getValue< std::string >( "Lobby", "WorldName", "Sapphire" ).c_str() );
|
||||||
pRP.addPacket( serverListPacket );
|
pRP.addPacket( serverListPacket );
|
||||||
|
|
||||||
auto retainerListPacket = makeLobbyPacket< FFXIVIpcRetainerList >( tmpId );
|
auto retainerListPacket = makeLobbyPacket< FFXIVIpcRetainerList >( tmpId );
|
||||||
|
@ -160,15 +160,15 @@ void Core::Network::GameConnection::getCharList( FFXIVARR_PACKET_RAW& packet, ui
|
||||||
auto& charEntry = charList[ charIndex ];
|
auto& charEntry = charList[ charIndex ];
|
||||||
details.uniqueId = std::get< 1 >( charEntry );
|
details.uniqueId = std::get< 1 >( charEntry );
|
||||||
details.contentId = std::get< 2 >( charEntry );
|
details.contentId = std::get< 2 >( charEntry );
|
||||||
details.serverId = g_serverLobby.getConfig()->getValue< uint16_t >( "Lobby.WorldID", 1 );
|
details.serverId = g_serverLobby.getConfig()->getValue< uint16_t >( "Lobby", "WorldID", 1 );
|
||||||
details.serverId1 = g_serverLobby.getConfig()->getValue< uint16_t >( "Lobby.WorldID", 1 );
|
details.serverId1 = g_serverLobby.getConfig()->getValue< uint16_t >( "Lobby", "WorldID", 1 );
|
||||||
details.index = charIndex;
|
details.index = charIndex;
|
||||||
strcpy( details.charDetailJson, std::get< 3 >( charEntry ).c_str() );
|
strcpy( details.charDetailJson, std::get< 3 >( charEntry ).c_str() );
|
||||||
strcpy( details.nameChara, std::get< 0 >( charEntry ).c_str() );
|
strcpy( details.nameChara, std::get< 0 >( charEntry ).c_str() );
|
||||||
strcpy( details.nameServer,
|
strcpy( details.nameServer,
|
||||||
g_serverLobby.getConfig()->getValue< std::string >( "Lobby.WorldName", "Sapphire" ).c_str() );
|
g_serverLobby.getConfig()->getValue< std::string >( "Lobby", "WorldName", "Sapphire" ).c_str() );
|
||||||
strcpy( details.nameServer1,
|
strcpy( details.nameServer1,
|
||||||
g_serverLobby.getConfig()->getValue< std::string >( "Lobby.WorldName", "Sapphire" ).c_str() );
|
g_serverLobby.getConfig()->getValue< std::string >( "Lobby", "WorldName", "Sapphire" ).c_str() );
|
||||||
|
|
||||||
charListPacket->data().charaDetails[ j ] = details;
|
charListPacket->data().charaDetails[ j ] = details;
|
||||||
|
|
||||||
|
@ -235,8 +235,8 @@ void Core::Network::GameConnection::enterWorld( FFXIVARR_PACKET_RAW& packet, uin
|
||||||
enterWorldPacket->data().contentId = lookupId;
|
enterWorldPacket->data().contentId = lookupId;
|
||||||
enterWorldPacket->data().seq = sequence;
|
enterWorldPacket->data().seq = sequence;
|
||||||
strcpy( enterWorldPacket->data().host,
|
strcpy( enterWorldPacket->data().host,
|
||||||
g_serverLobby.getConfig()->getValue< std::string >( "GlobalNetwork.ZoneHost" ).c_str() );
|
g_serverLobby.getConfig()->getValue< std::string >( "GlobalNetwork", "ZoneHost" ).c_str() );
|
||||||
enterWorldPacket->data().port = g_serverLobby.getConfig()->getValue< uint16_t >( "GlobalNetwork.ZonePort" );
|
enterWorldPacket->data().port = g_serverLobby.getConfig()->getValue< uint16_t >( "GlobalNetwork", "ZonePort" );
|
||||||
enterWorldPacket->data().charId = logInCharId;
|
enterWorldPacket->data().charId = logInCharId;
|
||||||
memcpy( enterWorldPacket->data().sid, m_pSession->getSessionId(), 66 );
|
memcpy( enterWorldPacket->data().sid, m_pSession->getSessionId(), 66 );
|
||||||
pRP.addPacket( enterWorldPacket );
|
pRP.addPacket( enterWorldPacket );
|
||||||
|
@ -247,7 +247,7 @@ bool Core::Network::GameConnection::sendServiceAccountList( FFXIVARR_PACKET_RAW&
|
||||||
{
|
{
|
||||||
LobbySessionPtr pSession = g_serverLobby.getSession( ( char* ) &packet.data[ 0 ] + 0x20 );
|
LobbySessionPtr pSession = g_serverLobby.getSession( ( char* ) &packet.data[ 0 ] + 0x20 );
|
||||||
|
|
||||||
if( g_serverLobby.getConfig()->getValue< bool >( "Lobby.AllowNoSessionConnect" ) && pSession == nullptr )
|
if( g_serverLobby.getConfig()->getValue< bool >( "Lobby", "AllowNoSessionConnect" ) && pSession == nullptr )
|
||||||
{
|
{
|
||||||
auto session = make_LobbySession();
|
auto session = make_LobbySession();
|
||||||
session->setAccountID( 0 );
|
session->setAccountID( 0 );
|
||||||
|
@ -318,7 +318,7 @@ bool Core::Network::GameConnection::createOrModifyChar( FFXIVARR_PACKET_RAW& pac
|
||||||
charCreatePacket->data().content_id = newContentId;
|
charCreatePacket->data().content_id = newContentId;
|
||||||
strcpy( charCreatePacket->data().name, name.c_str() );
|
strcpy( charCreatePacket->data().name, name.c_str() );
|
||||||
strcpy( charCreatePacket->data().world,
|
strcpy( charCreatePacket->data().world,
|
||||||
g_serverLobby.getConfig()->getValue< std::string >( "Lobby.WorldName", "Sapphire" ).c_str() );
|
g_serverLobby.getConfig()->getValue< std::string >( "Lobby", "WorldName", "Sapphire" ).c_str() );
|
||||||
charCreatePacket->data().type = 1;
|
charCreatePacket->data().type = 1;
|
||||||
charCreatePacket->data().seq = sequence;
|
charCreatePacket->data().seq = sequence;
|
||||||
charCreatePacket->data().unknown = 1;
|
charCreatePacket->data().unknown = 1;
|
||||||
|
@ -342,9 +342,9 @@ bool Core::Network::GameConnection::createOrModifyChar( FFXIVARR_PACKET_RAW& pac
|
||||||
charCreatePacket->data().content_id = newContentId;
|
charCreatePacket->data().content_id = newContentId;
|
||||||
strcpy( charCreatePacket->data().name, name.c_str() );
|
strcpy( charCreatePacket->data().name, name.c_str() );
|
||||||
strcpy( charCreatePacket->data().world,
|
strcpy( charCreatePacket->data().world,
|
||||||
g_serverLobby.getConfig()->getValue< std::string >( "Lobby.WorldName", "Sapphire" ).c_str() );
|
g_serverLobby.getConfig()->getValue< std::string >( "Lobby", "WorldName", "Sapphire" ).c_str() );
|
||||||
strcpy( charCreatePacket->data().world2,
|
strcpy( charCreatePacket->data().world2,
|
||||||
g_serverLobby.getConfig()->getValue< std::string >( "Lobby.WorldName", "Sapphire" ).c_str() );
|
g_serverLobby.getConfig()->getValue< std::string >( "Lobby", "WorldName", "Sapphire" ).c_str() );
|
||||||
charCreatePacket->data().type = 2;
|
charCreatePacket->data().type = 2;
|
||||||
charCreatePacket->data().seq = sequence;
|
charCreatePacket->data().seq = sequence;
|
||||||
charCreatePacket->data().unknown = 1;
|
charCreatePacket->data().unknown = 1;
|
||||||
|
@ -373,7 +373,7 @@ bool Core::Network::GameConnection::createOrModifyChar( FFXIVARR_PACKET_RAW& pac
|
||||||
charCreatePacket->data().content_id = 0;
|
charCreatePacket->data().content_id = 0;
|
||||||
strcpy( charCreatePacket->data().name, name.c_str() );
|
strcpy( charCreatePacket->data().name, name.c_str() );
|
||||||
strcpy( charCreatePacket->data().world,
|
strcpy( charCreatePacket->data().world,
|
||||||
g_serverLobby.getConfig()->getValue< std::string >( "Lobby.WorldName", "Sapphire" ).c_str() );
|
g_serverLobby.getConfig()->getValue< std::string >( "Lobby", "WorldName", "Sapphire" ).c_str() );
|
||||||
charCreatePacket->data().type = 4;
|
charCreatePacket->data().type = 4;
|
||||||
charCreatePacket->data().seq = sequence;
|
charCreatePacket->data().seq = sequence;
|
||||||
charCreatePacket->data().unknown = 1;
|
charCreatePacket->data().unknown = 1;
|
||||||
|
|
|
@ -73,8 +73,8 @@ void ServerLobby::run( int32_t argc, char* argv[] )
|
||||||
Network::addServerToHive< Network::GameConnection >( m_ip, m_port, hive );
|
Network::addServerToHive< Network::GameConnection >( m_ip, m_port, hive );
|
||||||
|
|
||||||
g_log.info(
|
g_log.info(
|
||||||
"Lobby server running on " + m_pConfig->getValue< std::string >( "LobbyNetwork.ListenIp", "0.0.0.0" ) + ":" +
|
"Lobby server running on " + m_pConfig->getValue< std::string >( "LobbyNetwork", "ListenIp", "0.0.0.0" ) + ":" +
|
||||||
m_pConfig->getValue< std::string >( "LobbyNetwork.ListenPort", "80" ) );
|
m_pConfig->getValue< std::string >( "LobbyNetwork", "ListenPort", "80" ) );
|
||||||
|
|
||||||
boost::thread_group worker_threads;
|
boost::thread_group worker_threads;
|
||||||
worker_threads.create_thread( boost::bind( &Network::Hive::Run, hive.get() ) );
|
worker_threads.create_thread( boost::bind( &Network::Hive::Run, hive.get() ) );
|
||||||
|
@ -130,12 +130,12 @@ bool ServerLobby::loadSettings( int32_t argc, char* argv[] )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_port = m_pConfig->getValue< uint16_t >( "LobbyNetwork.ListenPort", 54994 );
|
m_port = m_pConfig->getValue< uint16_t >( "LobbyNetwork", "ListenPort", 54994 );
|
||||||
m_ip = m_pConfig->getValue< std::string >( "LobbyNetwork.ListenIp", "0.0.0.0" );
|
m_ip = m_pConfig->getValue< std::string >( "LobbyNetwork", "ListenIp", "0.0.0.0" );
|
||||||
|
|
||||||
g_restConnector.restHost = m_pConfig->getValue< std::string >( "GlobalNetwork.RestHost" ) + ":" +
|
g_restConnector.restHost = m_pConfig->getValue< std::string >( "GlobalNetwork", "RestHost" ) + ":" +
|
||||||
m_pConfig->getValue< std::string >( "GlobalNetwork.RestPort" );
|
m_pConfig->getValue< std::string >( "GlobalNetwork", "RestPort" );
|
||||||
g_restConnector.serverSecret = m_pConfig->getValue< std::string >( "GlobalParameters.ServerSecret" );
|
g_restConnector.serverSecret = m_pConfig->getValue< std::string >( "GlobalParameters", "ServerSecret" );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "ServerLobby.h"
|
#include "ServerLobby.h"
|
||||||
|
|
||||||
Core::ServerLobby g_serverLobby( "lobby.ini" );
|
Core::ServerLobby g_serverLobby( "config.ini" );
|
||||||
|
|
||||||
int main( int32_t argc, char* argv[] )
|
int main( int32_t argc, char* argv[] )
|
||||||
{
|
{
|
||||||
|
|
|
@ -333,7 +333,7 @@ void Core::Entity::Player::eventItemActionStart( uint32_t eventId,
|
||||||
void Core::Entity::Player::onLogin()
|
void Core::Entity::Player::onLogin()
|
||||||
{
|
{
|
||||||
auto pConfig = g_fw.get< ConfigMgr >();
|
auto pConfig = g_fw.get< ConfigMgr >();
|
||||||
auto motd = pConfig->getValue< std::string >( "General.MotD", "" );
|
auto motd = pConfig->getValue< std::string >( "General", "MotD", "" );
|
||||||
|
|
||||||
std::istringstream ss( motd );
|
std::istringstream ss( motd );
|
||||||
std::string msg;
|
std::string msg;
|
||||||
|
|
|
@ -61,7 +61,7 @@ Core::Scripting::ScriptInfo* Core::Scripting::ScriptLoader::loadModule( const st
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy to temp dir
|
// copy to temp dir
|
||||||
fs::path cacheDir( f.parent_path() /= pConfig->getValue< std::string >( "Scripts.CachePath", "./cache/" ) );
|
fs::path cacheDir( f.parent_path() /= pConfig->getValue< std::string >( "Scripts", "CachePath", "./cache/" ) );
|
||||||
fs::create_directories( cacheDir );
|
fs::create_directories( cacheDir );
|
||||||
fs::path dest( cacheDir /= f.filename().string() );
|
fs::path dest( cacheDir /= f.filename().string() );
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ bool Core::Scripting::ScriptMgr::init()
|
||||||
auto pConfig = g_fw.get< ConfigMgr >();
|
auto pConfig = g_fw.get< ConfigMgr >();
|
||||||
auto pLog = g_fw.get< Logger >();
|
auto pLog = g_fw.get< Logger >();
|
||||||
|
|
||||||
auto status = loadDir( pConfig->getValue< std::string >( "Scripts.Path", "./compiledscripts/" ),
|
auto status = loadDir( pConfig->getValue< std::string >( "Scripts", "Path", "./compiledscripts/" ),
|
||||||
files, m_nativeScriptMgr->getModuleExtension() );
|
files, m_nativeScriptMgr->getModuleExtension() );
|
||||||
|
|
||||||
if( !status )
|
if( !status )
|
||||||
|
@ -90,11 +90,11 @@ bool Core::Scripting::ScriptMgr::init()
|
||||||
void Core::Scripting::ScriptMgr::watchDirectories()
|
void Core::Scripting::ScriptMgr::watchDirectories()
|
||||||
{
|
{
|
||||||
auto pConfig = g_fw.get< ConfigMgr >();
|
auto pConfig = g_fw.get< ConfigMgr >();
|
||||||
auto shouldWatch = pConfig->getValue< bool >( "Scripts.HotSwap", true );
|
auto shouldWatch = pConfig->getValue< bool >( "Scripts", "HotSwap", true );
|
||||||
if( !shouldWatch )
|
if( !shouldWatch )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Watchdog::watchMany( pConfig->getValue< std::string >( "Scripts.Path", "./compiledscripts/" ) + "*" +
|
Watchdog::watchMany( pConfig->getValue< std::string >( "Scripts", "Path", "./compiledscripts/" ) + "*" +
|
||||||
m_nativeScriptMgr->getModuleExtension(),
|
m_nativeScriptMgr->getModuleExtension(),
|
||||||
[ this ]( const std::vector< ci::fs::path >& paths )
|
[ this ]( const std::vector< ci::fs::path >& paths )
|
||||||
{
|
{
|
||||||
|
|
|
@ -124,7 +124,7 @@ bool Core::ServerZone::loadSettings( int32_t argc, char* argv[] )
|
||||||
}
|
}
|
||||||
|
|
||||||
pLog->info( "Setting up generated EXD data" );
|
pLog->info( "Setting up generated EXD data" );
|
||||||
if( !pExd->init( pConfig->getValue< std::string >( "GlobalParameters.DataPath", "" ) ) )
|
if( !pExd->init( pConfig->getValue< std::string >( "GlobalParameters", "DataPath", "" ) ) )
|
||||||
{
|
{
|
||||||
pLog->fatal( "Error setting up generated EXD data " );
|
pLog->fatal( "Error setting up generated EXD data " );
|
||||||
return false;
|
return false;
|
||||||
|
@ -133,20 +133,20 @@ bool Core::ServerZone::loadSettings( int32_t argc, char* argv[] )
|
||||||
Core::Db::DbLoader loader;
|
Core::Db::DbLoader loader;
|
||||||
|
|
||||||
Core::Db::ConnectionInfo info;
|
Core::Db::ConnectionInfo info;
|
||||||
info.password = pConfig->getValue< std::string >( "Database.Password", "" );
|
info.password = pConfig->getValue< std::string >( "Database", "Password", "" );
|
||||||
info.host = pConfig->getValue< std::string >( "Database.Host", "127.0.0.1" );
|
info.host = pConfig->getValue< std::string >( "Database", "Host", "127.0.0.1" );
|
||||||
info.database = pConfig->getValue< std::string >( "Database.Database", "sapphire" );
|
info.database = pConfig->getValue< std::string >( "Database", "Database", "sapphire" );
|
||||||
info.port = pConfig->getValue< uint16_t >( "Database.Port", 3306 );
|
info.port = pConfig->getValue< uint16_t >( "Database", "Port", 3306 );
|
||||||
info.user = pConfig->getValue< std::string >( "Database.Username", "root" );
|
info.user = pConfig->getValue< std::string >( "Database", "Username", "root" );
|
||||||
info.syncThreads = pConfig->getValue< uint8_t >( "Database.SyncThreads", 2 );
|
info.syncThreads = pConfig->getValue< uint8_t >( "Database", "SyncThreads", 2 );
|
||||||
info.asyncThreads = pConfig->getValue< uint8_t >( "Database.AsyncThreads", 2 );
|
info.asyncThreads = pConfig->getValue< uint8_t >( "Database", "AsyncThreads", 2 );
|
||||||
|
|
||||||
loader.addDb( *pDb, info );
|
loader.addDb( *pDb, info );
|
||||||
if( !loader.initDbs() )
|
if( !loader.initDbs() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_port = pConfig->getValue< uint16_t >( "ZoneNetwork.ListenPort", 54992 );
|
m_port = pConfig->getValue< uint16_t >( "ZoneNetwork", "ListenPort", 54992 );
|
||||||
m_ip = pConfig->getValue< std::string >( "ZoneNetwork.ListenIp", "0.0.0.0" );
|
m_ip = pConfig->getValue< std::string >( "ZoneNetwork", "ListenIp", "0.0.0.0" );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ using namespace Core;
|
||||||
|
|
||||||
bool setupFramework()
|
bool setupFramework()
|
||||||
{
|
{
|
||||||
auto pServer = std::make_shared< ServerZone >( "zone.ini" );
|
auto pServer = std::make_shared< ServerZone >( "config.ini" );
|
||||||
auto pLogger = std::make_shared< Logger >();
|
auto pLogger = std::make_shared< Logger >();
|
||||||
auto pExdData = std::make_shared< Data::ExdDataGenerated >();
|
auto pExdData = std::make_shared< Data::ExdDataGenerated >();
|
||||||
auto pScript = std::make_shared< Scripting::ScriptMgr >();
|
auto pScript = std::make_shared< Scripting::ScriptMgr >();
|
||||||
|
|
Loading…
Add table
Reference in a new issue