3 * ======================================================
4 * Metamod:Source Sample Plugin
5 * Written by AlliedModders LLC.
6 * ======================================================
8 * This software is provided 'as-is', without any express or implied warranty.
9 * In no event will the authors be held liable for any damages arising from
10 * the use of this software.
12 * This sample plugin is public domain.
17 #ifndef _INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_
18 #define _INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_
20 #include <ISmmPlugin.h>
21 #include <igameevents.h>
22 #include <iplayerinfo.h>
23 #include <sh_vector.h>
24 #include "engine_wrappers.h"
26 #if defined WIN32 && !defined snprintf
27 #define snprintf _snprintf
30 class StubPlugin : public ISmmPlugin, public IMetamodListener
33 bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
34 bool Unload(char *error, size_t maxlen);
35 bool Pause(char *error, size_t maxlen);
36 bool Unpause(char *error, size_t maxlen);
37 void AllPluginsLoaded();
38 public: //IMetamodListener stuff
39 void OnVSPListening(IServerPluginCallbacks *iface);
41 void Hook_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
42 bool Hook_LevelInit(const char *pMapName,
43 char const *pMapEntities,
44 char const *pOldLevel,
45 char const *pLandmarkName,
48 void Hook_GameFrame(bool simulating);
49 void Hook_LevelShutdown(void);
50 void Hook_ClientActive(edict_t *pEntity, bool bLoadGame);
51 void Hook_ClientDisconnect(edict_t *pEntity);
52 void Hook_ClientPutInServer(edict_t *pEntity, char const *playername);
53 void Hook_SetCommandClient(int index);
54 void Hook_ClientSettingsChanged(edict_t *pEdict);
55 bool Hook_ClientConnect(edict_t *pEntity,
57 const char *pszAddress,
60 #if defined ENGINE_ORANGEBOX
61 void Hook_ClientCommand(edict_t *pEntity, const CCommand &args);
62 #elif defined ENGINE_ORIGINAL
63 void Hook_ClientCommand(edict_t *pEntity);
66 const char *GetAuthor();
67 const char *GetName();
68 const char *GetDescription();
70 const char *GetLicense();
71 const char *GetVersion();
72 const char *GetDate();
73 const char *GetLogTag();
75 #if defined ENGINE_ORIGINAL
76 SourceHook::CallClass<IVEngineServer> *m_EngineCC;
80 extern StubPlugin g_StubPlugin;
84 #endif //_INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_