14 #ifndef NETWORK_CORE_TCP_CONTENT_H 15 #define NETWORK_CORE_TCP_CONTENT_H 20 #include "../../debug.h" 103 virtual void Close();
114 virtual bool Receive_CLIENT_INFO_LIST(
Packet *p);
123 virtual bool Receive_CLIENT_INFO_ID(
Packet *p);
137 virtual bool Receive_CLIENT_INFO_EXTID(
Packet *p);
152 virtual bool Receive_CLIENT_INFO_EXTID_MD5(
Packet *p);
170 virtual bool Receive_SERVER_INFO(
Packet *p);
179 virtual bool Receive_CLIENT_CONTENT(
Packet *p);
191 virtual bool Receive_SERVER_CONTENT(
Packet *p);
193 bool HandlePacket(
Packet *p);
209 bool ReceivePackets();
Helper to mark the end of the types.
The content consists of base graphics.
bool IsSelected() const
Is the state either selected or autoselected?
char filename[48]
Filename (for the .tar.gz; only valid on download)
uint32 unique_id
Unique ID; either GRF ID or shortname.
Internal entity of a packet.
Queries the content server for information about a list of external IDs.
Network stuff has many things that needs to be included and/or implemented by default.
State
The state the content can be in.
Subdirectory
The different kinds of subdirectories OpenTTD uses.
Base socket handler for all Content TCP sockets.
uint32 filesize
Size of the file.
The content consists of a scenario.
Base socket handler for all TCP sockets.
uint8 dependency_count
Number of dependencies.
char(* tags)[32]
Malloced array of tags (strings)
Wrapper for (un)resolved network addresses; there's no reason to transform a numeric IP to a string a...
ContentID * dependencies
Malloced array of dependencies (unique server side ids)
The content has been selected as dependency.
virtual ~NetworkContentSocketHandler()
On destructing of this class, the socket needs to be closed.
ContentID
Unique identifier for the content.
The content has not been selected.
Queries the content server for information about a list of internal IDs.
The content does not exist in the content system.
char name[32]
Name of the content.
The content consists of a game script.
The content's invalid.
uint8 tag_count
Number of tags.
char version[16]
Version of the content.
Subdirectory GetContentInfoSubDir(ContentType type)
Helper to get the subdirectory a ContentInfo is located in.
Reply of content server with information about content.
size_t Size() const
Get the size of the data as send over the network.
The content is already at the client side.
ContentID id
Unique (server side) ID for the content.
ContentInfo()
Clear everything in the struct.
State state
Whether the content info is selected (for download)
void TransferFrom(ContentInfo *other)
Copy data from other ContentInfo and take ownership of allocated stuff.
TextfileType
Additional text files accompanying Tar archives.
Queries the content server for a list of info of a given content type.
byte md5sum[16]
The MD5 checksum.
The content consists of a GS library.
The content consists of a NewGRF.
ContentType
The values in the enum are important; they are used as database 'keys'.
PacketContentType
Enum with all types of TCP content packets.
NetworkAddress client_addr
The address we're connected to.
Queries the content server for information about a list of external IDs and MD5.
The content consists of an AI library.
Sentinel for invalid content.
Request a content file given an internal ID.
~ContentInfo()
Free everything allocated.
The content consists of a heightmap.
The content consists of an AI.
const char * GetTextfile(TextfileType type) const
Search a textfile file next to this file in the content list.
ContentType type
Type of content.
bool upgrade
This item is an upgrade.
Helper to mark the begin of the types.
The content consists of base music.
Basic functions to create, fill and read packets.
The content has been manually selected.
NetworkContentSocketHandler(SOCKET s=INVALID_SOCKET, const NetworkAddress &address=NetworkAddress())
Create a new cs socket handler for a given cs.
Basic functions to receive and send TCP packets.
char url[96]
URL related to the content.
Must ALWAYS be on the end of this list!! (period)
char description[512]
Description of the content.
Container for all important information about a piece of content.
bool IsValid() const
Is the information from this content info valid?
Reply with the content of the given ID.
The content consists of base sounds.