OpenTTD Source 20250503-master-gf4f05dea33
|
Part of the network protocol handling content distribution. More...
#include <ranges>
#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 | |
using | ContentVector = std::vector< std::unique_ptr< ContentInfo > > |
Vector with content info. | |
using | ConstContentVector = std::vector< const ContentInfo * > |
Vector with constant content info. | |
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 GRFConfigList &list) |
Show the content list window with all missing grfs from the given list. | |
Variables | |
ClientNetworkContentSocketHandler | _network_content_client |
The client we use to connect to the server. | |
Part of the network protocol handling content distribution.
Definition in file network_content.h.
using ConstContentVector = std::vector<const ContentInfo *> |
Vector with constant content info.
Definition at line 22 of file network_content.h.
using ContentVector = std::vector<std::unique_ptr<ContentInfo> > |
Vector with content info.
Definition at line 20 of file network_content.h.
void ShowMissingContentWindow | ( | const GRFConfigList & | list | ) |
Show the content list window with all missing grfs from the given list.
list | The list of grfs to check for missing / not exactly matching ones. |
Definition at line 1515 of file newgrf_gui.cpp.
References Compatible, CONTENT_TYPE_NEWGRF, ContentInfo::DOES_NOT_EXIST, GRFConfig::flags, GCS_NOT_FOUND, GRFConfig::GetName(), GRFIdentifier::grfid, GRFConfig::ident, GRFIdentifier::md5sum, GRFConfig::original_md5sum, ShowNetworkContentListWindow(), GRFConfig::status, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
Referenced by SaveLoadWindow::OnClick(), NetworkGameWindow::OnClick(), and NewGRFWindow::OnClick().
void ShowNetworkContentListWindow | ( | ContentVector * | cv, |
ContentType | type1, | ||
ContentType | type2 | ||
) |
Show the content list window with a given set of content.
cv | the content to show, or nullptr when it has to search for itself |
type1 | the first type to (only) show or CONTENT_TYPE_END to show all. |
type2 | the 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 1115 of file network_content_gui.cpp.
References _network_content_client, _network_content_list_desc, ClientNetworkContentSocketHandler::Clear(), CloseWindowById(), CONTENT_TYPE_END, GetEncodedString(), 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().
|
extern |
The client we use to connect to the server.
Definition at line 47 of file network_content.cpp.
Referenced by BaseNetworkContentDownloadStatusWindow::BaseNetworkContentDownloadStatusWindow(), BootstrapAskForDownloadWindow::BootstrapAskForDownloadWindow(), NetworkContentListWindow::BuildContentList(), BootstrapAskForDownloadWindow::Close(), NetworkContentListWindow::Close(), BaseNetworkContentDownloadStatusWindow::Close(), NetworkContentListWindow::DrawDetails(), NetworkBackgroundLoop(), NetworkContentListWindow::NetworkContentListWindow(), BootstrapAskForDownloadWindow::OnClick(), NetworkContentDownloadStatusWindow::OnClick(), NetworkContentListWindow::OnClick(), BootstrapAskForDownloadWindow::OnConnect(), NetworkContentConnecter::OnConnect(), NetworkContentConnecter::OnFailure(), NetworkContentListWindow::OnKeyPress(), BootstrapAskForDownloadWindow::OnReceiveContentInfo(), NetworkContentListWindow::OnReceiveContentInfo(), and ShowNetworkContentListWindow().