4 #include "network_common.h"
5 #include "player_render.h"
6 #include "player_effects.h"
7 #include "player_api.h"
9 #include "player_skate.h"
10 #include "player_walk.h"
11 #include "player_dead.h"
12 #include "player_basic_info.h"
13 #include "player_glide.h"
15 #define NETWORK_SFX_QUEUE_LENGTH 12
17 struct global_netplayers
19 struct network_player
{
20 int active
, isfriend
, isblocked
;
22 u16 board_view_slot
, playermodel_view_slot
;
23 enum player_subsystem subsystem
;
25 /* this is set IF they exist in a world that we have loaded */
26 world_instance
*active_world
;
27 int world_match
[ k_world_max
];
28 u32 location_pstr
; /* TODO: valid if active_world set. */
30 /* TODO: Compression with server code */
31 char username
[ NETWORK_USERNAME_MAX
];
32 char items
[k_netmsg_playeritem_max
][ADDON_UID_MAX
];
33 char chat
[ NETWORK_MAX_CHAT
];
34 char region
[ NETWORK_REGION_MAX
];
45 struct player_effects_data effect_data
;
48 list
[ NETWORK_MAX_PLAYERS
];
50 struct interp_buffer
{
51 /* collect the most recent 6 frames of animation data */
55 enum player_subsystem subsystem
;
60 union interp_animdata
{
61 /* these aren't accessed directly, just used to take the
62 * max(sizeof) all systems */
63 struct player_skate_animator __skate
;
64 struct player_walk_animator __walk
;
65 struct player_dead_animator __dead
;
66 struct player_basic_info_animator __basic
;
70 struct remote_glider_animator data_glider
;
72 frames
[ NETWORK_BUFFERFRAMES
];
76 interp_data
[ NETWORK_MAX_PLAYERS
];
78 struct net_sfx sfx_queue
[ NETWORK_SFX_QUEUE_LENGTH
];
82 struct player_board_pose board_poses
[ NETWORK_MAX_PLAYERS
];
86 f64 last_data_measurement
;
89 char chat_buffer
[ NETWORK_MAX_CHAT
], chat_message
[ NETWORK_MAX_CHAT
];
94 void player_remote_rx_200_300( SteamNetworkingMessage_t
*msg
);
95 void remote_player_debug_update(void);
96 void remote_player_send_playerframe(void);
97 void animate_remote_player( u32 index
);
98 void animate_remote_players(void);
99 void render_remote_players( world_instance
*world
, vg_camera
*cam
);
100 void relink_all_remote_player_worlds(void);
101 void player_remote_update_friendflags( struct network_player
*remote
);
102 void remote_players_init(void);
103 void remote_sfx_pre_update(void);
104 void remote_player_network_imgui( m4x4f pv
);
105 void remote_players_imgui_world( world_instance
*world
, m4x4f pv
,
106 f32 max_dist
, int geo_cull
);
107 void remote_players_imgui_lobby(void);
108 void remote_players_chat_imgui(void);