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