15#include "../window_func.h"
19#include "../safeguards.h"
39 auto &item =
_network_game_list.emplace_back(std::make_unique<NetworkGame>(resolved_connection_string));
40 item->info.gamescript_version = -1;
54 auto it = std::ranges::find_if(
_network_game_list, [&remove](
const auto &item) {
return item.get() == remove; });
58 NetworkRebuildHostList();
84 item->info.compatible = item->info.version_compatible;
86 for (
auto &c : item->info.grfconfig) {
95 item->info.compatible =
false;
std::string connection_string
The connection string for this ServerAddress.
static ServerAddress Parse(std::string_view 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)
NetworkGame * NetworkGameListAddItem(std::string_view connection_string)
Add a new item to the linked gamelist.
void NetworkGameListRemoveItem(NetworkGame *remove)
Remove an item from the gamelist linked list.
void NetworkGameListRemoveExpired()
Remove all servers that have not recently been updated.
std::vector< std::unique_ptr< NetworkGame > > _network_game_list
Game list of this client.
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...
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.
const GRFConfig * FindGRFConfig(uint32_t grfid, FindGRFConfigMode mode, const MD5Hash *md5sum, uint32_t desired_version)
Find a NewGRF in the scanned list.
@ GCS_NOT_FOUND
GRF file was not found in the local cache.
@ GCS_UNKNOWN
The status of this grf file is unknown.
@ Copy
The data is copied from a grf in _all_grfs.
@ 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)
std::string connection_string
Address of the server.
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: