Move OnQueryCvarValueFinished into the global hook manager.

This commit is contained in:
David Anderson
2015-08-31 09:22:08 -07:00
parent 2ed044804d
commit 5d55ff23bd
12 changed files with 178 additions and 154 deletions
+31
View File
@@ -637,6 +637,32 @@ void CoreProviderImpl::UnloadMMSPlugin(int id)
g_pMMPlugins->Unload(id, true, ignore, sizeof(ignore));
}
bool CoreProviderImpl::IsClientConVarQueryingSupported()
{
return hooks_.GetQueryHookMode() != QueryHookMode::Unavailable;
}
int CoreProviderImpl::QueryClientConVar(int client, const char *cvar)
{
#if SOURCE_ENGINE != SE_DARKMESSIAH
switch (hooks_.GetQueryHookMode()) {
case QueryHookMode::DLL:
# if SOURCE_ENGINE == SE_DOTA
return ::engine->StartQueryCvarValue(CEntityIndex(client), cvar);
# else
return ::engine->StartQueryCvarValue(PEntityOfEntIndex(client), cvar);
# endif
case QueryHookMode::VSP:
# if SOURCE_ENGINE != SE_DOTA
return serverpluginhelpers->StartQueryCvarValue(PEntityOfEntIndex(client), cvar);
# endif
default:
return InvalidQueryCvarCookie;
}
#endif
return -1;
}
void CoreProviderImpl::InitializeBridge()
{
::serverGlobals.universalTime = g_pUniversalTime;
@@ -721,6 +747,11 @@ void CoreProviderImpl::InitializeHooks()
hooks_.Start();
}
void CoreProviderImpl::OnVSPReceived()
{
hooks_.OnVSPReceived();
}
void CoreProviderImpl::ShutdownHooks()
{
hooks_.Shutdown();