mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 05:57:45 +00:00
Merge pull request #184 from ayyaruq/bugfix/183-hardcoded-chaiscripts-path
Fix #183 hardcoded Chai scripts path
This commit is contained in:
commit
7ed3ee6f80
4 changed files with 13 additions and 2 deletions
|
@ -7,6 +7,8 @@
|
||||||
<ListenIp>127.0.0.1</ListenIp>
|
<ListenIp>127.0.0.1</ListenIp>
|
||||||
<!-- Path of FFXIV dat files -->
|
<!-- Path of FFXIV dat files -->
|
||||||
<DataPath>C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv</DataPath>
|
<DataPath>C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv</DataPath>
|
||||||
|
<!-- Path of Chai script files -->
|
||||||
|
<ScriptPath>../scripts/chai</ScriptPath>
|
||||||
<!-- Connection settings for the mysql db -->
|
<!-- Connection settings for the mysql db -->
|
||||||
<Mysql>
|
<Mysql>
|
||||||
<Host>127.0.0.1</Host>
|
<Host>127.0.0.1</Host>
|
||||||
|
|
|
@ -38,6 +38,8 @@ Core::Scripting::ScriptManager::~ScriptManager()
|
||||||
void Core::Scripting::ScriptManager::loadDir( std::string dirname, std::set<std::string>& chaiFiles )
|
void Core::Scripting::ScriptManager::loadDir( std::string dirname, std::set<std::string>& chaiFiles )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
g_log.info( "ScriptEngine: loading scripts from " + dirname );
|
||||||
|
|
||||||
boost::filesystem::path targetDir( dirname );
|
boost::filesystem::path targetDir( dirname );
|
||||||
|
|
||||||
boost::filesystem::recursive_directory_iterator iter( targetDir ), eod;
|
boost::filesystem::recursive_directory_iterator iter( targetDir ), eod;
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
#include <chaiscript/chaiscript.hpp>
|
#include <chaiscript/chaiscript.hpp>
|
||||||
|
|
||||||
|
#include <Server_Common/Config/XMLConfig.h>
|
||||||
#include <Server_Common/Logging/Logger.h>
|
#include <Server_Common/Logging/Logger.h>
|
||||||
#include <Server_Common/Script/ChaiscriptStdLib.h>
|
#include <Server_Common/Script/ChaiscriptStdLib.h>
|
||||||
|
|
||||||
|
#include "src/servers/Server_Zone/ServerZone.h"
|
||||||
|
|
||||||
#include "src/servers/Server_Zone/Script/ScriptManager.h"
|
#include "src/servers/Server_Zone/Script/ScriptManager.h"
|
||||||
|
|
||||||
#include "src/servers/Server_Zone/Zone/Zone.h"
|
#include "src/servers/Server_Zone/Zone/Zone.h"
|
||||||
|
@ -17,6 +20,7 @@
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
extern Core::Logger g_log;
|
extern Core::Logger g_log;
|
||||||
|
extern Core::ServerZone g_serverZone;
|
||||||
|
|
||||||
int Core::Scripting::ScriptManager::init()
|
int Core::Scripting::ScriptManager::init()
|
||||||
{
|
{
|
||||||
|
@ -169,8 +173,7 @@ int Core::Scripting::ScriptManager::init()
|
||||||
|
|
||||||
std::set< std::string > chaiFiles;
|
std::set< std::string > chaiFiles;
|
||||||
|
|
||||||
g_log.info( "ScriptEngine: Loading Scripts..." );
|
loadDir( g_serverZone.getConfig()->getValue< std::string >( "Settings.General.ScriptPath", "../scripts/chai" ), chaiFiles );
|
||||||
loadDir( "../scripts/chai", chaiFiles );
|
|
||||||
|
|
||||||
uint16_t scriptCount = 0;
|
uint16_t scriptCount = 0;
|
||||||
uint16_t errorCount = 0;
|
uint16_t errorCount = 0;
|
||||||
|
|
|
@ -129,6 +129,10 @@ bool Core::ServerZone::loadSettings( int32_t argc, char* argv[] )
|
||||||
{
|
{
|
||||||
m_pConfig->setValue< std::string >( "Settings.General.DataPath", val );
|
m_pConfig->setValue< std::string >( "Settings.General.DataPath", val );
|
||||||
}
|
}
|
||||||
|
else if( arg == "s" || arg == "scriptpath" )
|
||||||
|
{
|
||||||
|
m_pConfig->setValue< std::string >( "Settings.General.ScriptPath", val );
|
||||||
|
}
|
||||||
else if( arg == "h" || arg == "dbhost" )
|
else if( arg == "h" || arg == "dbhost" )
|
||||||
{
|
{
|
||||||
m_pConfig->setValue< std::string >( "Settings.General.Mysql.Host", val );
|
m_pConfig->setValue< std::string >( "Settings.General.Mysql.Host", val );
|
||||||
|
|
Loading…
Add table
Reference in a new issue