6#include "network_architecture.h"
7#include "connection_manager.h"
16#define MAX_PACKET_SIZE 1024
18#define INPUT_DOWN 0x02
19#define INPUT_SPAWN 0x80
28 PACKET_TYPE_ENTITY_UPDATE,
29 PACKET_TYPE_MULTI_ENTITY_UPDATE,
30 PACKET_TYPE_CLIENT_REGISTER,
31 PACKET_TYPE_SERVER_ACK,
32 PACKET_TYPE_CLIENT_INPUT,
80ECSNET_API
void protocol_handler_pack_entity_update(
protocol_handler_t *handler, entity_t entity_id,
const uint8_t *data,
88void protocol_handler_pack_client_register(
protocol_handler_t *handler, uint16_t udp_port);
101bool protocol_handler_unpack_client_register(
const network_packet_t* pkt, uint16_t* out_port);
117ECSNET_API
void protocol_handler_pack_client_input(
protocol_handler_t* handler, entity_t entity_id, uint8_t input_cmd,
const void* extra, uint16_t extra_len);
137ECSNET_API
bool protocol_handler_unpack_client_input(
const network_packet_t* pkt, entity_t* out_eid, uint8_t* out_cmd,
const void** out_extra, uint16_t* out_extra_len);
Manages all active network connections (peers) for a client or server.
Definition connection_manager.h:74
Internal structure representing the ECS world state. This holds:
Definition ecs_internal.h:44
A full network packet structure. This struct combines the header and the data payload,...
Definition protocol_handler.h:51
packet_header_t header
Definition protocol_handler.h:52
uint8_t data[MAX_PACKET_SIZE - sizeof(packet_header_t)]
Definition protocol_handler.h:53
Represents a connected network peer.
Definition connection_manager.h:45
The protocol handler structure. Manages the state for incoming and outgoing network packets,...
Definition protocol_handler.h:62
network_packet_t in_packet
Definition protocol_handler.h:64
network_packet_t out_packet
Definition protocol_handler.h:63