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/MultiTeamSelect.h $
15 * Multiplayer Team Selection Code header
18 * Revision 1.3 2002/06/09 04:41:14 relnev
19 * added copyright header
21 * Revision 1.2 2002/05/26 20:49:54 theoddone33
24 * Revision 1.1.1.1 2002/05/03 03:28:12 root
28 * 3 11/05/98 5:55p Dave
29 * Big pass at reducing #includes
31 * 2 10/07/98 10:53a Dave
34 * 1 10/07/98 10:50a Dave
36 * 22 5/19/98 8:35p Dave
37 * Revamp PXO channel listing system. Send campaign goals/events to
38 * clients for evaluation. Made lock button pressable on all screens.
40 * 21 5/18/98 12:41a Allender
41 * fixed subsystem problems on clients (i.e. not reporting properly on
42 * damage indicator). Fixed ingame join problem with respawns. minor
45 * 20 5/10/98 7:06p Dave
46 * Fix endgame sequencing ESC key. Changed how host options warning popups
47 * are done. Fixed pause/message scrollback/options screen problems in mp.
48 * Make sure observer HUD doesn't try to lock weapons.
50 * 19 5/06/98 8:06p Dave
51 * Made standalone reset properly under weird conditions. Tweak
52 * optionsmulti screen. Upped MAX_WEAPONS to 350. Put in new launch
53 * countdown anim. Minro ui fixes/tweaks.
55 * 18 4/22/98 7:24p Dave
56 * Made sure the "player/ships" locked button for multiplayer appears on
57 * all briefing screens.
59 * 17 4/20/98 4:56p Allender
60 * allow AI ships to respawn as many times as there are respawns in the
63 * 16 4/01/98 11:19p Dave
64 * Put in auto-loading of xferred pilot pic files. Grey out background
65 * behind pinfo popup. Put a chatbox message in when players are kicked.
66 * Moved mission title down in briefing. Other ui fixes.
68 * 15 3/26/98 6:01p Dave
69 * Put in file checksumming routine in cfile. Made pilot pic xferring more
70 * robust. Cut header size of voice data packets in half. Put in
71 * restricted game host query system.
73 * 14 3/10/98 10:56a Dave
74 * Put support for deleting ships from starting wings back in.
76 * 13 3/09/98 5:55p Dave
77 * Fixed stats to take asteroid hits into account. Polished up UI stuff in
78 * team select. Finished up pilot info popup. Tracked down and fixed
81 * 12 3/05/98 5:03p Dave
82 * More work on team vs. team support for multiplayer. Need to fix bugs in
85 * 11 3/01/98 3:26p Dave
86 * Fixed a few team select bugs. Put in multiplayer intertface sounds.
87 * Corrected how ships are disabled/enabled in team select/weapon select
90 * 10 2/23/98 11:09p Dave
91 * Finished up multiplayer campaign support. Seems bug-free.
93 * 9 2/19/98 6:26p Dave
94 * Fixed a few file xfer bugs. Tweaked mp team select screen. Put in
95 * initial support for player data uploading.
97 * 8 2/18/98 3:56p Dave
98 * Several bugs fixed for mp team select screen. Put in standalone packet
99 * routing for team select.
101 * 7 2/17/98 6:08p Dave
102 * Tore out old multiplayer team select screen, installed new one.
104 * 6 10/16/97 4:58p Dave
105 * Finsihed up server side respawning issues. Knocked off a bunch of
108 * 5 10/10/97 4:42p Dave
109 * Fixed up server transfer bugs.
111 * 4 10/09/97 4:58p Lawrance
112 * get short_callsign from player struct
114 * 3 10/03/97 4:58p Dave
115 * Put in client-side mimicing of host team selection changes. Some more
118 * 2 9/19/97 4:24p Allender
119 * start of team selection screen.
121 * 1 9/18/97 11:45a Allender
125 #ifndef _MULTITEAMSELECT_H
126 #define _MULTITEAMSELECT_H
130 // ------------------------------------------------------------------------------------------------------
131 // TEAM SELECT DEFINES/VARS
136 // should be initialize to 0 inside of multi_vars_init
137 extern int Multi_ts_inited;
139 #define MULTI_TS_MAX_TEAMS 2 // 2 teams max for now
140 #define MULTI_TS_NUM_SHIP_SLOTS 12 // # of ship slots in non team vs. team mode
142 // deleted ship objnums
143 extern int Multi_ts_deleted_objnums[MULTI_TS_MAX_TEAMS * MULTI_TS_NUM_SHIP_SLOTS];
144 extern int Multi_ts_num_deleted;
146 // ------------------------------------------------------------------------------------------------------
147 // TEAM SELECT FUNCTIONS
150 // initialize the team select screen (always call, even when switching between weapon select, etc)
151 void multi_ts_init();
153 // initialize all critical internal data structures
154 void multi_ts_common_init();
156 // do frame for team select
159 // close the team select screen (always call, even when switching between weapon select, etc)
160 void multi_ts_close();
162 // drop a carried icon
163 void multi_ts_drop(int from_type,int from_index,int to_type,int to_index,int ship_class,int player_index = -1);
165 // assign all players to appropriate default wings/slots
166 void multi_ts_assign_players_all();
168 // is the given slot disabled for the specified player
169 int multi_ts_disabled_slot(int slot_index,int player_index = -1);
171 // is the given slot disabled for the specified player, _and_ it is his ship as well
172 int multi_ts_disabled_high_slot(int slot_index,int player_index = -1);
174 // delete ships which have been removed from the game, tidy things
175 void multi_ts_create_wings();
177 // resynch all display/interface elements based upon all the ship/weapon pool values
178 void multi_ts_sync_interface();
180 // do any necessary processing for players who have left the game
181 void multi_ts_handle_player_drop();
183 // handle all details when the commit button is pressed (including possibly reporting errors/popups)
184 void multi_ts_commit_pressed();
186 // get the team # of the given ship
187 int multi_ts_get_team(char *ship_name);
189 // function to get the team and slot of a particular ship
190 void multi_ts_get_team_and_slot(char *ship_name,int *team_index,int *slot_index);
192 // function to return the shipname of the ship belonging in slot N
193 const char *multi_ts_get_shipname( int team, int slot_index );
195 // blit the proper "locked" button - used for weapon select and briefing screens
196 void multi_ts_blit_locked_button();
198 // the "lock" button has been pressed
199 void multi_ts_lock_pressed();
202 int multi_ts_is_locked();
204 // show a popup saying "only host and team captains can modify, etc, etc"
205 void multi_ts_maybe_host_only_popup();
207 // ------------------------------------------------------------------------------------------------------
208 // TEAM SELECT PACKET HANDLERS
211 // send a player slot position update
212 void send_pslot_update_packet(int team,int code,int sound = -1);
214 // process a player slot position update
215 void process_pslot_update_packet(ubyte *data, header *hinfo);
219 // ------------------------------------------------------------------------------------------------------
220 // TEAM SELECT STUBBED FUNCTIONS