1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 14:07:46 +00:00

fix hotloading setting, minor cleanup

This commit is contained in:
Adam 2018-01-18 13:56:55 +11:00
parent 1cbfccb1b3
commit 59e5a3a7f1
4 changed files with 5 additions and 4 deletions

View file

@ -13,7 +13,7 @@
<CachePath>./cache/</CachePath>
<HotSwap>
<Enabled>1</Enabled>
<Enabled>true</Enabled>
<ScriptsDir>../scripts/native/</ScriptsDir>
<BuildDir>../cmake-build-debug/</BuildDir>
<BuildCmd>cmake --build %1% --target %2%</BuildCmd>

View file

@ -40,8 +40,6 @@ namespace Scripting {
const std::string getModuleExtension();
bool isModuleLoaded( const std::string& name );
// todo: use some template magic (type_traits is_same?) to avoid ScriptType param
// not sure if worthwhile given that it adds an extra place where script types need to be managed
template< typename T >
T* getScript( uint32_t scriptId )
{

View file

@ -26,7 +26,6 @@ namespace Scripting {
ModuleHandle handle;
std::vector< ScriptObject* > scripts;
std::size_t type;
};
}
}

View file

@ -74,6 +74,10 @@ bool Core::Scripting::ScriptManager::init()
void Core::Scripting::ScriptManager::watchDirectories()
{
auto shouldWatch = g_serverZone.getConfig()->getValue< bool >( "Settings.General.Scripts.HotSwap.Enabled", true );
if( !shouldWatch )
return;
Watchdog::watchMany( g_serverZone.getConfig()->getValue< std::string >( "Settings.General.Scripts.Path", "./compiledscripts/" ) + "*" + m_nativeScriptManager->getModuleExtension(),
[ this ]( const std::vector< ci::fs::path >& paths )
{