2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
9 #ifndef _MULTI_NEW_OBJECT_UPDATE_HEADER_FILE
10 #define _MULTI_NEW_OBJECT_UPDATE_HEADER_FILE
12 // ---------------------------------------------------------------------------------------------------
13 // OBJECT UPDATE DEFINES/VARS
20 // client button info flags
21 #define OOC_FIRE_SECONDARY (1<<0)
22 #define OOC_TARGET_LOCKED (1<<1)
23 #define OOC_TARGET_SEEK_LOCK (1<<2)
24 #define OOC_LOCKING_ON_CENTER (1<<3)
25 #define OOC_TRIGGER_DOWN (1<<4)
26 #define OOC_PRIMARY_BANK (1<<5)
27 #define OOC_PRIMARY_LINKED (1<<6)
30 typedef struct np_update {
31 ubyte seq; // sequence #
32 int update_stamp; // global update stamp
33 int status_update_stamp;
34 int subsys_update_stamp;
35 ushort pos_chksum; // positional checksum
36 ushort orient_chksum; // orient checksum
39 // safer version of timestamp
40 #define timestamp_elapsed_safe(_a, _b) ( (_a != 0) ? (((timestamp_ticker >= (_a)) || (timestamp_ticker < (_a - (_b + 100)))) ? 1 : 0) : 1 )
42 // ---------------------------------------------------------------------------------------------------
43 // OBJECT UPDATE FUNCTIONS
46 // process all object update details for this frame
47 void multi_oo_process();
49 // process incoming object update data
50 void multi_oo_process_update(ubyte *data, header *hinfo);
52 // initialize all object update timestamps (call whenever entering gameplay state)
53 void multi_oo_gameplay_init();
55 // send control info for a client (which is basically a "reverse" object update)
56 void multi_oo_send_control_info();
58 // reset all sequencing info
59 void multi_oo_reset_sequencing();
61 // is this object one which needs to go through the interpolation
62 int multi_oo_is_interp_object(object *objp);
65 void multi_oo_interp(object *objp);
68 // ---------------------------------------------------------------------------------------------------
69 // DATARATE DEFINES/VARS
72 #define OO_HIGH_RATE_DEFAULT 11000
75 // ---------------------------------------------------------------------------------------------------
79 // process all object update datarate details
80 void multi_oo_rate_process();
82 // initialize all datarate checking stuff
83 void multi_oo_rate_init_all();
85 // initialize the rate limiting for the passed in player
86 void multi_oo_rate_init(net_player *pl);
88 // if the given net-player has exceeded his datarate limit, or if the overall datarate limit has been reached
89 int multi_oo_rate_exceeded(net_player *pl);
91 // if it is ok for me to send a control info (will be ~N times a second)
92 int multi_oo_cirate_can_send();
94 // display any oo info on the hud
95 void multi_oo_display();
97 // notify of a player join
98 void multi_oo_player_reset_all(net_player *pl = NULL);