2007-10-07 05:12:19 +02:00
|
|
|
/**
|
2009-11-14 01:25:56 +01:00
|
|
|
* vim: set ts=4 sw=4 tw=99 noet :
|
2007-10-07 05:12:19 +02:00
|
|
|
* ======================================================
|
|
|
|
* Metamod:Source Sample Plugin
|
|
|
|
* Written by AlliedModders LLC.
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* This software is provided 'as-is', without any express or implied warranty.
|
|
|
|
* In no event will the authors be held liable for any damages arising from
|
|
|
|
* the use of this software.
|
|
|
|
*
|
|
|
|
* This sample plugin is public domain.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_
|
|
|
|
#define _INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_
|
|
|
|
|
|
|
|
#include <ISmmPlugin.h>
|
|
|
|
#include <igameevents.h>
|
|
|
|
#include <iplayerinfo.h>
|
|
|
|
#include <sh_vector.h>
|
|
|
|
#include "engine_wrappers.h"
|
|
|
|
|
2008-02-17 23:56:20 +01:00
|
|
|
#if defined WIN32 && !defined snprintf
|
|
|
|
#define snprintf _snprintf
|
|
|
|
#endif
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
class SamplePlugin : public ISmmPlugin, public IMetamodListener
|
2007-10-07 05:12:19 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
|
|
|
|
bool Unload(char *error, size_t maxlen);
|
|
|
|
bool Pause(char *error, size_t maxlen);
|
|
|
|
bool Unpause(char *error, size_t maxlen);
|
|
|
|
void AllPluginsLoaded();
|
|
|
|
public: //IMetamodListener stuff
|
|
|
|
void OnVSPListening(IServerPluginCallbacks *iface);
|
|
|
|
public: //hooks
|
|
|
|
void Hook_ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
|
|
|
|
bool Hook_LevelInit(const char *pMapName,
|
|
|
|
char const *pMapEntities,
|
|
|
|
char const *pOldLevel,
|
|
|
|
char const *pLandmarkName,
|
|
|
|
bool loadGame,
|
|
|
|
bool background);
|
|
|
|
void Hook_GameFrame(bool simulating);
|
|
|
|
void Hook_LevelShutdown(void);
|
|
|
|
void Hook_ClientActive(edict_t *pEntity, bool bLoadGame);
|
|
|
|
void Hook_ClientDisconnect(edict_t *pEntity);
|
|
|
|
void Hook_ClientPutInServer(edict_t *pEntity, char const *playername);
|
|
|
|
void Hook_SetCommandClient(int index);
|
|
|
|
void Hook_ClientSettingsChanged(edict_t *pEdict);
|
|
|
|
bool Hook_ClientConnect(edict_t *pEntity,
|
|
|
|
const char *pszName,
|
|
|
|
const char *pszAddress,
|
|
|
|
char *reject,
|
|
|
|
int maxrejectlen);
|
2008-11-24 19:03:02 +01:00
|
|
|
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
2007-10-07 05:12:19 +02:00
|
|
|
void Hook_ClientCommand(edict_t *pEntity, const CCommand &args);
|
2008-11-24 19:03:02 +01:00
|
|
|
#else
|
2007-10-07 05:12:19 +02:00
|
|
|
void Hook_ClientCommand(edict_t *pEntity);
|
|
|
|
#endif
|
|
|
|
public:
|
|
|
|
const char *GetAuthor();
|
|
|
|
const char *GetName();
|
|
|
|
const char *GetDescription();
|
|
|
|
const char *GetURL();
|
|
|
|
const char *GetLicense();
|
|
|
|
const char *GetVersion();
|
|
|
|
const char *GetDate();
|
|
|
|
const char *GetLogTag();
|
|
|
|
};
|
|
|
|
|
2008-11-24 19:03:02 +01:00
|
|
|
extern SamplePlugin g_SamplePlugin;
|
2007-10-07 05:12:19 +02:00
|
|
|
|
|
|
|
PLUGIN_GLOBALVARS();
|
|
|
|
|
|
|
|
#endif //_INCLUDE_METAMOD_SOURCE_STUB_PLUGIN_H_
|