2 * $Logfile: /Freespace2/code/Network/multi_endgame.h $
8 * Revision 1.1 2002/05/03 03:28:12 root
12 * 3 8/22/99 1:55p Dave
13 * Cleaned up host/team-captain leaving code.
15 * 2 10/07/98 10:53a Dave
18 * 1 10/07/98 10:50a Dave
20 * 8 9/14/98 3:40p Allender
21 * better error checking for invalid number of waves for player wings in a
22 * multiplayer game. Better popup message in FreeSpace side.
24 * 7 9/11/98 4:14p Dave
25 * Fixed file checksumming of < file_size. Put in more verbose kicking and
26 * PXO stats store reporting.
28 * 6 7/24/98 9:27a Dave
29 * Tidied up endgame sequencing by removing several old flags and
30 * standardizing _all_ endgame stuff with a single function call.
32 * 5 7/13/98 5:19p Dave
34 * 4 5/17/98 6:32p Dave
35 * Make sure clients/servers aren't kicked out of the debriefing when team
36 * captains leave a game. Fixed chatbox off-by-one error. Fixed image
37 * xfer/pilot info popup stuff.
39 * 3 5/03/98 7:04p Dave
40 * Make team vs. team work mores smoothly with standalone. Change how host
41 * interacts with standalone for picking missions. Put in a time limit for
42 * ingame join ship select. Fix ingame join ship select screen for Vasudan
45 * 2 4/30/98 5:12p Dave
46 * Fixed game polling code for joining clients. Reworked some file xfer
49 * 1 4/22/98 5:50p Dave
55 #ifndef _MULTI_ENDGAME_HEADER_FILE
56 #define _MULTI_ENDGAME_HEADER_FILE
58 // ----------------------------------------------------------------------------------------------------------
59 // Put all functions/data related to leaving a netgame, handling players leaving, handling the server leaving,
60 // and notifying the user of all of these actions, here.
64 // ----------------------------------------------------------------------------------------------------------
65 // MULTI ENDGAME DEFINES/VARS
68 // defines for calling multi_quit_game(...)
69 #define PROMPT_NONE 0 // don't prompt anyone when quitting (multi_quit_game)
70 #define PROMPT_HOST 1 // prompt the host when quitting (multi_quit_game)
71 #define PROMPT_CLIENT 2 // prompt the client when quitting (multi_quit_game)
72 #define PROMPT_ALL 3 // prompt any players when quitting (multi_quit_game)
74 // notification defines for calling multi_quit_game(...)
75 #define MULTI_END_NOTIFY_NONE (-1) // no notification code
76 #define MULTI_END_NOTIFY_KICKED 1 // player was kicked
77 #define MULTI_END_NOTIFY_SERVER_LEFT 2 // server has left the game
78 #define MULTI_END_NOTIFY_FILE_REJECTED 3 // mission file was rejected by the server
79 #define MULTI_END_NOTIFY_EARLY_END 4 // game ended while the ingame joiner was joining
80 #define MULTI_END_NOTIFY_INGAME_TIMEOUT 5 // waited too long in the ship select screen
81 #define MULTI_END_NOTIFY_KICKED_BAD_XFER 6 // kicked because file xfer failed
82 #define MULTI_END_NOTIFY_KICKED_CANT_XFER 7 // kicked because can't xfer a builtin mission
83 #define MULTI_END_NOTIFY_KICKED_INGAME_ENDED 8 // kicked because was ingame joining in an ending game
85 // error defines for calling multi_quit_game(...)
86 #define MULTI_END_ERROR_NONE (-1) // no error code
87 #define MULTI_END_ERROR_CONTACT_LOST 1 // contact with the server has been lost
88 #define MULTI_END_ERROR_CONNECT_FAIL 2 // failed to connect to the server
89 #define MULTI_END_ERROR_LOAD_FAIL 3 // failed to load the mission properly
90 #define MULTI_END_ERROR_INGAME_SHIP 4 // unable to create ingame join player ship
91 #define MULTI_END_ERROR_INGAME_BOGUS 5 // received bogus data on ingame join
92 #define MULTI_END_ERROR_STRANS_FAIL 6 // server transfer failed (obsolete)
93 #define MULTI_END_ERROR_SHIP_ASSIGN 7 // server had problems assigning players to ships
94 #define MULTI_END_ERROR_HOST_LEFT 8 // host has left a standalone game
95 #define MULTI_END_ERROR_XFER_FAIL 9 // mission file xfer failed on the client
96 #define MULTI_END_ERROR_WAVE_COUNT 10 // illegal data found in mission when parsing
97 #define MULTI_END_ERROR_TEAM0_EMPTY 11 // all of team 0 has left
98 #define MULTI_END_ERROR_TEAM1_EMPTY 12 // all of team 1 has left
99 #define MULTI_END_ERROR_CAPTAIN_LEFT 13 // captain of a team has left while not ingame
101 // ----------------------------------------------------------------------------------------------------------
102 // MULTI ENDGAME FUNCTIONS
105 // initialize the endgame processor (call when joining/starting a new netgame)
106 void multi_endgame_init();
108 // process all endgame related events
109 void multi_endgame_process();
111 // if the game has been flagged as ended (ie, its going to be reset)
112 int multi_endgame_ending();
114 // general quit function, with optional notification, error, and winsock error codes
115 // return 0 if the act was cancelled, 1 if it was accepted
116 int multi_quit_game(int prompt,int notify_code = MULTI_END_NOTIFY_NONE,int err_code = MULTI_END_ERROR_NONE,int wsa_error = -1);