summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-05-16 23:34:14 +0000
committersmatz <smatz@openttd.org>2009-05-16 23:34:14 +0000
commit6221d74644922ea4bbba3ed9cd8bbec42398f77b (patch)
tree0069bbd6bb7525754c5d9353132f5dc64a0996cc /src/network
parent814f153b5a98e0030cbd221e6a89e083ce62bb1d (diff)
downloadopenttd-6221d74644922ea4bbba3ed9cd8bbec42398f77b.tar.xz
(svn r16325) -Codechange: replace GetPoolItem(index) by PoolItem::Get(index)
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/tcp_game.h4
-rw-r--r--src/network/network.cpp4
-rw-r--r--src/network/network_base.h4
-rw-r--r--src/network/network_client.cpp2
-rw-r--r--src/network/network_server.cpp2
5 files changed, 8 insertions, 8 deletions
diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h
index 3acd61310..e1224c5e2 100644
--- a/src/network/core/tcp_game.h
+++ b/src/network/core/tcp_game.h
@@ -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 */
diff --git a/src/network/network.cpp b/src/network/network.cpp
index a98ff2f12..95ff34dcc 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -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;
}
diff --git a/src/network/network_base.h b/src/network/network_base.h
index 191b6be40..3892db7d3 100644
--- a/src/network/network_base.h
+++ b/src/network/network_base.h
@@ -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 */
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index c5ac55961..4a6897bf3 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -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;
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 2b8f44ffc..9b29070a9 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -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)) {