OpenTTD Source: ContentCallback Struct Reference

OpenTTD Source 1.11.0-RC1

Public Member Functions
ContentCallback Struct Reference

Callbacks for notifying others about incoming data. More...

`#include <network_content.h>`

Inheritance diagram for ContentCallback:

## Public Member Functions
virtual void | OnConnect (bool success)
| Callback for when the connection has finished. More...
virtual void | OnDisconnect ()
| Callback for when the connection got disconnected.
virtual void | OnReceiveContentInfo (const ContentInfo *ci)
| We received a content info. More...
virtual void | OnDownloadProgress (const ContentInfo *ci, int bytes)
| We have progress in the download of a file. More...
virtual void | OnDownloadComplete (ContentID cid)
| We have finished downloading a file. More...
virtual | ~ContentCallback ()
| Silentium.

## Detailed Description

Callbacks for notifying others about incoming data.

Definition at line 27 of file network_content.h.

## Member Function Documentation

## ◆ OnConnect()

virtual void ContentCallback::OnConnect | ( | bool | success | ) |
| inlinevirtual

Callback for when the connection has finished.

Parameters

  success | whether the connection was made or that we failed to make it

Reimplemented in NetworkContentListWindow, BootstrapAskForDownloadWindow, ClientNetworkContentSocketHandler, and ConsoleContentCallback.

Definition at line 32 of file network_content.h.

Referenced by ClientNetworkContentSocketHandler::OnConnect().

## ◆ OnDownloadComplete()

virtual void ContentCallback::OnDownloadComplete | ( | ContentID | cid | ) |
| inlinevirtual

We have finished downloading a file.

Parameters

  cid | the ContentID of the downloaded file

Reimplemented in NetworkContentListWindow, BootstrapContentDownloadStatusWindow, ClientNetworkContentSocketHandler, and ConsoleContentCallback.

Definition at line 56 of file network_content.h.

Referenced by ClientNetworkContentSocketHandler::OnDownloadComplete().

## ◆ OnDownloadProgress()

virtual void ContentCallback::OnDownloadProgress | ( | const ContentInfo * | ci,
|  | int | bytes
| ) |  |
| inlinevirtual

We have progress in the download of a file.

Parameters

  ci | the content info of the file
  bytes | the number of bytes downloaded since the previous call

Reimplemented in NetworkContentDownloadStatusWindow, ClientNetworkContentSocketHandler, and BaseNetworkContentDownloadStatusWindow.

Definition at line 50 of file network_content.h.

Referenced by ClientNetworkContentSocketHandler::OnDownloadProgress().

## ◆ OnReceiveContentInfo()

virtual void ContentCallback::OnReceiveContentInfo | ( | const ContentInfo * | ci | ) |
| inlinevirtual

We received a content info.

Parameters

  ci | the content info

Reimplemented in NetworkContentListWindow, BootstrapAskForDownloadWindow, and ClientNetworkContentSocketHandler.

Definition at line 43 of file network_content.h.

Referenced by ClientNetworkContentSocketHandler::OnReceiveContentInfo().

The documentation for this struct was generated from the following file:

- src/network/network_content.h