diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/protocol.h | 19 | ||||
| -rw-r--r-- | include/throwables.h | 6 |
2 files changed, 22 insertions, 3 deletions
diff --git a/include/protocol.h b/include/protocol.h index 329810c..e0c47c6 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -13,11 +13,13 @@ typedef enum t_network_message_type MESSAGE_USER_LIST, MESSAGE_USER_MOVED, MESSAGE_USER_LOOK, + MESSAGE_USER_THROW, MESSAGE_ZOMBIE_LIST, MESSAGE_USER_SHOOT, MESSAGE_BULLET_LIST, MESSAGE_DROP_LIST, MESSAGE_SOUND_LIST, + MESSAGE_THROWABLES_LIST, } network_message_type; typedef struct t_protocol_generic_client_message @@ -87,6 +89,15 @@ typedef struct t_protocol_move float delta; } protocol_move; +typedef struct t_protocol_user_throw +{ + network_message_type type; + u32 id; + float dirx; + float diry; + throwable_type throwable; +} protocol_user_throw; + typedef struct t_protocol_user_look { network_message_type type; @@ -103,6 +114,12 @@ typedef struct t_protocol_bullets_list bullet bullets[500]; } protocol_bullets_list; +typedef struct t_protocol_throwables_list +{ + network_message_type type; + throwable throwables[50]; +} protocol_throwables_list; + typedef struct t_protocol_user_shoot { network_message_type type; @@ -131,9 +148,11 @@ 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_user_throw(u32 id, float dirx, float diry, throwable_type type); network_message create_protocol_zombie_list(); network_message create_protocol_bullets_list(); network_message create_protocol_drop_list(); +network_message create_protocol_throwables_list(); array messages_received_on_server; array messages_received_on_client; diff --git a/include/throwables.h b/include/throwables.h index 714e66b..5e49c16 100644 --- a/include/throwables.h +++ b/include/throwables.h @@ -36,10 +36,10 @@ typedef struct t_throwable { vec3f grenade_explosion_size = (vec3f){2.0f, 2.0f, 2.0f}; -throwable throwables[500] = {0}; -int max_throwables = 500; +throwable throwables[50] = {0}; +int max_throwables = 50; -void throw_throwable(platform_window* window, u32 id, throwable_type type, float dirx, float diry); +void throw_throwable(u32 id, throwable_type type, float dirx, float diry); void draw_throwables(platform_window* window); #endif
\ No newline at end of file |
