Rewrote user message caching code to always use IServerGameDLL::GetUserMessageInfo (
bug 4117, r=dvander).
Games where the above function can crash are handled by detouring tier0's Error() function and jumping back to our own code. So in theory this should work on all games now.
1 /* ======== SourceHook ========
2 * Copyright (C) 2004-2008 Metamod:Source Development Team
3 * No warranties of any kind
7 * Author(s): Pavol "PM OnoTo" Marko
8 * ============================
11 #ifndef __SOURCEHOOK_IMPL_CHOOKIDMAN_H__
12 #define __SOURCEHOOK_IMPL_CHOOKIDMAN_H__
14 #include "sh_vector.h"
20 // Associates hook ids with info about the hooks
21 // Also used to keep track of used hook ids
46 Entry(const CProto &pprt, int pvo, int pvi, void *pvp, void *pai, Plugin pplug, int pto,
47 ISHDelegate *ph, bool ppost)
48 : isfree(false), proto(pprt), vtbl_offs(pvo), vtbl_idx(pvi), vfnptr(pvp),
49 adjustediface(pai), plug(pplug), thisptr_offs(pto), handler(ph), post(ppost)
57 // Internally, hookid 1 is stored as m_Entries[0]
59 CVector<Entry> m_Entries;
62 int New(const CProto &proto, int vtbl_offs, int vtbl_idx, void *vfnptr, void *adjustediface,
63 Plugin plug, int thisptr_offs, ISHDelegate *handler, bool post);
64 bool Remove(int hookid);
65 const Entry * QueryHook(int hookid);
67 // Finds all hooks with the given info, and fills the hookids into output.
68 void FindAllHooks(CVector<int> &output, const CProto &proto, int vtbl_offs, int vtbl_idx,
69 void *adjustediface, Plugin plug, int thisptr_offs, ISHDelegate *handler, bool post);
71 // Removes all hooks with a specified vfnptr
72 void RemoveAll(void *vfnptr);
74 void FindAllHooks(CVector<int> &output);
75 void FindAllHooks(CVector<int> &output, Plugin plug);