]> icculus.org git repositories - taylor/freespace2.git/blob - include/multimsgs.h
added copyright header
[taylor/freespace2.git] / include / multimsgs.h
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
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/Network/multimsgs.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * Header file for the building and sending of multiplayer packets
16  *
17  * $Log$
18  * Revision 1.4  2002/06/09 04:41:14  relnev
19  * added copyright header
20  *
21  * Revision 1.3  2002/05/27 00:40:47  theoddone33
22  * Fix net_addr vs net_addr_t
23  *
24  * Revision 1.2  2002/05/26 20:49:54  theoddone33
25  * More progress
26  *
27  * Revision 1.1.1.1  2002/05/03 03:28:12  root
28  * Initial import.
29  *
30  * 
31  * 31    8/26/99 8:51p Dave
32  * Gave multiplayer TvT messaging a heavy dose of sanity. Cheat codes.
33  * 
34  * 30    8/25/99 4:38p Dave
35  * Updated PXO stuff. Make squad war report stuff much more nicely.
36  * 
37  * 29    8/22/99 5:53p Dave
38  * Scoring fixes. Added self destruct key. Put callsigns in the logfile
39  * instead of ship designations for multiplayer players.
40  * 
41  * 28    8/22/99 1:19p Dave
42  * Fixed up http proxy code. Cleaned up scoring code. Reverse the order in
43  * which d3d cards are detected.
44  * 
45  * 27    8/19/99 10:59a Dave
46  * Packet loss detection.
47  * 
48  * 26    8/16/99 4:05p Dave
49  * Big honking checkin.
50  * 
51  * 25    7/30/99 7:01p Dave
52  * Dogfight escort gauge. Fixed up laser rendering in Glide.
53  * 
54  * 24    7/22/99 7:17p Dave
55  * Fixed excessive whacks in multiplayer.
56  * 
57  * 23    7/08/99 10:53a Dave
58  * New multiplayer interpolation scheme. Not 100% done yet, but still
59  * better than the old way.
60  * 
61  * 22    7/03/99 5:50p Dave
62  * Make rotated bitmaps draw properly in padlock views.
63  * 
64  * 21    6/21/99 7:24p Dave
65  * netplayer pain packet. Added type E unmoving beams.
66  * 
67  * 20    5/14/99 1:59p Andsager
68  * Multiplayer message for subsystem cargo revealed.
69  * 
70  * 19    4/29/99 2:29p Dave
71  * Made flak work much better in multiplayer.
72  * 
73  * 18    4/28/99 11:13p Dave
74  * Temporary checkin of artillery code.
75  * 
76  * 17    4/09/99 2:21p Dave
77  * Multiplayer beta stuff. CD checking.
78  * 
79  * 16    4/02/99 9:55a Dave
80  * Added a few more options in the weapons.tbl for beam weapons. Attempt
81  * at putting "pain" packets into multiplayer.
82  * 
83  * 15    3/10/99 6:50p Dave
84  * Changed the way we buffer packets for all clients. Optimized turret
85  * fired packets. Did some weapon firing optimizations.
86  * 
87  * 14    3/09/99 6:24p Dave
88  * More work on object update revamping. Identified several sources of
89  * unnecessary bandwidth.
90  * 
91  * 13    3/08/99 7:03p Dave
92  * First run of new object update system. Looks very promising.
93  * 
94  * 12    2/23/99 2:29p Dave
95  * First run of oldschool dogfight mode. 
96  * 
97  * 11    2/21/99 6:02p Dave
98  * Fixed standalone WSS packets. 
99  * 
100  * 10    2/17/99 2:11p Dave
101  * First full run of squad war. All freespace and tracker side stuff
102  * works.
103  * 
104  * 9     1/14/99 12:48a Dave
105  * Todo list bug fixes. Made a pass at putting briefing icons back into
106  * FRED. Sort of works :(
107  * 
108  * 8     1/12/99 5:45p Dave
109  * Moved weapon pipeline in multiplayer to almost exclusively client side.
110  * Very good results. Bandwidth goes down, playability goes up for crappy
111  * connections. Fixed object update problem for ship subsystems.
112  * 
113  * 7     11/19/98 8:04a Dave
114  * Full support for D3-style reliable sockets. Revamped packet lag/loss
115  * system, made it receiver side and at the lowest possible level.
116  * 
117  * 6     11/17/98 11:12a Dave
118  * Removed player identification by address. Now assign explicit id #'s.
119  * 
120  * 5     11/12/98 12:13a Dave
121  * Tidied code up for multiplayer test. Put in network support for flak
122  * guns.
123  * 
124  * 4     11/05/98 5:55p Dave
125  * Big pass at reducing #includes
126  * 
127  * 3     10/20/98 1:39p Andsager
128  * Make so sparks follow animated ship submodels.  Modify
129  * ship_weapon_do_hit_stuff() and ship_apply_local_damage() to add
130  * submodel_num.  Add submodel_num to multiplayer hit packet.
131  * 
132  * 2     10/07/98 10:53a Dave
133  * Initial checkin.
134  * 
135  * 1     10/07/98 10:50a Dave
136  * 
137  * 169   9/20/98 7:20p Dave
138  * Added CHANGE_IFF packet. 
139  * 
140  * 168   9/11/98 4:14p Dave
141  * Fixed file checksumming of < file_size. Put in more verbose kicking and
142  * PXO stats store reporting.
143  * 
144  * 167   9/11/98 2:05p Allender
145  * make reinforcements work correctly in multiplayer games.  There still
146  * may be a team vs team issue that I haven't thought of yet :-(
147  * 
148  * 166   8/28/98 3:29p Dave
149  * EMP effect done. AI effects may need some tweaking as required.
150  * 
151  * 165   8/25/98 1:48p Dave
152  * First rev of EMP effect. Player side stuff basically done. Next comes
153  * AI code.
154  * 
155  * 164   6/22/98 8:36a Allender
156  * revamping of homing weapon system.  don't send as object updates
157  * anymore
158  * 
159  * 163   6/10/98 2:56p Dave
160  * Substantial changes to reduce bandwidth and latency problems.
161  * 
162  * 162   5/25/98 10:58a Allender
163  * more object update stuff -- fix duplicate repair ship messages
164  * 
165  * 161   5/20/98 2:24a Dave
166  * Fixed server side voice muting. Tweaked multi debrief/endgame
167  * sequencing a bit. Much friendlier for stats tossing/accepting now.
168  * 
169  * 160   5/18/98 12:41a Allender
170  * fixed subsystem problems on clients (i.e. not reporting properly on
171  * damage indicator).  Fixed ingame join problem with respawns.  minor
172  * comm menu stuff
173  * 
174  * 159   5/13/98 6:54p Dave
175  * More sophistication to PXO interface. Changed respawn checking so
176  * there's no window for desynchronization between the server and the
177  * clients.
178  * 
179  * 158   5/11/98 11:40p Dave
180  * Stuff.
181  * 
182  * 157   5/08/98 11:22a Allender
183  * fix ingame join trouble.  Small messaging fix.  Enable collisions for
184  * friendlies again
185  * 
186  * 156   5/04/98 1:46p Allender
187  * new join procedure which should allow > 10 players accurately.  Fixed a
188  * minor UI problem on join screen
189  * 
190  * 155   4/30/98 12:49a Allender
191  * deal with asteroid problems in multiplayer
192  * 
193  * 154   4/25/98 7:40p Allender
194  * fixd some small hotkey stuff.  Worked on turret orientation being
195  * correct for multiplayer.  new sexpression called end-campaign will will
196  * end the main campaign
197  * 
198  * 153   4/22/98 5:53p Dave
199  * Large reworking of endgame sequencing. Updated multi host options
200  * screen for new artwork. Put in checks for host or team captains leaving
201  * midgame.
202  * 
203  * 152   4/22/98 5:00p Allender
204  * new multiplayer dead popup.  big changes to the comm menu system for  *
205  * team vs. team.  Start of debriefing stuff for team vs. team  Make form
206  * on my wing work with individual ships who have high priority 
207  * orders
208  * 
209  * 151   4/21/98 4:44p Dave
210  * Implement Vasudan ships in multiplayer. Added a debug function to bash
211  * player rank. Fixed a few rtvoice buffer overrun problems. Fixed ui
212  * problem in options screen. 
213  * 
214  * 150   4/20/98 12:40a Allender
215  * fixed nasty problem where network read code was not reentrant.  minor
216  * UI tweaks.  ingame joiners now get netgame info correctly.
217  *
218  * $NoKeywords: $
219  */
220
221
222
223 #ifndef MULTI_MSGS_H
224 #define MULTI_MSGS_H
225
226 #include "pstypes.h"
227 #include "psnet2.h"
228
229 struct net_player;
230 struct object;
231 struct ship;
232 struct wing;
233 struct join_request;
234 struct button_info;
235 struct header;
236 struct beam_info;
237 struct ship_subsys;
238
239 // macros for building up packets -- to save on time and typing.  Important to note that local variables
240 // must be named correctly
241 // there are two flavors of sending orientation matrices, 16 bit and 32 bit. Just #define ORIENT_16 to use
242 // 16 bits, otherwise 32 bits is the default
243
244 #define BUILD_HEADER(t) do { data[0]=t; packet_size = HEADER_LENGTH; } while(0)
245 #define ADD_DATA(d) do { Assert((packet_size + sizeof(d)) < MAX_PACKET_SIZE); memcpy(data+packet_size, &d, sizeof(d) ); packet_size += sizeof(d); } while (0)
246 #define ADD_STRING(s) do { Assert((packet_size + strlen(s) + 4) < MAX_PACKET_SIZE);int len = strlen(s); ADD_DATA(len); memcpy(data+packet_size, s, len ); packet_size += len; } while(0)
247 #define ADD_ORIENT(d) { Assert((packet_size + 17) < MAX_PACKET_SIZE); ubyte dt[17]; multi_pack_orient_matrix(dt,&d); memcpy(data+packet_size,dt,17); packet_size += 17; }
248
249 #define GET_DATA(d) do { memcpy(&d, data+offset, sizeof(d) ); offset += sizeof(d); } while(0)
250 #define GET_STRING(s) do { int len;  memcpy(&len, data+offset, sizeof(len)); offset += sizeof(len); memcpy(s, data+offset, len); offset += len; s[len] = '\0'; } while(0)
251 #define GET_ORIENT(d) { ubyte dt[17]; memcpy(dt,data+offset,17); offset+=17; multi_unpack_orient_matrix(dt,&d); }
252
253 #define PACKET_SET_SIZE() do { hinfo->bytes_processed = offset; } while(0)
254
255 // defines for weapon status changes.
256 #define MULTI_PRIMARY_CHANGED           1
257 #define MULTI_SECONDARY_CHANGED 2
258
259 // data sending wrappers
260
261 // send the specified data packet to all players
262 void multi_io_send(net_player *pl, ubyte *data, int length);
263 void multi_io_send_to_all(ubyte *data, int length, net_player *ignore = NULL);
264 void multi_io_send_force(net_player *pl);
265
266 // send the data packet to all players via their reliable sockets
267 void multi_io_send_reliable(net_player *pl, ubyte *data, int length);
268 void multi_io_send_to_all_reliable(ubyte* data, int length, net_player *ignore = NULL);
269 void multi_io_send_reliable_force(net_player *pl);
270
271 // send all buffered packets
272 void multi_io_send_buffered_packets();
273
274
275 // packet handlers -------------------------------------------------------------------------------
276
277 // process an incoming join request packet
278 void process_join_packet( ubyte* data, header* hinfo );
279
280 // process an accept packet from the server
281 void process_accept_packet( ubyte* data, header* hinfo );
282
283 // process a notification for a new player who has joined the game
284 void process_new_player_packet(ubyte* data, header* hinfo);
285
286 // process an incoming hud message packet
287 void process_hud_message(ubyte* data, header* hinfo);
288
289 // process a notification the a player has left the game
290 void process_leave_game_packet(ubyte* data, header* hinfo);
291
292 // process information about an active game
293 void process_game_active_packet(ubyte* data, header* hinfo);
294
295 // process a query from a client looking for active freespace games
296 void process_game_query(ubyte* data, header* hinfo);
297
298 // process a general game chat packet, if we're the standalone we should rebroadcast
299 void process_game_chat_packet( ubyte *data, header *hinfo );
300
301 // process a game information update
302 void process_game_info_packet( ubyte *data, header *hinfo );
303
304 void process_team_update_packet(ubyte *data, header *hinfo);
305
306 // process a packet indicating a secondary weapon was fired
307 void process_secondary_fired_packet(ubyte* data, header* hinfo, int flag);
308
309 // process a packet indicating a countermeasure was fired
310 void process_countermeasure_fired_packet( ubyte *data, header *hinfo );
311
312 // process information about the netgame sent from the server/host
313 void process_netgame_update_packet( ubyte *data, header *hinfo );
314
315 // process an incoming netgame description packet
316 void process_netgame_descript_packet( ubyte *data, header *hinfo );
317
318 // process an incoming netplayer state update. if we're the server, we should rebroadcast
319 void process_netplayer_update_packet( ubyte *data, header *hinfo );
320
321 void process_ship_status_packet(ubyte *data, header *hinfo);
322 void process_player_order_packet(ubyte *data, header *hinfo);
323
324 // process an object update packet.  See send_object_update for information on how
325 // this packet data should be interpreted.  We send different information depending on
326 // on several variables (no change in orienation, etc).
327 void process_object_update_packet( ubyte *data, header *hinfo );
328
329 // process a packet indicating that a ship has been killed
330 void process_ship_kill_packet( ubyte *data, header *hinfo );
331
332 // process a packet saying that a wing should be created
333 void process_wing_create_packet( ubyte *data, header *hinfo );
334
335 // process a packet indicating a ship should be created
336 void process_ship_create_packet( ubyte *data, header *hinfo );
337
338 // process a packet indicating a ship is departing
339 void process_ship_depart_packet( ubyte *data, header *hinfo );
340
341 // process a mission log item packet
342 void process_mission_log_packet( ubyte *data, header *hinfo );
343
344 // process a mission message packet
345 void process_mission_message_packet( ubyte *data, header *hinfo );
346
347 // just send them a pong back as fast as possible
348 void process_ping_packet(ubyte *data, header *hinfo);
349
350 // right now it just routes the pong through to the standalone gui, which is the only
351 // system which uses ping and pong right now.
352 void process_pong_packet(ubyte *data, header *hinfo);
353
354 // process a request for a list of missions
355 void process_mission_request_packet(ubyte *data, header *hinfo);
356
357 // process an individual mission file item
358 void process_mission_item_packet(ubyte *data, header *hinfo);
359
360 // process a pause update packet (pause, unpause, etc)
361 void process_multi_pause_packet(ubyte *data, header *hinfo);
362
363 // process an ingame nak packet
364 void process_ingame_nak(ubyte *data, header *hinfo);
365
366 void process_ingame_ships_packet(ubyte *data, header *hinfo);
367 void process_ingame_wings_packet(ubyte *data, header *hinfo);
368
369 // process a packet indicating we should end the current mission
370 void process_endgame_packet(ubyte *data, header *hinfo);
371
372 // process a position/orientation update from an observer
373 void process_observer_update_packet(ubyte *data, header *hinfo);
374
375 void process_netplayer_slot_packet(ubyte *data, header *hinfo);
376 void process_netplayer_class_packet(ubyte *data, header *hinfo);
377
378 void process_subsys_update_packet(ubyte *data, header *hinfo);
379
380 void process_ingame_ship_update_packet(ubyte *data, header *hinfo);
381
382 void process_file_sig_packet(ubyte *data, header *hinfo);
383 void process_file_sig_request(ubyte *data, header *hinfo);
384
385 void process_ingame_respawn_points_packet(ubyte *data, header *hinfo);
386
387 void process_subsystem_destroyed_packet( ubyte *data, header *hinfo );
388
389 void process_netplayer_load_packet(ubyte *data, header *hinfo);
390
391 void process_jump_into_mission_packet(ubyte *data, header *hinfo);
392
393 void process_repair_info_packet(ubyte *data, header *hinfo);
394
395 void process_mission_sync_packet(ubyte *data, header *hinfo);
396
397 void process_store_stats_packet(ubyte *data, header *hinfo);
398
399 void process_debris_update_packet(ubyte *data, header *hinfo);
400
401 void process_ship_weapon_state_packet(ubyte *data, header *hinfo );
402 void process_ship_weapon_change( ubyte *data, header *hinfo );
403
404 void process_firing_info_packet( ubyte *data, header *hinfo );
405
406 // process a cargo revealed packet
407 void process_cargo_revealed_packet( ubyte *data, header *hinfo );
408
409 void process_subsystem_cargo_revealed_packet( ubyte *data, header *hinfo );
410
411 void process_mission_goal_info_packet( ubyte *data, header *hinfo );
412
413 void process_player_kick_packet(ubyte *data, header *hinfo);
414
415 void process_player_settings_packet(ubyte *data, header *hinfo);
416
417 void process_deny_packet(ubyte *data, header *hinfo);
418
419 void process_post_sync_data_packet(ubyte *data, header *hinfo);
420
421 void process_wss_slots_data_packet(ubyte *data, header *hinfo);
422
423 void process_shield_explosion_packet( ubyte *data, header *hinfo );
424
425 void process_player_stats_block_packet(ubyte *data, header *hinfo);
426
427 void process_host_restr_packet(ubyte *data, header *hinfo);
428
429 void process_netgame_end_error_packet(ubyte *data, header *hinfo);
430
431 void process_client_update_packet(ubyte *data, header *hinfo);
432
433 void process_countdown_packet(ubyte *data, header *hinfo);
434
435 // send a join packet request to the specified address (should be a server)
436 void send_join_packet(net_addr_t* addr,join_request *jr);
437
438 // send an accept packet to a client in response to a request to join the game
439 void send_accept_packet(int new_player_num, int code, int ingame_join_team = -1);
440
441 // send a general game chat packet (if msg_mode == MULTI_MSG_TARGET, need to pass in "to", if == MULTI_MSG_EXPR, need to pass in expr)
442 void send_game_chat_packet(net_player *from, char *msg, int msg_mode, net_player *to = NULL,char *expr = NULL,int server_msg = 0);
443
444 // send a game information update
445 void send_game_info_packet( void );
446
447 // send a notice that the player at net_addr is leaving (if target is NULL, the broadcast the packet)
448 void send_leave_game_packet(short player_id = -1,int kicked_reason = -1,net_player *target = NULL);
449
450 // send a packet indicating a secondary weapon was fired
451 void send_secondary_fired_packet( ship *shipp, ushort starting_sig, int starting_count, int num_fired, int allow_swarm );
452
453 // send a packet indicating a countermeasure was fired
454 void send_countermeasure_fired_packet( object *objp, int cmeasure_count, int rand_val );
455
456
457
458 // send_game_update_packet sends an updated Netgame structure to all players currently connected.  The update
459 // is used to change the current mission, current state, etc.
460 void send_netgame_update_packet(net_player *pl = NULL);
461
462 // sends information about netplayers in the game. if called on the server, broadcasts information about _all_ players
463 void send_netplayer_update_packet( net_player *pl = NULL );
464
465 void send_ship_status_packet(net_player *pl, button_info *bi, int id);
466 void send_player_order_packet(int type, int index, int command);
467
468 // send a request or a reply for mission description, if code == 0, request, if code == 1, reply
469 void send_netgame_descript_packet(net_addr_t *addr, int code);
470
471 // send object update packet sends object updates for all objects in the game.  This function will be smart
472 // about sending only certain objects to certain players based on the players distance from an object, whether
473 // the object is behind the player, etc.
474 void send_object_update_packet(int force_all = 0);
475
476 // send a packet indicating a ship has been killed
477 void send_ship_kill_packet( object *ship_obj, object *other_objp, float percent_killed, int self_destruct );
478
479 // send a packet indicating a wing of ships should be created
480 void send_wing_create_packet( wing *wingp, int num_to_create, int pre_create_count );
481
482 // send a packet indicating a ship should be created
483 void send_ship_create_packet( object *objp, int is_support = 0 );
484
485 // packet indicating a ship is departing
486 void send_ship_depart_packet( object *objp );
487
488 // send a mission log item packet
489 void send_mission_log_packet( int entry );
490
491 // send a mission message packet
492 void send_mission_message_packet(int id, char *who_from, int priority, int timing, int source, int builtin_type, int multi_target, int multi_team_filter);
493
494 // broadcast a query for active games. IPX will use net broadcast and TCP will either request from the MT or from the specified list
495 void broadcast_game_query();
496
497 // send an individual query to an address to see if there is an active game
498 void send_server_query(net_addr_t *addr);
499
500 // broadcast a hud message to all players
501 void send_hud_msg_to_all( char* msg );
502 void send_heartbeat();
503
504 // send a ping packet
505 void send_ping(net_addr_t *addr);
506
507 // send a pong packet
508 void send_pong(net_addr_t *addr);
509
510 // sent from host to master. give me the list of missions you have.
511 // this will be used only in a standalone mode
512 void send_mission_list_request( int what );
513
514 // send an individual mission file item
515 void send_mission_item(net_player *pl,char *file_name,char *mission_name);
516
517 // send a request to the server to pause or unpause the game
518 void send_multi_pause_packet(int pause);
519
520 // send an ack packet
521 void send_ingame_ack(int state,net_player *p);
522
523 // send an ingame nak packet
524 void send_ingame_nak(int state,net_player *p);
525
526 void send_ingame_ships_packet(net_player *pl);
527 void send_ingame_wings_packet(net_player *pl);
528
529 // send a notification that a new player has joined the game (if target != NULL, broadcast the packet)
530 void send_new_player_packet(int new_player_num,net_player *target);
531
532 // send a packet telling players to end the mission
533 void send_endgame_packet(net_player *pl = NULL);
534
535 // send a position/orientation update for myself (if I'm an observer)
536 void send_observer_update_packet();
537
538 void send_netplayer_slot_packet();
539
540 void send_subsys_update_packet(net_player *p);
541
542 void send_ingame_ship_update_packet(net_player *p,ship *sp);
543
544 void send_ingame_final_packet(int net_sig);
545
546 void send_file_sig_packet(ushort sum_sig,int length_sig);
547 void send_file_sig_request(char *file_name);
548
549 void send_subsystem_destroyed_packet( ship *shipp, int index, vector worldpos );
550
551 void send_netplayer_load_packet(net_player *pl);
552
553 void send_jump_into_mission_packet(net_player *pl = NULL);
554
555 void send_repair_info_packet(object *repaired_objp, object *repair_objp, int code );
556
557 void send_mission_sync_packet(int mode,int start_campaign = 0);
558
559 void send_store_stats_packet(int accept);
560
561 void send_debris_create_packet(object *objp, ushort net_signature, int model_num, vector exp_center );
562 void send_debris_update_packet(object *objp,int code);
563
564 void send_ship_weapon_change( ship *shipp, int what, int new_bank, int link_status );
565
566 // ALAN BEGIN
567
568 // send a request from the client to the host of the game (which is not necessarily the server in the case of the standalone) 
569 // mode == WSS_WEAPON_SELECT  or  WSS_SHIP_SELECT
570 void send_wss_request_packet(short player_id, int from_slot,int from_index, int to_slot, int to_index, int wl_ship_slot, int ship_class, int mode,net_player *p = NULL);
571 void process_wss_request_packet(ubyte *data, header *hinfo);
572
573 // send the update from the host to the clients
574 // wss_data is the pointer to a block of data returned by store_wss_stuff(...)
575 // 
576 // I would reccomend :
577 // int store_wss_data(ubyte *block);            // which returns bytes processed
578 // 
579 // so you would say :
580 // 
581 // ubyte block[MAX_PACKET_SIZE - 10 or so];
582 // int processed = store_wss_data(block);
583 // send_wss_update_packet(block,processed);
584 // 
585 // also :
586 // I would reccomend :
587 // int restore_wss_data(ubyte *block);          // which returns bytes processed
588 // 
589 // so I would say in the process_wss_update_packet() :
590 //
591 // int processed = restore_wss_data(block);
592 //      do_other_lowlevel_packet_related_stuff_here();
593 //
594 void send_wss_update_packet(int team_num,ubyte *wss_data,int size);
595 void process_wss_update_packet(ubyte *data, header *hinfo);
596 // ALAN END
597
598 void send_firing_info_packet(void);
599
600 void send_sh_transfer_complete_packet(int code);
601
602 // packet to tell clients cargo of a ship was revealed to all
603 void send_cargo_revealed_packet(ship *shipp);
604
605 void send_subsystem_cargo_revealed_packet(ship *shipp, int index);
606
607 void send_mission_goal_info_packet(int goal_num, int new_status, int valid);
608
609 void send_player_settings_packet(net_player *p = NULL);
610
611 void send_deny_packet(net_addr_t *addr, int code);
612
613 void send_post_sync_data_packet(net_player *p = NULL, int std_request = 1);
614
615 void send_wss_slots_data_packet(int team_num, int final, net_player *p = NULL, int std_request = 1);
616
617 void send_shield_explosion_packet(int objnum, int tri_num, vector hit_pos);
618
619 void send_player_stats_block_packet(net_player *pl, int stats_type, net_player *target = NULL);
620
621 void send_host_restr_packet(char *callsign, int code, int mode);
622
623 void send_netgame_end_error_packet(int notify_code, int err_code);
624
625 void send_client_update_packet(net_player *pl);
626
627 // send information about this currently active game to the specified address
628 void send_game_active_packet(net_addr_t* addr);
629
630 void send_ai_info_update_packet(object *objp, char what);
631 void process_ai_info_update_packet(ubyte *data, header *hinfo);
632
633 void send_asteroid_create(object *new_objp, object *parent_objp, int asteroid_type, vector *relvec);
634 void send_asteroid_throw(object *objp);
635 void send_asteroid_hit(object *objp, object *other_objp, vector *hitpos, float damage);
636 void process_asteroid_info(ubyte *data, header *hinfo);
637
638 void send_countermeasure_success_packet(int objnum);
639 void process_countermeasure_success_packet(ubyte *data, header *hinfo);
640
641 // host sends a -1 to the server to begin the countdown. server sends an int "seconds until start"
642 void send_countdown_packet(int time);
643
644 void send_debrief_info(int stage_count[], int *stage_active[]);
645 void process_debrief_info(ubyte *data, header *hinfo);
646
647 void send_accept_player_data(net_player *npp, int is_ingame);
648 void process_accept_player_data(ubyte *data, header *hinfo);
649
650 void send_homing_weapon_info(int num);
651 void process_homing_weapon_info(ubyte *data, header *hinfo);
652
653 // emp effect stuff
654 void send_emp_effect(ushort net_sig, float intensity, float time);
655 void process_emp_effect(ubyte *data, header *hinfo);
656
657 // for reinforcements
658 void send_reinforcement_avail( int rnum );
659 void process_reinforcement_avail( ubyte *data, header *hinfo );
660
661 // change iff stuff
662 void send_change_iff_packet(ushort net_signature, int new_team);
663 void process_change_iff_packet( ubyte *data, header *hinfo);
664
665 // new primary fired info
666 void send_NEW_primary_fired_packet(ship *shipp, int banks_fired);
667 void process_NEW_primary_fired_packet(ubyte *data, header *hinfo);
668
669 // new countermeasure fired info
670 void send_NEW_countermeasure_fired_packet(object *objp, int cmeasure_count, int rand_val);
671 void process_NEW_countermeasure_fired_packet(ubyte *data, header *hinfo);
672
673 // beam weapon packet
674 void send_beam_fired_packet(object *shooter, ship_subsys *turret, object *target, int beam_info_index, beam_info *override);
675 void process_beam_fired_packet(ubyte *data, header *hinfo);
676
677 // sw std query packet
678 void send_sw_query_packet(ubyte code, char *txt);
679 void process_sw_query_packet(ubyte *data, header *hinfo);
680
681 // event update packet
682 void send_event_update_packet(int event);
683 void process_event_update_packet(ubyte *data, header *hinfo);
684
685 // weapon detonate packet
686 void send_weapon_detonate_packet(object *objp);
687 void process_weapon_detonate_packet(ubyte *data, header *hinfo);
688
689 // turret fired packet
690 void send_turret_fired_packet( int objnum, int subsys_index, int weapon_objnum );
691 void process_turret_fired_packet( ubyte *data, header *hinfo );
692
693 // flak fired packet
694 void send_flak_fired_packet(int ship_objnum, int subsys_index, int weapon_objnum, float flak_range);
695 void process_flak_fired_packet(ubyte *data, header *hinfo);
696
697 // player pain packet
698 void send_player_pain_packet(net_player *pl, int weapon_info_index, float damage, vector *force, vector *hitpos);
699 void process_player_pain_packet(ubyte *data, header *hinfo);
700
701 // lightning packet
702 void send_lightning_packet(int bolt_type, vector *start, vector *strike);
703 void process_lightning_packet(ubyte *data, header *hinfo);
704
705 // bytes sent
706 void send_bytes_recvd_packet(net_player *pl);
707 void process_bytes_recvd_packet(ubyte *data, header *hinfo);
708
709 // host transfer
710 void send_host_captain_change_packet(short player_id, int captain_change);
711 void process_host_captain_change_packet(ubyte *data, header *hinfo);
712
713 // self destruct
714 void send_self_destruct_packet();
715 void process_self_destruct_packet(ubyte *data, header *hinfo);
716
717 #endif
718