1 /*
2  * XPilot NG, a multiplayer space war game.
3  *
4  * Copyright (C) 1991-2001 by
5  *
6  *      Bj�rn Stabell        <bjoern@xpilot.org>
7  *      Ken Ronny Schouten   <ken@xpilot.org>
8  *      Bert Gijsbers        <bert@xpilot.org>
9  *      Dick Balaska         <dick@xpilot.org>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24  */
25 
26 #ifndef PACKET_H
27 #define PACKET_H
28 
29 /* before version 3.8.0 this was 8 bytes. */
30 #define KEYBOARD_SIZE		9
31 
32 /*
33  * Definition of various client/server packet types.
34  */
35 
36 /* packet types: 0 - 9 */
37 #define PKT_UNDEFINED		0
38 #define PKT_VERIFY		1
39 #define PKT_REPLY		2
40 #define PKT_PLAY		3
41 #define PKT_QUIT		4
42 #define PKT_MESSAGE		5
43 #define PKT_START		6
44 #define PKT_END			7
45 #define PKT_SELF		8
46 #define PKT_DAMAGED		9
47 
48 /* packet types: 10 - 19 */
49 #define PKT_CONNECTOR		10
50 #define PKT_REFUEL		11
51 #define PKT_SHIP		12
52 #define PKT_ECM			13
53 #define PKT_PAUSED		14
54 #define PKT_ITEM		15
55 #define PKT_MINE		16
56 #define PKT_BALL		17
57 #define PKT_MISSILE		18
58 #define PKT_SHUTDOWN		19
59 
60 /* packet types: 20 - 29 */
61 #define PKT_STRING		20
62 #define PKT_DESTRUCT		21
63 #define PKT_RADAR		22
64 #define PKT_TARGET		23
65 #define PKT_KEYBOARD		24
66 #define PKT_SEEK		25
67 #define PKT_SELF_ITEMS		26	/* still under development */
68 #define PKT_TEAM_SCORE		27	/* was PKT_SEND_BUFSIZE */
69 #define PKT_PLAYER		28
70 #define PKT_SCORE		29
71 
72 /* packet types: 30 - 39 */
73 #define PKT_FUEL		30
74 #define PKT_BASE		31
75 #define PKT_CANNON		32
76 #define PKT_LEAVE		33
77 #define PKT_POWER		34
78 #define PKT_POWER_S		35
79 #define PKT_TURNSPEED		36
80 #define PKT_TURNSPEED_S		37
81 #define PKT_TURNRESISTANCE	38
82 #define PKT_TURNRESISTANCE_S	39
83 
84 /* packet types: 40 - 49 */
85 #define PKT_WAR			40
86 #define PKT_MAGIC		41
87 #define PKT_RELIABLE		42
88 #define PKT_ACK			43
89 #define PKT_FASTRADAR		44
90 #define PKT_TRANS		45
91 #define PKT_ACK_CANNON		46
92 #define PKT_ACK_FUEL		47
93 #define PKT_ACK_TARGET		48
94 #define	PKT_SCORE_OBJECT	49
95 
96 /* packet types: 50 - 59 */
97 #define PKT_AUDIO		50
98 #define PKT_TALK		51
99 #define PKT_TALK_ACK		52
100 #define PKT_TIME_LEFT		53
101 #define PKT_LASER		54
102 #define PKT_DISPLAY		55
103 #define PKT_EYES		56
104 #define PKT_SHAPE		57
105 #define PKT_MOTD		58
106 #define PKT_LOSEITEM		59
107 
108 /* packet types: 60 - 69 */
109 #define PKT_APPEARING		60
110 #define PKT_TEAM		61
111 #define PKT_POLYSTYLE		62
112 #define PKT_ACK_POLYSTYLE	63
113 #define PKT_NOT_USED_64		64
114 #define PKT_NOT_USED_65		65
115 #define PKT_NOT_USED_66		66
116 #define PKT_NOT_USED_67		67
117 #define PKT_MODIFIERS		68
118 #define PKT_FASTSHOT		69	/* replaces SHOT/TEAMSHOT */
119 
120 /* packet types: 70 - 79 */
121 #define PKT_THRUSTTIME		70
122 #define PKT_MODIFIERBANK	71
123 #define PKT_SHIELDTIME		72
124 #define PKT_POINTER_MOVE	73
125 #define PKT_REQUEST_AUDIO	74
126 #define PKT_ASYNC_FPS		75
127 #define PKT_TIMING		76
128 #define PKT_PHASINGTIME		77
129 #define PKT_ROUNDDELAY		78
130 #define PKT_WRECKAGE		79
131 
132 /* packet types: 80 - 89 */
133 #define PKT_ASTEROID		80
134 #define PKT_WORMHOLE		81
135 #define PKT_NOT_USED_82		82
136 #define PKT_NOT_USED_83		83
137 #define PKT_NOT_USED_84		84
138 #define PKT_NOT_USED_85		85
139 #define PKT_NOT_USED_86		86
140 #define PKT_NOT_USED_87		87
141 #define PKT_NOT_USED_88		88
142 #define PKT_NOT_USED_89		89
143 
144 /* packet types: 90 - 99 */
145 /*
146  * Use these 10 packet type numbers for
147  * experimenting with new packet types.
148  */
149 
150 /* status reports: 101 - 102 */
151 #define PKT_FAILURE		101
152 #define PKT_SUCCESS		102
153 
154 /* optimized packet types: 128 - 255 */
155 #define PKT_DEBRIS		128		/* + color + x + y */
156 
157 #endif
158