diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-18 17:41:50 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-18 17:41:50 +0100 |
| commit | 3e825971102a33dfbb82a20a365684d413bc1ba8 (patch) | |
| tree | 718bf8a802bf3631bee22ef33161dec8d68ed6cf /include | |
| parent | 9eefbb4afc9601024eac6191addd98e21f90a5b3 (diff) | |
refactor
Diffstat (limited to 'include')
| -rw-r--r-- | include/overlay.h | 2 | ||||
| -rw-r--r-- | include/players.h | 5 | ||||
| -rw-r--r-- | include/protocol.h | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/include/overlay.h b/include/overlay.h index de7410c..acbe1e4 100644 --- a/include/overlay.h +++ b/include/overlay.h @@ -3,7 +3,7 @@ #include <projectbase/project_base.h> -u64 server_update_time = 0; +u64 logic_update_time = 0; void draw_overlay(platform_window* window); diff --git a/include/players.h b/include/players.h index f76e620..027fb31 100644 --- a/include/players.h +++ b/include/players.h @@ -9,6 +9,8 @@ #include "math_helper.h" #include "guns.h" +#define MAX_PLAYERS 10 + typedef struct t_player { u32 id; bool active; @@ -33,8 +35,7 @@ u32 player_id = -1; camera _next_camera_pos; -int max_players = 10; -player players[10] = {0}; +player players[MAX_PLAYERS] = {0}; int get_player_count(); player* get_player_by_id(u32 id); diff --git a/include/protocol.h b/include/protocol.h index 39e7d6a..8fd33b9 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -4,6 +4,7 @@ #include <projectbase/project_base.h> #include "list.h" +#include "players.h" typedef enum t_network_message_type { @@ -45,7 +46,7 @@ typedef struct t_protocol_get_id_downstream typedef struct t_protocol_user_list { network_message_type type; - player players[10]; + player players[MAX_PLAYERS]; } protocol_user_list; #include "zombies.h" @@ -104,7 +105,7 @@ typedef struct t_protocol_user_shoot typedef struct t_send_queue_entry { bool active; - network_client recipients[10]; + network_client recipients[MAX_PLAYERS]; network_message message; } send_queue_entry; @@ -132,6 +133,7 @@ array messages_received_on_client; mutex messages_to_send_queue_mutex; send_queue_entry messages_to_send_queue[OUTGOING_QUEUE_SIZE] = {0}; +void add_message_to_outgoing_queuex(network_message message, network_client c); void add_message_to_outgoing_queue(send_queue_entry entry); void* network_send_thread(void* args); |
