diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/core/tcp_game.h | 4 | ||||
-rw-r--r-- | src/network/network_base.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h index 3bbb3ac0a..bfc82f17f 100644 --- a/src/network/core/tcp_game.h +++ b/src/network/core/tcp_game.h @@ -108,8 +108,8 @@ public: void Send_Command(Packet *p, const CommandPacket *cp); }; -#define FOR_ALL_CLIENT_SOCKETS_FROM(d, start) for (d = NetworkClientSocket::Get(start); d != NULL; d = (d->index + 1U < NetworkClientSocket::GetPoolSize()) ? NetworkClientSocket::Get(d->index + 1U) : NULL) if (d->IsValid()) -#define FOR_ALL_CLIENT_SOCKETS(d) FOR_ALL_CLIENT_SOCKETS_FROM(d, 0) +#define FOR_ALL_CLIENT_SOCKETS_FROM(var, start) FOR_ALL_ITEMS_FROM(NetworkClientSocket, clientsocket_index, var, start) +#define FOR_ALL_CLIENT_SOCKETS(var) FOR_ALL_CLIENT_SOCKETS_FROM(var, 0) #endif /* ENABLE_NETWORK */ diff --git a/src/network/network_base.h b/src/network/network_base.h index 929c4b7ba..700541b49 100644 --- a/src/network/network_base.h +++ b/src/network/network_base.h @@ -27,8 +27,8 @@ struct NetworkClientInfo : PoolItem<NetworkClientInfo, ClientIndex, &_NetworkCli inline bool IsValid() const { return client_id != INVALID_CLIENT_ID; } }; -#define FOR_ALL_CLIENT_INFOS_FROM(d, start) for (d = NetworkClientInfo::Get(start); d != NULL; d = (d->index + 1U < NetworkClientInfo::GetPoolSize()) ? NetworkClientInfo::Get(d->index + 1U) : NULL) if (d->IsValid()) -#define FOR_ALL_CLIENT_INFOS(d) FOR_ALL_CLIENT_INFOS_FROM(d, 0) +#define FOR_ALL_CLIENT_INFOS_FROM(var, start) FOR_ALL_ITEMS_FROM(NetworkClientInfo, clientinfo_index, var, start) +#define FOR_ALL_CLIENT_INFOS(var) FOR_ALL_CLIENT_INFOS_FROM(var, 0) #endif /* ENABLE_NETWORK */ #endif /* NETWORK_BASE_H */ |