2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
15 * $Source: /cvs/cvsroot/d2x/main/network.h,v $
18 * $Date: 2002-02-14 09:24:19 $
20 * FIXME: put description here
22 * $Log: not supported by cvs2svn $
23 * Revision 1.5 2002/02/13 10:39:22 bradleyb
24 * Lotsa networking stuff from d1x
26 * Revision 1.4 2001/10/25 02:15:57 bradleyb
27 * conditionalize including multi.h and network.h, fix backslashes
39 #define NETSTAT_MENU 0
40 #define NETSTAT_PLAYING 1
41 #define NETSTAT_BROWSING 2
42 #define NETSTAT_WAITING 3
43 #define NETSTAT_STARTING 4
44 #define NETSTAT_ENDLEVEL 5
46 #define CONNECT_DISCONNECTED 0
47 #define CONNECT_PLAYING 1
48 #define CONNECT_WAITING 2
49 #define CONNECT_DIED_IN_MINE 3
50 #define CONNECT_FOUND_SECRET 4
51 #define CONNECT_ESCAPE_TUNNEL 5
52 #define CONNECT_END_MENU 6
54 #define MAX_ACTIVE_NETGAMES 12
59 // defines and other things for appletalk/ipx games on mac
62 #define APPLETALK_GAME 2
64 extern int Network_game_type;
66 #define Network_game_type IPX_GAME
69 typedef struct sequence_packet {
73 netplayer_info player;
74 } __pack__ sequence_packet;
76 #define NET_XDATA_SIZE 454
79 // frame info is aligned -- 01/18/96 -- MWA
80 // if you change this structure -- be sure to keep
82 // bytes on byte boundries
83 // shorts on even byte boundries
84 // ints on even byte boundries
86 typedef struct frame_info {
87 ubyte type; // What type of packet
88 ubyte pad[3]; // Pad out length of frame_info packet
91 vms_matrix obj_orient;
92 vms_vector phys_velocity;
93 vms_vector phys_rotvel;
95 ushort data_size; // Size of data appended to the net packet
97 ubyte obj_render_type;
99 ubyte data[NET_XDATA_SIZE]; // extra data to be tacked on the end
100 } __pack__ frame_info;
102 // short_frame_info is not aligned -- 01/18/96 -- MWA
103 // won't align because of shortpos. Shortpos needs
104 // to stay in current form.
106 typedef struct short_frame_info {
107 ubyte type; // What type of packet
108 ubyte pad[3]; // Pad out length of frame_info packet
111 ushort data_size; // Size of data appended to the net packet
113 ubyte obj_render_type;
115 ubyte data[NET_XDATA_SIZE]; // extra data to be tacked on the end
116 } __pack__ short_frame_info;
118 void network_start_game();
119 void network_join_game();
120 void network_rejoin_game();
121 void network_leave_game();
122 int network_endlevel(int *secret);
123 void network_endlevel_poll2( int nitems, struct newmenu_item * menus, int * key, int citem );
125 int network_level_sync();
126 void network_send_endlevel_packet();
128 int network_delete_extra_objects();
129 int network_find_max_net_players();
130 int network_objnum_is_past(int objnum);
131 char * network_get_player_name( int objnum );
132 void network_send_endlevel_sub(int player_num);
134 void network_disconnect_player(int playernum);
136 extern int NetGameType;
137 extern int Network_send_objects;
138 extern int Network_send_objnum;
139 extern int PacketUrgent;
140 extern int Network_rejoined;
142 extern int Network_new_game;
143 extern int Network_status;
145 extern fix LastPacketTime[MAX_PLAYERS];
147 extern ushort my_segments_checksum;
149 extern int Network_initial_pps;
150 extern int Network_initial_shortpackets;
152 // By putting an up-to-20-char-message into Network_message and
153 // setting Network_message_reciever to the player num you want to
154 // send it to (100 for broadcast) the next frame the player will
157 // Call once at the beginning of a frame
158 void network_do_frame(int force, int listen);
160 // Tacks data of length 'len' onto the end of the next
161 // packet that we're transmitting.
162 void network_send_data( ubyte * ptr, int len, int urgent );
164 void network_send_objects(void);
165 void network_dump_player(ubyte * server, ubyte *node, int why);
166 void network_send_game_info(sequence_packet *their);
168 int GetMyNetRanking();
171 #define PID_LITE_INFO 43
172 #define PID_SEND_ALL_GAMEINFO 44
173 #define PID_PLAYERSINFO 45
174 #define PID_REQUEST 46
177 #define PID_ADDPLAYER 49
179 #define PID_ENDLEVEL 52
180 #define PID_QUIT_JOINING 54
181 #define PID_OBJECT_DATA 55
182 #define PID_GAME_LIST 56
183 #define PID_GAME_INFO 57
184 #define PID_PING_SEND 58
185 #define PID_PING_RETURN 59
186 #define PID_GAME_UPDATE 60
187 #define PID_ENDLEVEL_SHORT 61
188 #define PID_NAKED_PDATA 62
189 #define PID_GAME_PLAYERS 63
190 #define PID_NAMES_RETURN 64
192 #define PID_SHORTPDATA 42
193 #define PID_D2X_GAME_INFO_REQ 65
194 #define PID_D2X_GAME_LITE 68
195 #define PID_PDATA_SHORT2 70
197 #define NETGAME_ANARCHY 0
198 #define NETGAME_TEAM_ANARCHY 1
199 #define NETGAME_ROBOT_ANARCHY 2
200 #define NETGAME_COOPERATIVE 3
201 #define NETGAME_CAPTURE_FLAG 4
202 #define NETGAME_HOARD 5
203 #define NETGAME_TEAM_HOARD 6
205 typedef struct endlevel_info {
210 short kill_matrix[MAX_PLAYERS][MAX_PLAYERS];
213 } __pack__ endlevel_info;