network_base.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef NETWORK_BASE_H
00013 #define NETWORK_BASE_H
00014
00015 #ifdef ENABLE_NETWORK
00016
00017 #include "network_type.h"
00018 #include "../core/pool_type.hpp"
00019
00020 typedef Pool<NetworkClientInfo, ClientIndex, 8, MAX_CLIENT_SLOTS> NetworkClientInfoPool;
00021 extern NetworkClientInfoPool _networkclientinfo_pool;
00022
00023 struct NetworkClientInfo : NetworkClientInfoPool::PoolItem<&_networkclientinfo_pool> {
00024 ClientID client_id;
00025 char client_name[NETWORK_CLIENT_NAME_LENGTH];
00026 byte client_lang;
00027 CompanyID client_playas;
00028 NetworkAddress client_address;
00029 Date join_date;
00030 char unique_id[NETWORK_UNIQUE_ID_LENGTH];
00031
00032 NetworkClientInfo(ClientID client_id = INVALID_CLIENT_ID) : client_id(client_id) {}
00033 ~NetworkClientInfo();
00034 };
00035
00036 #define FOR_ALL_CLIENT_INFOS_FROM(var, start) FOR_ALL_ITEMS_FROM(NetworkClientInfo, clientinfo_index, var, start)
00037 #define FOR_ALL_CLIENT_INFOS(var) FOR_ALL_CLIENT_INFOS_FROM(var, 0)
00038
00039 #endif
00040 #endif