File: multi_endgame.h

package info (click to toggle)
freespace2 24.2.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 43,716 kB
  • sloc: cpp: 595,001; ansic: 21,741; python: 1,174; sh: 457; makefile: 248; xml: 181
file content (76 lines) | stat: -rw-r--r-- 3,829 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
 * Copyright (C) Volition, Inc. 1999.  All rights reserved.
 *
 * All source code herein is the property of Volition, Inc. You may not sell 
 * or otherwise commercially exploit the source or things you created based on the 
 * source.
 *
*/



#ifndef _MULTI_ENDGAME_HEADER_FILE
#define _MULTI_ENDGAME_HEADER_FILE

// ----------------------------------------------------------------------------------------------------------
// Put all functions/data related to leaving a netgame, handling players leaving, handling the server leaving,
// and notifying the user of all of these actions, here.
//


// ----------------------------------------------------------------------------------------------------------
// MULTI ENDGAME DEFINES/VARS
//

// defines for calling multi_quit_game(...)
#define PROMPT_NONE									0				// don't prompt anyone when quitting (multi_quit_game)
#define PROMPT_HOST									1				// prompt the host when quitting (multi_quit_game)
#define PROMPT_CLIENT								2				// prompt the client when quitting (multi_quit_game)
#define PROMPT_ALL									3				// prompt any players when quitting (multi_quit_game)

// notification defines for calling multi_quit_game(...)
#define MULTI_END_NOTIFY_NONE						(-1)			// no notification code
#define MULTI_END_NOTIFY_KICKED					1				// player was kicked
#define MULTI_END_NOTIFY_SERVER_LEFT			2				// server has left the game
#define MULTI_END_NOTIFY_FILE_REJECTED			3				// mission file was rejected by the server
#define MULTI_END_NOTIFY_EARLY_END				4				// game ended while the ingame joiner was joining
#define MULTI_END_NOTIFY_INGAME_TIMEOUT		5				// waited too long in the ship select screen
#define MULTI_END_NOTIFY_KICKED_BAD_XFER		6				// kicked because file xfer failed
#define MULTI_END_NOTIFY_KICKED_CANT_XFER		7				// kicked because can't xfer a builtin mission
#define MULTI_END_NOTIFY_KICKED_INGAME_ENDED	8				// kicked because was ingame joining in an ending game

// error defines for calling multi_quit_game(...)
#define MULTI_END_ERROR_NONE						(-1)			// no error code
#define MULTI_END_ERROR_CONTACT_LOST			1				// contact with the server has been lost
#define MULTI_END_ERROR_CONNECT_FAIL			2				// failed to connect to the server
#define MULTI_END_ERROR_LOAD_FAIL				3				// failed to load the mission properly
#define MULTI_END_ERROR_INGAME_SHIP				4				// unable to create ingame join player ship
#define MULTI_END_ERROR_INGAME_BOGUS			5				// received bogus data on ingame join
#define MULTI_END_ERROR_STRANS_FAIL				6				// server transfer failed (obsolete)
#define MULTI_END_ERROR_SHIP_ASSIGN				7				// server had problems assigning players to ships
#define MULTI_END_ERROR_HOST_LEFT				8				// host has left a standalone game
#define MULTI_END_ERROR_XFER_FAIL				9				// mission file xfer failed on the client
#define MULTI_END_ERROR_WAVE_COUNT				10				// illegal data found in mission when parsing
#define MULTI_END_ERROR_TEAM0_EMPTY				11				// all of team 0 has left
#define MULTI_END_ERROR_TEAM1_EMPTY				12				// all of team 1 has left
#define MULTI_END_ERROR_CAPTAIN_LEFT			13				// captain of a team has left while not ingame

// ----------------------------------------------------------------------------------------------------------
// MULTI ENDGAME FUNCTIONS
//

// initialize the endgame processor (call when joining/starting a new netgame)
void multi_endgame_init();

// process all endgame related events
void multi_endgame_process();

// if the game has been flagged as ended (ie, its going to be reset)
int multi_endgame_ending();

// general quit function, with optional notification, error, and winsock error codes
// return 0 if the act was cancelled, 1 if it was accepted
int multi_quit_game(int prompt,int notify_code = MULTI_END_NOTIFY_NONE,int err_code = MULTI_END_ERROR_NONE,int wsa_error = -1);


#endif