/[LeafOK_CVS]/pvpgn-1.7.4/src/common/d2game_protocol.h
ViewVC logotype

Contents of /pvpgn-1.7.4/src/common/d2game_protocol.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Tue Jun 6 03:41:38 2006 UTC (19 years, 9 months ago) by sysadm
Branch: GNU, MAIN
CVS Tags: arelease, HEAD
Changes since 1.1: +0 -0 lines
Content type: text/x-chdr
Error occurred while calculating annotation data.
no message

1 /*
2 * Copyright (C) 2000 Otto Chan (kenshin_@hotmail.com)
3 * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu)
4 * Copyright (C) 2000 Onlyer (onlyer@263.net)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20 #ifndef INCLUDED_D2GAME_PROTOCOL_TYPES
21 #define INCLUDED_D2GAME_PROTOCOL_TYPES
22
23 #ifdef JUST_NEED_TYPES
24 # include "bn_type.h"
25 #else
26 # define JUST_NEED_TYPES
27 # include "bn_type.h"
28 # undef JUST_NEED_TYPES
29 #endif
30
31
32 /*
33 * The protocol for communicating between a Diablo II client
34 * and game server.
35 * FIXME: put the #define's into the PROTO section
36 */
37
38
39 /******************************************************/
40 typedef struct
41 {
42 #ifdef NOTONLYER
43 bn_short magic;
44 bn_short size;
45 bn_byte type;
46 /* FIXME: the two sets of packets don't jive... did the beta have a different
47 game protocol or am I just confused (could easily be the later). */
48 #else
49 bn_byte type;
50 #endif
51 } t_d2game_header;
52 /******************************************************/
53
54
55 /******************************************************/
56 typedef struct
57 {
58 t_d2game_header h;
59 } t_d2game_generic;
60 /******************************************************/
61
62
63 /******************************************************/
64 /*
65 D2 00 05 00 00
66 */
67 #define SERVER_00 0x00 /* beta-only? */
68 typedef struct
69 {
70 t_d2game_header h;
71 bn_byte unknown1; /* data request #? */
72 } PACKED_ATTR() t_server_00_req;
73 #define SERVER_00 0x00
74 /******************************************************/
75
76
77 /******************************************************/
78 /*
79 D2 00 20 00 01 E2 5E 13 BE 4C 02 04 CA 00 00 00 .........L......
80 6C 69 6C 6A 6F 65 00 00 64 25 42 00 1C E9 50 00 liljoe..d.B...P.
81 */
82 #define CLIENT_01 0x01 /* beta-only? */
83 typedef struct /* game select? */
84 {
85 t_d2game_header h;
86 bn_byte unknown1; /* data reply #? */
87 bn_int gameid1; /* same as in auth 04 reply */
88 bn_short gameid2; /* same as in auth 04 reply */
89 bn_byte unknown2[5];
90 /* character name */
91 /* 00 64 25 42 00 1C E9 50 00 unknown... string or numeric? */
92 } PACKED_ATTR() t_client_01;
93 /******************************************************/
94
95
96 /******************************************************/
97 /*
98 0030 22 38 32 5D 00 00 97 20 20 20 20 20 "82]........
99 */
100 #define D2GAME_SERVER_WELCOME 0x97
101 typedef struct
102 {
103 t_d2game_header h;
104 } t_d2game_server_welcome;
105
106
107 /*
108 0000: 60 00 27 04 18 79 27 04 A8 00 00 00 07 02 00 00 `.'..y'.........
109 0010: B0 01 01 00 00 6F 6E 6C 79 65 72 00 B8 6A F7 BF .....onlyer..j..
110 0020: 00 00 00 00 34 00 00 04 00 00 00 00 00 ....4........
111
112 0000: 60 00 27 04 18 79 27 04 30 0D 00 00 07 02 00 00 `.'..y'.0.......
113 0010: B0 01 04 00 01 41 4C 42 45 52 54 00 B8 6A F7 BF .....ALBERT..j..
114 0020: 00 00 00 00 34 00 00 04 00 00 00 00 00 ....4........
115
116 0000: 60 00 27 04 18 79 27 04 A0 0A 00 00 07 02 00 00 `.'..y'.........
117 0010: B0 01 04 00 02 41 4C 42 45 52 54 00 B8 6A F7 BF .....ALBERT..j..
118 0020: 00 00 00 00 34 00 00 04 00 00 00 00 00 ....4........
119
120 0000: 60 00 AB 04 18 79 AB 04 DE 00 9F 00 0C 02 00 00 `....y..........
121 0010: 60 01 04 00 00 62 62 62 00 71 DF 77 A6 C0 E6 77 `....bbb.q.w...w
122 0020: A6 C0 E6 77 34 05 00 04 00 00 00 00 00 ...w4........
123
124 */
125
126
127 #define D2GAME_CLIENT_CREATEGAMEREQ 0x60
128
129 typedef bn_basic bn_charname[16];
130
131 typedef struct
132 {
133 t_d2game_header h;
134 char gamename[16];
135 bn_byte servertype; /* servertype=0, data not send to client and have no host */
136 /* creator changed to newbie data saved in server machine*/
137 /* servertype=1, data send to client and have host */
138 /* servertype=2, data send to client and have no host */
139 /* servertype=3, client all newbie,seems to be wrong */
140 /* data is saved in server machine */
141 /* client is loaded from server machine */
142 bn_byte class;
143 bn_byte template; /* character template */
144 /* affect the reply in 0x01 */
145 /* should less than the lines of excel/CharTemplate.txt */
146 bn_byte difficulty;
147 bn_charname charname;
148 bn_short arena;
149 bn_int gameflag;
150 bn_byte unknownb2; /* unused */
151 bn_byte unknownb3; /* unused */
152 } t_d2game_client_creategamereq;
153
154
155 typedef struct
156 {
157 bn_byte flag1; /* "test gameflag,06" should not be zero,or will be bad gameflag */
158 /* flag1 should be set with bit 0x04 or will fail or crash */
159 /* bit 0x10,0x20,0x08 is ignored in reply */
160
161 bn_byte flag2; /* hardcore and softcore */
162 /* 0x0 means softcore,0x1 template mode,0x8 means hardcore */
163 /* bit 0x02,0x04,0xF0 is ignored in reply */
164 /* have sth to do with char template */
165 /* opengame */
166
167 bn_byte flag3; /* guild data (not in reply) */
168 /* 0x01 means have guild */
169 /* others bits seems all unused */
170
171 bn_byte flag4; /* seems to be unused */
172
173 } t_d2game_gameflag;
174
175
176
177 /*
178 0030 22 37 86 D7 00 00 61 65 00 00 00 00 00 01 03 00 "7....ae........
179 0040 00 00 6F 6E 6C 79 65 72 2D 63 6E 61 61 00 24 E0 ..onlyer-cnaa.$.
180 0050 7B 05 {.
181 */
182
183 #define D2GAME_CLIENT_JOINGAMEREQ 0x61
184 typedef struct
185 {
186 t_d2game_header h;
187 bn_int token;
188 bn_short gameid;
189 bn_byte charclass; /* 00=Amazon 01=Sor 02=Nec 03=Pal 04=Bar */
190 bn_int version;
191 bn_charname charname;
192 /* 16 bytes playe name (including 0x0 ending) */
193 } t_d2game_client_joingamereq;
194
195
196 /*
197 0030 22 1C C9 65 00 00 20 20 20 20 20 20 "..e........
198 */
199
200 #define D2GAME_SERVER_NOOP 0x20
201 typedef struct
202 {
203 t_d2game_header h;
204 /* 5 \x20 noop */
205 } t_d2game_server_noop;
206
207
208
209 /*
210 0030 22 37 17 07 00 00 66 91 4B A1 00 00 00 00 00 "7....f.K......
211 */
212 #define D2GAME_CLIENT_UNKNOWN_66 0x66 /* echo message? */
213 typedef struct
214 {
215 t_d2game_header h;
216 bn_int unknown1;
217 bn_int unknown2;
218 } t_d2game_client_unknown_66;
219
220 /*
221 0000: 8F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
222 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
223 0020: 00 .
224 */
225
226 #define D2GAME_SERVER_UNKNOWN_8F 0x8f /* echo reply? */
227 typedef struct
228 {
229 t_d2game_header h;
230 bn_int unknown1;
231 bn_int unknown2;
232 bn_int unknown3;
233 bn_int unknown4;
234 bn_int unknown5;
235 bn_int unknown6;
236 bn_int unknown7; /* all here for open char is zero */
237 } t_d2game_server_unknown_8f;
238
239
240
241 /*
242 0030 22 1C C4 53 00 00 01 00 04 00 00 00 00 02 "..S..........
243 */
244 #define D2GAME_SERVER_JOINOK 0x01
245 /* this message will appear after
246 * 1. CLIENT_CREATEGAEM valid
247 * 2. CLIENT_JOINGAME valid
248 */
249 typedef struct
250 {
251 t_d2game_header h;
252 bn_byte difficulty;
253 bn_short gameflag;
254 bn_byte template;
255 bn_short unknown1;
256 bn_short unknown2;
257 } t_d2game_server_joinok;
258
259
260 /*
261 0030 22 2F 65 38 00 00 64 "/e8..d
262 */
263
264 #define D2GAME_CLIENT_JOINACTREQ 0x64
265 typedef struct
266 {
267 t_d2game_header h;
268 /* none */
269 } t_d2game_client_joinactreq;
270
271
272 #define D2GAME_SERVER_UNKNOWN_59 0x59
273 typedef struct
274 {
275 t_d2game_header h;
276 } t_d2game_server_unknown_59;
277
278
279 /*
280 0030 22 0E 0C 01 00 00 65 82 82 00 00 00 55 AA 55 AA ".....e.....U.U.
281 0040 47 00 00 00 6F 6E 6C 79 65 72 2D 63 6E 61 00 00 G...onlyer-cna..
282 0050 00 00 00 00 01 00 00 00 DD 00 10 00 82 00 01 00 ................
283 0060 01 00 01 01 01 01 01 FF FF FF 01 01 FF FF FF FF ................
284 0070 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
285 0080 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
286 0090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
287 00A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
288 00B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FC ...............
289 */
290
291
292 #define D2GAME_CLIENT_PLAYERSAVE 0x65
293 typedef struct
294 {
295 t_d2game_header h;
296 bn_byte size;
297 bn_int total_size;
298 /* player save file */
299 /* an append */
300 } t_d2game_client_playersave;
301
302
303 #define D2GAME_SERVER_ERROR 0x9c
304 typedef struct
305 {
306 t_d2game_header h;
307 bn_int errorno;
308 } t_d2game_server_error;
309
310 #define D2GAME_SERVER_ERROR_UNKNOWN_FAILURE 0 /* error biger than 22 is also unknown */
311 #define D2GAME_SERVER_ERROR_CHAR_VER 1
312 #define D2GAME_SERVER_ERROR_QUEST_DATA 2
313 #define D2GAME_SERVER_ERROR_WP_DATA 3
314 #define D2GAME_SERVER_ERROR_STAT_DATA 4
315 #define D2GAME_SERVER_ERROR_SKILL_DATA 5
316 #define D2GAME_SERVER_ERROR_UNABLE_ENTER 6
317 #define D2GAME_SERVER_ERROR_INVENTORY_DATA 7
318 #define D2GAME_SERVER_ERROR_DEAD_BODY 8
319 #define D2GAME_SERVER_ERROR_HEADER 9
320 #define D2GAME_SERVER_ERROR_HIREABLES 10
321 #define D2GAME_SERVER_ERROR_INTRO_DATA 11
322 #define D2GAME_SERVER_ERROR_ITEM 12
323 #define D2GAME_SERVER_ERROR_DEAD_BODY_ITEM 13
324 #define D2GAME_SERVER_ERROR_GENERIC_BAD_FILE 14
325 #define D2GAME_SERVER_ERROR_GAME_FULL 15
326 #define D2GAME_SERVER_ERROR_GAME_VER 16
327 #define D2GAME_SERVER_ERROR_NIGHTMARE 17
328 #define D2GAME_SERVER_ERROR_HELL 18
329 #define D2GAME_SERVER_ERROR_NORMAL_HARDCORE 19
330 #define D2GAME_SERVER_ERROR_HARDCORE_NORMAL 20
331 #define D2GAME_SERVER_ERROR_DEAD_HARDCORE 21
332 /*
333 0000: 15 01 00 69 20 77 69 6C 6C 20 67 6F 00 00 00 ...i will go...
334
335 0000: 15 01 00 74 68 61 6E 6B 73 20 66 6F 72 20 79 6F ...thanks for yo
336 0010: 75 72 20 68 65 6C 70 00 00 00 ur help...
337
338 0000: 15 01 00 73 65 65 20 75 00 00 00 ...see u...
339
340
341 */
342
343 #define D2GAME_CLIENT_CHAT_MESSAGE 0x15
344 typedef struct
345 {
346 t_d2game_header h;
347 bn_short unknown1;
348 /* chat message */
349 } t_d2game_client_chat_message;
350
351
352 /*
353 0000: 26 01 00 02 00 00 00 00 00 01 6F 6E 6C 79 65 72 &.........onlyer
354 0010: 2D 63 6E 61 61 00 69 20 77 69 6C 6C 20 67 6F 00 -cnaa.i will go.
355
356 0000: 26 01 00 02 00 00 00 00 00 01 6F 6E 6C 79 65 72 &.........onlyer
357 0010: 2D 63 6E 61 61 00 74 68 61 6E 6B 73 20 66 6F 72 -cnaa.thanks for
358 0020: 20 79 6F 75 72 20 68 65 6C 70 00 your help.
359
360 0000: 26 01 00 02 00 00 00 00 00 01 6F 6E 6C 79 65 72 &.........onlyer
361 0010: 2D 63 6E 61 61 00 73 65 65 20 75 00 -cnaa.see u.
362
363 0000: 26 01 00 02 00 00 00 00 00 17 63 63 00 62 79 65 &.........cc.bye
364 0010: 00 67 49 00 00 00 01 86 17 32 12 01 00 07 00 05 .gI......2......
365
366 */
367
368 #define D2GAME_SERVER_CHAT_MESSAGE 0x26
369 typedef struct
370 {
371 t_d2game_header h;
372 bn_short unknown1;
373 bn_int unknown2;
374 bn_short unknown3;
375 bn_byte unknown4; /* id or token? a fixed number for each char*/
376 /* player name */
377 /* message */
378 } t_d2game_server_chat_message;
379
380 #define D2GAME_SERVER_CHAT_MESSAGE_UNKNOWN1 0x0001
381 #define D2GAME_SERVER_CHAT_MESSAGE_UNKNOWN2 0x00000002
382 #define D2GAME_SERVER_CHAT_MESSAGE_UNKNOWN3 0x0000
383 #define D2GAME_SERVER_CHAT_MESSAGE_UNKNOWN4 0x01
384
385
386 /*
387 0000: 62 b
388 */
389
390 #define D2GAME_CLIENT_QUITGAME 0x62
391 typedef struct
392 {
393 t_d2game_header h;
394 } t_d2game_client_quitgame;
395
396
397 /*
398 0000: 9B FF 01 4E 03 00 00 55 AA 55 AA 47 00 00 00 6F ...N...U.U.G...o
399 0010: 6E 6C 79 65 72 2D 63 6E 61 61 00 00 00 00 00 00 nlyer-cnaa......
400 0020: 00 00 00 DD 00 10 00 82 00 01 00 01 00 FF FF FF ................
401 0030: FF FF 53 FF FF FF FF FF FF FF FF FF FF FF FF FF ..S.............
402 0040: FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 FF ................
403 0050: 00 FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 00 24 00 ..............$.
404 0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
405 0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
406 0080: 00 00 00 00 00 5E 17 41 5F 57 6F 6F 21 06 00 00 .....^.A_Woo!...
407 0090: 00 2A 01 01 00 00 00 00 00 00 00 00 00 00 00 00 .*..............
408 00A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
409 00B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
410 00C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
411 00D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
412 00E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
413 00F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
414 0100: 00 00 00 00 00 00 ......
415
416
417
418
419 */
420
421 #define D2GAME_SERVER_PLAYERSAVE 0x9b
422 typedef struct
423 {
424 t_d2game_header h;
425 bn_byte size;
426 bn_byte start;
427 bn_int total_size;
428 /* player save file */
429 } t_d2game_server_playersave;
430
431
432 /*
433 0000: 98 05 06
434 */
435
436 #define D2GAME_SERVER_CLOSEGAME 0x98
437 typedef struct
438 {
439 t_d2game_header h;
440 bn_short unknown1;
441 } t_d2game_server_closegame;
442
443 /*
444 0000: 5A 02 04 00 00 00 00 03 61 72 63 68 5F 6E 61 67 Z.......arch_nag
445 0010: 61 00 00 00 B0 FD B6 08 00 FF FF FF 78 07 39 04 a...........x.9.
446 0020: D5 16 2D 04 01 FD B6 08 ..-.....
447 */
448
449 #define D2GAME_SERVER_JOINGAME_MESSAGE 0x5a
450 typedef struct
451 {
452 t_d2game_header h;
453 bn_byte unknown1;
454 bn_byte unknown2;
455 bn_int unknown3;
456 bn_byte unknown4;
457 /* char name */
458 } t_d2game_joingame_message;
459
460
461
462 #define D2GAME_CLIENT_DIE 0x41
463 typedef struct
464 {
465 t_d2game_header h;
466 } t_d2game_client_die;
467
468
469 /*
470 0000: 02 73 00 00 00 4E 00 8B 0F 7B 14 00 00 .s...N...{...
471
472 #define D2GAME_SERVER_UNKNOWN_2 0x2
473
474 */
475
476 /*
477 0000: 67 06 00 00 00 01 B2 0F 6B 14 01 00 07 00 05 g.......k......
478
479 0000: 67 06 00 00 00 01 B2 0F 71 14 01 00 07 00 05 g.......q......
480
481 0000: 67 0A 00 00 00 01 72 0F 63 14 01 00 07 00 05 g.....r.c......
482
483
484 #define D2GAME_SERVER_UNKNOWN_67 0x67
485
486 */
487
488
489 /*
490 0000: 6D 0A 00 00 00 76 0F 64 14 80 m....v.d..
491
492 0000: 6D 0A 00 00 00 72 0F 63 14 80 m....r.c..
493
494 0000: 6D 06 00 00 00 B2 0F 71 14 80 8A 01 0B 00 00 00 m......q........
495
496 0000: 6D 06 00 00 00 B2 0F 6B 14 80 m......k..
497
498
499
500 #define D2GAME_SERVER_UNKNOWN_6D 0x6d
501
502 */
503
504 /*
505 0000: 8A 01 0B 00 00 00 6D 0B 00 00 00 9B 0F 70 14 80 ......m......p..
506 0010: 2C 01 0B 00 00 00 11 00 ,.......
507
508 0000: 8A 01 0B 00 00 00 ......
509
510
511 #define D2GAME_SERVER_UNKNOWN_8A 0x8a
512
513 */
514
515
516 /*
517 0000: 96 59 80 CC 07 36 8A 4C 36 .Y...6.L6
518
519 #define D2GAME_SERVER_UNKNOWN_96 0x96
520
521 */
522
523 /*
524 0000: 24 62 00 00 00 $b...
525
526 #define D2GAME_CLIENT_UNKNOWN_24 0x24
527
528 */
529
530
531 /*
532 CLIENT:
533
534 0000: 2F 01 00 00 00 49 00 00 00 /....I...
535
536 0000: 31 49 00 00 00 00 00 00 00 1I.......
537
538 0000: 30 01 00 00 00 49 00 00 00 0....I...
539
540 0000: 03 8C 17 2E 12 .....
541
542 0000: 03 87 17 27 12 ...'. command ?
543
544
545
546 SERVER:
547
548
549 */
550
551 #endif

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1