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/address.h"
00019 #include "../core/pool_type.hpp"
00020 #include "../company_type.h"
00021
00022 typedef Pool<NetworkClientInfo, ClientIndex, 8, MAX_CLIENT_SLOTS> NetworkClientInfoPool;
00023 extern NetworkClientInfoPool _networkclientinfo_pool;
00024
00025 struct NetworkClientInfo : NetworkClientInfoPool::PoolItem<&_networkclientinfo_pool> {
00026 ClientID client_id;
00027 char client_name[NETWORK_CLIENT_NAME_LENGTH];
00028 byte client_lang;
00029 CompanyID client_playas;
00030 NetworkAddress client_address;
00031 Date join_date;
00032
00033 NetworkClientInfo(ClientID client_id = INVALID_CLIENT_ID) : client_id(client_id) {}
00034 ~NetworkClientInfo();
00035 };
00036
00037 #define FOR_ALL_CLIENT_INFOS_FROM(var, start) FOR_ALL_ITEMS_FROM(NetworkClientInfo, clientinfo_index, var, start)
00038 #define FOR_ALL_CLIENT_INFOS(var) FOR_ALL_CLIENT_INFOS_FROM(var, 0)
00039
00040 #endif
00041 #endif