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/stand_gui.h $
16 * Revision 1.2 2002/06/09 04:41:15 relnev
17 * added copyright header
19 * Revision 1.1.1.1 2002/05/03 03:28:12 root
23 * 4 11/19/98 4:19p Dave
24 * Put IPX sockets back in psnet. Consolidated all multiplayer config
27 * 3 11/05/98 5:55p Dave
28 * Big pass at reducing #includes
30 * 2 10/07/98 10:53a Dave
33 * 1 10/07/98 10:50a Dave
35 * 24 9/04/98 3:52p Dave
36 * Put in validated mission updating and application during stats
39 * 23 6/10/98 2:56p Dave
40 * Substantial changes to reduce bandwidth and latency problems.
42 * 22 5/24/98 3:45a Dave
43 * Minor object update fixes. Justify channel information on PXO. Add a
44 * bunch of configuration stuff for the standalone.
46 * 21 5/22/98 9:35p Dave
47 * Put in channel based support for PXO. Put in "shutdown" button for
48 * standalone. UI tweaks for TvT
50 * 20 5/18/98 9:15p Dave
51 * Put in network config file support.
53 * 19 5/15/98 5:16p Dave
54 * Fix a standalone resetting bug.Tweaked PXO interface. Display captaincy
55 * status for team vs. team. Put in asserts to check for invalid team vs.
58 * 18 5/09/98 7:16p Dave
59 * Put in CD checking. Put in standalone host password. Made pilot into
62 * 17 5/08/98 5:05p Dave
63 * Go to the join game screen when quitting multiplayer. Fixed mission
64 * text chat bugs. Put mission type symbols on the create game list.
65 * Started updating standalone gui controls.
67 * 16 3/24/98 5:00p Dave
68 * Fixed several ui bugs. Put in pre and post voice stream playback sound
69 * fx. Put in error specific popups for clients getting dropped from games
70 * through actions other than their own.
72 * 15 1/31/98 4:32p Dave
73 * Put in new support for VMT player validation, game logging in, and game
74 * logging out. Need to finish stats transfer.
76 * 14 1/24/98 3:39p Dave
77 * Fixed numerous multiplayer bugs (last frame quit problem, weapon bank
78 * changing, deny packets). Add several controls to standalone server.
80 * 13 1/17/98 5:51p Dave
81 * Bug fixes for bugs generated by multiplayer testing.
83 * 12 1/13/98 5:37p Dave
84 * Reworked a lot of standalone interface code. Put in single and
85 * multiplayer popups for death sequence. Solidified multiplayer kick
88 * 11 1/11/98 10:03p Allender
89 * removed <winsock.h> from headers which included it. Made psnet_socket
90 * type which is defined just as SOCKET type is.
92 * 10 12/10/97 4:46p Dave
93 * Added in more detailed support for multiplayer packet lag/loss. Fixed
94 * some multiplayer stuff. Added some controls to the standalone.
96 * 9 12/03/97 11:59a Dave
97 * Dependant merge checkin
99 * 8 10/03/97 4:57p Dave
100 * Added functions for new text controls. Added some more reset controls.
101 * Put in checks for all-players-gone.
103 * 7 9/24/97 5:04p Dave
104 * Removed an unnecessary function prototype.
106 * 6 8/29/97 5:03p Dave
107 * Added a ton of new gui controls/features.
109 * 5 8/26/97 5:03p Dave
110 * Added bunch of informational controls. Standardized some functions for
111 * external use. Put in godview mode (conditionaled out though).
113 * 4 8/23/97 11:31a Dave
114 * Put in new gui calls. Added a bunch of display controls.
116 * 3 8/20/97 4:20p Dave
117 * Added standalone state text box.
119 * 2 8/11/97 4:52p Dave
120 * Spliced out standalone GUI stuff from OsApi and WinMain.cpp to its own
123 * 1 8/11/97 4:21p Dave
128 #ifndef _FREESPACE_STANDALONE_GUI_HEADER_FILE
129 #define _FREESPACE_STANDALONE_GUI_HEADER_FILE
131 // ----------------------------------------------------------------------------------------
132 // external variables
137 // ----------------------------------------------------------------------------------------
138 // generic dialog functions
141 // create the validate dialog
142 void std_create_gen_dialog(const char *title);
144 // kill the validate dialog();
145 void std_destroy_gen_dialog();
147 // set the text in the filename of the validate dialog
148 // valid values for field_num == 0 .. 2
149 void std_gen_set_text(const char *str, int field_num);
151 // is the validate dialog active
152 int std_gen_is_active();
155 // ----------------------------------------------------------------------------------------
156 // connection page/tab functions
159 // set the text box indicating how many players are connected, returning the determined count
160 int std_connect_set_connect_count();
162 // set the connect status (connected or not) of the game host
163 void std_connect_set_host_connect_status();
165 // add an ip string to the connect page listbox
166 void std_connect_add_ip_string(const char *string);
168 // remove an ip string from the connect page listbox
169 void std_connect_remove_ip_string(const char *string);
171 // set an ip string on the connect page listbox
172 void std_connect_set_ip_string(const char *lookup, const char *string);
174 // kick a player (the one currently selected in the listbox)
175 void std_connect_kick_player();
177 // update the ping for this particular player
178 void std_connect_update_ping(net_player *p);
180 // clear all the controls for this page
181 void std_connect_clear_controls();
183 // set the game name for the standalone. passing NULL uses the default
184 void std_connect_set_gamename(const char *name);
186 // the user has changed the text in the server name text box. handle this
187 void std_connect_handle_name_change();
189 // the user has changed the text in the host password text box
190 void std_connect_handle_passwd_change();
193 // ----------------------------------------------------------------------------------------
194 // multiplayer page/tab functions
197 // set the mission time in seconds
198 void std_multi_set_standalone_missiontime(float mission_time);
200 // set the mission name
201 void std_multi_set_standalone_mission_name(const char *mission_name);
203 // initialize the goal tree for this mission
204 void std_multi_setup_goal_tree();
206 // add all the goals from the current mission to the tree control
207 void std_multi_add_goals();
209 // update all the goals in the goal tree based upon the mission status
210 void std_multi_update_goals();
212 // set the framerate text box for this tab
213 void std_multi_set_framerate(float f);
215 // clear all the controls for this page
216 void std_multi_clear_controls();
218 // update the netgame information area controls with the current Netgame settings
219 void std_multi_update_netgame_info_controls();
222 // ---------------------------------------------------------------------------------------
223 // player info page/tab functions
226 // start displaying info for the passed player on this page
227 void std_pinfo_display_player_info(net_player *p);
229 // check to see if this player is the one being displayed, and if so, then update the display info
230 // return 1 if the player was updated
231 int std_pinfo_maybe_update_player_info(net_player *p);
233 // add a player to the list on the player info page
234 void std_pinfo_add_player_list_item(net_player *p);
236 // remove a player from the list on the player info page
237 void std_pinfo_remove_player_list_item(net_player *p);
239 // update the ping display for this player
240 void std_pinfo_update_ping(net_player *p);
242 // clear all the controls for this page
243 void std_pinfo_clear_controls();
246 // ---------------------------------------------------------------------------------------
247 // player god stuff page/tab functions
250 // add a player to the listbox on the godstuff page
251 void std_gs_add_player(net_player *p);
253 // remove a player from the listbox on the godstuff page
254 void std_gs_remove_player(net_player *p);
256 // send a message as if the standalone were a player
257 void std_gs_send_godstuff_message();
259 // set the framerate text box for this page
260 void std_gs_set_framerate(float f);
262 // clear all the controls for this page
263 void std_gs_clear_controls();
266 // ---------------------------------------------------------------------------------------
267 // debug page/tab functions
270 // set the text on the standalones state indicator box
271 void std_debug_set_standalone_state_string(const char *str);
273 // clear all the controls for this page
274 void std_debug_clear_controls();
277 // ---------------------------------------------------------------------------------------
281 // add a player and take care of updating all gui/data details
282 void std_add_player(net_player *p);
284 // remove a player and take care of updateing all gui/data details
285 int std_remove_player(net_player *p);
287 // set any relevant controls which display the framerate of the standalone
288 void std_set_standalone_fps(float fps);
290 // update any relveant controls which display the ping for the given player
291 void std_update_player_ping(net_player *p);
293 // reset all gui stuff for the standalone
294 void std_reset_standalone_gui();
296 // reset all networking/gui stuff (calls reset_standalone_gui) for the standalone
297 void std_multi_standalone_reset_all();
299 // close down the standalone
300 void std_deinit_standalone();
302 // initialize the standalone
303 void std_init_standalone();
305 // do any gui related issues on the standalone (like periodically updating player stats, etc...)
306 void std_do_gui_frame();
308 // notify the user that the standalone has failed to login to the tracker on startup
309 void std_tracker_notify_login_fail();
311 // attempt to log the standalone into the tracker
312 void std_tracker_login();
314 // reset all stand gui timestamps
315 void std_reset_timestamps();
317 // add a line of text chat to the standalone
318 void std_add_chat_text(const char *text, int player_index, int add_id);
320 // if the standalone is host password protected
321 int std_is_host_passwd();
323 // change the default property sheet interface into something more useful
324 void std_mutate_sheet();
326 // if the given callsign is banned from the server
327 int std_player_is_banned(const char *name);
329 // add a callsign to the ban list
330 void std_add_ban(const char *name);