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.
16 * Prototypes for network management functions.
28 #define NETSTAT_MENU 0
29 #define NETSTAT_PLAYING 1
30 #define NETSTAT_BROWSING 2
31 #define NETSTAT_WAITING 3
32 #define NETSTAT_STARTING 4
33 #define NETSTAT_ENDLEVEL 5
35 #define CONNECT_DISCONNECTED 0
36 #define CONNECT_PLAYING 1
37 #define CONNECT_WAITING 2
38 #define CONNECT_DIED_IN_MINE 3
39 #define CONNECT_FOUND_SECRET 4
40 #define CONNECT_ESCAPE_TUNNEL 5
41 #define CONNECT_END_MENU 6
46 // defines and other things for appletalk/ipx games on mac
49 #define APPLETALK_GAME 2
51 extern int Network_game_type;
53 #define Network_game_type IPX_GAME
56 typedef struct sequence_packet {
60 netplayer_info player;
61 } __pack__ sequence_packet;
63 #define NET_XDATA_SIZE 454
66 // frame info is aligned -- 01/18/96 -- MWA
67 // if you change this structure -- be sure to keep
69 // bytes on byte boundries
70 // shorts on even byte boundries
71 // ints on even byte boundries
73 typedef struct frame_info {
74 ubyte type; // What type of packet
75 ubyte pad[3]; // Pad out length of frame_info packet
78 vms_matrix obj_orient;
79 vms_vector phys_velocity;
80 vms_vector phys_rotvel;
82 ushort data_size; // Size of data appended to the net packet
84 ubyte obj_render_type;
86 char data[NET_XDATA_SIZE]; // extra data to be tacked on the end
87 } __pack__ frame_info;
89 // short_frame_info is not aligned -- 01/18/96 -- MWA
90 // won't align because of shortpos. Shortpos needs
91 // to stay in current form.
93 typedef struct short_frame_info {
94 ubyte type; // What type of packet
95 ubyte pad[3]; // Pad out length of frame_info packet
98 ushort data_size; // Size of data appended to the net packet
100 ubyte obj_render_type;
102 char data[NET_XDATA_SIZE]; // extra data to be tacked on the end
103 } __pack__ short_frame_info;
105 void network_start_game(void);
106 void network_join_game(void);
107 void network_rejoin_game(void);
108 void network_leave_game(void);
109 int network_endlevel(int *secret);
110 void network_endlevel_poll2(int nitems, struct newmenu_item * menus, int * key, int citem);
113 int network_level_sync(void);
114 void network_send_endlevel_packet(void);
116 int network_delete_extra_objects(void);
117 int network_find_max_net_players(void);
118 int network_objnum_is_past(int objnum);
119 char * network_get_player_name(int objnum);
120 void network_send_endlevel_sub(int player_num);
121 void network_disconnect_player(int playernum);
123 extern void network_dump_player(ubyte * server, ubyte *node, int why);
124 extern void network_send_netgame_update(void);
126 extern int GetMyNetRanking(void);
128 extern int NetGameType;
129 extern int Network_send_objects;
130 extern int Network_send_objnum;
131 extern int PacketUrgent;
132 extern int Network_rejoined;
134 extern int Network_new_game;
135 extern int Network_status;
137 extern fix LastPacketTime[MAX_PLAYERS];
139 extern ushort my_segments_checksum;
140 // By putting an up-to-20-char-message into Network_message and
141 // setting Network_message_reciever to the player num you want to
142 // send it to (100 for broadcast) the next frame the player will
145 // Call once at the beginning of a frame
146 void network_do_frame(int force, int listen);
148 // Tacks data of length 'len' onto the end of the next
149 // packet that we're transmitting.
150 void network_send_data(ubyte * ptr, int len, int urgent);
152 // returns 1 if hoard.ham available
153 extern int HoardEquipped(void);
155 #endif /* _NETWORK_H */