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.
23 #define NETSTAT_MENU 0
24 #define NETSTAT_PLAYING 1
25 #define NETSTAT_BROWSING 2
26 #define NETSTAT_WAITING 3
27 #define NETSTAT_STARTING 4
28 #define NETSTAT_ENDLEVEL 5
30 #define CONNECT_DISCONNECTED 0
31 #define CONNECT_PLAYING 1
32 #define CONNECT_WAITING 2
33 #define CONNECT_DIED_IN_MINE 3
34 #define CONNECT_FOUND_SECRET 4
35 #define CONNECT_ESCAPE_TUNNEL 5
36 #define CONNECT_END_MENU 6
41 // defines and other things for appletalk/ipx games on mac
44 #define APPLETALK_GAME 2
46 extern int Network_game_type;
48 #define Network_game_type IPX_GAME
51 typedef struct sequence_packet {
55 netplayer_info player;
58 #define NET_XDATA_SIZE 454
61 // frame info is aligned -- 01/18/96 -- MWA
62 // if you change this structure -- be sure to keep
64 // bytes on byte boundries
65 // shorts on even byte boundries
66 // ints on even byte boundries
68 typedef struct frame_info {
69 ubyte type; // What type of packet
70 ubyte pad[3]; // Pad out length of frame_info packet
73 vms_matrix obj_orient;
74 vms_vector phys_velocity;
75 vms_vector phys_rotvel;
77 ushort data_size; // Size of data appended to the net packet
79 ubyte obj_render_type;
81 ubyte data[NET_XDATA_SIZE]; // extra data to be tacked on the end
82 } __pack__ frame_info;
84 // short_frame_info is not aligned -- 01/18/96 -- MWA
85 // won't align because of shortpos. Shortpos needs
86 // to stay in current form.
88 typedef struct short_frame_info {
89 ubyte type; // What type of packet
90 ubyte pad[3]; // Pad out length of frame_info packet
93 ushort data_size; // Size of data appended to the net packet
95 ubyte obj_render_type;
97 ubyte data[NET_XDATA_SIZE]; // extra data to be tacked on the end
98 } __pack__ short_frame_info;
100 void network_start_game();
101 void network_join_game();
102 void network_rejoin_game();
103 void network_leave_game();
104 int network_endlevel(int *secret);
105 void network_endlevel_poll2( int nitems, struct newmenu_item * menus, int * key, int citem );
107 int network_level_sync();
108 void network_send_endlevel_packet();
110 int network_delete_extra_objects();
111 int network_find_max_net_players();
112 int network_objnum_is_past(int objnum);
113 char * network_get_player_name( int objnum );
114 void network_send_endlevel_sub(int player_num);
116 void network_disconnect_player(int playernum);
118 extern int NetGameType;
119 extern int Network_send_objects;
120 extern int Network_send_objnum;
121 extern int PacketUrgent;
122 extern int Network_rejoined;
124 extern int Network_new_game;
125 extern int Network_status;
127 extern fix LastPacketTime[MAX_PLAYERS];
129 extern ushort my_segments_checksum;
130 // By putting an up-to-20-char-message into Network_message and
131 // setting Network_message_reciever to the player num you want to
132 // send it to (100 for broadcast) the next frame the player will
135 // Call once at the beginning of a frame
136 void network_do_frame(int force, int listen);
138 // Tacks data of length 'len' onto the end of the next
139 // packet that we're transmitting.
140 void network_send_data( ubyte * ptr, int len, int urgent );
142 void network_send_objects(void);
143 void network_dump_player(ubyte * server, ubyte *node, int why);
144 void network_send_game_info(sequence_packet *their);
146 int GetMyNetRanking();