14 #ifndef NETWORK_CORE_TCP_GAME_H 15 #define NETWORK_CORE_TCP_GAME_H 19 #include "../network_type.h" 20 #include "../../core/pool_type.hpp" 542 assert(info != NULL && this->info == NULL);
Client acknowledges that it has all required NewGRFs.
Information about a single company.
Server tells everyone that someone is moved to another company.
Container for all information known about a client.
Internal entity of a packet.
Network stuff has many things that needs to be included and/or implemented by default.
CommandPacket * Pop(bool ignore_paused=false)
Return the first item in the queue and remove it from the queue.
A client changes its name.
A server tells that a client has hit an error and did quit.
The server is full and has no place for you.
Clients sends the (hashed) game password.
Base socket handler for all TCP sockets.
uint count
The number of items in the queue.
Server distributing the message of a client (or itself).
void Append(CommandPacket *p)
Append a CommandPacket at the end of the queue.
Server tells the client what frame it is in, and thus to where the client may progress.
The client tells the server which frame it has executed.
Server tells the client what the random state should be.
NetworkClientInfo * info
Client info related to this socket.
Server welcomes you and gives you your ClientID.
Client asks the server to execute some command.
Server tells the client that it is beginning to send the map.
CommandQueue incoming_queue
The command-queue awaiting handling.
Response of the executed command on the server.
A server tells that a client has quit.
Server distributes a command to (all) the clients.
A queue of CommandPackets.
Server sends NewGRF IDs and MD5 checksums for the client to check.
uint32 last_frame
Last frame we have executed.
A client would like to be moved to another company.
Server sends you information about a client.
CommandQueue()
Initialise the command queue.
Client sends the (hashed) company password.
Server sends bits of the map to the client.
CommandPacket * last
The last packet in the queue; only valid when first != NULL.
NetworkRecvStatus
Status of a network client; reasons why a client has quit.
A client (re)sets its company's password.
CommandPacket * first
The first packet in the queue.
void Free()
Free everything that is in the queue.
uint last_packet
Time we received the last frame.
NetworkClientInfo * GetInfo() const
Gets the client info of this socket handler.
Server sending an error message to the client.
A client reports an error to the server.
uint Count() const
Get the number of items in the queue.
PacketGameType
Enum with all types of TCP packets.
ClientID client_id
Client identifier.
uint32 last_frame_server
Last frame the server has executed.
Tells clients that a new client has joined.
Some network configuration important to the client changed.
Client requests the actual map.
void SetInfo(NetworkClientInfo *info)
Sets the client info for this socket handler.
The server is preparing to start a new game.
Client executed a command and sends it to the server.
ClientID
'Unique' identifier to be given to clients
void CDECL error(const char *s,...)
Error handling for fatal non-user errors.
Server tells it has just sent the last bits of the map to the client.
Server tells the client what the (compressed) size of the map is.
The client telling the server it wants to join.
Must ALWAYS be on the end of this list!! (period)
Server tells the client there are some people waiting for the map as well.
A client tells the server it is going to quit.
Everything we need to know about a command to be able to execute it.
Server requests the (hashed) game password.
Server requests the (hashed) company password.
Client said something that should be distributed.
CommandPacket * Peek(bool ignore_paused=false)
Return the first item in the queue, but don't remove it.
The server has banned you.
Base socket handler for all TCP sockets.
~CommandQueue()
Clear the command queue.
Basic functions to receive and send TCP packets.
The server is shutting down.
Information (password) of a company changed.
Request information about all companies.
Client tells the server that it received the whole map.