1 #ifndef _INCLUDE_SOURCEMOD_CPLAYERMANAGER_H_
2 #define _INCLUDE_SOURCEMOD_CPLAYERMANAGER_H_
4 #include "sm_globals.h"
6 #include "sourcemm_api.h"
7 #include <IForwardSys.h>
12 class CPlayerManager : public SMGlobalClass
15 CPlayerManager() : m_FirstPass(true) {}
16 public: //SMGlobalClass
17 virtual void OnSourceModAllInitialized();
18 virtual void OnSourceModShutdown();
20 int GetMaxClients() const;
21 CPlayer *GetPlayerByIndex(int client) const;
22 int GetPlayerCount() const;
24 bool OnClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen);
25 void OnClientPutInServer(edict_t *pEntity, char const *playername);
26 void OnClientDisconnect(edict_t *pEntity);
27 void OnClientDisconnect_Post(edict_t *pEntity);
28 void OnClientAuthorized(); //:TODO: any args needed?
29 void OnClientCommand(edict_t *pEntity);
30 void OnClientSettingsChanged(edict_t *pEntity);
32 void OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
34 IForward *m_clconnect;
35 IForward *m_cldisconnect;
36 IForward *m_cldisconnect_post;
37 IForward *m_clputinserver;
38 IForward *m_clcommand;
39 IForward *m_clinfochanged;
46 extern CPlayerManager g_PlayerManager;
48 inline int CPlayerManager::GetMaxClients() const
53 inline CPlayer *CPlayerManager::GetPlayerByIndex(int client) const
55 if (client > m_maxClients || client < 0)
59 return &m_Players[client];
62 inline int CPlayerManager::GetPlayerCount() const
67 #endif //_INCLUDE_SOURCEMOD_CPLAYERMANAGER_H_