sample_mm/sample_mm.h
author Pavol Marko <pavolmarko@gmail.com>
Sun Oct 21 21:55:17 2007 +0000 (2007-10-21)
branchhookman_autogen
changeset 433 a2d986ddd522
parent 379 e8a3f2617a3e
child 497 e6abd02a6a95
permissions -rw-r--r--
Changed license in sourcehook_hookmangen_x86.h (agreed to by BAILOPAN and faluco)
Updated MSVC7 proj file
     1 /**
     2  * vim: set ts=4 :
     3  * ======================================================
     4  * Metamod:Source Sample Plugin
     5  * Written by AlliedModders LLC.
     6  * ======================================================
     7  *
     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.
    11  *
    12  * This sample plugin is public domain.
    13  *
    14  * Version: $Id$
    15  */
    16 
    17 #ifndef _INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_
    18 #define _INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_
    19 
    20 #include <ISmmPlugin.h>
    21 #include <igameevents.h>
    22 #include <iplayerinfo.h>
    23 #include <sh_vector.h>
    24 #include "engine_wrappers.h"
    25 
    26 class StubPlugin : public ISmmPlugin, public IMetamodListener
    27 {
    28 public:
    29 	bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
    30 	bool Unload(char *error, size_t maxlen);
    31 	bool Pause(char *error, size_t maxlen);
    32 	bool Unpause(char *error, size_t maxlen);
    33 	void AllPluginsLoaded();
    34 public: //IMetamodListener stuff
    35 	void OnVSPListening(IServerPluginCallbacks *iface);
    36 public: //hooks
    37 	void Hook_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
    38 	bool Hook_LevelInit(const char *pMapName,
    39 		char const *pMapEntities,
    40 		char const *pOldLevel,
    41 		char const *pLandmarkName,
    42 		bool loadGame,
    43 		bool background);
    44 	void Hook_GameFrame(bool simulating);
    45 	void Hook_LevelShutdown(void);
    46 	void Hook_ClientActive(edict_t *pEntity, bool bLoadGame);
    47 	void Hook_ClientDisconnect(edict_t *pEntity);
    48 	void Hook_ClientPutInServer(edict_t *pEntity, char const *playername);
    49 	void Hook_SetCommandClient(int index);
    50 	void Hook_ClientSettingsChanged(edict_t *pEdict);
    51 	bool Hook_ClientConnect(edict_t *pEntity, 
    52 		const char *pszName,
    53 		const char *pszAddress,
    54 		char *reject,
    55 		int maxrejectlen);
    56 #if defined ORANGEBOX_BUILD
    57 	void Hook_ClientCommand(edict_t *pEntity, const CCommand &args);
    58 #else
    59 	void Hook_ClientCommand(edict_t *pEntity);
    60 #endif
    61 public:
    62 	const char *GetAuthor();
    63 	const char *GetName();
    64 	const char *GetDescription();
    65 	const char *GetURL();
    66 	const char *GetLicense();
    67 	const char *GetVersion();
    68 	const char *GetDate();
    69 	const char *GetLogTag();
    70 private:
    71 	SourceHook::CVector<int> m_hooks;
    72 };
    73 
    74 extern StubPlugin g_StubPlugin;
    75 
    76 PLUGIN_GLOBALVARS();
    77 
    78 #endif //_INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_