celestar@5642: /* $Id$ */ celestar@5642: celestar@5642: #ifndef NETWORK_CORE_TCP_H celestar@5642: #define NETWORK_CORE_TCP_H celestar@5642: celestar@5642: #ifdef ENABLE_NETWORK celestar@5642: celestar@5642: /** celestar@5642: * @file tcp.h Basic functions to receive and send TCP packets. celestar@5642: */ celestar@5642: celestar@5642: /** celestar@5642: * Enum with all types of UDP packets. celestar@5642: * The order of the first 4 packets MUST not be changed, as celestar@5642: * it protects old clients from joining newer servers celestar@5642: * (because SERVER_ERROR is the respond to a wrong revision) celestar@5642: */ celestar@5642: enum { celestar@5642: PACKET_SERVER_FULL, celestar@5642: PACKET_SERVER_BANNED, celestar@5642: PACKET_CLIENT_JOIN, celestar@5642: PACKET_SERVER_ERROR, celestar@5642: PACKET_CLIENT_COMPANY_INFO, celestar@5642: PACKET_SERVER_COMPANY_INFO, celestar@5642: PACKET_SERVER_CLIENT_INFO, celestar@5642: PACKET_SERVER_NEED_PASSWORD, celestar@5642: PACKET_CLIENT_PASSWORD, celestar@5642: PACKET_SERVER_WELCOME, celestar@5642: PACKET_CLIENT_GETMAP, celestar@5642: PACKET_SERVER_WAIT, celestar@5642: PACKET_SERVER_MAP, celestar@5642: PACKET_CLIENT_MAP_OK, celestar@5642: PACKET_SERVER_JOIN, celestar@5642: PACKET_SERVER_FRAME, celestar@5642: PACKET_SERVER_SYNC, celestar@5642: PACKET_CLIENT_ACK, celestar@5642: PACKET_CLIENT_COMMAND, celestar@5642: PACKET_SERVER_COMMAND, celestar@5642: PACKET_CLIENT_CHAT, celestar@5642: PACKET_SERVER_CHAT, celestar@5642: PACKET_CLIENT_SET_PASSWORD, celestar@5642: PACKET_CLIENT_SET_NAME, celestar@5642: PACKET_CLIENT_QUIT, celestar@5642: PACKET_CLIENT_ERROR, celestar@5642: PACKET_SERVER_QUIT, celestar@5642: PACKET_SERVER_ERROR_QUIT, celestar@5642: PACKET_SERVER_SHUTDOWN, celestar@5642: PACKET_SERVER_NEWGAME, celestar@5642: PACKET_SERVER_RCON, celestar@5642: PACKET_CLIENT_RCON, celestar@5642: PACKET_END ///< Must ALWAYS be on the end of this list!! (period) celestar@5642: }; celestar@5642: celestar@5642: void NetworkSend_Packet(Packet *packet, NetworkClientState *cs); celestar@5642: Packet *NetworkRecv_Packet(NetworkClientState *cs, NetworkRecvStatus *status); celestar@5642: bool NetworkSend_Packets(NetworkClientState *cs); celestar@5642: celestar@5642: #endif /* ENABLE_NETWORK */ celestar@5642: celestar@5642: #endif /* NETWORK_CORE_TCP_H */