1 #ifndef _MULTI_NEW_OBJECT_UPDATE_HEADER_FILE
2 #define _MULTI_NEW_OBJECT_UPDATE_HEADER_FILE
4 // ---------------------------------------------------------------------------------------------------
5 // OBJECT UPDATE DEFINES/VARS
12 // client button info flags
13 #define OOC_FIRE_SECONDARY (1<<0)
14 #define OOC_TARGET_LOCKED (1<<1)
15 #define OOC_TARGET_SEEK_LOCK (1<<2)
16 #define OOC_LOCKING_ON_CENTER (1<<3)
17 #define OOC_TRIGGER_DOWN (1<<4)
18 #define OOC_PRIMARY_BANK (1<<5)
19 #define OOC_PRIMARY_LINKED (1<<6)
22 typedef struct np_update {
23 ubyte seq; // sequence #
24 int update_stamp; // global update stamp
25 int status_update_stamp;
26 int subsys_update_stamp;
27 ushort pos_chksum; // positional checksum
28 ushort orient_chksum; // orient checksum
31 // safer version of timestamp
32 #define timestamp_elapsed_safe(_a, _b) ( (_a != 0) ? (((timestamp_ticker >= (_a)) || (timestamp_ticker < (_a - (_b + 100)))) ? 1 : 0) : 1 )
34 // ---------------------------------------------------------------------------------------------------
35 // OBJECT UPDATE FUNCTIONS
38 // process all object update details for this frame
39 void multi_oo_process();
41 // process incoming object update data
42 void multi_oo_process_update(ubyte *data, header *hinfo);
44 // initialize all object update timestamps (call whenever entering gameplay state)
45 void multi_oo_gameplay_init();
47 // send control info for a client (which is basically a "reverse" object update)
48 void multi_oo_send_control_info();
50 // reset all sequencing info
51 void multi_oo_reset_sequencing();
53 // is this object one which needs to go through the interpolation
54 int multi_oo_is_interp_object(object *objp);
57 void multi_oo_interp(object *objp);
60 // ---------------------------------------------------------------------------------------------------
61 // DATARATE DEFINES/VARS
64 #define OO_HIGH_RATE_DEFAULT 11000
67 // ---------------------------------------------------------------------------------------------------
71 // process all object update datarate details
72 void multi_oo_rate_process();
74 // initialize all datarate checking stuff
75 void multi_oo_rate_init_all();
77 // initialize the rate limiting for the passed in player
78 void multi_oo_rate_init(net_player *pl);
80 // if the given net-player has exceeded his datarate limit, or if the overall datarate limit has been reached
81 int multi_oo_rate_exceeded(net_player *pl);
83 // if it is ok for me to send a control info (will be ~N times a second)
84 int multi_oo_cirate_can_send();
86 // display any oo info on the hud
87 void multi_oo_display();
89 // notify of a player join
90 void multi_oo_player_reset_all(net_player *pl = NULL);