OpenTTD Source
12.0-beta2
|
Go to the source code of this file.
Data Structures | |
struct | NetworkGameList |
Structure with information shown in the game list (GUI) More... | |
Functions | |
NetworkGameList * | NetworkGameListAddItem (const std::string &connection_string) |
Add a new item to the linked gamelist. More... | |
void | NetworkGameListRemoveItem (NetworkGameList *remove) |
Remove an item from the gamelist linked list. More... | |
void | NetworkGameListRemoveExpired () |
Remove all servers that have not recently been updated. More... | |
Variables | |
NetworkGameList * | _network_game_list |
Game list of this client. | |
int | _network_game_list_version |
Current version of all items in the list. | |
Handling of the list of games.
Definition in file network_gamelist.h.
NetworkGameList* NetworkGameListAddItem | ( | const std::string & | connection_string | ) |
Add a new item to the linked gamelist.
If the IP and Port match return the existing item instead of adding it again
connection_string | the address of the to-be added item |
Definition at line 32 of file network_gamelist.cpp.
References _network_game_list, _network_game_list_version, NetworkGameList::connection_string, ServerAddress::connection_string, NETWORK_DEFAULT_PORT, NetworkGameList::next, ServerAddress::Parse(), UpdateNetworkGameWindow(), and NetworkGameList::version.
Referenced by NetworkAddServer(), TCPQueryConnecter::OnFailure(), ClientNetworkCoordinatorSocketHandler::Receive_GC_LISTING(), and ClientNetworkGameSocketHandler::Receive_SERVER_GAME_INFO().
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 91 of file network_gamelist.cpp.
References _network_game_list, _network_game_list_version, ClearGRFConfigList(), NetworkServerGameInfo::grfconfig, NetworkGameList::info, NetworkGameList::next, and UpdateNetworkGameWindow().
Referenced by ClientNetworkCoordinatorSocketHandler::Receive_GC_LISTING().
void NetworkGameListRemoveItem | ( | NetworkGameList * | remove | ) |
Remove an item from the gamelist linked list.
remove | pointer to the item to be removed |
Definition at line 63 of file network_gamelist.cpp.
References _network_game_list, ClearGRFConfigList(), NetworkServerGameInfo::grfconfig, NetworkGameList::info, and NetworkGameList::next.