Added more path building stuff
Addeed text parsing API --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40350
This commit is contained in:
@@ -608,10 +608,13 @@ void AdminCache::DumpAdminCache(int cache_flags, bool rebuild)
|
||||
{
|
||||
List<IAdminListener *>::iterator iter;
|
||||
IAdminListener *pListener;
|
||||
cell_t result;
|
||||
for (iter=m_hooks.begin(); iter!=m_hooks.end(); iter++)
|
||||
{
|
||||
pListener = (*iter);
|
||||
pListener->OnRebuildAdminCache(cache_flags);
|
||||
}
|
||||
m_pCacheFwd->PushCell(cache_flags);
|
||||
m_pCacheFwd->Execute(&result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\public\smn_admin.cpp"
|
||||
RelativePath="..\smn_admin.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
||||
@@ -428,6 +428,18 @@ static cell_t sm_WriteFileLine(IPluginContext *pContext, const cell_t *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell_t sm_BuildPath(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
char path[PLATFORM_MAX_PATH], *fmt, *buffer;
|
||||
int arg = 4;
|
||||
pContext->LocalToString(params[2], &buffer);
|
||||
pContext->LocalToString(params[4], &fmt);
|
||||
|
||||
atcprintf(path, sizeof(path), fmt, pContext, params, &arg);
|
||||
|
||||
return g_SourceMod.BuildPath(Path_SM_Rel, buffer, params[3], "%s", path);
|
||||
}
|
||||
|
||||
static FileNatives s_FileNatives;
|
||||
|
||||
REGISTER_NATIVES(filesystem)
|
||||
@@ -446,5 +458,6 @@ REGISTER_NATIVES(filesystem)
|
||||
{"FileSize", sm_FileSize},
|
||||
{"RemoveDir", sm_RemoveDir},
|
||||
{"WriteFileLine", sm_WriteFileLine},
|
||||
{"BuildPath", sm_BuildPath},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
||||
@@ -48,6 +48,7 @@ bool SourceModBase::InitializeSourceMod(char *error, size_t err_max, bool late)
|
||||
{
|
||||
g_BaseDir.assign(g_SMAPI->GetBaseDir());
|
||||
g_LibSys.PathFormat(m_SMBaseDir, sizeof(m_SMBaseDir), "%s/addons/sourcemod", g_BaseDir.c_str());
|
||||
g_LibSys.PathFormat(m_SMRelDir, sizeof(m_SMRelDir), "addons/sourcemod");
|
||||
|
||||
/* Attempt to load the JIT! */
|
||||
char file[PLATFORM_MAX_PATH];
|
||||
@@ -229,6 +230,8 @@ size_t SourceModBase::BuildPath(PathType type, char *buffer, size_t maxlength, c
|
||||
base = GetModPath();
|
||||
} else if (type == Path_SM) {
|
||||
base = GetSourceModPath();
|
||||
} else if (type == Path_SM_Rel) {
|
||||
base = m_SMRelDir;
|
||||
}
|
||||
|
||||
if (base)
|
||||
|
||||
@@ -56,6 +56,7 @@ private:
|
||||
void DoGlobalPluginLoads();
|
||||
private:
|
||||
char m_SMBaseDir[PLATFORM_MAX_PATH+1];
|
||||
char m_SMRelDir[PLATFORM_MAX_PATH+1];
|
||||
bool m_IsMapLoading;
|
||||
bool m_ExecPluginReload;
|
||||
};
|
||||
|
||||
@@ -1487,7 +1487,7 @@ void CPluginManager::OnRootConsoleCommand(const char *command, unsigned int argc
|
||||
g_RootMenu.ConsolePrint(" Description: %s", info->description);
|
||||
}
|
||||
g_RootMenu.ConsolePrint(" Debugging: %s", pl->IsDebugging() ? "yes" : "no");
|
||||
g_RootMenu.ConsolePrint(" Paused: %s", pl->GetStatus() == Plugin_Running ? "yes" : "no");
|
||||
g_RootMenu.ConsolePrint(" Paused: %s", pl->GetStatus() == Plugin_Running ? "no" : "yes");
|
||||
} else {
|
||||
g_RootMenu.ConsolePrint(" Load error: %s", pl->m_errormsg);
|
||||
g_RootMenu.ConsolePrint(" File info: (title \"%s\") (version \"%s\")",
|
||||
|
||||
Reference in New Issue
Block a user