FS2_Open
Open source remastering of the Freespace 2 engine
multi.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 
11 
12 #ifndef _MULTI_H
13 #define _MULTI_H
14 
15 #include "globalincs/pstypes.h"
16 #include "network/psnet2.h" // for PSNET_SOCKET
17 #include "network/multi_ping.h"
18 #include "network/multi_options.h"
19 #include "io/keycontrol.h"
20 #include "globalincs/globals.h"
21 
22 class p_object;
23 struct CFILE;
24 class player;
25 
26 // ----------------------------------------------------------------------------------------
27 // Basic defines
28 //
29 //
30 
31 // defines for checking PXO valid missions
32 #ifdef NDEBUG
33  // NEVER COMMENT OUT THIS LINE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
34  #define PXO_CHECK_VALID_MISSIONS // always check for valid missions in a debug build
35 #else
36  // #define PXO_CHECK_VALID_MISSIONS // comment this in and out as necessary (for testing or not)
37 #endif
38 
39 // name of the validated mission file for PXO missions
40 #define MULTI_VALID_MISSION_FILE "mvalid.cfg"
41 
42 // server version and compatible version
43 // to join a game - your LOCAL.MULTI_FS_SERVER_COMPATIBLE_VERSION must be >= GAME_SERVER.MULTI_FS_SERVER_VERSION
44 // Version #. Please put the date down when you up these values
45 // NOTE: always keep SERVER_VERSION and SERVER_COMPATIBLE_VERSION the same
46 //
47 // version 32 - 1/29/99
48 // version 33 - 2/22/99
49 // version 34 - 4/8/99
50 // version 35 - 4/21/99
51 // version 36 - 4/28/99
52 // version 37 - 4/29/99
53 // version 38 - 5/17/77
54 // version 39 - 7/3/99
55 // version 40 - 7/7/99
56 // version 41 - 7/22/99
57 // version 42 - 7/26/99 (ingame join stuff)
58 // version 43 - 7/30/99
59 // version 44 - 8/24/99
60 // version 46 - 8/30/99
61 // version 47 - 11/11/2003 (FS2OpenPXO, FS2 Open Changes - FS2Open 3.6)
62 // revert 46 - 9/7/2006 (the 47 bump wasn't needed, reverting to retail version for compatibility reasons)
63 // STANDALONE_ONLY
64 
65 #define MULTI_FS_SERVER_VERSION 147
66 
67 #define MULTI_FS_SERVER_COMPATIBLE_VERSION MULTI_FS_SERVER_VERSION
68 
69 // version defines (i.e. demo, full version, special OEM version
70 // id's should not be > 255!!!!
71 #define NG_VERSION_ID_FULL 1
72 
73 // set the next define to be what version you want to build for.
74 #define NG_VERSION_ID NG_VERSION_ID_FULL
75 
76 // the max # of active players (flying ships)
77 #define MULTI_MAX_PLAYERS 12
78 
79 // the total max # of connections (players + observers + (possibly)standalone server)
80 #define MULTI_MAX_CONNECTIONS 16
81 
82 // the max # of observers ever allowed
83 #define MAX_OBSERVERS 4
84 
85 #define LOGIN_LEN 33
86 
87 // string length defines
88 #define MAX_GAMENAME_LEN 32 // maximum length in characters of a game name
89 #define DESCRIPT_LENGTH 512 // maximum length of a mission description (as specified by Fred)
90 #define MAX_PASSWD_LEN 16 // maximum length of the password for a netgame
91 
92 // low level networking defines
93 #define IP_ADDRESS_LENGTH 4 // length of the address field for an IP address
94 #define IP_PORT_LENGTH 2 // length of the port field for an IP address
95 
96 // netgame defines
97 #define MP_SINGLE_MISSION 0 // not playing a campaign - single mission
98 #define MP_CAMPAIGN 1 // playing a campaign
99 
100 // respawn defines
101 #define RESPAWN_INVUL_TIMESTAMP 5000 // how long a player is invulnerable after he respawns
102 #define MAX_RESPAWN_POINTS 25 // the max # of respawn points we'll keep track of for any mission
103 
104 // player information defines
105 #define BUTTON_INFO_SAVE_COUNT 30 // how many buttons infos we keep track of for sending critical keypresses to the server
106 #define MAX_PINGS 10 // how many pings we keep track of for averaging player pings
107 
108 // reliable connect wait
109 #define MULTI_RELIABLE_CONNECT_WAIT 15
110 
111 // tracker mission validation status
112 #define MVALID_STATUS_UNKNOWN -1
113 #define MVALID_STATUS_VALID 0
114 #define MVALID_STATUS_INVALID 1
115 
116 // ----------------------------------------------------------------------------------------
117 
118 
119 // ----------------------------------------------------------------------------------------
120 // Network macros
121 //
122 //
123 
124 // netplayer management
125 #define NET_PLAYER_INDEX(np) (np-Net_players)
126 #define NET_PLAYER_NUM(np) (NET_PLAYER_INDEX(np))
127 #define MY_NET_PLAYER_NUM (NET_PLAYER_INDEX(Net_player))
128 
129 // determine what the status of this machine is
130 #define MULTIPLAYER_MASTER ( (Game_mode & GM_MULTIPLAYER) && (Net_player->flags & NETINFO_FLAG_AM_MASTER) )
131 #define MULTIPLAYER_HOST ( (Game_mode & GM_MULTIPLAYER) && (Net_player->flags & NETINFO_FLAG_GAME_HOST) )
132 #define MULTIPLAYER_CLIENT ( (Game_mode & GM_MULTIPLAYER) && !(Net_player->flags & NETINFO_FLAG_AM_MASTER) )
133 #define MULTIPLAYER_STANDALONE ( (Game_mode & GM_MULTIPLAYER) && (Net_players[0].flags & NETINFO_FLAG_AM_MASTER) && !(Net_players[0].flags & NETINFO_FLAG_GAME_HOST) )
134 
135 // determine the status of the passed player
136 #define MULTI_CONNECTED(np) (np.flags & NETINFO_FLAG_CONNECTED)
137 #define MULTI_HOST(np) (np.flags & NETINFO_FLAG_GAME_HOST)
138 #define MULTI_SERVER(np) (np.flags & NETINFO_FLAG_AM_MASTER)
139 #define MULTI_STANDALONE(np) ((np.flags & NETINFO_FLAG_AM_MASTER) && !(np.flags & NETINFO_FLAG_GAME_HOST))
140 #define MULTI_OBSERVER(np) (np.flags & NETINFO_FLAG_OBSERVER)
141 #define MULTI_TEMP_OBSERVER(np) ((np.flags & NETINFO_FLAG_OBSERVER) && (np.flags & NETINFO_FLAG_OBS_PLAYER))
142 #define MULTI_PERM_OBSERVER(np) ((np.flags & NETINFO_FLAG_OBSERVER) && !(np.flags & NETINFO_FLAG_OBS_PLAYER))
143 
144 // are we playing on a master tracker registered server
145 extern int Om_tracker_flag;
146 #define MULTI_IS_TRACKER_GAME (Om_tracker_flag)
147 // ----------------------------------------------------------------------------------------
148 
149 
150 // ----------------------------------------------------------------------------------------
151 // Packet definitions and additional packet data types
152 //
153 //
154 
155 #define NETPLAYER_SLOTS_P 0x01 // data telling clients what player has what object number ...
156 #define FIRING_INFO 0x02 // firing info packet
157 #define INGAME_SHIP_UPDATE 0x03 // ship status-like update for ingame joiners choosing ships.
158 #define INGAME_SHIP_REQUEST 0x04 // used for requesting a replying (confirm or no) ships for an ingame joiner
159 #define TEAM_SELECT_UPDATE 0x05 // update from host to players in team select regarding who has what ship
160 #define FILE_SIG_INFO 0x06 // file signature info ( as calculated by get_bigass_file_signature() )
161 #define RESPAWN_NOTICE 0x07 // from client to server, or server to client
162 #define LOAD_MISSION_NOW 0x08 // clients should load the mission and return an ack
163 #define FILE_SIG_REQUEST 0x09 // request from server to client for filesig info
164 #define JUMP_INTO_GAME 0x0A // from server to client telling him to jump into the mission
165 #define RESPAWN_POINTS 0x0B // from server to ingame joiners, giving respawn data
166 #define CLIENT_REPAIR_INFO 0x0C // passing various data to clients indicating their repair status
167 #define CARGO_REVEALED 0x0E // cargo is known
168 #define SHIELD_EXPLOSION 0x0F // shield explosion
169 
170 #define SUBSYSTEM_DESTROYED 0x10 // update about a subsystem update
171 #define MISSION_SYNC_DATA 0x11 // this is a unique packet from the host to the server in a standalone game
172 #define STORE_MISSION_STATS 0x12 // sent to client indicating the host has hit "accept" and they should update their alltime stats
173 #define DEBRIS_UPDATE 0x13 // debris position, velocity, orientation, etc update
174 #define SHIP_WSTATE_CHANGE 0x14 // used to tell clients that a ship's primary/secondary state changed
175 #define WSS_REQUEST_PACKET 0x15 // from client to server, requesting to do an operation
176 #define WSS_UPDATE_PACKET 0x16 // from server to client, given any update
177 #define KICK_PLAYER 0x17 // kick a specific player (sent to server by those who are allowed to do this)
178 #define MISSION_GOAL_INFO 0x18 // update of mission goal info
179 #define ASTEROID_INFO 0x19 // update of asteroid stuff
180 #define NETPLAYER_PAIN 0x1A // to notify the player of hits which he may not otherwise see
181 #define OBJECT_UPDATE_NEW 0x1B
182 #define SUBSYS_CARGO_REVEALED 0X1C // Capital ship cargo subsystem is known
183 
184 #define POST_SYNC_DATA 0x20 // a very large packet containing all the data players will need before going into the mission itself
185 #define PLAYER_SETTINGS 0x21 // player settings for each individual net player
186 #define WSS_SLOTS_DATA 0x22 // all weapon slots information for the starting wings (needs to be synched)
187 #define PLAYER_STATS 0x23 // stats for a given player
188 #define SLOT_UPDATE 0x24 // an player slot position update in multiplayer ship/team select
189 #define TEAM_UPDATE 0x25 // used for performing misc operations on pregame interface screens for team vs. team games
190 #define INGAME_EXTRA 0x26 // extra data for ingame joiners
191 #define HOST_RESTR_QUERY 0x27 // query the host when a player joins a restricted game
192 #define OPTIONS_UPDATE 0x28 // options (netgame or local) update packet
193 #define CLIENT_UPDATE 0x29 // sent from server to client periodically to update important info (pause status, etc)
194 #define CD_VERIFY 0x2A // cd verification update
195 #define PRIMARY_FIRED_NEW 0x2B // for client-side firing - highly streamlined
196 #define COUNTERMEASURE_NEW 0x2C // for client-side firing
197 #define EVENT_UPDATE 0x2D // event change
198 
199 #define SECONDARY_FIRED_AI 0xA0 // fired a secondary weapon (ai ship)
200 #define SECONDARY_FIRED_PLR 0xA1 // fired a secondary weapon (player ship)
201 #define COUNTERMEASURE_FIRED 0xA2 // countermeasure was fired
202 #define FIRE_TURRET_WEAPON 0xA3 // a turret weapon was fired
203 #define SHIP_STATUS_CHANGE 0xA4 // any of the relevant ship status buttons have been hit (need ack from server)
204 #define PLAYER_ORDER_PACKET 0xA5 // ship and wing commands sent from client to server
205 #define AI_INFO_UPDATE 0xA6 // update ai information for the given ship
206 #define CAMPAIGN_UPDATE 0xA7 // one of several campaign informational packets
207 #define CAMPAIGN_UPDATE_INGAME 0xA8 // campaign info for ingame joiner
208 #define HOMING_WEAPON_UPDATE 0xA9 // update homing object and subsystem for homing missile
209 #define FLAK_FIRED 0xAA // flak gun fired
210 #define SELF_DESTRUCT 0xAB // self destruct
211 
212 #define JOIN 0xB1 // a join request to a server
213 #define ACCEPT 0xB2 // acceptance of a join packet
214 #define DENY 0xB3 // a join request is denied
215 #define NOTIFY_NEW_PLAYER 0xB4 // notify players of a new player
216 #define MISSION_REQUEST 0xB5 // request a list of missions on the master.
217 #define MISSION_ITEM 0xB6 // a bundle of mission filenames
218 #define GAME_INFO 0xB7 // game information packet for an active server
219 #define MULTI_PAUSE_REQUEST 0xB8 // send a request to the server to pause or unpause the game
220 #define TRANSFER_HOST 0xB9 // transfer host status to the receiver
221 #define CHANGE_SERVER_ADDR 0xBA // change your host_addr to this value
222 #define ACCEPT_PLAYER_DATA 0xBB // player data -- sent after guy is accepted
223 #define BEAM_FIRED 0xBC // a beam weapon was fired
224 #define SW_STD_QUERY 0xBD // query from host to standalone server to query PXO about a squad war match
225 
226 #define HUD_MSG 0xC1 // a hud message
227 #define LEAVE_GAME 0xC2 // indication that a player is leaving the game
228 #define GAME_CHAT 0xC3 // this chat packet used for FreeSpace
229 #define MISSION_MESSAGE 0xC4 // a message (squadmate, etc)
230 #define SHIP_DEPART 0xC5 // a ship has left the building
231 #define SHIPS_INGAME_PACKET 0xC6 // ingame join ship data packet
232 #define WINGS_INGAME_PACKET 0xC7 // ingame join wing data packet
233 #define MISSION_END 0xC8 // sent from host(master) to clients indicating they should go to the debriefing
234 #define INGAME_NAK 0xC9 // opposite of INGAME_ACK. Uses the ACK_* defines as well.
235 #define OBSERVER_UPDATE 0xCA // sent from observers to server to give position and orientation
236 #define SQUADMSG_PLAYER 0xCB // a squadmate message command has been sent to a netplayer
237 #define OBJ_UPDATE_SYNC 0xCC // object update timebase syncing code
238 #define FORCE_MISSION_END 0xCD // Force all the players to skip straight to the debrief screen
239 
240 #define WEAPON_DET 0xD1 // a weapon has detonated, possibly with child weapons
241 #define SHIP_KILL 0xD2 // a ship was killed
242 #define WING_CREATE 0xD3 // create and warp in a wing of ships
243 #define SHIP_CREATE 0xD4 // create and wrap in a ship
244 #define PING 0xD5 // ping
245 #define PONG 0xD6 // pong
246 #define XFER_PACKET 0xD7 // file xfer data of one kind or another
247 #define VOICE_PACKET 0xD8 // a voice streaming packet of one kind or another
248 #define NETGAME_END_ERROR 0xD9 // the netgame has been ended by the server because of an error (passed error code)
249 #define COUNTERMEASURE_SUCCESS 0xDA // countermeasure was successful for this player.
250 #define REINFORCEMENT_AVAIL 0xDB // a reinforcement is available
251 #define LIGHTNING_PACKET 0xDC // lightning bolt packet for multiplayer nebula
252 #define BYTES_SENT 0xDD // how much data we've sent/received
253 
254 #define GAME_ACTIVE 0xE1 // info on an active game server
255 #define GAME_QUERY 0xE2 // request for a list of active game servers
256 #define GAME_UPDATE 0xE3 // update info on an active game server
257 #define NETPLAYER_UPDATE 0xE4 // a player update packet
258 #define OBJECT_UPDATE 0xE6 // an object update packet from server to all clients
259 #define MISSION_LOG_ENTRY 0xE7 // ad an item into the mission log
260 #define UPDATE_DESCRIPT 0xE8 // update the netgame description
261 #define COUNTDOWN 0xE9 // countdown timer for starting a game (pretty benign)
262 #define DEBRIEF_INFO 0xEA // end of mission debriefing information
263 #define EMP_EFFECT 0xEB // EMP effect (mission disk only)
264 #define CHANGE_IFF 0xEC // change iff (1.04+ only)
265 
266 #define CARGO_HIDDEN 0xED // cargo is hidden
267 #define SUBSYS_CARGO_HIDDEN 0xEE // Capital ship cargo subsystem is hidden
268 
269 #define CHANGE_AI_CLASS 0xEF // change ai class
270 #define NO_SUBSYS_STRING "NO-SUBSYS" // see change_ai_class - because same routine is used
271  // for both ships and subsystems
272 #define VARIABLE_UPDATE 0xF0 // Karajorma - a variable update packet from server to all clients
273 #define WEAPON_OR_AMMO_CHANGED 0xF1 // Karajorma - The weapon or ammo of a fighter/bomber has been changed
274 #define SEXP 0xF2 // Karajorma - a general packet which can be used to update clients with changes caused by SEXPs
275 #define CHANGE_IFF_COLOR 0xF3 // Wanderer - change iff color
276 
277 #define MAX_TYPE_ID 0xFF // better not try to send > 255 in a single byte buddy
278 
279 // ingame ack data codes
280 #define ACK_RESPAWN_POINTS 0x1 // from ingame joiner to server, indicating he got the respawn points packet
281 #define ACK_FILE_ACCEPTED 0x2 // server to client saying their file is valid
282 #define ACK_FILE_REJECTED 0x3 // server to client saying their file is not valid
283 
284 // join request denial codes
285 #define JOIN_DENY_JR_STATE 0 // join request is rejected because the game is not in the proper state
286 #define JOIN_DENY_JR_TRACKER_INVAL 1 // join request is rejected because the game is an MT game and the passed player info is invalid
287 #define JOIN_DENY_JR_PASSWD 2 // join request is rejected because the game is password protected and the password sent is incorrect
288 #define JOIN_DENY_JR_CLOSED 3 // join request is rejected because the game is closed and is currently ingame
289 #define JOIN_DENY_JR_RANK_HIGH 4 // join request is rejected because the game is rank based and the passed rank is too high
290 #define JOIN_DENY_JR_RANK_LOW 5 // join request is rejected because the game is rank based and the passed rank is too low
291 #define JOIN_DENY_JR_DUP 6 // join request is denied because there is an exiting netplayer with matching characteristics
292 #define JOIN_DENY_JR_FULL 7 // join request is denied because the game is full
293 #define JOIN_DENY_JR_TEMP_CLOSED 8 // join request is denied because the _forming_ netgame has been toggled closed
294 #define JOIN_DENY_JR_BANNED 9 // join request is denied because the player has been banned for the duration of the game
295 #define JOIN_DENY_JR_NOOBS 10 // join request is denied because observers are not allowed
296 #define JOIN_DENY_JR_INGAME_JOIN 11 // join request is denied because someone else is already ingame joining
297 #define JOIN_DENY_JR_BAD_VERSION 12 // incompatible version types
298 #define JOIN_QUERY_RESTRICTED 13 // poll the host of the game to see if he accepts this player
299 #define JOIN_DENY_JR_TYPE 14 // cannot ingame join anything but dogfight games
300 
301 // repair info codes
302 #define REPAIR_INFO_BEGIN 0x1 // server to client - set your REPAIRING flags
303 #define REPAIR_INFO_END 0x2 // server to client - unset your REPAIRING flags
304 #define REPAIR_INFO_UPDATE 0x3 // server to client - here's some repair update info (not currently used)
305 #define REPAIR_INFO_QUEUE 0x4 // server to client - client is queued for rearming.
306 #define REPAIR_INFO_ABORT 0x5 // server to client - client has aborted a rearm/repair
307 #define REPAIR_INFO_BROKEN 0x6 // server to client - client is breaking repair -- might be reestablished
308 #define REPAIR_INFO_WARP_ADD 0x7 // server to client - add client onto list of people for arriving support ship
309 #define REPAIR_INFO_WARP_REMOVE 0x8 // server to client - remove client from list of people for arriving support ship
310 #define REPAIR_INFO_ONWAY 0x9 // server to client - repair ship on way
311 #define REPAIR_INFO_KILLED 0xa // server to client - repair ship was killed on way to rearm player
312 #define REPAIR_INFO_COMPLETE 0xb // server to client - repair of your ship is complete
313 
314 // debris update codes
315 #define DEBRIS_UPDATE_UPDATE 0x1 // update a piece
316 #define DEBRIS_UPDATE_REMOVE 0x2 // remove a piece of debris
317 #define DEBRIS_UPDATE_NUKE 0x3 // blow up a piece of debris
318 #define DEBRIS_UPDATE_CREATE_HULL 0x4 // create a piece of debris
319 
320 // weapon select/ship select update packets
321 #define WSS_WEAPON_SELECT 0x1 // ship select stuff
322 #define WSS_SHIP_SELECT 0x2 // weapon select stuff
323 
324 // accept packet codes
325 #define ACCEPT_INGAME (1<<0) // accept the player as an ingame joiner
326 #define ACCEPT_HOST (1<<1) // accept the player as the host of the game
327 #define ACCEPT_OBSERVER (1<<2) // accept the player as an observer
328 #define ACCEPT_CLIENT (1<<3) // accept the player as a normal, non ingame join, non host player
329 
330 // accept player data codes
331 #define APD_NEXT 0 // there is still more player data
332 #define APD_END_PACKET 1 // end of this packet
333 #define APD_END_DATA 2 // end of the data
334 
335 // ingame ship request codes
336 #define INGAME_SR_REQUEST 0x1 // request for the ship with the given net signature
337 #define INGAME_SR_CONFIRM 0x2 // confirmation to the client that he can use the requested ship
338 #define INGAME_SR_DENY 0x3 // deny the request the ingame joiner made for the ship
339 #define INGAME_PLAYER_CHOICE 0x4 // sent to other players informing them of ingame joiners choice
340 
341 // ai info update codes
342 #define AI_UPDATE_DOCK 0x1 // server tells clients which ships are now docked
343 #define AI_UPDATE_UNDOCK 0x2 // server tells clients which ships have undocked
344 #define AI_UPDATE_ORDERS 0x3 // server tells clients about new AI order for the ship
345 
346 // requests to the standalone
347 #define MISSION_LIST_REQUEST 0x1 // ask for list of missions
348 #define CAMPAIGN_LIST_REQUEST 0x2 // ask for list of campaigns
349 
350 // asteroid stuff
351 #define ASTEROID_CREATE 0x1 // create an asteroid
352 #define ASTEROID_THROW 0x2 // throw an asteroid
353 #define ASTEROID_HIT 0x3 // asteroid hit occured
354 
355 // commands for squadmate messages
356 #define SQUAD_MSG_SHIP 0x1
357 #define SQUAD_MSG_WING 0x2
358 #define SQUAD_MSG_ALL 0x3
359 #define SQUAD_MSG_REINFORCEMENT 0x4
360 
361 // SW_STD_QUERY codes
362 #define SW_STD_START 0x1 // from host to standalone saying "query the tracker"
363 #define SW_STD_OK 0x2 // from standalone to host - "everything is cool"
364 #define SW_STD_BAD 0x3 // from standalone to host - "everything is bad"
365 
366 // stats block packet
367 #define STATS_MISSION 0 // all stats for the mission (except kills), for one player
368 #define STATS_ALLTIME 1 // alltime stats, for one player
369 #define STATS_MISSION_KILLS 2 // mission kills and assists
370 #define STATS_DOGFIGHT_KILLS 3 // same as mission kills, but also sends per-player kills
371 #define STATS_MISSION_CLASS_KILLS 4 // kills for the mission, for one player
372 #define STATS_ALLTIME_KILLS 5 // alltime kills, for one player
373 
374 #define MAX_SHIPS_PER_PACKET 64 // Number of ships in a STATS_MISSION_KILLS or STATS_ALLTIME_KILLS packet
375 
376 // ----------------------------------------------------------------------------------------
377 
378 
379 // ----------------------------------------------------------------------------------------
380 // Multiplayer structure definitions
381 //
382 //
383 
384 // definition of header packet used in any protocol
385 typedef struct header {
386  int bytes_processed; // used to determine how many bytes this packet was
387  ubyte net_id[4]; // obtained from network layer header
388  ubyte addr[6]; // obtained from network-layer header
389  short port; // obtained from network-layer header
390  short id; // will be stuffed with player_id (short)
391 } header;
392 
393 // NETPLAYER INFORMATION THE SERVER AND THE INDIVIDUAL CLIENT MUST HAVE
394 typedef struct net_player_server_info {
395  ping_struct ping; // evaluated by the ping module
396  int wing_index_backup; // in case of fail on the last packet
397  int wing_index; // index of the next wing data item to be sent
398  int ingame_join_flags; // status flags for an ingame joiner
399  int invul_timestamp; // invulnerability flag timestamp (for respawning after dying)
400  button_info last_buttons[BUTTON_INFO_SAVE_COUNT]; // button info for sending critical control packets to the server
404  fix last_full_update_time; // time when server last updated this player position/orientation
405  int xfer_handle; // handle to the file xfer handle (-1 if no file xfer is taking place)
406  int kick_timestamp; // timestamp with which we'll disconnect a player if he hasn't reponded to a kick packet
407  int kick_reason; // reason he was kicked
408  int voice_token_timestamp; // timestamp set when a player loses a token (so we can prevent him from getting it again too quickly)
409  int reliable_connect_time; // after sending an accept packet, wait for this long for the guy to connect on the reliable socket
410 
411  // weapon select/linking information (maintained on the server and passed on respawn to all clients)
412  char cur_primary_bank; // currently selected primary bank
413  char cur_secondary_bank; // currently selected secondary bank
414  ubyte cur_link_status; // if (1<<0) - primaries linked. if (1<<1) - secondaries are linked
415 
416  // information regarding the current view position of this player.
417  vec3d eye_pos; // eye position and orientation
419 
420  // ets information
421  ushort ship_ets; // ets settings (sigh......)
422 
423  // tracker information
424  int tracker_security_last; // this is the value returned when getting tracker data. it must be used when "sending" tracker data
425  unsigned int tracker_checksum; // tracker checksum
426 
427  // common targeting information
429 
430  // rate limiting information
431  int rate_stamp; // rate limiting timestamp
432  int rate_bytes; // bytes sent this "second"
433 
434  // firing info (1<<0) for primary fire, (1<<1) for secondary fired, (1<<2) for countermeasure fired, (1<<3) for afterburner on
435  // basically, we set these bits if necessary between control info sends from the client. once sent, these values are
436  // cleared until the next send time
438 
439  // buffered packet info
440  ubyte unreliable_buffer[MAX_PACKET_SIZE]; // buffer used to buffer unreliable packets before sending as a single UDP packet
441  int unreliable_buffer_size; // length (in bytes) of data in unreliable send_buffer
442  ubyte reliable_buffer[MAX_PACKET_SIZE]; // buffer used to buffer reliable packets before sending as a single UDP packet
443  int reliable_buffer_size; // length (in bytes) of data in reliable send_buffer
445 
446 // NETPLAYER INFORMATION ALL COMPUTERS IN THE GAME MUST HAVE
447 typedef struct net_player_info {
448  p_object *p_objp; // pointer to parse object for my ship -- used with respawns
449  int team; // valid for team v. team games -- which team is this guy on
450  int ship_index; // index into the ship choices in team select/ship select (out of 12 choices)
451  int ship_class; // the ship class of the players ship
452  multi_local_options options; // players options settings
454  char pxo_squad_name[LOGIN_LEN]; // PXO squadron name
456 
457 // NETPLAYER COMMON INFORMATION
458 typedef struct net_player {
459  player *m_player; // stuff pertaining directly to the player (callsign, etc).
460  short player_id; // player id (always use this instead of ip address for identification purposes)
461  int tracker_player_id; // the tracker id for this player, only matters in
462  // tracker games.
463  int flags; // tells us interesting information about this player
464  int state; // one of the NETGAME_STATE_* flags below -- used for sequencing
465  PSNET_SOCKET_RELIABLE reliable_socket; // reliable socket to server
466 
467  ushort client_cinfo_seq; // sequence # for client control info packets
468  ushort client_server_seq; // sequence # for incoming object update packets
469 
470  fix last_heard_time; // time when last heard from this player
471 
472  net_player_server_info s_info; // server critical info
473  net_player_info p_info; // player critical info
474 
475  // bytes sent and received
476  // SERVER-side
477  int sv_bytes_sent; // bytes we've sent to this guy (on the server)
478  int sv_last_pl; // packet loss
479 
480  // CLIENT-side
481  int cl_bytes_recvd; // bytes we've received (as a client)
482  int cl_last_pl; // packet loss
483 } net_player;
484 
485 // structure which describes the state of the multiplayer game currently being played
486 typedef struct netgame_info {
487  char name[MAX_GAMENAME_LEN+1]; // name of the netgame (host can set this!)
488  char mission_name[NAME_LENGTH+1]; // current mission name (filename)
489  char title[NAME_LENGTH+1]; // title of the mission (as appears in the mission file)
490  char campaign_name[NAME_LENGTH+1]; // current campaign name
491  char passwd[MAX_PASSWD_LEN+1]; // password for the game
492  int version_info; // version info for this game.
493  int type_flags; // see NG_TYPE_* defines
494  int mode; // see NG_MODE_* defines
495  int flags; // see NG_FLAG_* defines
496  int rank_base; // used to compare against connecting players (rank above/rank below)
498  int game_state; // state (briefing, in mission, etc) this game is in
499  int security; // some random number that should hopefully be unique for each game started
500  // I'm also using this value to use as a starting base for the net_signature
501  // for object synchronization.
502  float ping_time; // ping time to this server
503  net_addr server_addr; // address of the server
505  net_player *server; // pointer to the server
506 
508 
509  int campaign_mode; // 0 == single mission mode, 1 == starting campaign
510 
511  ushort server_update_seq; // the current object update reference count (server-side only)
512  int server_update_frame_ref; // used to determine when we should increment the server_update_seq value
513 
514  multi_server_options options; // server options settings
515 
516  ubyte debug_flags; // special debug flags (see NETD_FLAG_* defines)
517 } netgame_info;
518 
519 // structure for active games -- kind of like Descent, but using the linked list thing, we will
520 // be able to support many more games in the list.
521 #define AG_FLAG_COOP (1<<0) // is a coop game
522 #define AG_FLAG_TEAMS (1<<1) // is a team vs. team game
523 #define AG_FLAG_DOGFIGHT (1<<2) // is a dogfight game
524 #define AG_FLAG_FORMING (1<<3) // game is currently forming
525 #define AG_FLAG_BRIEFING (1<<4) // game is in the briefing state
526 #define AG_FLAG_DEBRIEF (1<<5) // game is in the debriefing state
527 #define AG_FLAG_PAUSE (1<<6) // game is paused
528 #define AG_FLAG_IN_MISSION (1<<7) // game is in mission
529 #define AG_FLAG_PASSWD (1<<8) // is a password protected game
530 #define AG_FLAG_STANDALONE (1<<9) // this is a standalone server
531 #define AG_FLAG_CAMPAIGN (1<<10) // the server is playing in campaign mode
532 #define AG_FLAG_TRACKER (1<<11)
533 
534 // flags for defining the connection speed
535 #define AG_FLAG_CONNECTION_SPEED_MASK ((1<<12)|(1<<13)|(1<<14)) // mask for the connection speed
536 
537 #define AG_FLAG_VALID_MISSION (1<<15) // the mission is a "valid" tracker mission
538 
539 #define AG_FLAG_CONNECTION_BIT 12 // number of bits to shift right or left to get speed
540 
541 #define AG_FLAG_TYPE_MASK (AG_FLAG_COOP|AG_FLAG_TEAMS|AG_FLAG_DOGFIGHT)
542 #define AG_FLAG_STATE_MASK (AG_FLAG_FORMING|AG_FLAG_BRIEFING|AG_FLAG_DEBRIEF|AG_FLAG_PAUSE|AG_FLAG_IN_MISSION)
543 
544 typedef struct active_game {
545  active_game *next, *prev; // next and previous elements in the list
546  int heard_from_timer; // when we last heard from the game
547 
550  char title[NAME_LENGTH+1];
553  ushort flags; // see above AG_FLAG_* defines
554  ubyte version,comp_version; // version and compatible version
555  ping_struct ping; // ping time to the server
556 } active_game;
557 
558 // permanent server list (read from tcp.cfg)
559 typedef struct server_item {
561 
563 } server_item;
564 
565 // sent to the server on a join request with various data
566 #define JOIN_FLAG_AS_OBSERVER (1<<0) // wants to join as an aboserver
567 #define JOIN_FLAG_HAXOR (1<<2) // if the player has hacked data
568 
569 typedef struct join_request {
570  char passwd[MAX_PASSWD_LEN+1]; // password for a password protected game
571  char callsign[CALLSIGN_LEN+1]; // player's callsign
572  char image_filename[MAX_FILENAME_LEN+1]; // player's image filename
573  char squad_filename[MAX_FILENAME_LEN+1]; // player's squad filename
574  ubyte player_rank; // the rank of the requesting player
575  ubyte flags; // misc flags associated with this guy
576  int tracker_id; // player's tracker ID #
577  multi_local_options player_options; // player's options
578  ubyte version, comp_version; // local version and comp_version
579 
580  // multiplayer squad war info
581  char pxo_squad_name[LOGIN_LEN]; // squad name
582 } join_request;
583 
584 // network buffer for sending and receiving packets
585 typedef struct network_buffer {
586  int size; // size of the buffer
587  ubyte data[MAX_PACKET_SIZE]; // MAX_PACKET_SIZE from psnet2.h
589 // -------------------------------------------------------------------------------------
590 
591 
592 // ----------------------------------------------------------------------------------------
593 // Multiplayer structure flags/settings
594 //
595 //
596 
597 // flags used for the net_player structure
598 #define NETINFO_FLAG_CONNECTED (1<<0) // if this player connected
599 #define NETINFO_FLAG_AM_MASTER (1<<1) // is this player the master
600 #define NETINFO_FLAG_MT_CONNECTED (1<<2) // if everything is hunky dory with the tracker connection
601 #define NETINFO_FLAG_MT_FAILED (1<<3) // all attempts to connect have failed
602 #define NETINFO_FLAG_MT_STARTUP (1<<4) // the initial state (ie, we haven't tried anything yet)
603 #define NETINFO_FLAG_GAME_HOST (1<<5) // I'm the host
604 #define NETINFO_FLAG_INGAME_JOIN (1<<6) // means he is still in the process of joining ingame
605 #define NETINFO_FLAG_OBSERVER (1<<7) // means he's an observer
606 #define NETINFO_FLAG_OBS_PLAYER (1<<8) // means he's an observer, but he was formerly a player (should show his stats)
607 #define NETINFO_FLAG_LIMBO (1<<9) // (client side) means he has to choose whether to be an observer or quit (no more respawns)
608 #define NETINFO_FLAG_MISSION_OK (1<<10) // this client's mission has been verified
609 #define NETINFO_FLAG_RESPAWNING (1<<11) // so that we wait on a keypress, or other user input before respawning
610 #define NETINFO_FLAG_DO_NETWORKING (1<<12) // set when we can send/receive data
611 #define NETINFO_FLAG_TEAM_LOCKED (1<<13) // if this is set, only the host can modify the team settings for this player
612 #define NETINFO_FLAG_TEAM_CAPTAIN (1<<14) // this player is the captain of his team
613 #define NETINFO_FLAG_KICKED (1<<15) // this player was kicked
614 #define NETINFO_FLAG_ACCEPT_INGAME (1<<16) // accepted ingame
615 #define NETINFO_FLAG_ACCEPT_HOST (1<<17) // accetped as host
616 #define NETINFO_FLAG_ACCEPT_OBSERVER (1<<18) // accepted as observer
617 #define NETINFO_FLAG_ACCEPT_CLIENT (1<<19) // accepted as client
618 #define NETINFO_FLAG_WARPING_OUT (1<<20) // clients keep track of this for themselves to know if they should be leaving
619 #define NETINFO_FLAG_HAS_CD (1<<21) // the player has a CD in the drive
620 #define NETINFO_FLAG_RELIABLE_CONNECTED (1<<22) // reliable socket is now active
621 #define NETINFO_FLAG_MT_GET_FAILED (1<<23) // set during MT stats update process indicating we didn't properly get his stats
622 #define NETINFO_FLAG_MT_SEND_FAILED (1<<24) // set during MT stats update process indicating we didn't properly send his stats
623 #define NETINFO_FLAG_MT_DONE (1<<25) // set when a player has been processed for stats (fail, succeed, or otherwise)
624 #define NETINFO_FLAG_HAXOR (1<<26) // the player has some form of hacked client data
625 
626 #define NETPLAYER_IS_OBSERVER(player) (player->flags & (NETINFO_FLAG_OBSERVER|NETINFO_FLAG_OBS_PLAYER))
627 #define NETPLAYER_IS_DEAD(player) (player->flags & (NETINFO_FLAG_LIMBO|NETINFO_FLAG_RESPAWNING))
628 
629 // netgame modes
630 #define NG_MODE_OPEN 1 // an open game
631 #define NG_MODE_CLOSED 2 // a closed game
632 #define NG_MODE_PASSWORD 3 // a password protected game
633 #define NG_MODE_RESTRICTED 4 // a restricted game
634 #define NG_MODE_RANK_ABOVE 5 // ranks above a certain rank are allowed
635 #define NG_MODE_RANK_BELOW 6 // ranks below a certain rank are allowed
636 
637 // netgame option flags
638 #define NG_FLAG_TEMP_CLOSED (1<<0) // a forming netgame is temporarily closed (should not be checked otherwise)
639 #define NG_FLAG_SERVER_LOST (1<<1) // client has temporarily lost contact with the server
640 #define NG_FLAG_INGAME_JOINING (1<<2) // someone is ingame joining.
641 #define NG_FLAG_INGAME_JOINING_CRITICAL (1<<3) // someone is ingame joining and at the critical point where we cannot do certain things.
642 #define NG_FLAG_STORED_MT_STATS (1<<4) // stored tracker stats in the debriefing already
643 #define NG_FLAG_HACKED_SHIPS_TBL (1<<5) // set when the server is playing with a hacked ships.tbl (only needed to notify hosts playing on a standalone)
644 #define NG_FLAG_HACKED_WEAPONS_TBL (1<<6) // set when the server is playing with a hacked weapons.tbl (only needed to notify hosts playing on a standalone)
645 
646 // netgame type flags
647 #define NG_TYPE_COOP (1<<0) // cooperative mode
648 #define NG_TYPE_TVT (1<<1) // team vs. team mode
649 #define NG_TYPE_SW (1<<2) // squad war
650 #define NG_TYPE_TEAM ( NG_TYPE_TVT | NG_TYPE_SW )
651 #define NG_TYPE_DOGFIGHT (1<<3) // plain old dogfight mode
652 
653 // some quick macros for the above
654 #define MULTI_COOP ((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_COOP))
655 #define MULTI_TEAM ((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_TEAM))
656 #define MULTI_DOGFIGHT ((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_DOGFIGHT))
657 
658 // and some to handle everything but
659 #define MULTI_NOT_COOP ((Game_mode & GM_MULTIPLAYER) && !(Netgame.type_flags & NG_TYPE_COOP))
660 #define MULTI_NOT_TEAM ((Game_mode & GM_MULTIPLAYER) && !(Netgame.type_flags & NG_TYPE_TEAM))
661 #define MULTI_NOT_DOGFIGHT ((Game_mode & GM_MULTIPLAYER) && !(Netgame.type_flags & NG_TYPE_DOGFIGHT))
662 
663 // state defines for netgame states
664 #define NETGAME_STATE_FORMING 1 // players are joining, host is selecting missions, etc
665 #define NETGAME_STATE_BRIEFING 2 // players are reading the mission briefing
666 #define NETGAME_STATE_IN_MISSION 3 // the mission itself is being played
667 #define NETGAME_STATE_SERVER_TRANSFER 4 // server status is being transferred from one computer to another
668 #define NETGAME_STATE_PAUSED 5 // the netgame is paused
669 #define NETGAME_STATE_DEBRIEF 6 // the debriefing screen
670 #define NETGAME_STATE_MISSION_SYNC 7 // client/server data sync screens before and after the briefing stage
671 #define NETGAME_STATE_ENDGAME 8 // game is moving from gameplay to the debriefing state
672 #define NETGAME_STATE_STD_HOST_SETUP 9 // the host is on the setup netgame screen for the standalone server
673 #define NETGAME_STATE_HOST_SETUP 10 // the host is on the setup netgame screen _non_ standalone
674 
675 // state defines for netplayer states
676 #define NETPLAYER_STATE_JOINING 0 // joining the netgame
677 #define NETPLAYER_STATE_JOINED 1 // has joined and opened a reliable socket connection
678 #define NETPLAYER_STATE_MISSION_LOADING 2 // in the process of loading the mission
679 #define NETPLAYER_STATE_MISSION_LOADED 3 // mission loaded
680 #define NETPLAYER_STATE_BRIEFING 4 // in the briefing
681 #define NETPLAYER_STATE_SHIP_SELECT 5 // in the ship selection screen
682 #define NETPLAYER_STATE_WEAPON_SELECT 6 // in the weapon selection screen
683 #define NETPLAYER_STATE_DATA_LOAD 7 // loading specific data (textures, etc)
684 #define NETPLAYER_STATE_WAITING 8 // waiting to do something (like enter the mission)
685 #define NETPLAYER_STATE_SLOT_ACK 9 // got player ship slot packets
686 #define NETPLAYER_STATE_IN_MISSION 10 // in the mission itself
687 #define NETPLAYER_STATE_INGAME_SHIPS 11 // player is receiving ingame join ship data
688 #define NETPLAYER_STATE_INGAME_WINGS 12 // player is receiving ingame join wing data
689 #define NETPLAYER_STATE_INGAME_RPTS 13 // player is receiving ingame join respawn data
690 #define NETPLAYER_STATE_INGAME_SHIP_SELECT 14 // player is in the ship select screen for ingame join
691 #define NETPLAYER_STATE_DEBRIEF 15 // player is in the debrief state (screen)
692 #define NETPLAYER_STATE_MISSION_SYNC 16 // player is in the mission sync screen
693 #define NETPLAYER_STATE_STD_HOST_SETUP 17 // the host is on the setup netgame screen for the standalone server
694 #define NETPLAYER_STATE_HOST_SETUP 18 // the host is on the setup netgame screen _non_ standalone
695 #define NETPLAYER_STATE_SETTINGS_ACK 19 // the player has received the player settings data for all players
696 #define NETPLAYER_STATE_SLOTS_ACK 20 // the player has received wss slots data (ingame join only)
697 #define NETPLAYER_STATE_POST_DATA_ACK 21 // the player has received the post briefing data block
698 #define NETPLAYER_STATE_WSS_ACK 22 // have received weapon slot information
699 #define NETPLAYER_STATE_FLAG_ACK 23 // the player has received his flag change information
700 #define NETPLAYER_STATE_MT_STATS 24 // the server is in the process of requesting or updating stats from the MT
701 #define NETPLAYER_STATE_MISSION_XFER 25 // the player is in the process of receiving a mission file
702 #define NETPLAYER_STATE_INGAME_STUFF 26 // received ingame "stuff" happens just before ship selection
703 #define NETPLAYER_STATE_DEBRIEF_ACCEPT 27 // the player has hit the accept button in the debrief and is good to go
704 #define NETPLAYER_STATE_DEBRIEF_REPLAY 28 // set on the host instead of NETPLAYER_STATE_DEBRIEF_ACCEPT to indicate he wants to replay the mission
705 #define NETPLAYER_STATE_CPOOL_ACK 29 // player has acked all campaign pool status data
706 #define NETPLAYER_STATE_INGAME_CINFO 30 // player has received campaign information (ingame join only)
707 
708 // defines for connection speed
709 #define CONNECTION_SPEED_NONE -1 // not really used except for error checking
710 
711 #define CONNECTION_SPEED_288 0
712 #define CONNECTION_SPEED_56K 1
713 #define CONNECTION_SPEED_SISDN 2
714 #define CONNECTION_SPEED_CABLE 3
715 #define CONNECTION_SPEED_T1 4
716 
717 // use this to check and see whether a netgame is anywhere in mission (paused, etc, etc)
718 #define MULTI_IN_MISSION ( (Netgame.game_state == NETGAME_STATE_IN_MISSION) || (Netgame.game_state == NETGAME_STATE_PAUSED) )
719 
720 extern int Multi_connection_speed;
721 
722 // -------------------------------------------------------------------------------------
723 
724 
725 // ----------------------------------------------------------------------------------------
726 // Multiplayer global vars
727 //
728 //
729 
730 // netplayer vars
731 extern net_player Net_players[MAX_PLAYERS]; // array of all netplayers in the game
732 extern net_player *Net_player; // pointer to console's net_player entry
733 
734 // network object management
735 #define SHIP_SIG_MIN 1
736 #define SHIP_SIG_MAX (0x2fff)
737 
738 #define STANDALONE_SHIP_SIG (SHIP_SIG_MAX+1)
739 #define REAL_SHIP_SIG_MAX (0x3fff)
740 
741 #define DEBRIS_SIG_MIN (REAL_SHIP_SIG_MAX+1)
742 #define DEBRIS_SIG_MAX (0x5fff)
743 
744 #define ASTEROID_SIG_MIN (DEBRIS_SIG_MAX+1)
745 #define ASTEROID_SIG_MAX (0x7fff)
746 
747 #define NPERM_SIG_MIN (ASTEROID_SIG_MAX+1)
748 #define NPERM_SIG_MAX (0xffff)
749 
750 extern ushort Next_ship_signature; // next network signature to assign to an object
751 extern ushort Next_asteroid_signature; // next asteroid signature
752 extern ushort Next_non_perm_signature; // next non-permanent signature
753 extern ushort Next_debris_signature; // next debris signature
754 
755 // netgame vars
756 extern netgame_info Netgame; // netgame information
757 extern int Multi_mission_loaded; // flag, so that we don't load the mission more than once client side
758 extern ushort Multi_ingame_join_sig; // signature for the player obj for use when joining ingame
759 extern int Multi_button_info_ok; // flag saying it is ok to apply critical button info on a client machine
760 extern int Multi_button_info_id; // identifier of the stored button info to be applying
761 
762 // low level networking vars
763 extern int ADDRESS_LENGTH; // will be 4 for IP
764 extern int PORT_LENGTH; // will be 2 for IP
765 extern int HEADER_LENGTH; // 1 byte (packet type)
766 
767 // misc data
768 extern active_game* Active_game_head; // linked list of active games displayed on Join screen
769 extern int Active_game_count; // for interface screens as well
770 extern CFILE* Multi_chat_stream; // for streaming multiplayer chat strings to a file
771 extern int Multi_has_cd; // if this machine has a cd or not (call multi_common_verify_cd() to set this)
772 extern int Multi_num_players_at_start; // the # of players present (kept track of only on the server) at the very start of the mission
773 extern short Multi_id_num; // for assigning player id #'s
774 
775 // permanent server list
776 extern server_item* Game_server_head; // list of permanent game servers to be querying
777 
778 // restricted game vars
779 #define MULTI_QUERY_RESTR_STAMP 5000 // 5 seconds to reply
780 #define MULTI_JOIN_RESTR_MODE_1 0 // mode 1 - normal restricted join
781 #define MULTI_JOIN_RESTR_MODE_2 1 // mode 2 - team vs. team, only team 0 has ships
782 #define MULTI_JOIN_RESTR_MODE_3 2 // mode 3 - team vs. team, only team 1 has ships
783 #define MULTI_JOIN_RESTR_MODE_4 3 // mode 4 - team vs. team, both teams have ships
784 
785 extern int Multi_restr_query_timestamp; // timestamp for querying the host to see if he will allow a new player to join ingame
786 extern join_request Multi_restr_join_request; // join request for the query
787 extern net_addr Multi_restr_addr; // net address of the join request
788 extern int Multi_join_restr_mode; // what mode we're in
789 
790 // non API master tracker vars
791 #define MULTI_TRACKER_STRING_LEN 100
795 extern int Multi_tracker_id;
796 extern char Multi_tracker_id_string[255];
797 
798 // current file checksum
800 extern int Multi_current_file_length;
801 
802 
803 // ----------------------------------------------------------------------------------------
804 // Multiplayer main functions
805 //
806 //
807 
808 // module handling functions -------------------
809 
810 // called at game startup
811 void multi_init();
812 
813 // called whenever a netgame is started
814 void multi_level_init();
815 
816 // reset all relevant main networking loop timestamps
818 
819 // returns true is server hasn't been heard from in N seconds. false otherwise
821 
822 
823 // netgame data processing functions -----------
824 
825 // do all network processing for this game frame
826 void multi_do_frame();
827 
828 // analog of multi_do_frame() called when netgame is in the pause state
829 void multi_pause_do_frame();
830 
831 // process all incoming packets
832 // void multi_process_bigdata(ubyte* data, int size, net_addr* from_addr);
833 
834 // process all reliable socket details
836 
837 
838 // standalone handling functions ---------------
839 
840 // initialize the standalone
841 void standalone_main_init();
842 
843 // do frame for the main standalone state
844 void standalone_main_do();
845 
846 // close for the main standalone state
847 void standalone_main_close();
848 
849 // reset all standalone stuff, including gui, networking, netgame, etc, and go into the main state
851 
852 // init for the wait mode of the standalone (when waiting for players to finish the briefing)
854 
855 // do frame for the standalone wait state (when waiting for players to finish the briefing)
857 
858 // close for the standalone wait state (when waiting for players to finish the briefing)
860 
861 // init for the standalone postgame state (when players are in the debriefing)
863 
864 // do frame for the standalone postgame state (when players are in the debriefing)
866 
867 // close for the standalone postgame state (when players are in the debriefing_
869 
870 
871 #endif
#define MULTI_TRACKER_STRING_LEN
Definition: multi.h:791
uint respawn
Definition: multi.h:507
char pxo_squad_name[LOGIN_LEN]
Definition: multi.h:454
#define MAX_FILENAME_LEN
Definition: pstypes.h:324
int Multi_current_file_length
Definition: multi.cpp:151
ushort client_server_seq
Definition: multi.h:468
struct join_request join_request
int ship_class
Definition: multi.h:451
void multi_standalone_wait_do()
Definition: multi.cpp:1663
active_game * next
Definition: multi.h:545
struct header header
net_addr server_addr
Definition: multi.h:552
int Multi_restr_query_timestamp
Definition: multi.cpp:135
int Multi_mission_loaded
Definition: multi.cpp:98
ushort client_cinfo_seq
Definition: multi.h:467
char image_filename[MAX_FILENAME_LEN+1]
Definition: multi.h:572
uint PSNET_SOCKET_RELIABLE
Definition: multi_xfer.h:20
player * m_player
Definition: multi.h:459
ushort Multi_current_file_checksum
Definition: multi.cpp:150
int security
Definition: multi.h:499
int mode
Definition: multi.h:494
unsigned int tracker_checksum
Definition: multi.h:425
ubyte flags
Definition: multi.h:575
net_player * Net_player
Definition: multi.cpp:94
join_request Multi_restr_join_request
Definition: multi.cpp:136
Definition: pstypes.h:88
int heard_from_timer
Definition: multi.h:546
void multi_reset_timestamps()
Definition: multi.cpp:1741
#define LOGIN_LEN
Definition: multi.h:85
struct netgame_info netgame_info
struct net_player_server_info net_player_server_info
server_item * next
Definition: multi.h:560
Definition: cfile.h:28
ubyte version
Definition: multi.h:578
char mission_name[NAME_LENGTH+1]
Definition: multi.h:549
void multi_standalone_wait_close()
Definition: multi.cpp:1671
int flags
Definition: multi.h:463
int tracker_id
Definition: multi.h:576
multi_local_options player_options
Definition: multi.h:577
#define BUTTON_INFO_SAVE_COUNT
Definition: multi.h:105
int game_state
Definition: multi.h:498
int Multi_num_players_at_start
Definition: multi.cpp:114
ushort Next_asteroid_signature
Definition: multiutil.cpp:89
active_game * prev
Definition: multi.h:545
struct active_game active_game
void multi_standalone_postgame_close()
Definition: multi.cpp:1736
int version_info
Definition: multi.h:492
int tracker_player_id
Definition: multi.h:461
#define MAX_PACKET_SIZE
Definition: psnet2.h:34
ubyte comp_version
Definition: multi.h:578
Definition: player.h:85
int Multi_button_info_id
Definition: multi.cpp:101
int bytes_processed
Definition: multi.h:386
net_player_info p_info
Definition: multi.h:473
int type_flags
Definition: multi.h:493
void standalone_main_do()
Definition: multi.cpp:1590
struct net_player net_player
ubyte reliable_buffer[MAX_PACKET_SIZE]
Definition: multi.h:442
unsigned int uint
Definition: pstypes.h:64
int state
Definition: multi.h:464
multi_server_options options
Definition: multi.h:514
PSNET_SOCKET_RELIABLE reliable_socket
Definition: multi.h:465
int server_update_frame_ref
Definition: multi.h:512
void multi_standalone_postgame_init()
Definition: multi.cpp:1690
int unreliable_buffer_size
Definition: multi.h:441
fix last_heard_time
Definition: multi.h:470
ushort server_update_seq
Definition: multi.h:511
float ping_time
Definition: multi.h:502
net_player * host
Definition: multi.h:504
void multi_pause_do_frame()
Definition: multi.cpp:1329
void multi_do_frame()
Definition: multi.cpp:1122
int HEADER_LENGTH
Definition: multi.cpp:106
ushort flags
Definition: multi.h:553
net_player_server_info s_info
Definition: multi.h:472
ubyte version
Definition: multi.h:554
int Om_tracker_flag
#define MAX_PLAYERS
Definition: pstypes.h:32
short player_id
Definition: multi.h:460
net_addr server_addr
Definition: multi.h:562
char mission_name[NAME_LENGTH+1]
Definition: multi.h:488
char passwd[MAX_PASSWD_LEN+1]
Definition: multi.h:491
ubyte debug_flags
Definition: multi.h:516
short port
Definition: multi.h:389
struct server_item server_item
ubyte player_rank
Definition: multi.h:574
char campaign_name[NAME_LENGTH+1]
Definition: multi.h:490
struct network_buffer network_buffer
long fix
Definition: pstypes.h:54
unsigned char ubyte
Definition: pstypes.h:62
char title[NAME_LENGTH+1]
Definition: multi.h:489
char pxo_squad_name[LOGIN_LEN]
Definition: multi.h:581
net_addr addr
Definition: multi.h:453
void multi_standalone_reset_all()
Definition: multi.cpp:1610
int cl_last_pl
Definition: multi.h:482
int rank_base
Definition: multi.h:496
void standalone_main_init()
Definition: multi.cpp:1428
char Multi_tracker_id_string[255]
Definition: multi.cpp:147
button_info last_buttons[BUTTON_INFO_SAVE_COUNT]
Definition: multi.h:400
ubyte num_players
Definition: multi.h:551
int Multi_has_cd
Definition: multi.cpp:112
net_player Net_players[MAX_PLAYERS]
Definition: multi.cpp:93
int ADDRESS_LENGTH
Definition: multi.cpp:104
netgame_info Netgame
Definition: multi.cpp:97
int multi_client_server_dead()
Definition: multi.cpp:376
int last_buttons_id[BUTTON_INFO_SAVE_COUNT]
Definition: multi.h:401
GLuint const GLchar * name
Definition: Glext.h:5608
ubyte net_id[4]
Definition: multi.h:387
net_addr server_addr
Definition: multi.h:503
void standalone_main_close()
Definition: multi.cpp:1605
short Multi_id_num
Definition: multi.cpp:115
ping_struct ping
Definition: multi.h:395
int Multi_tracker_id
Definition: multi.cpp:146
ushort Next_non_perm_signature
Definition: multiutil.cpp:90
#define MAX_PASSWD_LEN
Definition: multi.h:90
#define CALLSIGN_LEN
Definition: globals.h:31
void multi_standalone_wait_init()
Definition: multi.cpp:1644
int campaign_mode
Definition: multi.h:509
CFILE * Multi_chat_stream
Definition: multi.cpp:111
void multi_process_reliable_details()
Definition: multi.cpp:996
ubyte unreliable_buffer[MAX_PACKET_SIZE]
Definition: multi.h:440
int Multi_button_info_ok
Definition: multi.cpp:100
#define NAME_LENGTH
Definition: globals.h:15
char Multi_tracker_passwd[MULTI_TRACKER_STRING_LEN+1]
Definition: multi.cpp:144
server_item * prev
Definition: multi.h:560
char passwd[MAX_PASSWD_LEN+1]
Definition: multi.h:570
int Multi_connection_speed
Definition: multi.cpp:113
Definition: multi.h:385
unsigned short ushort
Definition: pstypes.h:63
#define MAX_GAMENAME_LEN
Definition: multi.h:88
active_game * Active_game_head
Definition: multi.cpp:109
struct net_player_info net_player_info
GLenum GLsizei GLenum GLenum const GLvoid * data
Definition: Gl.h:1509
short id
Definition: multi.h:390
char callsign[CALLSIGN_LEN+1]
Definition: multi.h:571
int Multi_join_restr_mode
Definition: multi.cpp:138
ushort Multi_ingame_join_sig
server_item * Game_server_head
Definition: multi.cpp:118
p_object * p_objp
Definition: multi.h:448
int ship_index
Definition: multi.h:450
int PORT_LENGTH
Definition: multi.cpp:105
char squad_filename[MAX_FILENAME_LEN+1]
Definition: multi.h:573
fix last_buttons_time[BUTTON_INFO_SAVE_COUNT]
Definition: multi.h:402
char Multi_tracker_login[MULTI_TRACKER_STRING_LEN+1]
Definition: multi.cpp:143
net_addr Multi_restr_addr
Definition: multi.cpp:137
int cl_bytes_recvd
Definition: multi.h:481
ping_struct ping
Definition: multi.h:555
ushort Next_ship_signature
Definition: multiutil.cpp:88
GLenum const GLvoid * addr
Definition: Glext.h:9092
char Multi_tracker_squad_name[MULTI_TRACKER_STRING_LEN+1]
Definition: multi.cpp:145
char title[NAME_LENGTH+1]
Definition: multi.h:550
void multi_standalone_postgame_do()
Definition: multi.cpp:1721
int sv_bytes_sent
Definition: multi.h:477
int sv_last_pl
Definition: multi.h:478
int max_players
Definition: multi.h:497
net_player * server
Definition: multi.h:505
int flags
Definition: multi.h:495
ushort Next_debris_signature
Definition: multiutil.cpp:91
multi_local_options options
Definition: multi.h:452
int Active_game_count
Definition: multi.cpp:110
ubyte comp_version
Definition: multi.h:554
void multi_level_init()
Definition: multi.cpp:253
void multi_init()
Definition: multi.cpp:160