core/smn_player.cpp
changeset 435 3097c4ab9f8f
parent 370 d3a484f98f6d
child 448 25984ddd0ce0
     1.1 --- a/core/smn_player.cpp	Mon Feb 05 10:34:58 2007 +0000
     1.2 +++ b/core/smn_player.cpp	Mon Feb 05 20:32:34 2007 +0000
     1.3 @@ -18,26 +18,26 @@
     1.4  {
     1.5  	if (params[1])
     1.6  	{
     1.7 -		return g_PlayerManager.GetPlayerCount();
     1.8 +		return g_PlayerManager.NumPlayers();
     1.9  	}
    1.10  
    1.11 -	int maxplayers = g_PlayerManager.GetMaxClients();
    1.12 +	int maxplayers = g_PlayerManager.MaxClients();
    1.13  	int count = 0;
    1.14  	for (int i=1; i<=maxplayers; ++i)
    1.15  	{
    1.16  		CPlayer *pPlayer = g_PlayerManager.GetPlayerByIndex(i);
    1.17 -		if ((pPlayer->IsPlayerConnected()) && !(pPlayer->IsPlayerInGame()))
    1.18 +		if ((pPlayer->IsConnected()) && !(pPlayer->IsInGame()))
    1.19  		{
    1.20  			count++;
    1.21  		}
    1.22  	}
    1.23  
    1.24 -	return (g_PlayerManager.GetPlayerCount() + count);
    1.25 +	return (g_PlayerManager.NumPlayers() + count);
    1.26  }
    1.27  
    1.28  static cell_t sm_GetMaxClients(IPluginContext *pCtx, const cell_t *params)
    1.29  {
    1.30 -	return g_PlayerManager.GetMaxClients();
    1.31 +	return g_PlayerManager.MaxClients();
    1.32  }
    1.33  
    1.34  static cell_t sm_GetClientName(IPluginContext *pCtx, const cell_t *params)
    1.35 @@ -49,12 +49,12 @@
    1.36  	}
    1.37  
    1.38  	CPlayer *pPlayer = g_PlayerManager.GetPlayerByIndex(index);
    1.39 -	if (!pPlayer->IsPlayerConnected())
    1.40 +	if (!pPlayer->IsConnected())
    1.41  	{
    1.42  		return pCtx->ThrowNativeError("Client %d is not connected.", index);
    1.43  	}
    1.44  
    1.45 -	pCtx->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), pPlayer->PlayerName(), NULL);
    1.46 +	pCtx->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), pPlayer->GetName(), NULL);
    1.47  	return 1;
    1.48  }
    1.49  
    1.50 @@ -67,13 +67,13 @@
    1.51  	}
    1.52  
    1.53  	CPlayer *pPlayer = g_PlayerManager.GetPlayerByIndex(index);
    1.54 -	if (!pPlayer->IsPlayerConnected())
    1.55 +	if (!pPlayer->IsConnected())
    1.56  	{
    1.57  		return pCtx->ThrowNativeError("Client %d is not connected.", index);
    1.58  	}
    1.59  
    1.60  	char buf[64], *ptr;
    1.61 -	strcpy(buf, pPlayer->PlayerIP());
    1.62 +	strcpy(buf, pPlayer->GetIPAddress());
    1.63  
    1.64  	if (params[4] && (ptr = strchr(buf, ':')))
    1.65  	{
    1.66 @@ -93,12 +93,12 @@
    1.67  	}
    1.68  
    1.69  	CPlayer *pPlayer = g_PlayerManager.GetPlayerByIndex(index);
    1.70 -	if (!pPlayer->IsPlayerConnected())
    1.71 +	if (!pPlayer->IsConnected())
    1.72  	{
    1.73  		return pCtx->ThrowNativeError("Client %d is not connected.", index);
    1.74  	}
    1.75  
    1.76 -	pCtx->StringToLocal(params[2], static_cast<size_t>(params[3]), pPlayer->PlayerAuthString());
    1.77 +	pCtx->StringToLocal(params[2], static_cast<size_t>(params[3]), pPlayer->GetAuthString());
    1.78  	return 1;
    1.79  }
    1.80  
    1.81 @@ -110,7 +110,7 @@
    1.82  		return pCtx->ThrowNativeError("Invalid client index %d.", index);
    1.83  	}
    1.84  
    1.85 -	return (g_PlayerManager.GetPlayerByIndex(index)->IsPlayerConnected()) ? 1 : 0;
    1.86 +	return (g_PlayerManager.GetPlayerByIndex(index)->IsConnected()) ? 1 : 0;
    1.87  }
    1.88  
    1.89  static cell_t sm_IsPlayerIngame(IPluginContext *pCtx, const cell_t *params)
    1.90 @@ -121,7 +121,7 @@
    1.91  		return pCtx->ThrowNativeError("Invalid client index %d.", index);
    1.92  	}
    1.93  
    1.94 -	return (g_PlayerManager.GetPlayerByIndex(index)->IsPlayerInGame()) ? 1 : 0;
    1.95 +	return (g_PlayerManager.GetPlayerByIndex(index)->IsInGame()) ? 1 : 0;
    1.96  }
    1.97  
    1.98  static cell_t sm_IsPlayerAuthorized(IPluginContext *pCtx, const cell_t *params)
    1.99 @@ -132,7 +132,7 @@
   1.100  		return pCtx->ThrowNativeError("Invalid client index %d.", index);
   1.101  	}
   1.102  
   1.103 -	return (g_PlayerManager.GetPlayerByIndex(index)->IsPlayerAuthorized()) ? 1 : 0;
   1.104 +	return (g_PlayerManager.GetPlayerByIndex(index)->IsAuthorized()) ? 1 : 0;
   1.105  }
   1.106  
   1.107  static cell_t sm_IsPlayerFakeClient(IPluginContext *pCtx, const cell_t *params)
   1.108 @@ -144,12 +144,12 @@
   1.109  	}
   1.110  
   1.111  	CPlayer *pPlayer = g_PlayerManager.GetPlayerByIndex(index);
   1.112 -	if (!pPlayer->IsPlayerConnected())
   1.113 +	if (!pPlayer->IsConnected())
   1.114  	{
   1.115  		return pCtx->ThrowNativeError("Client %d is not connected.", index);
   1.116  	}
   1.117  
   1.118 -	return (pPlayer->IsPlayerFakeClient()) ? 1 : 0;
   1.119 +	return (pPlayer->IsFakeClient()) ? 1 : 0;
   1.120  }
   1.121  
   1.122  static cell_t sm_PrintToServer(IPluginContext *pCtx, const cell_t *params)
   1.123 @@ -178,7 +178,7 @@
   1.124  	}
   1.125  
   1.126  	CPlayer *pPlayer = g_PlayerManager.GetPlayerByIndex(index);
   1.127 -	if (!pPlayer->IsPlayerInGame())
   1.128 +	if (!pPlayer->IsInGame())
   1.129  	{
   1.130  		return pCtx->ThrowNativeError("Client %d is not in game.", index);
   1.131  	}
   1.132 @@ -193,7 +193,7 @@
   1.133  	buffer[res++] = '\n';
   1.134  	buffer[res] = '\0';
   1.135  
   1.136 -	engine->ClientPrintf(pPlayer->GetPlayerEdict(), buffer);
   1.137 +	engine->ClientPrintf(pPlayer->GetEdict(), buffer);
   1.138  
   1.139  	return 1;
   1.140  }