diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-14 00:04:20 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-14 00:04:20 +0100 |
| commit | 99f328fa19bb9cb266d9525629813cc0268a889e (patch) | |
| tree | 514d5eb5fe51afc5f19bb3acf240a425239eba2a /include/protocol.h | |
| parent | f8ccfba637267bae8064daa320cfb00b8ffe3e66 (diff) | |
bullets network transfer
Diffstat (limited to 'include/protocol.h')
| -rw-r--r-- | include/protocol.h | 18 |
1 files changed, 18 insertions, 0 deletions
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; |
