comparison src/gppackets.h @ 4:aa38447a4b21

First entry of Paradise Server 2.9 patch 10 Beta
author darius
date Sat, 06 Dec 1997 04:37:03 +0000
parents
children
comparison
equal deleted inserted replaced
3:cafa94d86546 4:aa38447a4b21
1 /*--------------------------------------------------------------------------
2 NETREK II -- Paradise
3
4 Permission to use, copy, modify, and distribute this software and its
5 documentation, or any derivative works thereof, for any NON-COMMERCIAL
6 purpose and without fee is hereby granted, provided that this copyright
7 notice appear in all copies. No representations are made about the
8 suitability of this software for any purpose. This software is provided
9 "as is" without express or implied warranty.
10
11 Xtrek Copyright 1986 Chris Guthrie
12 Netrek (Xtrek II) Copyright 1989 Kevin P. Smith
13 Scott Silvey
14 Paradise II (Netrek II) Copyright 1993 Larry Denys
15 Kurt Olsen
16 Brandon Gillespie
17 --------------------------------------------------------------------------*/
18
19 #ifndef gppackets_h_
20 #define gppackets_h_
21
22 /* the definitions of {INT,CARD}{8,16,32} are in packets.h */
23 #include "packets.h"
24
25 struct gameparam_spacket
26 {
27 INT8 type;
28 INT8 subtype; /* this packet is not real */
29 /* generic game parameter packet */
30 INT16 pad;
31 };
32
33 struct gp_sizes_spacket
34 {
35 INT8 type;
36 INT8 subtype; /* =0 */
37
38 CARD8 nplayers;
39 CARD8 nteams; /* max of 8 */
40
41 CARD8 nshiptypes;
42 CARD8 nranks; /* number of ranks */
43 CARD8 nroyal; /* number of royalties */
44 CARD8 nphasers;
45
46 CARD8 ntorps;
47 CARD8 nplasmas;
48 CARD8 nthingies; /* per-player */
49 CARD8 gthingies; /* auxiliary thingies */
50
51 CARD32 gwidth; /* galaxy width */
52 /* 16 bytes */
53 CARD32 flags; /* some game parameter flags */
54 #define GP_WRAPVERT (1<<0)
55 #define GP_WRAPHORIZ (1<<1)
56 #define GP_WRAPALL (GP_WRAPVERT|GP_WRAPHORIZ)
57
58 /*
59 * The following bytes are room for growth. The size of this packet is
60 * unimportant because it only gets sent once. hopefully we've got plenty
61 * of room.
62 */
63 CARD16 nplanets;
64 INT16 ext1;
65
66 INT32 ext2;
67 INT32 ext3;
68 /* 32 bytes */
69
70 INT32 ext4;
71 INT32 ext5;
72 INT32 ext6;
73 INT32 ext7;
74
75 INT32 ext8;
76 INT32 ext9;
77 INT32 ext10;
78 INT32 ext11; /* 16 ints, 64 bytes */
79 };
80
81 struct gp_team_spacket
82 {
83 INT8 type;
84 INT8 subtype; /* =1 */
85
86 CARD8 index; /* team index */
87 CARD8 letter; /* team letter 'F' */
88
89 CARD8 shortname[3]; /* non-null-terminated 3-letter abbrev 'FED' */
90 CARD8 pad;
91 /* 8 bytes */
92 CARD8 teamname[56]; /* padding to 64 byte packet */
93 };
94
95 struct gp_teamlogo_spacket
96 {
97 /*
98 * This packet contains several adjacent rows of a team's logo bitmap Data
99 * is in raw XBM format (scanline-padded to 8 bits). Maximum bitmap size is
100 * 99x99, which takes 1287 (99x13) bytes.
101 */
102 INT8 type;
103 INT8 subtype; /* =2 */
104
105 INT8 logowidth; /* <= 99 */
106 INT8 logoheight; /* <= 99 */
107
108 INT8 y; /* y coord of the start of this packets info */
109 INT8 thisheight; /* the height of this packet's info */
110 INT8 teamindex; /* which team's logo this is */
111
112 CARD8 data[768 - 7]; /* pad packet to 768 bytes. */
113 };
114
115 struct gp_shipshape_spacket
116 {
117 INT8 type;
118 INT8 subtype; /* =3 */
119
120 CARD8 shipno;
121 INT8 race; /* -1 is independent */
122 CARD8 nviews; /* typically 16 */
123
124 CARD8 width, height;
125 CARD8 pad1;
126 };
127
128 struct gp_shipbitmap_spacket
129 {
130 INT8 type;
131 INT8 subtype; /* =4 */
132
133 CARD8 shipno;
134 INT8 race; /* -1 is independent */
135 CARD8 thisview; /* 0..nviews-1 */
136
137 CARD8 bitmapdata[999];
138 };
139
140 struct gp_rank_spacket
141 {
142 INT8 type;
143 INT8 subtype; /* =5 */
144
145 INT8 rankn; /* rank number */
146
147 CARD8 name[-3 + 64 - 20]; /* name of the rank */
148
149 INT32 genocides;
150 INT32 milliDI; /* DI*1000 */
151 INT32 millibattle; /* battle*1000 */
152 INT32 millistrat; /* strategy*1000 */
153 INT32 millispec; /* special ships*1000 */
154 };
155
156 struct gp_royal_spacket
157 {
158 INT8 type;
159 INT8 subtype; /* =6 */
160
161 CARD8 rankn; /* rank number */
162
163 CARD8 name[-3 + 64]; /* name of the rank */
164 };
165
166 struct gp_teamplanet_spacket
167 {
168 INT8 type;
169 INT8 subtype; /* =7 */
170
171 INT8 teamn; /* 0..7 */
172 CARD8 pad1;
173
174 INT32 ext1; /* extensions? */
175
176 /*
177 * Bitmaps of the team logo and masks. The bitmap of the planet will be
178 * constructed with (mask ? logo : planet), applied bitwise. This
179 * calculation is equivalent to (logo&mask)|(planet&~mask)
180 */
181
182 /* bitmap 30x30, X bitmap format (scanline padded to 8 bits) */
183 CARD8 tactical[120];
184 CARD8 tacticalM[120];
185
186 /* bitmap 16x16, X bitmap format (scanline padded to 8 bits) */
187 CARD8 galactic[32];
188 CARD8 galacticM[32];
189 };
190
191 #endif