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