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_CIFACE_H__
12 #define __SOURCEHOOK_IMPL_CIFACE_H__
25 List<CHook> m_PreHooks;
26 List<CHook> m_PostHooks;
30 typedef void* Descriptor;
33 inline CIface(void *ptr);
35 inline bool operator==(const Descriptor &other);
36 inline void *GetPtr() const;
37 inline List<CHook> &GetPreHookList();
38 inline List<CHook> &GetPostHookList();
39 inline const List<CHook> &GetPreHookList() const;
40 inline const List<CHook> &GetPostHookList() const;
43 // *** Implementation ***
44 inline CIface::CIface(void *ptr)
49 inline CIface::~CIface()
51 // Before getting deleted, delete all remaining hook handlers
52 for (List<CHook>::iterator iter = m_PreHooks.begin(); iter != m_PreHooks.end(); ++iter)
54 iter->GetHandler()->DeleteThis();
57 for (List<CHook>::iterator iter = m_PostHooks.begin(); iter != m_PostHooks.end(); ++iter)
59 iter->GetHandler()->DeleteThis();
63 inline bool CIface::operator==(const Descriptor &other)
65 return m_Ptr == other;
68 inline void *CIface::GetPtr() const
73 inline List<CHook> &CIface::GetPreHookList()
78 inline List<CHook> &CIface::GetPostHookList()
83 inline const List<CHook> &CIface::GetPreHookList() const
88 inline const List<CHook> &CIface::GetPostHookList() const