Added missing CS:GO GameRulesProxy gamedata.
3 * =============================================================================
5 * Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
6 * =============================================================================
8 * This program is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, version 3.0, as published by the
10 * Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
20 * As a special exception, AlliedModders LLC gives you permission to link the
21 * code of this program (as well as its derivative works) to "Half-Life 2," the
22 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
23 * by the Valve Corporation. You must obey the GNU General Public License in
24 * all respects for all other code used. Additionally, AlliedModders LLC grants
25 * this exception to all derivative works. AlliedModders LLC defines further
26 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
27 * or <http://www.sourcemod.net/license.php>.
32 #ifndef _INCLUDE_SOURCEMOD_EVENTMANAGER_H_
33 #define _INCLUDE_SOURCEMOD_EVENTMANAGER_H_
35 #include "sm_globals.h"
36 #include "sourcemm_api.h"
40 #include <IHandleSys.h>
41 #include <IForwardSys.h>
42 #include <IPluginSys.h>
44 using namespace SourceHook;
51 EventInfo(IGameEvent *ev, IdentityToken_t *owner) : pEvent(ev), pOwner(owner)
55 IdentityToken_t *pOwner;
68 IChangeableForward *pPreHook;
69 IChangeableForward *pPostHook;
71 unsigned int refCount;
79 EventHookMode_PostNoCopy
84 EventHookErr_Okay = 0, /**< No error */
85 EventHookErr_InvalidEvent, /**< Specified event does not exist */
86 EventHookErr_NotActive, /**< Specified event has no active hook */
87 EventHookErr_InvalidCallback, /**< Specified event does not fire specified callback */
92 public IHandleTypeDispatch,
93 public IPluginsListener,
94 public IGameEventListener2
99 public: // SMGlobalClass
100 void OnSourceModAllInitialized();
101 void OnSourceModShutdown();
102 public: // IHandleTypeDispatch
103 void OnHandleDestroy(HandleType_t type, void *object);
104 public: // IPluginsListener
105 void OnPluginUnloaded(IPlugin *plugin);
106 public: // IGameEventListener2
107 void FireGameEvent(IGameEvent *pEvent);
108 #if SOURCE_ENGINE >= SE_LEFT4DEAD
109 int GetEventDebugID();
113 * Get the 'GameEvent' handle type ID.
115 inline HandleType_t GetHandleType()
120 EventHookError HookEvent(const char *name, IPluginFunction *pFunction, EventHookMode mode=EventHookMode_Post);
121 EventHookError UnhookEvent(const char *name, IPluginFunction *pFunction, EventHookMode mode=EventHookMode_Post);
122 EventInfo *CreateEvent(IPluginContext *pContext, const char *name, bool force=false);
123 void FireEvent(EventInfo *pInfo, bool bDontBroadcast=false);
124 void CancelCreatedEvent(EventInfo *pInfo);
125 private: // IGameEventManager2 hooks
126 bool OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast);
127 bool OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast);
129 HandleType_t m_EventType;
131 CStack<EventInfo *> m_FreeEvents;
132 CStack<EventHook *> m_EventStack;
133 CStack<IGameEvent *> m_EventCopies;
136 extern EventManager g_EventManager;
138 #endif // _INCLUDE_SOURCEMOD_EVENTMANAGER_H_