sourcemm/sample_mm/SamplePlugin.h
changeset 22 3fe8e457c5a2
parent 20 7d2ff2c0999b
child 24 9f04f9fb2485
     1.1 --- a/sourcemm/sample_mm/SamplePlugin.h	Mon Apr 18 19:50:33 2005 +0000
     1.2 +++ b/sourcemm/sample_mm/SamplePlugin.h	Mon Apr 18 23:33:44 2005 +0000
     1.3 @@ -52,6 +52,53 @@
     1.4  	{
     1.5  		return "SAMPLE";
     1.6  	}
     1.7 +public:
     1.8 +	//These functions are from IServerPluginCallbacks
     1.9 +	//Note, the parameters might be a little different to match the actual calls!
    1.10 +
    1.11 +	//Called on LevelInit.  Server plugins only have pMapName
    1.12 +	bool LevelInit(const char *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
    1.13 +
    1.14 +	//Called on ServerActivate.  Same definition as server plugins
    1.15 +	void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
    1.16 +
    1.17 +	//Called on a game tick.  Same definition as server plugins
    1.18 +	void GameFrame(bool simulating);
    1.19 +
    1.20 +	//Called on level shutdown.  Same definition as server plugins 
    1.21 +	void LevelShutdown(void);
    1.22 +
    1.23 +	//Client is activate (whatever that means).  We get an extra parameter...
    1.24 +	// "If bLoadGame is true, don't spawn the player because its state is already setup."
    1.25 +	void ClientActive(edict_t *pEntity, bool bLoadGame);
    1.26 +
    1.27 +	//Client disconnects - same as server plugins
    1.28 +	void ClientDisconnect(edict_t *pEntity);
    1.29 +
    1.30 +	//Client is put in server - same as server plugins
    1.31 +	void ClientPutInServer(edict_t *pEntity, char const *playername);
    1.32 +
    1.33 +	//Sets the client index - same as server plugins
    1.34 +	void SetCommandClient(int index);
    1.35 +
    1.36 +	//Called on client settings changed (duh) - same as server plugins
    1.37 +	void ClientSettingsChanged(edict_t *pEdict);
    1.38 +
    1.39 +	//Called on client connect.  Unlike server plugins, we return whether the 
    1.40 +	// connection is allowed rather than set it through a pointer in the first parameter.
    1.41 +	// You can still supercede the GameDLL through RETURN_META_VALUE(MRES_SUPERCEDE, true/false)
    1.42 +	bool ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen);
    1.43 +
    1.44 +	//Called when a client uses a command.  Unlike server plugins, it's void.
    1.45 +	// You can still supercede the gamedll through RETURN_META(MRES_SUPERCEDE).
    1.46 +	void ClientCommand(edict_t *pEntity);
    1.47 +
    1.48 +private:
    1.49 +	IVEngineServer *m_Engine;
    1.50 +	IServerGameDLL *m_ServerDll;
    1.51 +	IServerGameClients *m_ServerClients;
    1.52 +	IServerGameDLL *m_ServerDll_CC;
    1.53 +	IServerGameClients *m_ServerClients_CC;
    1.54  };
    1.55  
    1.56  extern SamplePlugin g_SamplePlugin;