# 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.
NetworkGameList * | NetworkGameListAddItem (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:

  | address | the address of the to-be added item
  | port | the port the server is running on

Returns:
  a point to the newly added or already existing item

Definition at line 78 of file network_gamelist.cpp.

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

Referenced by NetworkGameListHandleDelayedInsert(), and NetworkGameWindow::OnClick().

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:

  | item | the item to add. Will be freed once added.

Definition at line 36 of file network_gamelist.cpp.

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

Referenced by NetworkUDPQueryServerThread().

void NetworkGameListRemoveItem | ( | NetworkGameList * | remove | ) |

Remove an item from the gamelist linked list.

Parameters:

  | remove | pointer to the item to be removed

Definition at line 117 of file network_gamelist.cpp.

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

Referenced by NetworkGameWindow::OnKeyPress().