core/PlayerManager.cpp
changeset 3942 7aaa00382627
parent 3914 ec79ea87c2e7
child 3944 86d78f0e7a1c
     1.1 --- a/core/PlayerManager.cpp	Wed Jul 10 20:46:00 2013 -0400
     1.2 +++ b/core/PlayerManager.cpp	Fri Jul 12 02:31:41 2013 -0400
     1.3 @@ -59,11 +59,11 @@
     1.4  List<ICommandTargetProcessor *> target_processors;
     1.5  
     1.6  #if SOURCE_ENGINE == SE_DOTA
     1.7 -SH_DECL_HOOK5(IServerGameClients, ClientConnect, SH_NOATTRIB, 0, bool, int, const char *, const char *, char *, int);
     1.8 -SH_DECL_HOOK2_void(IServerGameClients, ClientPutInServer, SH_NOATTRIB, 0, int, const char *);
     1.9 -SH_DECL_HOOK1_void(IServerGameClients, ClientDisconnect, SH_NOATTRIB, 0, int);
    1.10 -SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, int, const CCommand &);
    1.11 -SH_DECL_HOOK1_void(IServerGameClients, ClientSettingsChanged, SH_NOATTRIB, 0, int);
    1.12 +SH_DECL_HOOK5(IServerGameClients, ClientConnect, SH_NOATTRIB, 0, bool, CEntityIndex, const char *, const char *, char *, int);
    1.13 +SH_DECL_HOOK2_void(IServerGameClients, ClientPutInServer, SH_NOATTRIB, 0, CEntityIndex, const char *);
    1.14 +SH_DECL_HOOK1_void(IServerGameClients, ClientDisconnect, SH_NOATTRIB, 0, CEntityIndex);
    1.15 +SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, CEntityIndex, const CCommand &);
    1.16 +SH_DECL_HOOK1_void(IServerGameClients, ClientSettingsChanged, SH_NOATTRIB, 0, CEntityIndex);
    1.17  #else
    1.18  SH_DECL_HOOK5(IServerGameClients, ClientConnect, SH_NOATTRIB, 0, bool, edict_t *, const char *, const char *, char *, int);
    1.19  SH_DECL_HOOK2_void(IServerGameClients, ClientPutInServer, SH_NOATTRIB, 0, edict_t *, const char *);
    1.20 @@ -83,7 +83,7 @@
    1.21  #endif
    1.22  
    1.23  #if SOURCE_ENGINE == SE_DOTA
    1.24 -SH_DECL_EXTERN2_void(ConCommand, Dispatch, SH_NOATTRIB, false, void *, const CCommand &);
    1.25 +SH_DECL_EXTERN2_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommandContext &, const CCommand &);
    1.26  #elif SOURCE_ENGINE >= SE_ORANGEBOX
    1.27  SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
    1.28  #elif SOURCE_ENGINE == SE_DARKMESSIAH
    1.29 @@ -470,8 +470,9 @@
    1.30  }
    1.31  
    1.32  #if SOURCE_ENGINE == SE_DOTA
    1.33 -bool PlayerManager::OnClientConnect(int client, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
    1.34 +bool PlayerManager::OnClientConnect(CEntityIndex index, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
    1.35  {
    1.36 +	int client = index.Get();
    1.37  	edict_t *pEntity = PEntityOfEntIndex(client);
    1.38  #else
    1.39  bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
    1.40 @@ -535,8 +536,9 @@
    1.41  }
    1.42  
    1.43  #if SOURCE_ENGINE == SE_DOTA
    1.44 -bool PlayerManager::OnClientConnect_Post(int client, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
    1.45 +bool PlayerManager::OnClientConnect_Post(CEntityIndex index, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
    1.46  {
    1.47 +	int client = index.Get();
    1.48  	edict_t *pEntity = PEntityOfEntIndex(client);
    1.49  #else
    1.50  bool PlayerManager::OnClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
    1.51 @@ -581,8 +583,9 @@
    1.52  }
    1.53  
    1.54  #if SOURCE_ENGINE == SE_DOTA
    1.55 -void PlayerManager::OnClientPutInServer(int client, const char *playername)
    1.56 +void PlayerManager::OnClientPutInServer(CEntityIndex index, const char *playername)
    1.57  {
    1.58 +	int client = index.Get();
    1.59  	edict_t *pEntity = PEntityOfEntIndex(client);
    1.60  #else
    1.61  void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername)
    1.62 @@ -763,8 +766,9 @@
    1.63  }
    1.64  
    1.65  #if SOURCE_ENGINE == SE_DOTA
    1.66 -void PlayerManager::OnClientDisconnect(int client)
    1.67 +void PlayerManager::OnClientDisconnect(CEntityIndex index)
    1.68  {
    1.69 +	int client = index.Get();
    1.70  	edict_t *pEntity = PEntityOfEntIndex(client);
    1.71  #else
    1.72  void PlayerManager::OnClientDisconnect(edict_t *pEntity)
    1.73 @@ -808,8 +812,9 @@
    1.74  }
    1.75  
    1.76  #if SOURCE_ENGINE == SE_DOTA
    1.77 -void PlayerManager::OnClientDisconnect_Post(int client)
    1.78 +void PlayerManager::OnClientDisconnect_Post(CEntityIndex index)
    1.79  {
    1.80 +	int client = index.Get();
    1.81  	edict_t *pEntity = PEntityOfEntIndex(client);
    1.82  #else
    1.83  void PlayerManager::OnClientDisconnect_Post(edict_t *pEntity)
    1.84 @@ -850,7 +855,7 @@
    1.85  	}
    1.86  
    1.87  #if SOURCE_ENGINE == SE_DOTA
    1.88 -	engine->ClientPrintf(IndexOfEdict(e), buffer);
    1.89 +	engine->ClientPrintf(CEntityIndex(IndexOfEdict(e)), buffer);
    1.90  #else
    1.91  	engine->ClientPrintf(e, buffer);
    1.92  #endif
    1.93 @@ -1017,8 +1022,9 @@
    1.94  }
    1.95  
    1.96  #if SOURCE_ENGINE == SE_DOTA
    1.97 -void PlayerManager::OnClientCommand(int client, const CCommand &args)
    1.98 +void PlayerManager::OnClientCommand(CEntityIndex index, const CCommand &args)
    1.99  {
   1.100 +	int client = index.Get();
   1.101  	edict_t *pEntity = PEntityOfEntIndex(client);
   1.102  #elif SOURCE_ENGINE >= SE_ORANGEBOX
   1.103  void PlayerManager::OnClientCommand(edict_t *pEntity, const CCommand &args)
   1.104 @@ -1141,8 +1147,9 @@
   1.105  }
   1.106  
   1.107  #if SOURCE_ENGINE == SE_DOTA
   1.108 -void PlayerManager::OnClientSettingsChanged(int client)
   1.109 +void PlayerManager::OnClientSettingsChanged(CEntityIndex index)
   1.110  {
   1.111 +	int client = index.Get();
   1.112  	edict_t *pEntity = PEntityOfEntIndex(client);
   1.113  #else
   1.114  void PlayerManager::OnClientSettingsChanged(edict_t *pEntity)
   1.115 @@ -1805,7 +1812,7 @@
   1.116  }
   1.117  
   1.118  #if SOURCE_ENGINE == SE_DOTA
   1.119 -void CmdMaxplayersCallback(void *pUnknown, const CCommand &command)
   1.120 +void CmdMaxplayersCallback(const CCommandContext &context, const CCommand &command)
   1.121  {
   1.122  #elif SOURCE_ENGINE >= SE_ORANGEBOX
   1.123  void CmdMaxplayersCallback(const CCommand &command)