From 99f328fa19bb9cb266d9525629813cc0268a889e Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Wed, 14 Dec 2022 00:04:20 +0100 Subject: bullets network transfer --- include/protocol.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/protocol.h') diff --git a/include/protocol.h b/include/protocol.h index 989c4d5..64822a2 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -10,6 +10,8 @@ typedef enum t_network_message_type { MESSAGE_USER_MOVED, MESSAGE_USER_LOOK, MESSAGE_ZOMBIE_LIST, + MESSAGE_USER_SHOOT, + MESSAGE_BULLET_LIST, } network_message_type; typedef struct t_protocol_generic_client_message { @@ -60,6 +62,20 @@ typedef struct t_protocol_user_look { float guny; } protocol_user_look; +#include "bullets.h" + +typedef struct t_protocol_bullets_list { + network_message_type type; + bullet bullets[500]; +} protocol_bullets_list; + +typedef struct t_protocol_user_shoot { + network_message_type type; + u32 id; + float dirx; + float diry; +} protocol_user_shoot; + #define MAX_NETWORK_BUFFER_SIZE 50000 u8 network_buffer[50000]; network_message create_protocol_get_id_up(); @@ -67,7 +83,9 @@ network_message create_protocol_get_id_down(u32 id); network_message create_protocol_user_list(); network_message create_protocol_user_moved(protocol_move_type move, u32 id); network_message create_protocol_user_look(u32 id, float gunx, float guny); +network_message create_protocol_user_shoot(u32 id, float dirx, float diry); network_message create_protocol_zombie_list(); +network_message create_protocol_bullets_list(); array messages_received_on_server; array messages_received_on_client; -- cgit v1.2.3-70-g09d2