Debian Codegraph @

Descent3/multi.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/Main/multi.h $
21 * $Revision: 172 $
22 * $Date: 7/09/01 2:06p $
23 * $Author: Matt $
24 *
25 * Header for multiplayer
26 *
27 * $Log: /DescentIII/Main/multi.h $
28 *
29 * 172 7/09/01 2:06p Matt
30 * Channged multiplayer version to 10
31 *
32 * 171 5/09/00 5:11p Jeff
33 * fixed struct packing bug
34 *
35 * 170 4/19/00 5:35p Matt
36 * Changed multiplayer version to 9
37 *
38 * 169 10/25/99 5:22p Jeff
39 * upped multiplayer version for merc/1.3
40 *
41 * 168 10/16/99 8:45p Jeff
42 * created multi functions to strip a player of his weapons and energy
43 *
44 * 167 10/01/99 1:39p Kevin
45 * new MULTI_VERSION for demo (macintosh)
46 *
47 * 166 9/09/99 12:24p Kevin
48 * Fixed a bug that was causing problems in the Mac version
49 * (Game_is_master_tracker_game was defined as a uint8_t in the game, but an
50 * int in the dll)
51 *
52 * 165 9/02/99 3:34p Jason
53 * send secondary fire reliable in a C/S game
54 *
55 * 164 9/01/99 6:56p Jason
56 * fixed guided missiles and timeout missiles so they work in multiplayer
57 *
58 * 163 9/01/99 4:12p Kevin
59 * Byte ordering fixes for the macintosh
60 *
61 * 162 7/26/99 2:11p Kevin
62 * 1.1 patch multiplayer version change
63 *
64 * 161 6/03/99 8:48a Kevin
65 * fixes for new OEM version....
66 *
67 * 160 5/23/99 3:04a Jason
68 * fixed bug with player rankings not being updated correctly
69 *
70 * 159 5/20/99 4:54p Jason
71 * added heartbeats to server
72 *
73 * 158 5/20/99 4:10p Jason
74 * added heartbeat to multiplayer so clients wouldn't time out, also
75 * various multiplayer fixes
76 *
77 * 157 5/19/99 5:39p Jason
78 * made level failing work in coop
79 *
80 * 156 5/11/99 10:59a Kevin
81 * Ship allow/dissalow works now!
82 *
83 * 155 5/03/99 2:36p Jason
84 * change for multiplayer games
85 *
86 * 154 5/02/99 5:01p Kevin
87 * changed MAX_RESPAWNS per Jason
88 *
89 * 153 4/29/99 11:46p Jason
90 * added ability to set the next level in a multiplayer game
91 *
92 * 152 4/29/99 11:02p Jeff
93 * added the ability for the server to set audio taunt delay time via
94 * command line option and/or dedicated server console
95 *
96 * 151 4/28/99 2:28a Jeff
97 * finished (hopefully) making guidebot multiplayer friendly
98 *
99 * 150 4/25/99 10:19p Matt
100 * Fixed multiplayer and demo problems will killing an object from script,
101 * and cleaned up the death code a bit in the process.
102 *
103 * 149 4/24/99 11:58p Kevin
104 * Game info list (hit I in the pxo game list)
105 *
106 * 148 4/24/99 6:44p Jeff
107 * added functions for theif so he can steal things other than weapons
108 *
109 * 147 4/17/99 4:24p Kevin
110 * Changed multiplayer version number for Demo & regular
111 *
112 * 146 4/16/99 12:03a Jeff
113 * removed #pragma's for Linux
114 *
115 * 145 4/06/99 6:24p Jason
116 * various fixes for multiplayer
117 *
118 * 144 4/03/99 2:06p Kevin
119 * Changed last file to audio taunt #4.
120 *
121 * 143 4/02/99 6:31p Jason
122 * fixed multiplayer powerup/player start bugs
123 *
124 * 142 4/01/99 5:48p Kevin
125 * Put in code to make it easy to add the guidebot to multiplayer (coop)
126 * games
127 *
128 * 141 3/17/99 4:08p Kevin
129 * Changed the way games appear and timeout in the game list.
130 *
131 * 140 3/11/99 6:30p Jeff
132 * numerous fixes to demo system in multiplayer games (when
133 * recording/playback a demo in a multiplayer game)
134 *
135 * 139 3/02/99 5:50p Kevin
136 * Ouch. Duplicate structures existed and were conflicting.
137 *
138 * 138 2/25/99 11:01a Matt
139 * Added new explosion system.
140 *
141 * 137 2/25/99 10:30a Jason
142 * added nonvis generic/robot system
143 *
144 * 136 2/13/99 12:35a Jeff
145 * fixed up packets to handle new inventory system (removed some compiler
146 * warnings)
147 *
148 * 135 2/12/99 3:38p Jason
149 * added client-side interpolation...its not fully debugged though.
150 *
151 * 134 2/09/99 6:52p Jeff
152 * implemented 'typing inidcator' in multiplayer...players that are typing
153 * messages have an icon on them
154 *
155 * 133 2/04/99 12:26p Jason
156 * added spew that was better for multiplayer
157 *
158 * 132 2/03/99 12:15p Jason
159 * added multiplayer vis optimizations
160 *
161 * 131 1/28/99 6:17p Jason
162 * added markers
163 *
164 * 130 1/27/99 5:47p Jeff
165 * audio taunts implemented!
166 *
167 * 129 1/22/99 4:06p Jeff
168 * added hud messages that can be sent to just teammates or individual
169 * people
170 *
171 * 128 1/21/99 11:15p Jeff
172 * pulled out some structs and defines from header files and moved them
173 * into seperate header files so that multiplayer dlls don't require major
174 * game headers, just those new headers. Side effect is a shorter build
175 * time. Also cleaned up some header file #includes that weren't needed.
176 * This affected polymodel.h, object.h, player.h, vecmat.h, room.h,
177 * manage.h and multi.h
178 *
179 * 127 1/13/99 2:53p Jason
180 * added CONNECT_BAIL packet type
181 *
182 * 126 1/13/99 6:38a Jeff
183 * fixed object.h. There were numerous struct declarations that were the
184 * same name as the instance of the struct (gcc doesn't like this).
185 * Changed the struct name. Also added some #ifdef's for linux build,
186 * along with fixing case-sensitive includes
187 *
188 * 125 1/08/99 2:56p Samir
189 * Ripped out OSIRIS1.
190 *
191 * 124 1/05/99 5:09p Jason
192 * added permissable server networking (ala Quake/Unreal) to Descent3
193 *
194 * 123 1/05/99 11:52a Jason
195 * added more msafe functionality
196 *
197 * 122 1/04/99 8:11p Jason
198 * fixed packet loss tracking problem
199 *
200 * 121 12/31/98 7:36p Jeff
201 * correctly hash type/ids for multisafe. Added some new inline functions
202 * to add/get type/id to a packet
203 *
204 * 120 12/28/98 2:22p Kevin
205 * Initial mission downloading system
206 *
207 * 119 12/21/98 4:04p Jason
208 * first pass at multisafe powerups
209 *
210 * 118 12/16/98 5:37p Jason
211 * added new multisafe architecture
212 *
213 * 117 12/15/98 4:20p Jason
214 * added triggers and door funtions to multisafe list
215 *
216 * 116 12/14/98 5:32p Jason
217 * added multisafe functions
218 *
219 * 115 12/14/98 10:53a Jason
220 * added bright player ships option
221 *
222 * 114 12/10/98 10:51a Jason
223 * added autolag
224 *
225 * 113 12/07/98 3:02p Jason
226 * added multi_logo_state
227 *
228 * 112 12/03/98 3:39p Jason
229 * added peer 2 peer style damage
230 *
231 * 111 12/02/98 10:30a Jason
232 * added additional damage types for client-side multiplayer
233 *
234 * 110 12/01/98 5:48p Jeff
235 * added pilot picture id to netplayer struct
236 *
237 * 109 12/01/98 12:47p Jason
238 * got rid of NF_DROPMISORDERED and added NF_USE_SMOOTHING
239 *
240 * 108 11/19/98 11:27a Jason
241 * added Multi_accept_state for Jeff
242 *
243 * 107 11/16/98 4:47p Jason
244 * changes for multiplayer (weapons load sent and deleting destroyed
245 * lightmapped objects)
246 *
247 * 106 11/13/98 4:25p Jason
248 * changes for better weapon effects
249 *
250 * 105 11/11/98 12:11p Chris
251 * The attach system and weapon firing (continous and spray) are now
252 * network friendly
253 *
254 * 104 11/10/98 4:29p Kevin
255 * Added attach code for chris
256 *
257 * 103 11/10/98 11:16a Jason
258 * fixed some multiplayer bugs with powerups disappearing
259 *
260 *
261 * 102 11/06/98 5:43p Jason
262 * made pings sent not reliably
263 *
264 * 101 11/03/98 6:14p Chris
265 * Starting to make on/off and spray weapons accessable to robots
266 *
267 * 100 10/28/98 11:51a Jason
268 * fixed some multiplayer problems, plus redid coop a bit to make it
269 * cleaner
270 *
271 * 99 10/27/98 10:19a Jason
272 * changes for new architecture
273 *
274 * 98 10/23/98 1:08p Kevin
275 * changed multi version
276 *
277 * 97 10/19/98 7:19p Matt
278 * Added system to support different types of damage to the player and
279 * have these different types make different sounds.
280 *
281 * 96 10/19/98 2:48p Kevin
282 * Added accurate weapon thingy for Chris
283 *
284 * 95 10/08/98 3:38p Jeff
285 * removed time_left from Netgame
286 *
287 * 94 10/07/98 1:07p Jason
288 * added more safety precautions
289 *
290 * 93 10/05/98 7:23p Jason
291 * added protective layer onto multiplayer
292 *
293 * 92 10/01/98 12:17p Kevin
294 * Fixed Ping for Peer-Peer games
295 *
296 * 91 10/01/98 11:29a Jason
297 * changes for world states in multiplayer games
298 *
299 * 90 9/30/98 5:35p Jason
300 * added multiplayer menu bailing for samir
301 *
302 * 89 9/15/98 12:42p Jason
303 * got dedicated server actually working
304 *
305 * 88 9/14/98 4:17p Jason
306 * added friendly fire damage
307 *
308 * 87 9/11/98 12:26p Jason
309 * got energy to shield and fusion damage working in multiplayer
310 *
311 * 86 9/04/98 3:45p Kevin
312 * Added ping_time to Netplayers struct. It's updated in peer-peer and
313 * client server
314 *
315 * 85 8/13/98 6:32p Kevin
316 * Initial implementation of directplay API
317 *
318 * 84 8/12/98 6:36p Jeff
319 * converted the send link/unlink functions to handle ghosted objects.
320 * Updated MultiSendObject to handle dummy objects
321 *
322 * 83 8/12/98 1:17p Jeff
323 * added link/unlink object packets
324 *
325 * 82 8/07/98 12:27p Kevin
326 * Added network stuff for energy/shield conversion
327 *
328 * 81 8/04/98 6:13p Kevin
329 * fixes for sound & bmp exchange
330 *
331 * 80 8/04/98 3:07p Kevin
332 * sound & bmp exchange fixes for > 2 players
333 *
334 * 79 8/04/98 10:26a Kevin
335 * Custom sound and bmp exchange system
336 *
337 * 78 8/03/98 5:56p Jason
338 * got fusion cannon working correctly
339 *
340 * 77 7/29/98 5:39p Kevin
341 * sound/bitmap exchange
342 *
343 * 76 7/29/98 12:40p Jason
344 * more multiplayer testing for occlusion and packet sequencing
345 *
346 * 75 7/27/98 5:31p Kevin
347 * Sound/Bitmap exchange system
348 *
349 * 74 7/24/98 9:37a Kevin
350 * Added some new MP_ types
351 *
352 * 73 7/23/98 12:38p Jason
353 * more tweaks for multiplayer vis stuff
354 *
355 * 72 7/22/98 3:16p Jason
356 * added observer mode
357 *
358 * 71 7/20/98 6:20p Kevin
359 * peer-peer stuff
360 *
361 * 70 7/17/98 1:22p Kevin
362 * Dynamic retransmission of reliable packets and stuff
363 *
364 * 69 7/16/98 12:51p Jason
365 * added a way for DLLs to bail out if something is wrong
366 *
367 * 68 7/14/98 5:52p Kevin
368 * Packet loss measurements and auto pps adjusting
369 *
370 * 67 7/13/98 11:52a Kevin
371 * Added Callscriptwithparms
372 *
373 * 66 7/08/98 6:01p Jeff
374 * added packet to remove an item from inventory
375 *
376 * 65 7/08/98 12:01p Kevin
377 * weapon battery info
378 *
379 * 64 7/07/98 7:33p Jeff
380 * changes made for inventory use
381 *
382 * 63 7/07/98 3:16p Kevin
383 * Added inventory parms
384 *
385 * 62 7/07/98 11:19a Kevin
386 * Added inventory use message
387 *
388 * 61 7/07/98 10:10a Kevin
389 * Added basic turret support for coop
390 *
391 * 60 7/06/98 6:46p Kevin
392 * vector parameter passing in scripts
393 *
394 * 59 7/06/98 5:36p Kevin
395 * Variable parameter passing
396 *
397 * 58 7/06/98 11:51a Jason
398 * added accessor function for countermeasures
399 *
400 * 57 7/02/98 12:57p Jason
401 * various changes for multiplayer positional sequencing
402 *
403 * 56 7/02/98 10:39a Kevin
404 * More coop stuff
405 *
406 * 55 7/01/98 6:30p Kevin
407 * More coop
408 *
409 * 54 7/01/98 12:55p Jason
410 * more changes for countermeasures
411 *
412 * 53 7/01/98 12:11p Jason
413 * added countermeasures
414 *
415 * 52 6/30/98 7:17p Kevin
416 * more animation stuff
417 *
418 * 51 6/30/98 5:08p Kevin
419 * Animation frame stuff
420 *
421 * 50 6/30/98 3:58p Chris
422 *
423 * 49 6/30/98 11:39a Jason
424 * added AdditionalDamage packet type for multiplayer
425 *
426 * 48 6/29/98 3:08p Jason
427 * added on/off weapons
428 *
429 * 47 6/29/98 12:49p Jason
430 * temp checkin for on/off weapons
431 *
432 * 46 6/29/98 12:12p Kevin
433 * Added robot damage and death packets
434 *
435 * 45 6/26/98 6:53p Kevin
436 * Coop mode
437 *
438 * 44 6/26/98 6:20p Jason
439 * changes for coop
440 *
441 * 43 6/25/98 5:22p Kevin
442 * Req/Send gametime to clients
443 *
444 * 42 6/25/98 12:32p Jason
445 * added new multiplayer functionality
446 *
447 * 41 6/24/98 3:24p Kevin
448 * Updated PXO screens with chat, etc.
449 *
450 * 40 6/18/98 4:49p Kevin
451 * Updated multiplayer menus
452 *
453 * 39 5/19/98 6:27p Jason
454 * put in urgent packets
455 *
456 * 38 5/14/98 11:07a Kevin
457 * Made gameover packet to the tracker reliable
458 *
459 * 37 5/12/98 5:12p Jason
460 * added dll callable level ending
461 *
462 * 36 5/12/98 4:18p Jason
463 * added better level sequencing for multiplayer
464 *
465 * 35 5/12/98 12:33p Jason
466 * got level sequencing working in multiplayer
467 *
468 * 34 5/04/98 10:55a Kevin
469 * Mastertracker fixes/enhancements
470 *
471 * 33 4/30/98 3:50p Kevin
472 * Mastertracker pilot stats
473 *
474 * 32 4/28/98 2:58p Kevin
475 * Added mastertracker flags
476 *
477 * 31 4/24/98 3:50p Kevin
478 * Added mastertracker game tracking support
479 *
480 * 30 4/20/98 12:46p Jason
481 * added level checksumming for multiplayer games
482 *
483 * 29 4/17/98 1:59p Jason
484 * added cool object effects
485 *
486 * 28 4/14/98 7:56p Matt
487 * Moved MSN_NAMELEN from mission.h to descent,h, so multi.h didn't need
488 * to include mission.h.
489 *
490 */
491
492 #ifndef MULTI_H
493 #define MULTI_H
494
495 #include "pstypes.h"
496 #include "vecmat_external.h"
497 #include "object_external_struct.h"
498 #include "object_external.h"
499 #include "player_external.h"
500
501 #if defined(POSIX)
502 #include "linux_fix.h"
503 #endif
504
505 #include "multi_external.h" //defines and structs are in here
506
507 extern bool Multi_bail_ui_menu;
508 #if defined(DEMO)
509 #define MULTI_VERSION 7
510 #elif defined(OEM)
511 #define MULTI_VERSION 5
512 #else
513 // #define MULTI_VERSION 4
514 // Patch 1.1!
515 // #define MULTI_VERSION 6
516 // Patch 1.3
517 #define MULTI_VERSION 10
518 #endif
519
520 #define MULTI_PING_INTERVAL 3
521
522 // Multiplayer packets
523 #define MP_CONNECTION_ACCEPTED 1 // Server says we can join
524 #define MP_OBJECT 2 // Object packet from the server
525 #define MP_PLAYER 3 // Name packet from the server
526 #define MP_ALL_SET 4 // Client is ready to play!
527 #define MP_PLAYER_POS 5 // Player position packet
528 #define MP_REQUEST_PLAYERS 6 // Clients wants to know about players
529 #define MP_MY_INFO 7 // Stats for local client
530 #define MP_DONE_PLAYERS 8 // Done requesting players
531 #define MP_ENTERING_GAME 9 // I'm entering the game
532 #define MP_DISCONNECT 10 // A player has disconnected
533 #define MP_PLAYER_FIRE 11 // A player is firing
534 #define MP_ASK_TO_JOIN 12 // Asking if its ok to join
535 #define MP_JOIN_RESPONSE 13 // Answering MP_ASK_TO_JOIN
536 #define MP_SERVER_QUIT 14 // Server is quitting
537 #define MP_LEAVE_GAME 15 // A client is leaving the game
538 #define MP_BLOWUP_BUILDING 16 // A building is blowing up
539 #define MP_DONE_BUILDINGS 17 // Server is done sending buildings
540 #define MP_REQUEST_BUILDINGS 18 // Requesting buildings
541 #define MP_BUILDING 19 // Server is telling us about buildings
542 #define MP_DONE_OBJECTS 20 // Server is done sending buildings
543 #define MP_REQUEST_OBJECTS 21 // Requesting buildings
544 #define MP_JOIN_OBJECTS 22 // Server is telling us about buildings
545 #define MP_PLAYER_DEAD 23 // Server says someone is dead!
546 #define MP_PLAYER_RENEW 24 // A player is coming back from the dead!
547 #define MP_PLAYER_ENTERED_GAME 25 // A player is entering the game
548 #define MP_DAMAGE_PLAYER 26 // A player should take damage
549 #define MP_MESSAGE_FROM_SERVER 27 // A text message from the server
550 #define MP_END_PLAYER_DEATH 28 // A player is done dying
551 #define MP_RENEW_PLAYER 29 // Renew a player (a new ship!)
552 #define MP_GET_GAME_INFO 30 // Someone is asking about our game
553 #define MP_GAME_INFO 31 // Server is telling us about its game
554 //@@#define MP_EXECUTE_SCRIPT 32 // Server says to execute a script
555 #define MP_MESSAGE_TO_SERVER 33 // A message from the client to the server
556 #define MP_SPECIAL_PACKET 34 // a special data packet for scripts
557 #define MP_EXECUTE_DLL 35 // Server says to execute a dll
558 #define MP_REMOVE_OBJECT 36 // Server says to remove an object
559 #define MP_GUIDED_INFO 37 // Guided missile info from a player
560 #define MP_LEVEL_ENDED 38 // Server says the level has ended
561 #define MP_READY_FOR_LEVEL 39 // Client wants info about the level
562 #define MP_LEVEL_INFO 40 // Server is telling client about the level
563 #define MP_GET_PXO_GAME_INFO 41 // Same as MP_GET_GAME_INFO but for PXO games only
564 #define MP_POWERUP_REPOSITION 42 // The server is telling the client to move a powerup
565 #define MP_GET_GAMETIME 43 // Client equesting the server's gametime
566 #define MP_HERE_IS_GAMETIME 44 // Server's gametime response
567 #define MP_ROBOT_POS 45 // Robot position and orientation
568 #define MP_ROBOT_FIRE 46 // A robot is firing
569 #define MP_ROBOT_DAMAGE 47 // Apply damage to robot
570 #define MP_ROBOT_EXPLODE 48 // Blow up robot
571 #define MP_ON_OFF 49 // a player is starting or stopping an on/off weapon
572 #define MP_ADDITIONAL_DAMAGE 50 // Server is telling us to add or subtract shields
573 #define MP_ANIM_UPDATE 51 // Server is sending an animation update packet
574 #define MP_REQUEST_COUNTERMEASURE 52 // Client is asking the server to create a countermeasure
575 #define MP_CREATE_COUNTERMEASURE 53 // Server is telling us to create a countermeasure
576 #define MP_PLAY_3D_SOUND_FROM_OBJ 54 // Server sending a 3d sound based on an obj position
577 #define MP_PLAY_3D_SOUND_FROM_POS 55 // Server sending a 3d sound based on an arbitrary position
578 #define MP_ROBOT_FIRE_SOUND 56 // The packet type which makes the firing sound from the robot
579 //@@#define MP_EXECUTE_SCRIPT_WITH_PARMS 57 // Execute Script with parameters
580 #define MP_TURRET_UPDATE 58 // Update on turret info from the server
581 #define MP_CLIENT_USE_INVENTORY_ITEM \
582 59 // Client is telling the server that he want's to use an item from his inventory
583 #define MP_REMOVE_INVENTORY_ITEM 60 // Server is telling the clients to remove an item from a player's inventory
584 #define MP_SERVER_SENT_COUNT 61 // The server is telling the client how much data he has sent
585 #define MP_CLIENT_SET_PPS 62 // The client is telling the server what pps to use
586 #define MP_GREETINGS_FROM_CLIENT 63 // The client is identifying himself so the server knows his ip
587 #define MP_REQUEST_TO_OBSERVE 64 // A player is requesting to enter observe mode
588 #define MP_OBSERVER_CHANGE 65 // The server is telling us about an observer change
589 #define MP_VISIBLE_PLAYERS 66 // Server is telling us what players are visible
590 #define MP_FILE_REQ 67 // Request a sound or bmp for a particular player slot
591 #define MP_FILE_DENIED 68 // The server isn't going to send you a file you asked for (no soup for you)
592 #define MP_FILE_DATA 69 // Data chunk, which is part of a file xfer
593 #define MP_FILE_ACK 70 // When you receive a chunk of data, reply with this ACK and the sender will send the next chunk
594 #define MP_SERVER_ECHO_REQ \
595 71 // Special packet the server sends to an echo server (on the mastertracker) which responds with his IP address and
596 // port. It makes sure servers behind firewalls/NAT/proxy work
597 #define MP_SERVER_ECHO_RSP 72 // Response from Echo server with our real IP and port
598 #define MP_FILE_CANCEL 73 // Cancel an existing file transfer (client or server/Sender or receiver)
599 #define MP_INVISIBLE_PLAYER 74 // Just a packeting test
600 #define MP_PLAYER_CUSTOM_DATA 75 // This player has custom data. Here are the file names
601 #define MP_ABORT_JOIN_SERVER 76 // Stop trying to join a server because the level is ending or server quiting
602 #define MP_ENERGY_SHIELD_CONV_ON_OFF 77 // Client wants to do an energy to shield conversion
603 #define MP_GHOST_OBJECT 78 // Tells clients to ghost or unghost an object
604 #define MP_PLAYER_PING 79 // Ask for a ping
605 #define MP_PLAYER_PONG 80 // Response to a ping.
606 #define MP_PLAYER_LAG_INFO 81 // Tell clients in a client/server game what the ping of another player is.
607 #define MP_REQUEST_DAMAGE 82 // We're asking the server to damage us
608 #define MP_REQUEST_SHIELDS 83 // We're asking the server to give us shields
609 #define MP_REQUEST_WORLD_STATES 84 // Clients wants to know about the world state
610 #define MP_DONE_WORLD_STATES 85 // Server says we're done with world states
611 #define MP_WORLD_STATES 86 // Information about the world
612 #define MP_ATTACH_OBJ 87 // Attach an object with the attach system
613 #define MP_UNATTACH_OBJ 88 // UnAttach an object with the attach system
614 #define MP_AIWEAP_FLAGS 89 // Allows robots to have continous and spray weapons
615 #define MP_ATTACH_RAD_OBJ 90 // Attach by rad
616 #define MP_TIMEOUT_WEAPON 91 // Timeout weapon
617 #define MP_WEAPONS_LOAD 92 // Client is telling server about weapons load
618 #define MP_REQUEST_PEER_DAMAGE 93 // Client is asking another player to damage him
619 #define MP_MSAFE_FUNCTION 94 // Msafe function
620 #define MP_MSAFE_POWERUP 95 // Multisafe powerup
621 #define MP_ASK_FOR_URL 96 // Ask for a url list from the server
622 #define MP_CUR_MSN_URLS 97 // Response from the server listing the URLs for the current mission
623 #define MP_REQUEST_TO_FIRE 98 // Client is requesting to fire
624 #define MP_PERMISSION_TO_FIRE 99 // Permissable firing packet
625 #define MP_CONNECT_BAIL 100 // Server says to bail on connecting
626 #define MP_CLIENT_PLAY_TAUNT 101 // Client is requesting to play audio taunt
627 #define MP_SERVER_PLAY_TAUNT 102 // Server is telling clients to play a player's audio taunt
628 #define MP_REQUEST_MARKER 103 // Client is asking for a marker to be dropped
629 #define MP_REQUEST_TYPE_ICON 104 // Client is telling server that he is typing a message
630 #define MP_SEND_TYPE_ICON 105 // Server is telling clients that a player is typing a message (to display icon on hud)
631 #define MP_REQUEST_TO_MOVE 106 // Client is requesting to move
632 #define MP_ADJUST_POSITION 107 // Server is telling me my new position
633 #define MP_GENERIC_NONVIS 108 // Server says I can't see this generic object
634 #define MP_SEND_DEMO_OBJECT_FLAGS 109 // Server is sending what join objects have the OF_CLIENTDEMOOBJECT set
635 #define MP_GUIDEBOTMENU_REQUEST 110 // Client is requesting either the guidebot menu, or one of the items on the menu
636 #define MP_GUIDEBOTMENU_DATA 111 // Server is sending the guidebot text to display in the menu
637 #define MP_BREAK_GLASS 112 // Server is telling us to break some glass
638 #define MP_THIEF_STEAL 113 // Server is telling a client that the thief stole an item from him
639 #define MP_REQUEST_PLAYERLIST 114 // Client is requesting a list of players for this game
640 #define MP_PLAYERLIST_DATA 115 // Server is sending a list of players in this game
641 #define MP_SERVER_AUDIOTAUNT_TIME 116
642 #define MP_CHANGE_RANK 117 // Server says a player has changed rank
643 #define MP_BASHPLAYER_SHIP 118 // Server says we need to use a different ship
644 #define MP_HEARTBEAT 119 // A blank packet that says we're still alive (for loading levels)
645 #define MP_INITIAL_RANK 120 // Server is telling me about rank
646 #define MP_MISSILE_RELEASE 121 // Informing about a guided missile being released from guided mode
647 #define MP_STRIP_PLAYER 122 // Strips player of all weapons (but laser) and reduces energy to 0
648 #define MP_REJECTED_CHECKSUM 123 // The server rejected the client checksum. This lets the client know.
649
650 // Shield request defines
651 #define MAX_SHIELD_REQUEST_TYPES 1
652 #define SHIELD_REQUEST_ENERGY_TO_SHIELD 0
653
654 #define SERVER_PLAYER 128
655
656 #define MASTER_TRACKER_SIG 0xf429b142
657
658 // values for fired_on_this_frame
659 #define PFP_NO_FIRED 0 // the player didn't fire at all this frame
660 #define PFP_FIRED 1 // the player fired this frame and the info should be packed in a player pos flag
661 #define PFP_FIRED_RELIABLE 2 // used for secondaries of a non-peer to peer game
662 struct player_fire_packet {
663 uint8_t fired_on_this_frame;
664 uint8_t wb_index;
665 uint8_t fire_mask;
666 uint8_t damage_scalar;
667 uint8_t reliable;
668 int dest_roomnum;
669 };
670
671 extern netgame_info Netgame;
672
673 extern uint16_t Local_object_list[];
674 extern uint16_t Server_object_list[];
675 extern uint16_t Server_spew_list[];
676
677 #define MAX_RECEIVE_SIZE 4096
678 #define MAX_NETWORK_GAMES 100
679
680 // The size of the packet_number and guaranteed fields of game_packet_data:
681 #define HEADER_INFO_SIZE 5
682
683 #define NETFILE_NONE 0 // No file transfer in progress
684 #define NETFILE_SENDING 1 // Sending a file to someone
685 #define NETFILE_RECEIVING 2 // Receiving a file from someone
686 #define NETFILE_ASKING 3 // Waiting for a response as to if we can get a file
687
688 #define NETFILE_ID_NOFILE 0 // No file at all (for sequencing)
689 #define NETFILE_ID_SHIP_TEX 1 // Custom ship texture
690 #define NETFILE_ID_VOICE_TAUNT1 2 // Voice taunt #1
691 #define NETFILE_ID_VOICE_TAUNT2 3 // Voice taunt #2
692 #define NETFILE_ID_VOICE_TAUNT3 4 // Voice taunt #3
693 #define NETFILE_ID_VOICE_TAUNT4 5 // Voice taunt #4
694 #define NETFILE_ID_DONE 99 // Done transferring files
695
696 // This sets the last file we look for in the sequence above
697 #define NETFILE_ID_LAST_FILE NETFILE_ID_VOICE_TAUNT4
698
699 // A semi-compressed orientation matrix for multiplayer games
700 struct multi_orientation {
701 int16_t multi_matrix[9];
702 };
703
704 static inline void MultiMatrixMakeEndianFriendly(multi_orientation *mmat) {
705 for (int i = 0; i < 9; i++) {
706 mmat->multi_matrix[i] = INTEL_SHORT(mmat->multi_matrix[i]);
707 }
708 }
709
710 // For firing players
711 extern player_fire_packet Player_fire_packet[MAX_NET_PLAYERS];
712
713 // For powerup respawning
714 #define MAX_RESPAWNS 300
715 #define RESPAWN_TIME 60 // seconds until a powerup respawns
716
717 #define MULTI_SEND_MESSAGE_ALL -1
718 #define MULTI_SEND_MESSAGE_RED_TEAM -2
719 #define MULTI_SEND_MESSAGE_BLUE_TEAM -3
720 #define MULTI_SEND_MESSAGE_GREEN_TEAM -4
721 #define MULTI_SEND_MESSAGE_YELLOW_TEAM -5
722
723 struct powerup_respawn {
724 vector pos;
725 int objnum;
726 int roomnum;
727 uint8_t used;
728 int16_t original_id;
729 };
730
731 struct powerup_timer {
732 int id;
733 float respawn_time;
734 };
735
736 extern powerup_timer Powerup_timer[];
737 extern powerup_respawn Powerup_respawn[];
738 extern network_game Network_games[];
739 extern netplayer NetPlayers[MAX_NET_PLAYERS];
740 extern uint8_t Multi_receive_buffer[MAX_RECEIVE_SIZE];
741 extern int Ok_to_join;
742 extern int Num_powerup_respawn;
743 extern int Num_powerup_timer;
744 extern int Multi_next_level;
745
746 // Heartbeat flag
747 extern bool Got_heartbeat;
748
749 // This is for breakable glass
750 #define MAX_BROKE_GLASS 100
751 extern uint16_t Broke_glass_rooms[], Broke_glass_faces[];
752 extern int Num_broke_glass;
753
754 // For keeping track of damage and shields
755 extern float Multi_additional_damage[];
756 extern int Multi_requested_damage_type;
757 extern float Multi_requested_damage_amount;
758 extern float Multi_additional_shields[];
759
760 extern uint8_t Multi_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE];
761 extern int Multi_send_size[MAX_NET_PLAYERS];
762 extern float Multi_last_sent_time[MAX_NET_PLAYERS][MAX_NET_PLAYERS];
763 extern int Multi_additional_damage_type[MAX_NET_PLAYERS];
764
765 extern uint8_t Multi_reliable_urgent[MAX_NET_PLAYERS];
766 extern uint8_t Multi_reliable_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE];
767 extern int Multi_reliable_send_size[MAX_NET_PLAYERS];
768 extern float Multi_reliable_last_send_time[MAX_NET_PLAYERS];
769 extern uint8_t Multi_reliable_sent_position[MAX_NET_PLAYERS];
770 extern uint32_t Multi_visible_players[];
771
772 extern int Got_level_info;
773 extern int Got_new_game_time;
774 // For keeping track of buildings that have changed
775 extern uint8_t Multi_building_states[];
776 extern uint16_t Multi_num_buildings_changed;
777
778 extern bool Multi_logo_state;
779
780 // For searching out netgames
781 extern int Num_network_games_known;
782
783 // Is this a master tracker game?
784 extern int Game_is_master_tracker_game;
785
786 #define TRACKER_ID_LEN 10 // Don't change this!
787 extern char Tracker_id[TRACKER_ID_LEN];
788
789 extern uint16_t Turrett_position_counter[MAX_OBJECTS];
790
791 #define LOGIN_LEN 33
792 #define REAL_NAME_LEN 66
793 #define PASSWORD_LEN 17
794 #define EMAIL_LEN 100
795 #define TRACKER_ID_LEN 10
796 #define PILOT_NAME_LEN 20
797
798 #if defined(WIN32)
799 #pragma pack(push, pxo)
800 #endif
801 #pragma pack(1) // Single byte alignment!
802 struct vmt_descent3_struct {
803 char tracker_id[TRACKER_ID_LEN];
804 char pilot_name[PILOT_NAME_LEN];
805 int rank;
806
807 int kills;
808 int deaths;
809 int suicides;
810 int online_time;
811 int games_played;
812 uint32_t security;
813 uint8_t virgin_pilot; // This pilot was just created if TRUE
814 uint32_t lateral_thrust;
815 uint32_t rotational_thrust;
816 uint32_t sliding_pct; // Percentage of the time you were sliding
817 uint32_t checksum; // This value needs to be equal to whatever the checksum is once the packet is decoded
818 uint32_t pad; // just to provide room for out 4 byte encryption boundry only needed on the client side for now
819 };
820 #define DESCENT3_BLOCK_SIZE (sizeof(vmt_descent3_struct) - 4)
821 #if defined(WIN32)
822 #pragma pack(pop, pxo)
823 #else
824 #pragma pack()
825 #endif
826
827 extern vmt_descent3_struct MTPilotinfo[MAX_NET_PLAYERS];
828
829 // Display a menu based on what the server just told us about
830 void MultiDoGuidebotMenuData(uint8_t *data);
831
832 // The user either wants a menu to display or they took an action off of the menu
833 void MultiDoGuidebotMenuRequest(uint8_t *data, int slot);
834
835 void MultiProcessBigData(uint8_t *buf, int len, network_address *from_addr);
836
837 // Points the server_address variable at a new location
838 void MultiSetServerAddress(network_address *addr);
839
840 // Does multiplayer stuff for one frame
841 void MultiDoFrame();
842
843 // Returns 1 on success, 0 on fail
844 int TryToJoinServer(network_address *addr);
845
846 // The server says we can join!
847 void MultiDoConnectionAccepted(uint8_t *data);
848
849 // Polls for a connection message so we can finally join this game
850 void MultiPollForConnectionAccepted();
851
852 // Gets a new connection set up
853 void MultiSendConnectionAccepted(int slotnum, SOCKET sock, network_address *addr);
854
855 // Starts a new multiplayer game
856 void StartNewMultiplayerGame();
857
858 // Clears all connections
859 // Server and Client
860 void MultiCloseGame();
861
862 // The server sends to everyone that the player is dead
863 void MultiSendPlayerDead(int slot, uint8_t fate);
864
865 // Called when you want to leave a netgame
866 void MultiLeaveGame();
867
868 // MultiProcessIncoming reads incoming data off the unreliable and reliable ports and sends
869 // the data to process_big_data
870 void MultiProcessIncoming();
871
872 // Starts a packet of data
873 int START_DATA(int type, uint8_t *data, int *count, uint8_t reliable = 0);
874
875 // End a pakcet of data
876 void END_DATA(int count, uint8_t *data, int offset);
877
878 // Skip the header stuff
879 void SKIP_HEADER(uint8_t *data, int *count);
880
881 // Starts a level for multiplayer
882 bool MultiStartNewLevel(int level);
883
884 // Returns the number of players in a game
885 int MultiCountPlayers();
886
887 // Puts player "slot" position info into the passed in buffer
888 // Returns the number of bytes used
889 int MultiStuffPosition(int slot, uint8_t *data);
890
891 // Sends a full packet out the the server
892 // Resets the send_size variable
893 // If slot = -1, sends out to the server
894 void MultiSendFullPacket(int slot, int flags);
895
896 void MultiSendFullReliablePacket(int slot, int flags);
897
898 // Makes the passed in player a ghost
899 void MultiMakePlayerGhost(int slot);
900
901 // Makes the passed in player real (non-ghost)
902 void MultiMakePlayerReal(int slot);
903
904 // Sends a fire packet from a player
905 void MultiSendFirePlayerWB(int playernum, uint8_t wb_index, uint8_t fire_mask, uint8_t reliable = 0, float scalar = 1.0);
906
907 void MultiMakeMatrix(multi_orientation *dest, matrix *src);
908
909 // Extracts a matrix from an abbreviated matrix
910 void MultiExtractMatrix(matrix *dest, multi_orientation *src);
911
912 void MultiSendBlowupBuilding(int, int, float);
913
914 // Return index of powerup that has matching table entry
915 int MultiMatchPowerup(int unique_id);
916
917 // Return index of robot that has matching table entry
918 int MultiMatchRobot(int unique_id);
919
920 // Builds the tables for uniquely identifying powerups and robots
921 void MultiBuildMatchTables();
922
923 // Return index of generic that has matching table entry
924 int MultiMatchWeapon(uint32_t unique_id);
925
926 // Tell my clients about damage done to a player
927 void MultiSendDamagePlayer(int, int, int type, float amount);
928
929 // Send a message!
930 void MultiSendMessageFromServer(int, char *, int to = MULTI_SEND_MESSAGE_ALL);
931
932 // Tells the server that I'm done dying
933 void MultiSendEndPlayerDeath();
934
935 // Returns the unique id of a given object type/id
936 uint32_t MultiGetMatchChecksum(int type, int id);
937
938 // Return index of generic that has matching table entry
939 int MultiMatchGeneric(uint32_t unique_id);
940
941 // Sends a message from client to server
942 void MultiSendMessageToServer(int, char *, int to = MULTI_SEND_MESSAGE_ALL);
943
944 // Sends an object from the server to the client
945 void MultiSendObject(object *obj, uint8_t announce, uint8_t demo_record = false);
946
947 // Paints all the goal rooms in a level with their colors
948 void MultiPaintGoalRooms(int *texcolors = NULL);
949
950 // Sends a special script packet to a player
951 void MultiSendSpecialPacket(int slot, uint8_t *outdata, int size);
952
953 // Flushes all receive sockets so that there is no data coming from them
954 void MultiFlushAllIncomingBuffers();
955
956 // Tells all clients to remove a specified object
957 void MultiSendRemoveObject(object *obj, uint8_t playsound);
958
959 // Sends the special script packet to the server
960 void MultiClientSendSpecialPacket(uint8_t *outdata, int size);
961
962 // Sends info out on my guided missile into a slot
963 // returns number of bytes in packet
964 int MultiStuffGuidedInfo(uint8_t, uint8_t *);
965
966 // Polls for a connection message so we can finally join this game
967 // Client only
968 int MultiPollForLevelInfo();
969
970 // Server is telling us about the level
971 void MultiDoLevelInfo(uint8_t *data);
972
973 // Server is telling the client about the level currently playing
974 // Server only
975 void MultiSendLevelInfo(int slot);
976
977 // Clients says he's ready for level info
978 // so send it to him
979 void MultiDoReadyForLevel(uint8_t *data);
980
981 // Client is telling the server that he is ready for a level
982 // Client only
983 void MultiSendReadyForLevel();
984
985 // Tells all the clients to end the level
986 void MultiSendLevelEnded(int success, int next_level);
987
988 // Some DLL is telling us to end the level!
989 void MultiEndLevel();
990
991 // Request the server's gametime
992 void GetServerGameTime();
993
994 // Send robot info
995 int MultiStuffRobotPosition(uint16_t objectnum, uint8_t *data);
996
997 // Handle robot position
998 void MultiDoRobotPos(uint8_t *data);
999
1000 // Handle robot (or any AI created) weapon fire
1001 int MultiSendRobotFireWeapon(uint16_t objectnum, vector *pos, vector *dir, uint16_t weaponnum);
1002
1003 // Send robot damage
1004 void MultiSendKillObject(object *hit_obj, object *killer, float damage, int death_flags, float delay, int16_t seed);
1005
1006 // handle robot damage
1007 void MultiDoRobotExplode(uint8_t *data);
1008
1009 // Peer to peer request for damage
1010 void MultiSendRequestPeerDamage(object *, int, int, float);
1011
1012 // Tell all the clients about this players rank
1013 void MultiSendInitialRank(int pnum);
1014
1015 // Tells the other players that a slot is starting/stopping its on/off weapon
1016 void MultiSendOnOff(object *obj, uint8_t on, uint8_t wb_index, uint8_t fire_mask);
1017
1018 // Tells all the clients to apply damage to a player
1019 void MultiSendAdditionalDamage(int slot, int type, float amount);
1020
1021 // We're asking the server to create a countermeasure for us
1022 void MultiSendRequestCountermeasure(int16_t objnum, int weapon_index);
1023
1024 // Tell the client that an object took damage
1025 void MultiSendDamageObject(object *hit_obj, object *killer, float damage, int weaponid);
1026
1027 // Handle message from server that robot/object took damage
1028 void MultiDoRobotDamage(uint8_t *data);
1029
1030 // Add an object to the list of objects that need an animation update next player packet interval
1031 void MultiAddObjAnimUpdate(int objnum);
1032
1033 // Stuff an animation update into a packet
1034 int MultiStuffObjAnimUpdate(uint16_t objnum, uint8_t *data);
1035
1036 // Handle an animation update
1037 void MultiDoObjAnimUpdate(uint8_t *data);
1038
1039 // Play a 3d sound that the server told us about
1040 void MultiDoPlay3dSound(uint8_t *data);
1041
1042 // Tell the clients to play a 3d sound
1043 void MultiPlay3dSound(int16_t soundidx, uint16_t objnum, int priority);
1044
1045 // Tell the client to play a sound because a robot fired
1046 void MultiSendRobotFireSound(int16_t soundidx, uint16_t objnum);
1047
1048 // Play the robot sound that the server told us about
1049 void MultiDoRobotFireSound(uint8_t *data);
1050
1051 // Add a turret to the list of stuff to be updated
1052 void MultiAddObjTurretUpdate(int objnum);
1053
1054 // Stuff turret data into a packet
1055 int MultiStuffTurretUpdate(uint16_t objnum, uint8_t *data);
1056
1057 // Handle a turret update from the server
1058 void MultiDoTurretUpdate(uint8_t *data);
1059
1060 // Handle a client use inventory item packet
1061 void MultiDoClientInventoryUseItem(int slot, uint8_t *data);
1062
1063 // Send a request to use an inventory item to the server
1064 void MultiSendClientInventoryUseItem(int type, int id);
1065
1066 // Handle a remove item from inventory
1067 void MultiDoClientInventoryRemoveItem(int slot, uint8_t *data);
1068
1069 // Tell the clients to remove an item from a player's inventory
1070 void MultiSendInventoryRemoveItem(int slot, int type, int id);
1071
1072 void MultiAddObjWBAnimUpdate(int objnum);
1073
1074 int MultiStuffObjWBAnimUpdate(uint16_t objnum, uint8_t *data);
1075
1076 void MultiDoObjWBAnimUpdate(uint8_t *data);
1077
1078 void MultiDoBytesSent(uint8_t *data);
1079
1080 void MultiSendBytesSent(int slot);
1081
1082 void MultiSendPPSSet(int pps);
1083
1084 void MultiDoPPSSet(uint8_t *data, int slot);
1085
1086 void MultiSendGreetings(uint32_t id);
1087
1088 void MultiDoGreetings(uint8_t *data, network_address *addr);
1089
1090 // We're asking to enter observer mode
1091 void MultiSendRequestToObserve(int mode, int on, int objnum);
1092
1093 // Server is telling us about players that we can see
1094 void MultiDoVisiblePlayers(uint8_t *data);
1095
1096 // Sends all the visible players to another player
1097 void MultiSendVisiblePlayers(int to_slot);
1098
1099 void MultiDoFileReq(uint8_t *data);
1100
1101 void MultiDoFileDenied(uint8_t *data);
1102
1103 void MultiDoFileData(uint8_t *data);
1104
1105 void MultiDoFileAck(uint8_t *data);
1106
1107 // Tells clients that a particular player's custom data is here and ready for downloading
1108 void MultiSendClientCustomData(int slot, int whoto = -1);
1109
1110 void MultiCancelFile(int playernum, int filenum, int file_who);
1111
1112 void MultiAskForFile(uint16_t file_id, uint16_t file_who, uint16_t who);
1113
1114 void DoNextPlayerFile(int playernum);
1115
1116 // We're asking the server to damage us
1117 void MultiSendRequestDamage(int type, float amount);
1118
1119 // Asks the server for shields based on frametime "amount" x the type of shields requested
1120 void MultiSendRequestShields(int type, float amount);
1121
1122 // Tells the clients to ghost or unghost an object
1123 void MultiSendGhostObject(object *obj, bool ghost);
1124 void MultiDoGhostObject(uint8_t *data);
1125
1126 // Sends this nonreliable packet to everyone except the server and the named slot
1127 void MultiSendToAllExcept(int except, uint8_t *data, int size, int seq_threshold);
1128
1129 // Tells the server about the weapons we're carrying
1130 void MultiSendWeaponsLoad();
1131
1132 // Tell clients to break some glass
1133 void MultiSendBreakGlass(room *rp, int facenum);
1134
1135 // Sends a heartbeat to the server
1136 void MultiSendHeartbeat();
1137
1138 // Ping functions to find the players latency
1139 void MultiDoPong(uint8_t *data);
1140 void MultiDoPing(uint8_t *data, network_address *addr);
1141 void MultiSendPing(int slot);
1142 void MultiDoLagInfo(uint8_t *data);
1143
1144 // Stuffs a players firing information into a packet
1145 int MultiStuffPlayerFire(int slot, uint8_t *data);
1146
1147 // Stuffs request to move into a packet
1148 int MultiStuffRequestToMove(uint8_t *data);
1149
1150 // Stuff info for a guided missile
1151 int MultiStuffGuidedInfo(int slot, uint8_t *data);
1152
1153 // Tell everyone I'm timingout my timeout weapon
1154 void MultiSendReleaseTimeoutMissile();
1155
1156 // We're asking the server for permission to fire!
1157 void MultiSendRequestToFire(int, int, float scalar = 1.0);
1158
1159 // Client is asking the server to play an audio taunt
1160 void MultiSendRequestPlayTaunt(int index);
1161
1162 // Client is asking for a marker
1163 void MultiSendRequestForMarker(char *message);
1164
1165 // Client is telling the server that he is [not] typing a hud message
1166 void MultiSendRequestTypeIcon(bool typing_message);
1167
1168 // Sets whether or not the server answsers to a connection request
1169 extern bool Multi_accept_state;
1170 void MultiSetAcceptState(bool state);
1171
1172 void MultiSendAiWeaponFlags(object *obj, int flags, int wb_index);
1173 void MultiDoAiWeaponFlags(uint8_t *data);
1174 void MultiSendAttach(object *parent, char parent_ap, object *child, char child_ap, bool f_aligned);
1175 void MultiDoAttach(uint8_t *data);
1176 void MultiSendAttachRad(object *parent, char parent_ap, object *child, float rad);
1177 void MultiDoAttachRad(uint8_t *data);
1178 void MultiSendUnattach(object *child);
1179 void MultiDoUnattach(uint8_t *data);
1180
1181 void MultiDoJoinDemoObjects(uint8_t *data);
1182
1183 // Rank stuff
1184 void MultiDoChangeRank(uint8_t *data);
1185
1186 // Sets whether or not we want the logos to be displayed on ships
1187 void MultiSetLogoState(bool state);
1188
1189 void MultiSendThiefSteal(int player, int item);
1190 void MultiDoThiefSteal(uint8_t *data);
1191
1192 void MultiSetAudioTauntTime(float time, int to_who = -1);
1193 void MultiDoAudioTauntTime(uint8_t *data);
1194
1195 // Server only function to clear a Guidebot for a disconnected player
1196 void MultiClearGuidebot(int slot);
1197
1198 // Guided missile release
1199 void MultiDoMissileRelease(int from_slot, uint8_t *data);
1200 void MultiSendMissileRelease(int slot, bool is_guided);
1201
1202 // Server telling a client what ship to switch to
1203 void MultiBashPlayerShip(int slot, char *ship);
1204
1205 // Strips a player bare of weapons
1206 void MultiSendStripPlayer(int slot);
1207
1208 inline void MultiGetTypeID(uint8_t *data, int *count, int *type, int *id) {
1209 *id = -1;
1210 *type = MultiGetByte(data, count);
1211
1212 uint32_t hash_value = MultiGetUint(data, count);
1213
1214 if ((*type) == OBJ_WEAPON)
1215 *id = MultiMatchWeapon(hash_value);
1216 else
1217 *id = MultiMatchGeneric(hash_value);
1218 }
1219
1220 inline void MultiAddTypeID(int type, int id, uint8_t *data, int *count) {
1221 uint32_t hash_value;
1222 hash_value = MultiGetMatchChecksum(type, id);
1223
1224 MultiAddByte(type, data, count);
1225 MultiAddUint(hash_value, data, count);
1226 }
1227
1228 int MultiGetShipChecksum(int ship_index);
1229
1230 #endif