10#ifndef NETWORK_CORE_TCP_CONTENT_H
11#define NETWORK_CORE_TCP_CONTENT_H
34 static constexpr bool value =
true;
virtual bool ReceiveClientContent(Packet &p)
Client requesting the actual content: uint16_t count of unique ids uint32_t unique id (count times).
virtual bool ReceiveClientInfoID(Packet &p)
Client requesting a list of content info: uint16_t count of ids uint32_t id (count times).
NetworkContentSocketHandler(SOCKET s=INVALID_SOCKET)
Create a new cs socket handler for a given cs.
bool ReceivePackets()
Receive a packet at TCP level.
virtual bool ReceiveServerInfo(Packet &p)
Server sending list of content info: uint8_t type (invalid ID == does not exist) uint32_t id uint32_t...
virtual bool ReceiveClientInfoList(Packet &p)
Client requesting a list of content info: uint8_t type uint32_t openttd version (or 0xFFFFFFFF if usi...
virtual bool ReceiveServerContent(Packet &p)
Server sending list of content info: uint32_t unique id uint32_t file size (0 == does not exist) stri...
virtual bool ReceiveClientInfoExternalIDMD5(Packet &p)
Client requesting a list of content info based on an external 'unique' id; GRF ID + MD5 checksum for ...
virtual bool ReceiveClientInfoExternalID(Packet &p)
Client requesting a list of content info based on an external 'unique' id; GRF ID for NewGRFS,...
~NetworkContentSocketHandler() override
On destructing of this class, the socket needs to be closed.
bool ReceiveInvalidPacket(PacketContentType type)
Helper for logging receiving invalid packets.
bool HandlePacket(Packet &p)
Handle the given packet, i.e.
NetworkTCPSocketHandler(SOCKET s=INVALID_SOCKET)
Construct a socket handler for a TCP connection.
void CloseSocket()
Close the actual socket of the connection.
Functions related to debugging.
Subdirectory
The different kinds of subdirectories OpenTTD uses.
Includes and/or implementations for the network stuff.
Basic functions to create, fill and read packets.
static constexpr bool value
This is an enumeration of a PacketType.
Trait to mark an enumeration as a PacketType.
Basic functions to receive and send TCP packets.
Subdirectory GetContentInfoSubDir(ContentType type)
Helper to get the subdirectory a ContentInfo is located in.
PacketContentType
Enum with all types of TCP content packets.
@ ClientContent
Request a content file given an internal ID.
@ ClientInfoExternalID
Queries the content server for information about a list of external IDs.
@ ClientInfoID
Queries the content server for information about a list of internal IDs.
@ ClientInfoExternalIDMD5
Queries the content server for information about a list of external IDs and MD5.
@ ServerInfo
Reply of content server with information about content.
@ ServerContent
Reply with the content of the given ID.
@ ClientInfoList
Queries the content server for a list of info of a given content type.
Basic types related to the content on the content server.
ContentType
The values in the enum are important; they are used as database 'keys'.