FS2_Open
Open source remastering of the Freespace 2 engine
multi_obj.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
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 the
6  * source.
7  *
8 */
9 
10 #ifndef _MULTI_NEW_OBJECT_UPDATE_HEADER_FILE
11 #define _MULTI_NEW_OBJECT_UPDATE_HEADER_FILE
12 
13 #include "math/vecmat.h"
14 
15 // ---------------------------------------------------------------------------------------------------
16 // OBJECT UPDATE DEFINES/VARS
17 //
18 #include "globalincs/pstypes.h"
19 
20 struct interp_info;
21 class object;
22 struct header;
23 struct net_player;
24 
25 
26 // client button info flags
27 #define OOC_FIRE_SECONDARY (1<<0)
28 #define OOC_TARGET_LOCKED (1<<1)
29 #define OOC_TARGET_SEEK_LOCK (1<<2)
30 #define OOC_LOCKING_ON_CENTER (1<<3)
31 #define OOC_TRIGGER_DOWN (1<<4)
32 #define OOC_PRIMARY_BANK (1<<5)
33 #define OOC_PRIMARY_LINKED (1<<6)
34 #define OOC_AFTERBURNER_ON (1<<7)
35 // NOTE: no additional flags here unless it's sent in an extra data byte
36 
37 // update info
38 typedef struct np_update {
39  ubyte seq; // sequence #
40  int update_stamp; // global update stamp
43  ushort pos_chksum; // positional checksum
44  ushort orient_chksum; // orient checksum
45 } np_update;
46 
47 // ---------------------------------------------------------------------------------------------------
48 // OBJECT UPDATE FUNCTIONS
49 //
50 
51 // process all object update details for this frame
52 void multi_oo_process();
53 
54 // process incoming object update data
56 
57 // initialize all object update timestamps (call whenever entering gameplay state)
59 
60 // send control info for a client (which is basically a "reverse" object update)
62 void multi_oo_send_changed_object(object *changedobj);
63 
64 // reset all sequencing info
66 
67 // is this object one which needs to go through the interpolation
68 int multi_oo_is_interp_object(object *objp);
69 
70 // interp
71 void multi_oo_interp(object *objp);
72 
73 
74 // ---------------------------------------------------------------------------------------------------
75 // DATARATE DEFINES/VARS
76 //
77 
78 #define OO_HIGH_RATE_DEFAULT 11000
79 
80 
81 // ---------------------------------------------------------------------------------------------------
82 // DATARATE FUNCTIONS
83 //
84 
85 // process all object update datarate details
87 
88 // initialize all datarate checking stuff
90 
91 // initialize the rate limiting for the passed in player
93 
94 // if the given net-player has exceeded his datarate limit, or if the overall datarate limit has been reached
96 
97 // if it is ok for me to send a control info (will be ~N times a second)
99 
100 // display any oo info on the hud
101 void multi_oo_display();
102 
103 // notify of a player join
104 void multi_oo_player_reset_all(net_player *pl = NULL);
105 
106 #endif
int multi_oo_is_interp_object(object *objp)
Definition: multi_obj.cpp:1825
int multi_oo_rate_exceeded(net_player *pl)
Definition: multi_obj.cpp:1704
int multi_oo_cirate_can_send()
Definition: multi_obj.cpp:1753
void multi_oo_player_reset_all(net_player *pl=NULL)
int status_update_stamp
Definition: multi_obj.h:41
void multi_oo_rate_init(net_player *pl)
Definition: multi_obj.cpp:1696
int update_stamp
Definition: multi_obj.h:40
void multi_oo_reset_sequencing()
Definition: multi_obj.cpp:1820
void multi_oo_process_update(ubyte *data, header *hinfo)
Definition: multi_obj.cpp:1357
object * objp
Definition: lua.cpp:3105
void multi_oo_interp(object *objp)
Definition: multi_obj.cpp:1866
void multi_oo_send_changed_object(object *changedobj)
Definition: multi_obj.cpp:1485
void multi_oo_display()
Definition: multi_obj.cpp:1541
void multi_oo_rate_process()
Definition: multi_obj.cpp:1604
unsigned char ubyte
Definition: pstypes.h:62
Definition: object.h:141
ubyte seq
Definition: multi_obj.h:39
struct np_update np_update
ushort orient_chksum
Definition: multi_obj.h:44
Definition: multi.h:385
unsigned short ushort
Definition: pstypes.h:63
void multi_oo_rate_init_all()
Definition: multi_obj.cpp:1668
GLenum GLsizei GLenum GLenum const GLvoid * data
Definition: Gl.h:1509
void multi_oo_process()
Definition: multi_obj.cpp:1336
int subsys_update_stamp
Definition: multi_obj.h:42
void multi_oo_gameplay_init()
Definition: multi_obj.cpp:1386
ushort pos_chksum
Definition: multi_obj.h:43
void multi_oo_send_control_info()
Definition: multi_obj.cpp:1436