Base socket handler for all Content TCP sockets.
virtual bool Receive_SERVER_CONTENT(Packet *p)
Server sending list of content info: uint32 unique id uint32 file size (0 == does not exist) string f...
bool ReceivePackets()
Receive a packet at TCP level.
virtual bool Receive_CLIENT_INFO_EXTID_MD5(Packet *p)
Client requesting a list of content info based on an external 'unique' id; GRF ID + MD5 checksum for ...
ContentType
The values in the enum are important; they are used as database 'keys'.
PacketContentType
Enum with all types of TCP content packets.
virtual bool Receive_CLIENT_INFO_EXTID(Packet *p)
Client requesting a list of content info based on an external 'unique' id; GRF ID for NewGRFS,...
virtual ~NetworkContentSocketHandler()
On destructing of this class, the socket needs to be closed.
NetworkContentSocketHandler(SOCKET s=INVALID_SOCKET)
Create a new cs socket handler for a given cs.
bool ReceiveInvalidPacket(PacketContentType type)
Helper for logging receiving invalid packets.
virtual bool Receive_CLIENT_CONTENT(Packet *p)
Client requesting the actual content: uint16 count of unique ids uint32 unique id (count times)
virtual bool Receive_CLIENT_INFO_LIST(Packet *p)
Client requesting a list of content info: byte type uint32 openttd version.
virtual bool Receive_CLIENT_INFO_ID(Packet *p)
Client requesting a list of content info: uint16 count of ids uint32 id (count times)
Subdirectory GetContentInfoSubDir(ContentType type)
Helper to get the subdirectory a ContentInfo is located in.
bool HandlePacket(Packet *p)
Handle the given packet, i.e.
virtual bool Receive_SERVER_INFO(Packet *p)
Server sending list of content info: byte type (invalid ID == does not exist) uint32 id uint32 file_s...