1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-28 17:09:10 +00:00

(svn r16325) -Codechange: replace GetPoolItem(index) by PoolItem::Get(index)

This commit is contained in:
smatz
2009-05-16 23:34:14 +00:00
parent 814f153b5a
commit 6221d74644
116 changed files with 645 additions and 637 deletions

View File

@@ -110,10 +110,10 @@ public:
static inline bool IsValidNetworkClientSocketIndex(ClientIndex index)
{
return (uint)index < GetNetworkClientSocketPoolSize() && GetNetworkClientSocket(index)->IsValid();
return (uint)index < GetNetworkClientSocketPoolSize() && NetworkClientSocket::Get(index)->IsValid();
}
#define FOR_ALL_CLIENT_SOCKETS_FROM(d, start) for (d = GetNetworkClientSocket(start); d != NULL; d = (d->index + 1U < GetNetworkClientSocketPoolSize()) ? GetNetworkClientSocket(d->index + 1U) : NULL) if (d->IsValid())
#define FOR_ALL_CLIENT_SOCKETS_FROM(d, start) for (d = NetworkClientSocket::Get(start); d != NULL; d = (d->index + 1U < GetNetworkClientSocketPoolSize()) ? NetworkClientSocket::Get(d->index + 1U) : NULL) if (d->IsValid())
#define FOR_ALL_CLIENT_SOCKETS(d) FOR_ALL_CLIENT_SOCKETS_FROM(d, 0)
#endif /* ENABLE_NETWORK */

View File

@@ -97,7 +97,7 @@ extern void StateGameLoop();
*/
NetworkClientInfo *NetworkFindClientInfoFromIndex(ClientIndex index)
{
return IsValidNetworkClientInfoIndex(index) ? GetNetworkClientInfo(index) : NULL;
return IsValidNetworkClientInfoIndex(index) ? NetworkClientInfo::Get(index) : NULL;
}
/**
@@ -926,7 +926,7 @@ static bool NetworkDoClientLoop()
NetworkError(STR_NETWORK_ERR_DESYNC);
DEBUG(desync, 1, "sync_err: %d; %d\n", _date, _date_fract);
DEBUG(net, 0, "Sync error detected!");
NetworkClientError(NETWORK_RECV_STATUS_DESYNC, GetNetworkClientSocket(0));
NetworkClientError(NETWORK_RECV_STATUS_DESYNC, NetworkClientSocket::Get(0));
return false;
}

View File

@@ -29,10 +29,10 @@ struct NetworkClientInfo : PoolItem<NetworkClientInfo, ClientIndex, &_NetworkCli
static inline bool IsValidNetworkClientInfoIndex(ClientIndex index)
{
return (uint)index < GetNetworkClientInfoPoolSize() && GetNetworkClientInfo(index)->IsValid();
return (uint)index < GetNetworkClientInfoPoolSize() && NetworkClientInfo::Get(index)->IsValid();
}
#define FOR_ALL_CLIENT_INFOS_FROM(d, start) for (d = GetNetworkClientInfo(start); d != NULL; d = (d->index + 1U < GetNetworkClientInfoPoolSize()) ? GetNetworkClientInfo(d->index + 1U) : NULL) if (d->IsValid())
#define FOR_ALL_CLIENT_INFOS_FROM(d, start) for (d = NetworkClientInfo::Get(start); d != NULL; d = (d->index + 1U < GetNetworkClientInfoPoolSize()) ? NetworkClientInfo::Get(d->index + 1U) : NULL) if (d->IsValid())
#define FOR_ALL_CLIENT_INFOS(d) FOR_ALL_CLIENT_INFOS_FROM(d, 0)
#endif /* ENABLE_NETWORK */

View File

@@ -30,7 +30,7 @@
/* So we don't make too much typos ;) */
#define MY_CLIENT GetNetworkClientSocket(0)
#define MY_CLIENT NetworkClientSocket::Get(0)
static uint32 last_ack_frame;

View File

@@ -1237,7 +1237,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_MOVE)
/* Check if the company is valid */
if (!IsValidCompanyID(company_id) && company_id != COMPANY_SPECTATOR) return;
/* We don't allow moving to AI companies */
if (company_id != COMPANY_SPECTATOR && GetCompany(company_id)->is_ai) return;
if (company_id != COMPANY_SPECTATOR && Company::Get(company_id)->is_ai) return;
/* Check if we require a password for this company */
if (company_id != COMPANY_SPECTATOR && !StrEmpty(_network_company_states[company_id].password)) {