network oneshots
[carveJwlIkooP6JGAAIwe30JlM.git] / player_remote.h
index ca96290b241231e7fc1d72c0b235c1675ed429ba..a35e22ce1f0e897c032ab12259195dcf2927dfd6 100644 (file)
@@ -3,6 +3,9 @@
 
 #include "player.h"
 #include "network.h"
+#include "network_common.h"
+
+#define NETWORK_SFX_QUEUE_LENGTH 12
 
 struct {
    struct network_player {
@@ -10,11 +13,18 @@ struct {
       u16 board_view_slot, playermodel_view_slot;
       enum player_subsystem subsystem;
 
-      char username[32];
+      /* this is set IF they exist in a world that we have loaded */
+      world_instance *active_world;
+      int hub_match, client_match;
+
+      /* TODO: Compression with server code */
+      char username[ NETWORK_USERNAME_MAX ];
+      char items[k_netmsg_playeritem_max][ADDON_UID_MAX];
+
       u32 down_bytes;
       f32 down_kbs;
    }
-   list[32];
+   list[ NETWORK_MAX_PLAYERS ];
 
    struct interp_buffer {
       /* collect the most recent 6 frames of animation data */
@@ -23,6 +33,9 @@ struct {
          f64 timestamp;
          enum player_subsystem subsystem;
 
+         u8 instance_id;
+         u16 boundary_hash;
+
          union interp_animdata {
             struct player_skate_animator _skate;
             struct player_walk_animator _walk;
@@ -30,13 +43,17 @@ struct {
          } 
          data;
       }
-      frames[6];
+      frames[ NETWORK_BUFFERFRAMES ];
 
       f64 t;
    }
-   interp_data[32];
+   interp_data[ NETWORK_MAX_PLAYERS ];
+
+   struct net_sfx sfx_queue[ NETWORK_SFX_QUEUE_LENGTH ];
+   u8 sfx_availible[ NETWORK_SFX_QUEUE_LENGTH ];
 
    m4x3f *final_mtx;
+   struct player_board_pose board_poses[ NETWORK_MAX_PLAYERS ];
 
    u32 up_bytes;
    f32 up_kbs, down_kbs;
@@ -48,5 +65,7 @@ static void player_remote_rx_200_300( SteamNetworkingMessage_t *msg );
 static void remote_player_debug_update(void);
 static void remote_player_send_playerframe(void);
 static void animate_remote_player( u32 index );
+static void render_remote_players( world_instance *world, camera *cam );
+static void relink_all_remote_player_worlds(void);
 
 #endif /* PLAYER_REMOTE_H */