Changed a few natives/stocks that should have used IsClientInGame() rather than IsClientConnected()
3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is not open source and may not be copied without explicit
8 * written permission of AlliedModders LLC. This file may not be redistributed
9 * in whole or significant part.
10 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
15 #ifndef _INCLUDE_SOURCEMOD_CPLAYERMANAGER_H_
16 #define _INCLUDE_SOURCEMOD_CPLAYERMANAGER_H_
18 #include "sm_globals.h"
20 #include "sourcemm_api.h"
21 #include <IForwardSys.h>
22 #include <IPlayerHelpers.h>
23 #include <IAdminSystem.h>
24 #include <sh_string.h>
26 #include <sh_vector.h>
28 using namespace SourceHook;
30 class CPlayer : public IGamePlayer
32 friend class PlayerManager;
36 const char *GetName();
37 const char *GetIPAddress();
38 const char *GetAuthString();
44 void SetAdminId(AdminId id, bool temporary);
47 IPlayerInfo *GetPlayerInfo();
49 void Initialize(const char *name, const char *ip, edict_t *pEntity);
51 void Authorize(const char *steamid);
53 void SetName(const char *name);
54 void DumpAdmin(bool deleting);
75 public: //SMGlobalClass
76 void OnSourceModAllInitialized();
77 void OnSourceModShutdown();
79 CPlayer *GetPlayerByIndex(int client) const;
81 void ClearAdminId(AdminId id);
82 void ClearAllAdmins();
84 bool OnClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen);
85 bool OnClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen);
86 void OnClientPutInServer(edict_t *pEntity, char const *playername);
87 void OnClientDisconnect(edict_t *pEntity);
88 void OnClientDisconnect_Post(edict_t *pEntity);
89 void OnClientCommand(edict_t *pEntity);
90 void OnClientSettingsChanged(edict_t *pEntity);
91 public: //IPlayerManager
92 void AddClientListener(IClientListener *listener);
93 void RemoveClientListener(IClientListener *listener);
94 IGamePlayer *GetGamePlayer(int client);
95 IGamePlayer *GetGamePlayer(edict_t *pEdict);
98 int GetClientOfUserId(int userid);
100 inline int MaxClients()
104 inline int NumPlayers()
106 return m_PlayerCount;
109 void OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
111 List<IClientListener *> m_hooks;
112 IForward *m_clconnect;
113 IForward *m_cldisconnect;
114 IForward *m_cldisconnect_post;
115 IForward *m_clputinserver;
116 IForward *m_clcommand;
117 IForward *m_clinfochanged;
119 IForward *m_onActivate;
120 IForward *m_onActivate2;
126 unsigned int *m_AuthQueue;
129 extern PlayerManager g_Players;
130 extern bool g_OnMapStarted;
132 #endif //_INCLUDE_SOURCEMOD_CPLAYERMANAGER_H_