Added sm_reload_databases (#773)
Added command sm_reload_databases for refreshing "registered" Databases Configurations cache. Closes #772
This commit is contained in:
parent
c1d235a59c
commit
ccfd2ffe38
@ -37,6 +37,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <IThreader.h>
|
||||
#include <bridge/include/ILogger.h>
|
||||
#include <bridge/include/CoreProvider.h>
|
||||
|
||||
#define DBPARSE_LEVEL_NONE 0
|
||||
#define DBPARSE_LEVEL_MAIN 1
|
||||
@ -75,6 +76,12 @@ void DBManager::OnSourceModAllInitialized()
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user