OpenTTD Source 20241224-master-gf74b0cf984
network_content.h File Reference

Part of the network protocol handling content distribution. More...

#include "core/tcp_content.h"
#include "core/http.h"
#include <unordered_map>
#include "../core/container_func.hpp"

Go to the source code of this file.

Data Structures

struct  ContentCallback
 Callbacks for notifying others about incoming data. More...
 
class  ClientNetworkContentSocketHandler
 Socket handler for the content server connection. More...
 

Typedefs

typedef std::vector< ContentInfo * > ContentVector
 Vector with content info.
 
typedef std::vector< const ContentInfo * > ConstContentVector
 Vector with constant content info.
 
typedef ContentInfo ** ContentIterator
 Iterator for the content vector.
 
typedef const ContentInfo *const * ConstContentIterator
 Iterator for the constant content vector.
 

Functions

void ShowNetworkContentListWindow (ContentVector *cv=nullptr, ContentType type1=CONTENT_TYPE_END, ContentType type2=CONTENT_TYPE_END)
 Show the content list window with a given set of content.
 
void ShowMissingContentWindow (const struct GRFConfig *list)
 

Variables

ClientNetworkContentSocketHandler _network_content_client
 The client we use to connect to the server.
 

Detailed Description

Part of the network protocol handling content distribution.

Definition in file network_content.h.

Typedef Documentation

◆ ConstContentIterator

typedef const ContentInfo* const* ConstContentIterator

Iterator for the constant content vector.

Definition at line 26 of file network_content.h.

◆ ConstContentVector

typedef std::vector<const ContentInfo *> ConstContentVector

Vector with constant content info.

Definition at line 21 of file network_content.h.

◆ ContentIterator

Iterator for the content vector.

Definition at line 24 of file network_content.h.

◆ ContentVector

typedef std::vector<ContentInfo *> ContentVector

Vector with content info.

Definition at line 19 of file network_content.h.

Function Documentation

◆ ShowNetworkContentListWindow()

void ShowNetworkContentListWindow ( ContentVector cv,
ContentType  type1,
ContentType  type2 
)

Show the content list window with a given set of content.

Parameters
cvthe content to show, or nullptr when it has to search for itself
type1the first type to (only) show or CONTENT_TYPE_END to show all.
type2the second type to (only) show in addition to type1. If type2 is != CONTENT_TYPE_END, then also type1 should be != CONTENT_TYPE_END. If type2 != CONTENT_TYPE_END, then type1 != type2 must be true.

Definition at line 1130 of file network_content_gui.cpp.

References _network_content_client, _network_content_list_desc, ClientNetworkContentSocketHandler::Clear(), CloseWindowById(), CONTENT_TYPE_END, ClientNetworkContentSocketHandler::RequestContentList(), ShowErrorMessage(), WC_NETWORK_WINDOW, WL_ERROR, and WN_NETWORK_WINDOW_CONTENT_LIST.

Referenced by AIConfigWindow::OnClick(), SaveLoadWindow::OnClick(), GSConfigWindow::OnClick(), SelectGameWindow::OnClick(), GameOptionsWindow::OnClick(), and ShowMissingContentWindow().

Variable Documentation

◆ _network_content_client