FS2_Open
Open source remastering of the Freespace 2 engine
multi_ingame.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
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 the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef _MULTI_INGAME_JOIN_HEADER_FILE
13 #define _MULTI_INGAME_JOIN_HEADER_FILE
14 
15 #include "globalincs/pstypes.h"
16 
17 class ship;
18 struct wing;
19 struct net_player;
20 struct header;
21 
22 // --------------------------------------------------------------------------------------------------
23 // DAVE's BIGASS INGAME JOIN WARNING/DISCLAIMER
24 //
25 // Ingame joining is another delicate system. Although not as delicate as server transfer, it will
26 // help to take as many precautions as possible when handling ingame joins. Please be sure to follow
27 // all the same rules as explained in multi_strans.h
28 //
29 // --------------------------------------------------------------------------------------------------
30 
31 // --------------------------------------------------------------------------------------------------
32 // INGAME JOIN DESCRIPTION
33 //
34 // 1.) Joiner sends a JOIN packet to the server
35 // 2.) If the server accepts him, he receives an ACCEPT packet in return
36 // 3.) The client then moves into the INGAME_SYNC state to begin receiving data from the server
37 // 4.) The first thing he does on this screen is send his filesig packet to the server. At which
38 // point the server will either let him in or deny him. There are no file transfers ingame.
39 // 5.) The server calls multi_handle_ingame_joiners() once per frame, through multi_do_frame()
40 // 6.) After verifiying or kicking the player because of his file signature, the server tells the
41 // player to load the mission
42 // 7.) When the mission is loaded, the server, sends a netgame update to the client
43 // 8.) Without waiting, the server then begins sending data ship packets to the player
44 // 9.) Upon confirmation of receiving these packets, the server sends wing data packets
45 // 10.) Upon completion of this, the server sends respawn point packets
46 // 11.) Upon completion of this, the server sends a post briefing data block packet containing ship class and
47 // weapon information
48 // 12.) After this, the server sends a player settings packet (to all players for good measure)
49 // 13.) At this point, the server sends a jump into mission packet
50 // 14.) Upon receipt of this packet, the client moves into the ingame ship select state
51 // 15.) The first thing the client does in this state is load the mission data (textures, etc)
52 // 16.) The player is presented with a list of ships he can choose from. He selects one and sends
53 // an INGAME_SHIP_REQUEST to the server.
54 // 17.) The server checks to see if this request is acceptable and sends an INGAME_SHIP_REQUEST back
55 // with the appropriate data.
56 // 18.) If the client received an affirmative, he selects the ship and jumps into the mission, otherwise
57 // he removes it from the list and tries for another ship
58 // --------------------------------------------------------------------------------------------------
59 
60 // --------------------------------------------------------------------------------------------------
61 // INGAME JOIN DEFINES
62 //
63 
64 // ingame join defines - NOTE : it is important to keep these flags so that they appear
65 // numerically in the order in which the events they represent are done
66 #define INGAME_JOIN_FLAG_SENDING_SETS (1<<0) // sending player settings to him - it is important that this is done _first_
67 #define INGAME_JOIN_FLAG_CAMPAIGN_INFO (1<<1) // sending player settings to him - it is important that this is done _first_
68 #define INGAME_JOIN_FLAG_LOADING_MISSION (1<<2) // player has finished loading the mission
69 #define INGAME_JOIN_FLAG_SENDING_SHIPS (1<<3) // sending ships to an ingame joiner
70 #define INGAME_JOIN_FLAG_SENDING_WINGS (1<<4) // sending wings to an ingame joiner
71 #define INGAME_JOIN_FLAG_SENDING_RPTS (1<<5) // sending respawn points to a player
72 #define INGAME_JOIN_FLAG_SENDING_POST (1<<6) // sending standard post briefing data block
73 #define INGAME_JOIN_FLAG_SENDING_WSS (1<<7) // sending wss slots info
74 #define INGAME_JOIN_FLAG_PICK_SHIP (1<<8) // player is in the "pick" ship screen
75 #define INGAME_JOIN_FLAG_FILE_XFER (1<<9) // player is in the process of downloading the mission file
76 
77 #define INGAME_SHIP_UPDATE_TIME 1500 // update time information for all ships the ingame joiner can see
78 
79 #define INGAME_SHIP_NEXT 0 // another ship to follow
80 #define INGAME_SHIP_WARP_SUPPORT 1 // support ship warping in
81 #define INGAME_SHIP_LIST_EOP 2 // end of packet
82 #define INGAME_SHIP_LIST_EOL 3 // end of list
83 
84 #define INGAME_WING_NEXT 0 // another wing to follow
85 #define INGAME_WING_LIST_EOP 1 // end of packet
86 #define INGAME_WING_LIST_EOL 2 // end of list
87 
88 // defines used for the ingame wings packet
89 #define INGAME_WING_NOT_ARRIVED 1 // wing not yet present
90 #define INGAME_WING_DEPARTED 2 // wing is gone -- never to be seen again
91 #define INGAME_WING_PRESENT 3 // wing is in mission
92 
93 
94 // --------------------------------------------------------------------------------------------------
95 // INGAME JOIN SERVER FUNCTIONS
96 //
97 
98 // called on the server to process ingame joiners and move them through the motions of ingame joining
100 
101 // pack the ship into the data string and return bytes processed
103 
104 // pack the wing into the data string and return bytes processed
106 
107 // --------------------------------------------------------------------------------------------------
108 // INGAME JOIN CLIENT FUNCTIONS
109 //
110 
111 // unpack a ship from the data string and return bytes processed
113 
114 // unpack a wing from the data string and return bytes processed
116 
117 // the final step for an ingame joining observer - create my observer object, unflag myself as joining and jump into mission
119 
120 
121 // --------------------------------------------------------------------------------------------------
122 // INGAME DATA SYNC SCREEN
123 //
124 
125 // mission sync screen init function for ingame joining
127 
128 // mission sync screen do function for ingame joining
129 void multi_ingame_sync_do();
130 
131 // mission sync screen do function for ingame joining
133 
134 
135 // --------------------------------------------------------------------------------------------------
136 // INGAME SHIP SELECT SCREEN
137 //
138 
139 // ingame join ship selection screen init
141 
142 // ingame join ship selection screen do
144 
145 // ingame join ship selection screen close
147 
148 
149 // --------------------------------------------------------------------------------------------------
150 // PACKET HANDLER functions
151 // these are also defined in multimsgs.h, but the implementations are in the module for the sake of convenience
152 //
153 
154 // send ship information for the mission to the ingame joiner
156 
157 // process ship information for the mission
159 
160 // send wing information for the mission to the ingame joiner
162 
163 // process wing information for the mission
165 
166 // send respawn points information to the ingame joiner
167 void send_ingame_respawn_points_packet(net_player *pl = /*NULL*/ 0);
168 
169 // process respawn points information for the mission
171 
172 // send Wss_slots data to an ingame joiner
174 
175 // process Wss_slots data for the mission
177 
178 // send a request or a reply regarding ingame join ship choice
179 void send_ingame_ship_request_packet(int code,int rdata,net_player *pl = NULL);
180 
181 // process an ingame ship request packet
183 
184 // for extra mission information
186 
187 #endif
void process_ingame_wings_packet(ubyte *data, header *hinfo)
void multi_ingame_sync_init()
int multi_reconstruct_wing(ubyte *data)
void send_ingame_ships_packet(net_player *pl)
Definition: ship.h:1516
void send_ingame_ship_request_packet(int code, int rdata, net_player *pl=NULL)
HWND DWORD code
Definition: vddraw.h:425
void process_ingame_ship_request_packet(ubyte *data, header *hinfo)
void multi_ingame_sync_close()
void send_ingame_respawn_points_packet(net_player *pl=0)
void multi_ingame_sync_do()
void send_ingame_slots_packet(net_player *p)
int multi_deconstruct_wing(ubyte *data, wing *w)
GLdouble s
Definition: Glext.h:5321
int multi_deconstruct_ship(ubyte *data, ship *s)
Definition: ship.h:534
void multi_ingame_select_init()
unsigned char ubyte
Definition: pstypes.h:62
void multi_handle_ingame_joiners()
void process_ingame_ships_packet(ubyte *data, header *hinfo)
void send_ingame_wings_packet(net_player *pl)
GLubyte GLubyte GLubyte GLubyte w
Definition: Glext.h:5679
void multi_ingame_observer_finish()
Definition: multi.h:385
GLfloat GLfloat p
Definition: Glext.h:8373
GLenum GLsizei GLenum GLenum const GLvoid * data
Definition: Gl.h:1509
int multi_reconstruct_ship(ubyte *data)
void process_ingame_respawn_points_packet(ubyte *data, header *hinfo)
void process_ingame_slots_packet(ubyte *data, header *hinfo)
void multi_ingame_select_do()
void multi_ingame_select_close()
void multi_ingame_process_mission_stuff(ubyte *data, header *hinfo)