OpenTTD
Data Structures | Functions | Variables
network_gamelist.h File Reference

Handling of the list of games. More...

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

Go to the source code of this file.

Data Structures

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

Functions

void NetworkGameListAddItemDelayed (NetworkGameList *item)
 Add a new item to the linked gamelist, but do it delayed in the next tick or so to prevent race conditions.
NetworkGameListNetworkGameListAddItem (NetworkAddress address)
 Add a new item to the linked gamelist.
void NetworkGameListRemoveItem (NetworkGameList *remove)
 Remove an item from the gamelist linked list.
void NetworkGameListRequery ()
 Requeries the (game) servers we have not gotten a reply from.

Variables

NetworkGameList_network_game_list
 Game list of this client.

Detailed Description

Handling of the list of games.

Definition in file network_gamelist.h.

Function Documentation

NetworkGameList* NetworkGameListAddItem ( NetworkAddress  address)

Add a new item to the linked gamelist.

If the IP and Port match return the existing item instead of adding it again

Parameters
addressthe address of the to-be added item
Returns
a point to the newly added or already existing item

Definition at line 80 of file network_gamelist.cpp.

References NetworkGameList::address, DEBUG, NetworkAddress::GetHostname(), NetworkGameList::next, StrEmpty(), and UpdateNetworkGameWindow().

Referenced by NetworkGameListHandleDelayedInsert(), and ClientNetworkUDPSocketHandler::Receive_SERVER_RESPONSE().

void NetworkGameListAddItemDelayed ( NetworkGameList item)

Add a new item to the linked gamelist, but do it delayed in the next tick or so to prevent race conditions.

Parameters
itemthe item to add. Will be freed once added.

Definition at line 39 of file network_gamelist.cpp.

References _network_game_delayed_insertion_list, ThreadMutex::BeginCritical(), ThreadMutex::EndCritical(), and NetworkGameList::next.

Referenced by NetworkUDPQueryServer().

void NetworkGameListRemoveItem ( NetworkGameList remove)

Remove an item from the gamelist linked list.

Parameters
removepointer to the item to be removed

Definition at line 119 of file network_gamelist.cpp.

References ClearGRFConfigList(), DEBUG, free(), NetworkGameList::next, and UpdateNetworkGameWindow().

Referenced by NetworkGameWindow::OnKeyPress().