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