13 #include "../stdafx.h"
15 #include "../window_func.h"
21 #include "../safeguards.h"
49 if (prev_item ==
nullptr) {
52 prev_item->
next = item;
69 if (prev_item ==
nullptr) {
79 NetworkRebuildHostList();
106 prev_item = &item->
next;
122 item->info.compatible = item->info.version_compatible;
124 for (
GRFConfig *c = item->
info.grfconfig; c !=
nullptr; c = c->next) {
133 item->info.compatible =
false;
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.
std::string connection_string
The connection string for this ServerAddress.
static ServerAddress Parse(const std::string &connection_string, uint16_t default_port, CompanyID *company_id=nullptr)
Convert a string containing either "hostname", "hostname:port" or invite code to a ServerAddress,...
static const uint16_t NETWORK_DEFAULT_PORT
The default port of the game server (TCP & UDP)
void NetworkGameListRemoveExpired()
Remove all servers that have not recently been updated.
void NetworkGameListRemoveItem(NetworkGameList *remove)
Remove an item from the gamelist linked list.
NetworkGameList * NetworkGameListAddItem(const std::string &connection_string)
Add a new item to the linked gamelist.
int _network_game_list_version
Current version of all items in the list.
void NetworkAfterNewGRFScan()
Rebuild the GRFConfig's of the servers in the game list as we did a rescan and might have found new N...
NetworkGameList * _network_game_list
Game list of this client.
Handling of the list of games.
void UpdateNetworkGameWindow()
Update the network new window because a new server is found on the network.
Variables and function used internally.
Sending and receiving UDP messages.
void ClearGRFConfigList(GRFConfig **config)
Clear a GRF Config list, freeing all nodes.
const GRFConfig * FindGRFConfig(uint32_t grfid, FindGRFConfigMode mode, const MD5Hash *md5sum, uint32_t desired_version)
Find a NewGRF in the scanned list.
@ GCF_COPY
The data is copied from a grf in _all_grfs.
@ GCS_NOT_FOUND
GRF file was not found in the local cache.
@ GCS_UNKNOWN
The status of this grf file is unknown.
@ FGCM_EXACT
Only find Grfs matching md5sum.
Information about GRF, used in the game and (part of it) in savegames.
GRFTextWrapper info
NOSAVE: GRF info (author, copyright, ...) (Action 0x08)
GRFTextWrapper name
NOSAVE: GRF name (Action 0x08)
std::string filename
Filename - either with or without full path.
Structure with information shown in the game list (GUI)
int version
Used to see which servers are no longer available on the Game Coordinator and can be removed.
std::string connection_string
Address of the server.
NetworkGameList * next
Next pointer to make a linked game list.
NetworkGameInfo info
The game information of this server.
GRFConfig * grfconfig
List of NewGRF files used.
int gamescript_version
Version of the gamescript.
void InvalidateWindowClassesData(WindowClass cls, int data, bool gui_scope)
Mark window data of all windows of a given class as invalid (in need of re-computing) Note that by de...
@ WC_NETWORK_WINDOW
Network window; Window numbers: