34 #define PXO_CHECK_VALID_MISSIONS // always check for valid missions in a debug build
40 #define MULTI_VALID_MISSION_FILE "mvalid.cfg"
65 #define MULTI_FS_SERVER_VERSION 147
67 #define MULTI_FS_SERVER_COMPATIBLE_VERSION MULTI_FS_SERVER_VERSION
71 #define NG_VERSION_ID_FULL 1
74 #define NG_VERSION_ID NG_VERSION_ID_FULL
77 #define MULTI_MAX_PLAYERS 12
80 #define MULTI_MAX_CONNECTIONS 16
83 #define MAX_OBSERVERS 4
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
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
97 #define MP_SINGLE_MISSION 0 // not playing a campaign - single mission
98 #define MP_CAMPAIGN 1 // playing a campaign
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
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
109 #define MULTI_RELIABLE_CONNECT_WAIT 15
112 #define MVALID_STATUS_UNKNOWN -1
113 #define MVALID_STATUS_VALID 0
114 #define MVALID_STATUS_INVALID 1
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))
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) )
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))
146 #define MULTI_IS_TRACKER_GAME (Om_tracker_flag)
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
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
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
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
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
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
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
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)
266 #define CARGO_HIDDEN 0xED // cargo is hidden
267 #define SUBSYS_CARGO_HIDDEN 0xEE // Capital ship cargo subsystem is hidden
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
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
277 #define MAX_TYPE_ID 0xFF // better not try to send > 255 in a single byte buddy
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
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
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
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
321 #define WSS_WEAPON_SELECT 0x1 // ship select stuff
322 #define WSS_SHIP_SELECT 0x2 // weapon select stuff
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
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
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
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
347 #define MISSION_LIST_REQUEST 0x1 // ask for list of missions
348 #define CAMPAIGN_LIST_REQUEST 0x2 // ask for list of campaigns
351 #define ASTEROID_CREATE 0x1 // create an asteroid
352 #define ASTEROID_THROW 0x2 // throw an asteroid
353 #define ASTEROID_HIT 0x3 // asteroid hit occured
356 #define SQUAD_MSG_SHIP 0x1
357 #define SQUAD_MSG_WING 0x2
358 #define SQUAD_MSG_ALL 0x3
359 #define SQUAD_MSG_REINFORCEMENT 0x4
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"
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
374 #define MAX_SHIPS_PER_PACKET 64 // Number of ships in a STATS_MISSION_KILLS or STATS_ALLTIME_KILLS packet
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)
535 #define AG_FLAG_CONNECTION_SPEED_MASK ((1<<12)|(1<<13)|(1<<14)) // mask for the connection speed
537 #define AG_FLAG_VALID_MISSION (1<<15) // the mission is a "valid" tracker mission
539 #define AG_FLAG_CONNECTION_BIT 12 // number of bits to shift right or left to get speed
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)
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
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
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))
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
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)
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
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))
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))
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
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)
709 #define CONNECTION_SPEED_NONE -1 // not really used except for error checking
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
718 #define MULTI_IN_MISSION ( (Netgame.game_state == NETGAME_STATE_IN_MISSION) || (Netgame.game_state == NETGAME_STATE_PAUSED) )
735 #define SHIP_SIG_MIN 1
736 #define SHIP_SIG_MAX (0x2fff)
738 #define STANDALONE_SHIP_SIG (SHIP_SIG_MAX+1)
739 #define REAL_SHIP_SIG_MAX (0x3fff)
741 #define DEBRIS_SIG_MIN (REAL_SHIP_SIG_MAX+1)
742 #define DEBRIS_SIG_MAX (0x5fff)
744 #define ASTEROID_SIG_MIN (DEBRIS_SIG_MAX+1)
745 #define ASTEROID_SIG_MAX (0x7fff)
747 #define NPERM_SIG_MIN (ASTEROID_SIG_MAX+1)
748 #define NPERM_SIG_MAX (0xffff)
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
791 #define MULTI_TRACKER_STRING_LEN 100
#define MULTI_TRACKER_STRING_LEN
char pxo_squad_name[LOGIN_LEN]
int Multi_current_file_length
int tracker_security_last
struct join_request join_request
void multi_standalone_wait_do()
int Multi_restr_query_timestamp
char image_filename[MAX_FILENAME_LEN+1]
uint PSNET_SOCKET_RELIABLE
ushort Multi_current_file_checksum
unsigned int tracker_checksum
join_request Multi_restr_join_request
void multi_reset_timestamps()
struct netgame_info netgame_info
struct net_player_server_info net_player_server_info
char mission_name[NAME_LENGTH+1]
void multi_standalone_wait_close()
multi_local_options player_options
#define BUTTON_INFO_SAVE_COUNT
int Multi_num_players_at_start
ushort Next_asteroid_signature
struct active_game active_game
void multi_standalone_postgame_close()
void standalone_main_do()
struct net_player net_player
ubyte reliable_buffer[MAX_PACKET_SIZE]
int voice_token_timestamp
multi_server_options options
PSNET_SOCKET_RELIABLE reliable_socket
int server_update_frame_ref
void multi_standalone_postgame_init()
int unreliable_buffer_size
void multi_pause_do_frame()
net_player_server_info s_info
char mission_name[NAME_LENGTH+1]
char passwd[MAX_PASSWD_LEN+1]
struct server_item server_item
char campaign_name[NAME_LENGTH+1]
int reliable_connect_time
struct network_buffer network_buffer
char title[NAME_LENGTH+1]
char pxo_squad_name[LOGIN_LEN]
void multi_standalone_reset_all()
void standalone_main_init()
char Multi_tracker_id_string[255]
button_info last_buttons[BUTTON_INFO_SAVE_COUNT]
net_player Net_players[MAX_PLAYERS]
int multi_client_server_dead()
int last_buttons_id[BUTTON_INFO_SAVE_COUNT]
GLuint const GLchar * name
void standalone_main_close()
ushort Next_non_perm_signature
void multi_standalone_wait_init()
CFILE * Multi_chat_stream
void multi_process_reliable_details()
ubyte unreliable_buffer[MAX_PACKET_SIZE]
char Multi_tracker_passwd[MULTI_TRACKER_STRING_LEN+1]
fix last_full_update_time
char passwd[MAX_PASSWD_LEN+1]
int Multi_connection_speed
active_game * Active_game_head
struct net_player_info net_player_info
GLenum GLsizei GLenum GLenum const GLvoid * data
char callsign[CALLSIGN_LEN+1]
int Multi_join_restr_mode
ushort Multi_ingame_join_sig
server_item * Game_server_head
char squad_filename[MAX_FILENAME_LEN+1]
fix last_buttons_time[BUTTON_INFO_SAVE_COUNT]
char Multi_tracker_login[MULTI_TRACKER_STRING_LEN+1]
net_addr Multi_restr_addr
ushort Next_ship_signature
GLenum const GLvoid * addr
char Multi_tracker_squad_name[MULTI_TRACKER_STRING_LEN+1]
char title[NAME_LENGTH+1]
void multi_standalone_postgame_do()
ushort Next_debris_signature
multi_local_options options