1 #ifndef PLAYER_REMOTE_H
2 #define PLAYER_REMOTE_H
6 #include "network_common.h"
7 #include "player_effects.h"
9 #define NETWORK_SFX_QUEUE_LENGTH 12
12 struct network_player
{
13 int active
, isfriend
, isblocked
;
15 u16 board_view_slot
, playermodel_view_slot
;
16 enum player_subsystem subsystem
;
18 /* this is set IF they exist in a world that we have loaded */
19 world_instance
*active_world
;
20 int world_match
[ k_world_max
];
21 u32 location_pstr
; /* TODO: valid if active_world set. */
23 /* TODO: Compression with server code */
24 char username
[ NETWORK_USERNAME_MAX
];
25 char items
[k_netmsg_playeritem_max
][ADDON_UID_MAX
];
26 char chat
[ NETWORK_MAX_CHAT
];
27 char region
[ NETWORK_REGION_MAX
];
38 struct player_effects_data effect_data
;
41 list
[ NETWORK_MAX_PLAYERS
];
43 struct interp_buffer
{
44 /* collect the most recent 6 frames of animation data */
48 enum player_subsystem subsystem
;
53 union interp_animdata
{
54 /* these aren't accessed directly, just used to take the
55 * max(sizeof) all systems */
56 struct player_skate_animator __skate
;
57 struct player_walk_animator __walk
;
58 struct player_dead_animator __dead
;
59 struct player_basic_info_animator __basic
;
63 struct remote_glider_animator data_glider
;
65 frames
[ NETWORK_BUFFERFRAMES
];
69 interp_data
[ NETWORK_MAX_PLAYERS
];
71 struct net_sfx sfx_queue
[ NETWORK_SFX_QUEUE_LENGTH
];
75 struct player_board_pose board_poses
[ NETWORK_MAX_PLAYERS
];
79 f64 last_data_measurement
;
82 char chat_buffer
[ NETWORK_MAX_CHAT
], chat_message
[ NETWORK_MAX_CHAT
];
87 static void player_remote_rx_200_300( SteamNetworkingMessage_t
*msg
);
88 static void remote_player_debug_update(void);
89 static void remote_player_send_playerframe(void);
90 static void animate_remote_player( u32 index
);
91 static void render_remote_players( world_instance
*world
, camera
*cam
);
92 static void relink_all_remote_player_worlds(void);
93 static void player_remote_update_friendflags( struct network_player
*remote
);
95 #endif /* PLAYER_REMOTE_H */