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