Debian Codegraph @

src/common/anongame_protocol.h

raw symbols SCIP
1 /*
2 * Copyright (C) 1998 Mark Baysinger ([email protected])
3 * Copyright (C) 1998,1999,2000 Ross Combs ([email protected])
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19 #ifndef INCLUDED_ANONGAME_PROTOCOL_TYPES
20 #define INCLUDED_ANONGAME_PROTOCOL_TYPES
21
22 #ifdef JUST_NEED_TYPES
23 # include "common/bn_type.h"
24 #else
25 # define JUST_NEED_TYPES
26 # include "common/bn_type.h"
27 # undef JUST_NEED_TYPES
28 #endif
29
30 namespace pvpgn
31 {
32
33 /***********************************************************************************/
34 /* first packet recieved from client - option decides which struct to use next */
35 #define CLIENT_FINDANONGAME 0x44ff
36 #define SERVER_FINDANONGAME 0x44ff
37 typedef struct
38 {
39 t_bnet_header h;
40 bn_byte option;
41 /* rest of packet data */
42 } PACKED_ATTR() t_client_anongame;
43
44 /***********************************************************************************/
45 #define CLIENT_FINDANONGAME_SEARCH 0x00
46 #define CLIENT_FINDANONGAME_INFOS 0x02
47 #define CLIENT_FINDANONGAME_CANCEL 0x03
48 #define CLIENT_FINDANONGAME_PROFILE 0x04
49 #define CLIENT_FINDANONGAME_AT_SEARCH 0x05
50 #define CLIENT_FINDANONGAME_AT_INVITER_SEARCH 0x06
51 #define CLIENT_ANONGAME_TOURNAMENT 0X07
52 #define CLIENT_FINDANONGAME_PROFILE_CLAN 0x08
53 #define CLIENT_FINDANONGAME_GET_ICON 0x09
54 #define CLIENT_FINDANONGAME_SET_ICON 0x0A
55
56 #define SERVER_FINDANONGAME_SEARCH 0x00
57 #define SERVER_FINDANONGAME_FOUND 0x01
58 #define SERVER_FINDANONGAME_CANCEL 0x03
59 /***********************************************************************************/
60 /* option 00 - anongame search */
61 /*
62 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
63 Tournament PG 1v1 - battle.net
64 # 440 packet from client: type=0x44ff(CLIENT_FINDANONGAME) length=28 class=bnet
65 0000: FF 44 1C 00 00 01 00 00 00 00 00 00 00[02 13]01 .D..............
66 0010: 00 00 00 08 13 C7 30 04 04 00 00 00 ......0.....
67 PG 1v1
68 # 438 packet from client: type=0x44ff(CLIENT_FINDANONGAME) length=28 class=bnet
69 0000: FF 44 1C 00 00 01 00 00 00 00 00 00 00[00 00]FF .D..............
70 0010: 00 00 00 08 C2 13 A6 02 20 00 00 00 ........ ...
71 PG 2v2
72 # 456 packet from client: type=0x44ff(CLIENT_FINDANONGAME) length=28 class=bnet
73 0000: FF 44 1C 00 00 02 00 00 00 00 00 00 00[00 01]FF .D..............
74 0010: 07 00 00 08 A0 45 A6 02 20 00 00 00 .....E.. ...
75 PG 3v3
76 # 482 packet from client: type=0x44ff(CLIENT_FINDANONGAME) length=28 class=bnet
77 0000: FF 44 1C 00 00 03 00 00 00 00 00 00 00[00 02]FF .D..............
78 0010: 03 00 00 08 E8 7D A6 02 20 00 00 00 .....}.. ...
79 PG 4v4
80 # 516 packet from client: type=0x44ff(CLIENT_FINDANONGAME) length=28 class=bnet
81 0000: FF 44 1C 00 00 04 00 00 00 00 00 00 00[00 03]FF .D..............
82 0010: 01 00 00 08 48 B0 A6 02 20 00 00 00 ....H... ...
83 PG sffa
84 # 550 packet from client: type=0x44ff(CLIENT_FINDANONGAME) length=28 class=bnet
85 0000: FF 44 1C 00 00 05 00 00 00 00 00 00 00[00 04]FF .D..............
86 0010: 01 00 00 08 E6 F4 A6 02 20 00 00 00 ........ ...
87 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
88 inviter 2v2 - battle.net
89 # 74059 packet from client: type=0x44ff(CLIENT_FINDANONGAME) length=57 class=bnet
90 0000: FF 44 39 00 06 09 00 00 00 A0 03 00 0C 72 40 27 .D9..........r@'
91 0010: 3F 02 B9 DA 6B 9A A4 22 5D 60 49 EF 15 6F 44 25 ?...k.."]`I..oD%
92 0020: 02 4E F9 13 BC 4D 00 00 00 00[01 00]FF 07 00 00 .N...M..........
93 0030: 08 7E 98 E6 04 04 00 00 00 .~.......
94 inviter 2v2 - battle.net
95 # 83545 packet from client: type=0x44ff(CLIENT_FINDANONGAME) length=57 class=bnet
96 0000: FF 44 39 00 06 0A 00 00 00 E4 03 00 0C 9E 45 27 .D9...........E'
97 0010: 3F 02 1E 4E E7 53 80 F9 01 00 4F 68 A1 58 C5 1B ?..N.S....Oh.X..
98 0020: 44 31 BD EE 47 7F 00 00 00 00[01 00]FF 07 00 00 D1..G...........
99 0030: 08 48 07 FB 04 04 00 00 00 .H.......
100 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
101 AT 3v3 - pvpgn - with uid of team members
102 # 378 packet from client: type=0x44ff(CLIENT_FINDANONGAME) length=57 class=bnet
103 0000: FF 44 39 00 06 01 00 00 00[B7 36 C4 19]1B 02 2F .D9.......6..../
104 0010: 3F 03[19 00 00 00|02 00 00 00|01 00 00 00|FF FF ?...............
105 0020: FF FF|FF FF FF FF]00 00 00 00 01 02 FF 03 00 00 ................
106 0030: 08 AA A4 E2 0C 20 00 00 00 ..... ...
107
108 # 379 packet from client: type=0x44ff(CLIENT_FINDANONGAME) length=51 class=bnet
109 0000: FF 44 33 00 05 01 00 00 00[B7 36 C4 19]1B 02 2F .D3.......6..../
110 0010: 3F 03[19 00 00 00|02 00 00 00|01 00 00 00|FF FF ?...............
111 0020: FF FF|FF FF FF FF]00 00 00 00 08 59 C6 0E 00 20 ...........Y...
112 0030: 00 00 00 ...
113
114 # 382 packet from client: type=0x44ff(CLIENT_FINDANONGAME) length=51 class=bnet
115 0000: FF 44 33 00 05 01 00 00 00[B7 36 C4 19]1B 02 2F .D3.......6..../
116 0010: 3F 03[19 00 00 00|02 00 00 00|01 00 00 00|FF FF ?...............
117 0020: FF FF|FF FF FF FF]00 00 00 00 08 45 2C 13 00 20 ...........E,..
118 0030: 00 00 00 ...
119 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
120 */
121
122 typedef struct
123 {
124 t_bnet_header h;
125 bn_byte option;
126 bn_int count; /* Goes up each time client clicks search */
127 bn_int unknown2; /* 00 00 00 00 */
128 bn_byte type; /* 0 = PG , 1 = AT , 2 = TY - from TYPE */
129 bn_byte gametype; /* 0 = 1v1 , 1 = 2v2 , 2 = 3v3 , 3 = 4v4 , 4 = sffa - from TYPE */
130 bn_int map_prefs; /* map preferences bitmask */
131 bn_byte unknown3; /* 8 */
132 bn_int id; /* client id */
133 bn_int race; /* 1 = H , 2 = O , 4 = N , 8 = U , 0x20 = R */
134 } PACKED_ATTR() t_client_findanongame;
135
136 typedef struct
137 {
138 t_bnet_header h;
139 bn_byte option;
140 bn_int count;
141 bn_int tid; /* team id */
142 bn_int timestamp;
143 bn_byte teamsize;
144 bn_int info[5]; /* client get this info from SERVER_ARRANGEDTEAM_INVITE_FRIEND_ACK (0x61ff) */
145 bn_int unknown2; /* 00 00 00 00 */
146 bn_byte type; /* 0 = PG , 1 = AT , 2 = TY - from TYPE */
147 bn_byte gametype; /* 0 = 1v1 , 1 = 2v2 , 2 = 3v3 , 3 = 4v4 , 4 = sffa - from TYPE */
148 bn_int map_prefs; /* map preferences bitmask */
149 bn_byte unknown3; /* 08 */
150 bn_int id; /* client id */
151 bn_int race; /* 1 = H , 2 = O , 4 = N , 8 = U , 0x20 = R */
152 } PACKED_ATTR() t_client_findanongame_at_inv;
153
154 typedef struct
155 {
156 t_bnet_header h;
157 bn_byte option;
158 bn_int count; /* Goes up each time client clicks search */
159 bn_int tid; /* team id */
160 bn_int timestamp;
161 bn_byte teamsize;
162 bn_int info[5]; /* client get this info from inviter form SERVER_ARRANGEDTEAM_INVITE_FRIEND_ACK (0x61ff) */
163 bn_int unknown2; /* 00 00 00 00 */
164 bn_byte unknown3; /* 08 */
165 bn_int id; /* client id */
166 bn_int race; /* 1 = H , 2 = O , 4 = N , 8 = U , 0x20 = R */
167 } PACKED_ATTR() t_client_findanongame_at;
168
169 #define SERVER_ANONGAME_SEARCH_REPLY 0x44ff
170 typedef struct
171 {
172 t_bnet_header h;
173 bn_byte option;
174 bn_int count;
175 bn_int reply;
176 /* bn_short avgtime; - only in W3XP so far average time in seconds of search */
177 } PACKED_ATTR() t_server_anongame_search_reply;
178
179 /***********************************************************************************/
180 /* option 01 - anongame found */
181 /*
182 tournament 1v1
183 # 490 packet from server: type=0x44ff(unknown) length=84 class=bnet
184 0000: FF 44 54 00 01 01 00 00 00 00 00 00 00 3F F1 53 .DT..........?.S
185 0010: CD E0 17 F8 CC 00 00 3E 4F 8E 12 06[02 13]4D 61 .......>O.....Ma
186 0020: 70 73 5C 46 72 6F 7A 65 6E 54 68 72 6F 6E 65 5C ps\FrozenThrone\
187 0030: 28 34 29 46 6C 6F 6F 64 70 6C 61 69 6E 73 31 76 (4)Floodplains1v
188 0040: 31 2E 77 33 78 00 FF FF FF FF 31 44 4C 46 02 00 1.w3x.....1DLF..
189 0050: 00 00 02 02 ....
190 PG 2v2
191 # 28332 packet from server: type=0x44ff(unknown) length=83 class=bnet
192 0000: FF 44 53 00 01 02 00 00 00 00 00 00 00 D3 E9 00 .DS.............
193 0010: DC E0 17 2E 67 00 00 9A 7D 56 0F 06 00 01 4D 61 ....g...}V....Ma
194 0020: 70 73 5C 46 72 6F 7A 65 6E 54 68 72 6F 6E 65 5C ps\FrozenThrone\
195 0030: 28 36 29 53 63 6F 72 63 68 65 64 42 61 73 69 6E (6)ScorchedBasin
196 0040: 2E 77 33 78 00 FF FF FF FF 4D 41 45 54 04 02 00 .w3x.....MAET...
197 0050: 00 02 02 ...
198 PG 4v4
199 # 28827 packet from server: type=0x44ff(unknown) length=82 class=bnet
200 0000: FF 44 52 00 01 02 00 00 00 00 00 00 00 3F F1 53 .DR..........?.S
201 0010: DA E0 17 77 D6 00 00 92 D4 B8 56 06 00 03 4D 61 ...w......V...Ma
202 0020: 70 73 5C 46 72 6F 7A 65 6E 54 68 72 6F 6E 65 5C ps\FrozenThrone\
203 0030: 28 38 29 42 61 74 74 6C 65 67 72 6F 75 6E 64 2E (8)Battleground.
204 0040: 77 33 78 00 FF FF FF FF 4D 41 45 54 08 02 00 00 w3x.....MAET....
205 0050: 02 02 ..
206 PG 3v3
207 # 357 packet from server: type=0x44ff(unknown) length=84 class=bnet
208 0000: FF 44 54 00 01 01 00 00 00 00 00 00 00 3F F1 53 .DT..........?.S
209 0010: CE E0 17 10 22 01 00 29 0F 62 A0 06 00 02 4D 61 ...."..).b....Ma
210 0020: 70 73 5C 46 72 6F 7A 65 6E 54 68 72 6F 6E 65 5C ps\FrozenThrone\
211 0030: 28 36 29 42 6C 6F 6F 64 73 74 6F 6E 65 4D 65 73 (6)BloodstoneMes
212 0040: 61 2E 77 33 78 00 FF FF FF FF 4D 41 45 54 06 02 a.w3x.....MAET..
213 0050: 00 00 02 02 ....
214 PG 4v4
215 # 620 packet from server: type=0x44ff(unknown) length=79 class=bnet
216 0000: FF 44 4F 00 01 02 00 00 00 00 00 00 00 3F F1 53 .DO..........?.S
217 0010: DA E0 17 94 22 01 00 4C 29 5F 62 06 00 03 4D 61 ...."..L)_b...Ma
218 0020: 70 73 5C 46 72 6F 7A 65 6E 54 68 72 6F 6E 65 5C ps\FrozenThrone\
219 0030: 28 38 29 53 61 6E 63 74 75 61 72 79 2E 77 33 78 (8)Sanctuary.w3x
220 0040: 00 FF FF FF FF 4D 41 45 54 08 02 00 00 02 02 .....MAET......
221 PG sffa
222 # 810 packet from server: type=0x44ff(unknown) length=82 class=bnet
223 0000: FF 44 52 00 01 03 00 00 00 00 00 00 00 3F F1 53 .DR..........?.S
224 0010: C9 E0 17 3E 22 01 00 93 44 ED 22 06 00 04 4D 61 ...>"...D."...Ma
225 0020: 70 73 5C 46 72 6F 7A 65 6E 54 68 72 6F 6E 65 5C ps\FrozenThrone\
226 0030: 28 38 29 42 61 74 74 6C 65 67 72 6F 75 6E 64 2E (8)Battleground.
227 0040: 77 33 78 00 FF FF FF FF 20 41 46 46 05 00 00 00 w3x..... AFF....
228 0050: 02 02 ..
229 =-=-=-=-==-=-=-=-=
230 AT 2v2
231 # 74077 packet from server: type=0x44ff(unknown) length=87 class=bnet
232 0000: FF 44 57 00 01 09 00 00 00 00 00 00 00 3F F1 53 .DW..........?.S
233 0010: D3 E0 17 D8 D1 00 00 B4 2B 57 C6 06[01 00]4D 61 ........+W....Ma
234 0020: 70 73 5C 46 72 6F 7A 65 6E 54 68 72 6F 6E 65 5C ps\FrozenThrone\
235 0030: 28 36 29 53 74 72 61 6E 67 6C 65 74 68 6F 72 6E (6)Stranglethorn
236 0040: 56 61 6C 65 2E 77 33 78 00 FF FF FF FF 32 53 56 Vale.w3x.....2SV
237 0050: 32 04 02 00 00 02 02 2......
238
239 AT 2v2
240 # 83549 packet from server: type=0x44ff(unknown) length=79 class=bnet
241 0000: FF 44 4F 00 01 0A 00 00 00 00 00 00 00 3F F1 53 .DO..........?.S
242 0010: CF E0 17 BB D1 00 00 01 CB E4 BA 06[01 00]4D 61 ..............Ma
243 0020: 70 73 5C 46 72 6F 7A 65 6E 54 68 72 6F 6E 65 5C ps\FrozenThrone\
244 0030: 28 36 29 47 6E 6F 6C 6C 57 6F 6F 64 2E 77 33 78 (6)GnollWood.w3x
245 0040: 00 FF FF FF FF 32 53 56 32 04 02 00 00 02 02 .....2SV2......
246 */
247 #define SERVER_ANONGAME_FOUND 0x44ff
248 typedef struct
249 {
250 t_bnet_header h;
251 bn_byte option; /* 1: anongame found */
252 bn_int count;
253 bn_int unknown1; /* 00 00 00 00 */
254 bn_int ip;
255 bn_short port;
256 bn_byte unknown2;
257 bn_byte unknown3;
258 bn_short unknown4; /* usually 00 00 , seen 01 00 */
259 bn_int id; /* random val for identifying client */
260 bn_byte unknown5; /* 0x06 */
261 bn_byte type; /* 0 = PG , 1 = AT , 2 = TY - from TYPE */
262 bn_byte gametype; /* for PG - 0 = 1v1 , 1 = 2v2 , 2 = 3v3 , 3 = 4v4 , 4 = sffa
263 * for AT - 0 = 2v2 , 2 = 3v3 , 3 = 4v3
264 * for TY - set to 0
265 * from TYPE
266 */
267 /* char * mapname */
268 /* t_saf_pt2 * pt2 */
269 } PACKED_ATTR() t_server_anongame_found;
270
271 /* MISC PACKET APPEND DATA's */
272 typedef struct
273 {
274 bn_int unknown1; /* 0xFFFFFFFF */
275 bn_int anongame_string; /* ie. SOLO, TEAM, 2VS2, etc. */
276 bn_byte totalplayers;
277 bn_byte totalteams; /* 1v1 & sffa = 0, rest 2 */
278 bn_short unknown2; /* 0x0000 */
279 bn_byte visibility; /* 0x01 = dark - 0x02 = default */
280 bn_byte unknown3; /* 0x02 */
281 } PACKED_ATTR() t_saf_pt2;
282
283 /***********************************************************************************/
284 /* option 02 - info request */
285 #define CLIENT_FINDANONGAME_INFOREQ 0x44ff
286 typedef struct
287 {
288 t_bnet_header h;
289 bn_byte option; /* type of request:
290 * 0x02 for matchmaking infos */
291 bn_int count; /* 0x00000001 increments each request of same type */
292 bn_byte noitems;
293 } PACKED_ATTR() t_client_findanongame_inforeq;
294
295 #define SERVER_FINDANONGAME_INFOREPLY 0x44ff
296 typedef struct {
297 t_bnet_header h;
298 bn_byte option; /* as received from client */
299 bn_int count; /* as received from client */
300 bn_byte noitems; /* not very sure about it */
301 /* data */
302 /*
303 for type 0x02 :
304 <type of info><unknown int><info>
305 if <type of info> is :
306 URL\0 : <info> contains 3 NULL terminated urls/strings
307 MAP\0 : <info> contains 7 (seen so far) maps names
308 TYPE : <info> unknown 38 bytes probably meaning anongame types
309 DESC : <info>
310 */
311 } PACKED_ATTR() t_server_findanongame_inforeply;
312
313 /***********************************************************************************/
314 /* option 03 - playgame cancel */
315 #define SERVER_FINDANONGAME_PLAYGAME_CANCEL 0x44ff
316 typedef struct
317 {
318 t_bnet_header h; /* header */
319 bn_byte cancel; /* Cancel byte always 03 */
320 bn_int count;
321 } PACKED_ATTR() t_server_findanongame_playgame_cancel;
322
323
324 /* option 04 - profile request */
325 typedef struct
326 {
327 t_bnet_header h;
328 bn_byte option;
329 bn_int count;
330 /* USERNAME TO LOOKUP
331 * CLIENT TAG */
332 } PACKED_ATTR() t_client_findanongame_profile;
333
334 #define SERVER_FINDANONGAME_PROFILE 0x44ff
335 /*
336 typedef struct
337 {
338 t_bnet_header h; //header
339 bn_byte option; // in this case it will be 0x04 (for profile)
340 bn_int count; // count that goes up each time user clicks on someones profile
341 // REST OF PROFILE STATS - THIS WILL BE SET IN HANDLE_BNET.C after
342 // SERVER LOOKS UP THE USER ACCOUNT
343 } PACKED_ATTR() t_server_findanongame_profile;
344 */
345 typedef struct
346 {
347 t_bnet_header h;
348 bn_byte option;
349 bn_int count;
350 bn_int icon;
351 bn_byte rescount;
352 /* REST OF PROFILE STATS - THIS WILL BE SET IN HANDLE_BNET.C after
353 * SERVER LOOKS UP THE USER ACCOUNT */
354 } PACKED_ATTR() t_server_findanongame_profile2;
355
356 /***********************************************************************************/
357 /* option 07 - tournament request */
358 #define CLIENT_FINDANONGAME_TOURNAMENT_REQUEST 0x44ff
359 typedef struct
360 {
361 t_bnet_header h;
362 bn_byte option; /* 07 */
363 bn_int count; /* 01 00 00 00 */
364 } PACKED_ATTR() t_client_anongame_tournament_request;
365
366 #define SERVER_FINDANONGAME_TOURNAMENT_REPLY 0x44ff
367 typedef struct
368 {
369 t_bnet_header h;
370 bn_byte option; /* 07 */
371 bn_int count; /* 00 00 00 01 reply with same number */
372 bn_byte type; /* type - 01 = notice - time = prelim round begins
373 * 02 = signups - time = signups end
374 * 03 = signups over - time = prelim round ends
375 * 04 = prelim over - time = finals round 1 begins
376 */
377 bn_byte unknown; /* 00 */
378 bn_short unknown4; /* random ? might be part of time/date ? */
379 bn_int timestamp;
380 bn_byte unknown5; /* 01 effects time/date */
381 bn_short countdown; /* countdown until next timestamp (seconds) */
382 bn_short unknown2; /* 00 00 */
383 bn_byte wins; /* during prelim */
384 bn_byte losses; /* during prelim */
385 bn_byte ties; /* during prelim */
386 bn_byte unknown3; /* 00 = notice. 08 = signups thru prelim over (02-04) */
387 bn_byte selection; /* matches anongame_TY_section of DESC */
388 bn_byte descnum; /* matches desc_count of DESC */
389 bn_byte nulltag; /* 00 */
390 } PACKED_ATTR() t_server_anongame_tournament_reply;
391
392 /***********************************************************************************/
393
394 /* option 08 - clan profile request */
395 typedef struct
396 {
397 t_bnet_header h;
398 bn_byte option;
399 bn_int count;
400 bn_int clantag;
401 bn_int clienttag;
402 } PACKED_ATTR() t_client_findanongame_profile_clan;
403
404 #define SERVER_FINDANONGAME_PROFILE_CLAN 0x44ff
405
406 typedef struct
407 {
408 t_bnet_header h;
409 bn_byte option;
410 bn_int count;
411 bn_byte rescount;
412 /* REST OF PROFILE STATS - THIS WILL BE SET IN HANDLE_BNET.C after
413 * SERVER LOOKS UP THE USER ACCOUNT */
414 } PACKED_ATTR() t_server_findanongame_profile_clan;
415
416
417 /***********************************************************************************/
418 /* option 9 - icon request */
419 #define SERVER_FINDANONGAME_ICONREPLY 0x44ff
420 typedef struct{
421 t_bnet_header h;
422 bn_byte option; /* as received from client */
423 bn_int count; /* as received from client */
424 bn_int curricon; /* current icon code */
425 bn_byte table_width; /* the icon table width */
426 bn_byte table_size; /* the icon table total size */
427 /* table data */
428 } PACKED_ATTR() t_server_findanongame_iconreply;
429
430 /***********************************************************************************/
431 #define SERVER_ANONGAME_SOLO_STR 0x534F4C4F /* "SOLO" */
432 #define SERVER_ANONGAME_TEAM_STR 0x5445414D /* "TEAM" */
433 #define SERVER_ANONGAME_SFFA_STR 0x46464120 /* "FFA " */
434 #define SERVER_ANONGAME_AT2v2_STR 0x32565332 /* "2VS2" */
435 #define SERVER_ANONGAME_AT3v3_STR 0x33565333 /* "3VS3" */
436 #define SERVER_ANONGAME_AT4v4_STR 0x34565334 /* "4VS4" */
437 #define SERVER_ANONGAME_TY_STR 0X54592020 /* "TY " FIXME-TY: WHAT TO PUT HERE */
438
439 #define CLIENT_FINDANONGAME_INFOTAG_URL 0x55524c /* URL\0 */
440 #define CLIENT_FINDANONGAME_INFOTAG_MAP 0x4d4150 /* MAP\0 */
441 #define CLIENT_FINDANONGAME_INFOTAG_TYPE 0x54595045 /* TYPE */
442 #define CLIENT_FINDANONGAME_INFOTAG_DESC 0x44455343 /* DESC */
443 #define CLIENT_FINDANONGAME_INFOTAG_LADR 0x4c414452 /* LADR */
444 #define CLIENT_FINDANONGAME_INFOTAG_SOLO 0x534f4c4f /* SOLO */
445 #define CLIENT_FINDANONGAME_INFOTAG_TEAM 0x5445414d /* TEAM */
446 #define CLIENT_FINDANONGAME_INFOTAG_FFA 0x46464120 /* FFA\20 */
447
448 #define ANONGAME_TYPE_1V1 0
449 #define ANONGAME_TYPE_2V2 1
450 #define ANONGAME_TYPE_3V3 2
451 #define ANONGAME_TYPE_4V4 3
452 #define ANONGAME_TYPE_SMALL_FFA 4
453 #define ANONGAME_TYPE_AT_2V2 5
454 #define ANONGAME_TYPE_TEAM_FFA 6
455 #define ANONGAME_TYPE_AT_3V3 7
456 #define ANONGAME_TYPE_AT_4V4 8
457 /* Added by Omega */
458 #define ANONGAME_TYPE_TY 9
459 #define ANONGAME_TYPE_5V5 10
460 #define ANONGAME_TYPE_6V6 11
461 #define ANONGAME_TYPE_2V2V2 12
462 #define ANONGAME_TYPE_3V3V3 13
463 #define ANONGAME_TYPE_4V4V4 14
464 #define ANONGAME_TYPE_2V2V2V2 15
465 #define ANONGAME_TYPE_3V3V3V3 16
466 #define ANONGAME_TYPE_AT_2V2V2 17
467
468 #define ANONGAME_TYPES 18
469
470 #define SERVER_FINDANONGAME_PROFILE_UNKNOWN2 0x6E736865 /* Sheep */
471
472 /***********************************************************************************/
473 /***********************************************************************************/
474 /* This is a blank packet - includes just type and size */
475 #define CLIENT_ARRANGEDTEAM_FRIENDSCREEN 0x60ff
476 typedef struct
477 {
478 t_bnet_header h;
479 } PACKED_ATTR() t_client_arrangedteam_friendscreen;
480
481 /***********************************************************************************/
482 #define SERVER_ARRANGEDTEAM_FRIENDSCREEN 0x60ff
483 typedef struct
484 {
485 t_bnet_header h;
486 bn_byte f_count;
487 /* usernames get appended here */
488 } PACKED_ATTR() t_server_arrangedteam_friendscreen;
489
490 #define SERVER_ARRANGED_TEAM_ADDNAME 0x01
491
492 /***********************************************************************************/
493 /*
494 0000: FF 61 1C 00 01 00 00 00 C9 7B A0 02 01 00 00 00 .........{......
495 0010: 01 74 72 65 6E 64 65 63 69 64 65 00 .trendecide.
496 */
497 #define CLIENT_ARRANGEDTEAM_INVITE_FRIEND 0x61ff
498 typedef struct
499 {
500 t_bnet_header h;
501 bn_int count;
502 bn_int id;
503 bn_int unknown1; /* 01 00 00 00 */
504 bn_byte numfriends; /* next is a byte, that is the number of friends to invite */
505 /* usernames get appended here */
506 } PACKED_ATTR() t_client_arrangedteam_invite_friend;
507
508 /***********************************************************************************/
509 #define SERVER_ARRANGEDTEAM_INVITE_FRIEND_ACK 0x61ff
510 typedef struct
511 {
512 t_bnet_header h;
513 bn_int count;
514 bn_int id; /* client id */
515 bn_int timestamp;
516 bn_byte teamsize; /* numfriends + 1 */
517 bn_int info[5];
518 } PACKED_ATTR() t_server_arrangedteam_invite_friend_ack;
519
520 /***********************************************************************************/
521 #define SERVER_ARRANGEDTEAM_SEND_INVITE 0x63ff
522 typedef struct
523 {
524 t_bnet_header h;
525 bn_int count;
526 bn_int id; /* client id of inviter */
527 bn_int inviterip; /* IP address of the person who invited them into the game */
528 bn_short port; /* Port of the person who invited them into the game */
529 bn_byte numfriends; /* Number of friends that got invited to the game */
530 /* username of the inviter */
531 /* usernames of the others who got invited */
532 } PACKED_ATTR() t_server_arrangedteam_send_invite;
533
534 /***********************************************************************************/
535 #define CLIENT_ARRANGEDTEAM_ACCEPT_DECLINE_INVITE 0x63ff
536 typedef struct
537 {
538 t_bnet_header h;
539 bn_int count;
540 bn_int id;
541 bn_int option; /* accept or decline */
542 /* username of the inviter */
543 } PACKED_ATTR() t_client_arrangedteam_accept_decline_invite;
544
545 #define CLIENT_ARRANGEDTEAM_ACCEPT 0x00000003
546 #define CLIENT_ARRANGEDTEAM_DECLINE 0x00000002
547
548 /***********************************************************************************/
549 #define SERVER_ARRANGEDTEAM_MEMBER_DECLINE 0x62ff
550 typedef struct
551 {
552 t_bnet_header h;
553 bn_int count;
554 bn_int action; /* number assigned to player? playernum? */
555 /* username of the person who declined invitation */
556 } PACKED_ATTR() t_server_arrangedteam_member_decline;
557
558 #define SERVER_ARRANGEDTEAM_ACCEPT 0x00000003
559 #define SERVER_ARRANGEDTEAM_DECLINE 0x00000002
560
561 /***********************************************************************************/
562 /* not used ?? [Omega] */
563 /*
564 0000: FF 64 1C 00 02 00 00 00 00 00 00 00 01 00 00 00 .d..............
565 0010: 00 00 00 00 03 00 00 00 00 00 00 00 ............
566 */
567 /* THIS NEEDS FINISHED */
568 /*
569 #define SERVER_ARRANGEDTEAM_TEAM_STATS 0x64ff
570 typedef struct
571 {
572 t_bnet_header h;
573 }
574 */
575 /***********************************************************************************/
576 /***********************************************************************************/
577 /*
578 # 144 packet from client: type=0x65ff(unknown) length=4 class=bnet
579 0000: FF 65 04 00 .e..
580 */
581 #define CLIENT_FRIENDSLISTREQ 0x65ff
582 typedef struct
583 {
584 t_bnet_header h;
585 } PACKED_ATTR() t_client_friendslistreq;
586
587 /*
588 # 158 packet from server: type=0x65ff(unknown) length=16 class=bnet
589 0000: FF 65 10 00 01 66 6F 6F 00 00 00 00 00 00 00 00 .e.. .foo. .......
590
591
592 */
593 #define SERVER_FRIENDSLISTREPLY 0x65ff
594 typedef struct
595 {
596 t_bnet_header h;
597 bn_byte friendcount;
598 /* 1 byte status, 0-terminated name, 6 bytes unknown, ... */
599 } PACKED_ATTR() t_server_friendslistreply;
600
601 typedef struct
602 {
603 bn_byte status;
604 bn_byte location;
605 bn_int clienttag;
606 } PACKED_ATTR() t_server_friendslistreply_status;
607
608 /*
609 # 124 packet from client: type=0x66ff(unknown) length=5 class=bnet
610 0000: FF 66 05 00 00 .f...
611 */
612 /* FF 66-05 00 00 40 - AT */
613 #define CLIENT_FRIENDINFOREQ 0x66ff
614 typedef struct
615 {
616 t_bnet_header h;
617 bn_byte friendnum;
618 } PACKED_ATTR() t_client_friendinforeq;
619
620 /*
621 # 126 packet from server: type=0x66ff(unknown) length=12 class=bnet
622 0000: FF 66 0C 00 00 00 00 00 00 00 00 00 .f..........
623
624 Arranged Team sends this to each inviter
625 FF 66-1A 00 00 01 03 33 52 41 ..g....f.....3RA
626 0x0040 57 41 72 72 61 6E 67 65-64 20 54 65 61 6D 73 00 WArranged Teams.
627 and this to the inviter
628 FF 66-18 00 00 01 02 33 52 41 ..i....f.....3RA
629 0x0040 57 57 61 72 63 72 61 66-74 20 49 49 49 00 WWarcraft III.
630 */
631
632 #define SERVER_FRIENDINFOREPLY 0x66ff
633 typedef struct
634 {
635 t_bnet_header h;
636 bn_byte friendnum;
637 bn_byte type;
638 bn_byte status;
639 bn_int clienttag;
640 /* game name */
641 } PACKED_ATTR() t_server_friendinforeply;
642 #define FRIEND_TYPE_NON_MUTUAL 0x00
643 #define FRIEND_TYPE_MUTUAL 0x01
644 #define FRIEND_TYPE_DND 0x02
645 #define FRIEND_TYPE_AWAY 0x04
646
647 /******************************************************/
648 /*
649 # 126 packet from server: type=0x67ff(unknown) length=15 class=bnet
650 0000: FF 67 0F 00 66 6F 6F 00 00 00 00 00 00 00 00 .g..foo........
651 */
652 #define SERVER_FRIENDADD_ACK 0x67ff
653 typedef struct
654 {
655 t_bnet_header h;
656 /* friend name, status */
657 } PACKED_ATTR() t_server_friendadd_ack;
658 /******************************************************/
659 /*
660 # 114 packet from server: type=0x68ff(unknown) length=5 class=bnet
661 0000: FF 68 05 00 01 .h...
662 */
663 #define SERVER_FRIENDDEL_ACK 0x68ff
664 typedef struct
665 {
666 t_bnet_header h;
667 bn_byte friendnum;
668 } PACKED_ATTR() t_server_frienddel_ack;
669 /******************************************************/
670
671 #define SERVER_FRIENDMOVE_ACK 0x69ff
672 typedef struct
673 {
674 t_bnet_header h;
675 bn_byte pos1;
676 bn_byte pos2;
677 } PACKED_ATTR() t_server_friendmove_ack;
678
679 #define FRIENDSTATUS_OFFLINE 0x00
680 #define FRIENDSTATUS_ONLINE 0x01
681 #define FRIENDSTATUS_CHAT 0x02
682 #define FRIENDSTATUS_PUBLIC_GAME 0x03
683 #define FRIENDSTATUS_PRIVATE_GAME 0x05
684
685 }
686
687 #endif