From c6763223b8b0c3f78edb6ac759c14f08375b438f Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Wed, 15 May 2024 10:23:02 +0200 Subject: join game menu --- include/game.h | 2 +- include/menu.h | 2 ++ include/protocol.h | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/game.h b/include/game.h index df9a686..88fd0e1 100644 --- a/include/game.h +++ b/include/game.h @@ -39,6 +39,6 @@ game global_state = {GAMESTATE_IDLE,DISCONNECTED,0,0}; void init_game(); void start_solo_game(); -void connect_to_game(char* ip, char* port); +bool connect_to_game(char* ip, char* port); #endif \ No newline at end of file diff --git a/include/menu.h b/include/menu.h index f2ccb76..fd74425 100644 --- a/include/menu.h +++ b/include/menu.h @@ -3,6 +3,8 @@ #include +#define PROGRAM_VERSION "0.1.0 | "__DATE__ + extern int current_res_index; extern bool is_fullscreen; vec2 available_resolutions[] = { diff --git a/include/protocol.h b/include/protocol.h index 9ca7226..d89952c 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -8,6 +8,8 @@ typedef enum t_network_message_type { + MESSAGE_PING_UPSTREAM, + MESSAGE_PING_DOWNSTREAM, MESSAGE_GET_ID_UPSTREAM, MESSAGE_GET_ID_DOWNSTREAM, MESSAGE_USER_LIST, @@ -48,6 +50,12 @@ typedef struct t_protocol_get_id_downstream u32 id; } protocol_get_id_downstream; +typedef struct t_protocol_ping_downstream +{ + network_message_type type; + char program_version[30]; +} protocol_ping_downstream; + typedef struct t_protocol_user_list { network_message_type type; @@ -166,6 +174,7 @@ allocator server_incomming_allocator; allocator client_incomming_allocator; allocator outgoing_allocator; +network_message create_protocol_ping_downstream(); network_message create_protocol_get_id_up(u32 id); network_message create_protocol_get_id_down(u32 id); network_message create_protocol_sound_list(); -- cgit v1.2.3-70-g09d2