diff --git a/core/logic/Database.cpp b/core/logic/Database.cpp index 7da7ea47..c805765c 100644 --- a/core/logic/Database.cpp +++ b/core/logic/Database.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #define DBPARSE_LEVEL_NONE 0 #define DBPARSE_LEVEL_MAIN 1 @@ -63,7 +64,7 @@ void DBManager::OnSourceModAllInitialized() g_HandleSys.InitAccessDefaults(NULL, &sec); sec.access[HandleAccess_Delete] |= HANDLE_RESTRICT_IDENTITY; sec.access[HandleAccess_Clone] |= HANDLE_RESTRICT_IDENTITY; - + m_DriverType = g_HandleSys.CreateType("IDriver", this, 0, NULL, &sec, g_pCoreIdent, NULL); m_DatabaseType = g_HandleSys.CreateType("IDatabase", this, 0, NULL, NULL, g_pCoreIdent, NULL); @@ -73,8 +74,14 @@ void DBManager::OnSourceModAllInitialized() m_Builder.SetPath(m_Filename); g_PluginSys.AddPluginsListener(this); - + g_pSM->AddGameFrameHook(&FrameHook); + + auto sm_reload_databases = [this] (int client, const ICommandArgs *args) -> bool { + m_Builder.StartParse(); + return true; + }; + bridge->DefineCommand("sm_reload_databases", "Reparse database configurations file", sm_reload_databases); } void DBManager::OnSourceModLevelChange(const char *mapName) @@ -594,4 +601,3 @@ void DBManager::AddDependency(IExtension *myself, IDBDriver *driver) { g_Extensions.AddRawDependency(myself, driver->GetIdentity(), driver); } -