OpenTTD Source 20260621-master-g720d10536d
network_gamelist.h File Reference

Handling of the list of games. More...

#include "core/address.h"
#include "core/network_game_info.h"
#include "network_type.h"

Go to the source code of this file.

Data Structures

struct  NetworkGame
 Structure with information shown in the game list (GUI). More...

Enumerations

enum class  NetworkGameStatus : uint8_t {
  Offline , Online , Full , Banned ,
  TooOld
}
 The status a server can be in. More...

Functions

NetworkGameNetworkGameListAddItem (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.

Variables

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.

Detailed Description

Handling of the list of games.

Definition in file network_gamelist.h.

Enumeration Type Documentation

◆ NetworkGameStatus

enum class NetworkGameStatus : uint8_t
strong

The status a server can be in.

Enumerator
Offline 

Server is offline (or cannot be queried).

Online 

Server is online.

Full 

Server is full and cannot be queried.

Banned 

You are banned from this server.

TooOld 

Server is too old to query.

Definition at line 18 of file network_gamelist.h.

Function Documentation

◆ NetworkGameListAddItem()

◆ NetworkGameListRemoveExpired()

void NetworkGameListRemoveExpired ( )

Remove all servers that have not recently been updated.

Call this after you received all the servers from the Game Coordinator, so the ones that are no longer listed are removed.

Definition at line 65 of file network_gamelist.cpp.

References _network_game_list, _network_game_list_version, and UpdateNetworkGameWindow().

Referenced by ClientNetworkCoordinatorSocketHandler::ReceiveGameCoordinatorListing().

◆ NetworkGameListRemoveItem()

void NetworkGameListRemoveItem ( NetworkGame * remove)

Remove an item from the gamelist linked list.

Parameters
removepointer to the item to be removed

Definition at line 49 of file network_gamelist.cpp.

References _network_game_list, NetworkRebuildHostList(), and UpdateNetworkGameWindow().

Referenced by NetworkGameWindow::OnKeyPress().

Variable Documentation

◆ _network_game_list

std::vector<std::unique_ptr<NetworkGame> > _network_game_list
extern

◆ _network_game_list_version

int _network_game_list_version
extern