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