1 #ifndef _MULTIPLAYER_OBJECT_UPDATE_HEADER_FILE
2 #define _MULTIPLAYER_OBJECT_UPDATE_HEADER_FILE
12 // ---------------------------------------------------------------------------------------------------
13 // OBJECT UPDATE DEFINES/VARS
20 // client button info flags
21 #define OOC_FIRE_PRIMARY (1<<0)
22 #define OOC_FIRE_SECONDARY (1<<1)
23 #define OOC_FIRE_COUNTERMEASURE (1<<2)
24 #define OOC_TARGET_LOCKED (1<<3)
25 #define OOC_TARGET_SEEK_LOCK (1<<4)
26 #define OOC_LOCKING_ON_CENTER (1<<5)
28 // interpolation info struct
29 typedef struct interp_info {
30 // position and timestamp
34 // velocity and timestamp
38 // desired velocity and timestamp
42 // orientation and timestamp
46 // rotvel and timestamp
50 // desired rotvel and timestamp
51 vector desired_rotvel;
52 int desired_rotvel_time;
55 int lowest_ping; // lowest ping (or -1, if not known)
56 int lowest_ping_avg; // (lowest ping + average ping)/2 or -1 if not known
60 // ---------------------------------------------------------------------------------------------------
61 // OBJECT UPDATE FUNCTIONS
64 // process all object update details for this frame
65 void multi_oo_process();
67 // process incoming object update data
68 void multi_oo_process_update(ubyte *data, header *hinfo);
70 // initialize all object update timestamps (call whenever entering gameplay state)
71 void multi_oo_gameplay_init();
73 // process an object update sync packet
74 void multi_oo_process_update_sync(ubyte *data, header *hinfo);
76 // send an update sync packet
77 void multi_oo_send_update_sync(net_player *pl = NULL);
79 // initialize the server's time sync stuff
80 void multi_oo_sync_init();
82 // send control info for a client (which is basically a "reverse" object update)
83 void multi_oo_send_control_info();
85 // reset all sequencing info
86 void multi_oo_reset_sequencing();
88 // interpolate for this object
89 void multi_oo_interpolate(object *objp, interp_info *current, interp_info *last);
91 // do all interpolation for this frame - client side and server side
92 void multi_oo_interpolate_all();
94 // set global object update timestamp for this frame
95 void multi_oo_set_global_timestamp();
98 // ---------------------------------------------------------------------------------------------------
99 // DATARATE DEFINES/VARS
102 #define OO_HIGH_RATE_DEFAULT 11000
105 // ---------------------------------------------------------------------------------------------------
106 // DATARATE FUNCTIONS
109 // process all object update datarate details
110 void multi_oo_rate_process();
112 // initialize all datarate checking stuff
113 void multi_oo_rate_init_all();
115 // initialize the rate limiting for the passed in player
116 void multi_oo_rate_init(net_player *pl);
118 // if the given net-player has exceeded his datarate limit, or if the overall datarate limit has been reached
119 int multi_oo_rate_exceeded(net_player *pl);
121 // if it is ok for me to send a control info (will be ~N times a second)
122 int multi_oo_cirate_can_send();
124 // display any oo info on the hud
125 void multi_oo_display();
127 #endif // #ifdef OO_NEW