1.1 --- a/core/ConVarManager.cpp Fri Nov 14 23:08:24 2008 -0600
1.2 +++ b/core/ConVarManager.cpp Mon Nov 17 22:11:06 2008 -0600
1.3 @@ -51,8 +51,6 @@
1.4 SH_DECL_HOOK2_void(ICvar, CallGlobalChangeCallbacks, SH_NOATTRIB, false, ConVar *, const char *);
1.5 #endif
1.6
1.7 -SH_DECL_HOOK1_void(ICvar, InstallGlobalChangeCallback, SH_NOATTRIB, false, FnChangeCallback_t);
1.8 -
1.9 SH_DECL_HOOK5_void(IServerGameDLL, OnQueryCvarValueFinished, SH_NOATTRIB, 0, QueryCvarCookie_t, edict_t *, EQueryCvarValueStatus, const char *, const char *);
1.10 SH_DECL_HOOK5_void(IServerPluginCallbacks, OnQueryCvarValueFinished, SH_NOATTRIB, 0, QueryCvarCookie_t, edict_t *, EQueryCvarValueStatus, const char *, const char *);
1.11
1.12 @@ -81,35 +79,6 @@
1.13 m_ConVarType = g_HandleSys.CreateType("ConVar", this, 0, NULL, &sec, g_pCoreIdent, NULL);
1.14 }
1.15
1.16 -bool GetFileOfAddress(void *pAddr, char *buffer, size_t maxlength)
1.17 -{
1.18 -#if defined WIN32 || defined _WIN32
1.19 - MEMORY_BASIC_INFORMATION mem;
1.20 - if (!VirtualQuery(pAddr, &mem, sizeof(mem)))
1.21 - return false;
1.22 - if (mem.AllocationBase == NULL)
1.23 - return false;
1.24 - HMODULE dll = (HMODULE)mem.AllocationBase;
1.25 - GetModuleFileName(dll, (LPTSTR)buffer, maxlength);
1.26 -#elif defined __linux__
1.27 - Dl_info info;
1.28 - if (!dladdr(pAddr, &info))
1.29 - return false;
1.30 - if (!info.dli_fbase || !info.dli_fname)
1.31 - return false;
1.32 - const char *dllpath = info.dli_fname;
1.33 - snprintf(buffer, maxlength, "%s", dllpath);
1.34 -#endif
1.35 - return true;
1.36 -}
1.37 -
1.38 -void InstallCallback(FnChangeCallback_t callback)
1.39 -{
1.40 - char path[MAX_PATH];
1.41 - GetFileOfAddress((void *)callback, path, sizeof(path));
1.42 - printf("Yo: %s\n", path);
1.43 -}
1.44 -
1.45 void ConVarManager::OnSourceModAllInitialized()
1.46 {
1.47 /**
1.48 @@ -123,7 +92,6 @@
1.49 }
1.50 #endif
1.51
1.52 - SH_ADD_HOOK_STATICFUNC(ICvar, CallGlobalChangeCallbacks, icvar, OnConVarChanged, false);
1.53 SH_ADD_HOOK_STATICFUNC(ICvar, InstallGlobalChangeCallback, icvar, InstallCallback, false);
1.54
1.55 /* Add the 'convars' option to the 'sm' console command */