2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
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
10 * $Logfile: /Freespace2/code/Network/multi_team.h $
16 * Revision 1.2 2002/06/09 04:41:14 relnev
17 * added copyright header
19 * Revision 1.1.1.1 2002/05/03 03:28:12 root
23 * 5 9/04/99 1:54p Dave
24 * externed team scores.
26 * 4 4/09/99 2:21p Dave
27 * Multiplayer beta stuff. CD checking.
29 * 3 2/17/99 2:11p Dave
30 * First full run of squad war. All freespace and tracker side stuff
33 * 2 10/07/98 10:53a Dave
36 * 1 10/07/98 10:50a Dave
38 * 8 5/22/98 9:35p Dave
39 * Put in channel based support for PXO. Put in "shutdown" button for
40 * standalone. UI tweaks for TvT
42 * 7 5/15/98 5:16p Dave
43 * Fix a standalone resetting bug.Tweaked PXO interface. Display captaincy
44 * status for team vs. team. Put in asserts to check for invalid team vs.
47 * 6 4/08/98 2:51p Dave
48 * Fixed pilot image xfer once again. Solidify team selection process in
49 * pre-briefing multiplayer.
51 * 5 3/31/98 4:51p Dave
52 * Removed medals screen and multiplayer buttons from demo version. Put in
53 * new pilot popup screen. Make ships in mp team vs. team have proper team
54 * ids. Make mp respawns a permanent option saved in the player file.
56 * 4 3/10/98 4:26p Dave
57 * Second pass at furball mode. Fixed several team vs. team bugs.
59 * 3 3/09/98 5:54p Dave
60 * Fixed stats to take asteroid hits into account. Polished up UI stuff in
61 * team select. Finished up pilot info popup. Tracked down and fixed
64 * 2 3/03/98 8:55p Dave
65 * Finished pre-briefing team vs. team support.
67 * 1 3/03/98 5:09p Dave
72 #ifndef _MULTI_TEAMPLAY_HEADER_FILE
73 #define _MULTI_TEAMPLAY_HEADER_FILE
75 // ------------------------------------------------------------------------------------
76 // MULTIPLAYER TEAMPLAY DEFINES/VARS
84 // score for teams 0 and 1 for this mission
85 extern int Multi_team0_score;
86 extern int Multi_team1_score;
88 // ------------------------------------------------------------------------------------
89 // MULTIPLAYER TEAMPLAY FUNCTIONS
92 // call before level load (pre-sync)
93 void multi_team_level_init();
95 // call to determine who won the sw match, -1 == tie, 0 == team 0, 1 == team 1
96 int multi_team_winner();
98 // call to add score to a team
99 void multi_team_maybe_add_score(int points, int team);
101 // reset all players and assign them to default teams
102 void multi_team_reset();
104 // set the captaincy status of this player
105 void multi_team_set_captain(net_player *pl,int set);
107 // set the team of this given player (if called by the host, the player becomes locked, cnad only the host can modify him from thereon)
108 void multi_team_set_team(net_player *pl,int team);
110 // is it ok for the host to hit commit
111 int multi_team_ok_to_commit();
113 // handle a player drop
114 void multi_team_handle_drop();
116 // handle a player join
117 void multi_team_handle_join(net_player *pl);
119 // send a full update on a player-per-player basis (should call this to update all players after other relevant function calls)
120 void multi_team_send_update();
122 // set all ships in the mission to be marked as the proper team (TEAM_HOSTILE, TEAM_FRIENLY)
123 void multi_team_mark_all_ships();
125 // set the proper team for the passed in ship
126 void multi_team_mark_ship(ship *sp);
128 // host locks all players into their teams
129 void multi_team_host_lock_all();
131 // verify that we have valid team stuff
132 void multi_team_verify();
134 // get the player counts for team 0 and team 1 (NULL values are valid)
135 void multi_team_get_player_counts(int *team0,int *team1);
137 // report on the winner/loser of the game via chat text
138 void multi_team_report();
140 // ------------------------------------------------------------------------------------
141 // MULTIPLAYER TEAMPLAY PACKET HANDLERS
144 // process an incoming team update packet
145 void multi_team_process_packet(unsigned char *data,header *hinfo);