forked from pvpgn/d2gs109
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathd2cs_d2gs_protocol.h
143 lines (123 loc) · 2.74 KB
/
d2cs_d2gs_protocol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#ifndef INCLUDED_D2CS_D2GS_PROTOCOL_H
#define INCLUDED_D2CS_D2GS_PROTOCOL_H
/*
* there is only little comments in this header file
* check the documents for more details
*/
/* include your own header files here */
#ifdef D2CS
# include "common/bn_type.h"
#endif
#ifdef D2GS
# include "bn_types.h"
#pragma pack(push, pack01, 1)
#endif
typedef struct
{
bn_short size;
bn_short type;
bn_int seqno; /* seqno, set by the sender */
} t_d2cs_d2gs_header;
typedef struct
{
t_d2cs_d2gs_header h;
} t_d2cs_d2gs_generic;
#define D2CS_D2GS_AUTHREQ 0x10
typedef struct
{
t_d2cs_d2gs_header h;
bn_int sessionnum;
/* realm name */
} t_d2cs_d2gs_authreq;
#define D2GS_D2CS_AUTHREPLY 0x11
typedef struct
{
t_d2cs_d2gs_header h;
bn_int version;
bn_int checksum;
} t_d2gs_d2cs_authreply;
#define D2CS_D2GS_AUTHREPLY 0x11
typedef struct
{
t_d2cs_d2gs_header h;
bn_int reply;
} t_d2cs_d2gs_authreply;
#define D2CS_D2GS_AUTHREPLY_SUCCEED 0x00
#define D2CS_D2GS_AUTHREPLY_BAD_VERSION 0x01
#define D2CS_D2GS_AUTHREPLY_BAD_CHECKSUM 0x02
#define D2GS_D2CS_SETGSINFO 0x12
typedef struct
{
t_d2cs_d2gs_header h;
bn_int maxgame;
} t_d2gs_d2cs_setgsinfo;
#define D2CS_D2GS_ECHOREQ 0x13
typedef struct {
t_d2cs_d2gs_header h;
} t_d2cs_d2gs_echoreq;
#define D2GS_D2CS_ECHOREPLY 0x13
typedef struct {
t_d2cs_d2gs_header h;
} t_d2gs_d2cs_echoreply;
#define D2CS_D2GS_CREATEGAMEREQ 0x20
typedef struct
{
t_d2cs_d2gs_header h;
bn_byte expansion;
bn_byte difficulty;
bn_byte hardcore;
/* gamename */
} t_d2cs_d2gs_creategamereq;
#define D2GAME_DIFFICULTY_NORMAL 0
#define D2GAME_DIFFICULTY_NIGHTMARE 1
#define D2GAME_DIFFICULTY_HELL 2
#define D2GS_D2CS_CREATEGAMEREPLY 0x20
typedef struct
{
t_d2cs_d2gs_header h;
bn_int result;
bn_int gameid;
} t_d2gs_d2cs_creategamereply;
#define D2GS_D2CS_CREATEGAME_SUCCEED 0
#define D2GS_D2CS_CREATEGAME_FAILED 1
#define D2CS_D2GS_JOINGAMEREQ 0x21
typedef struct
{
t_d2cs_d2gs_header h;
bn_int gameid;
bn_int token;
/* character name */
/* account name */
} t_d2cs_d2gs_joingamereq;
#define D2GS_D2CS_JOINGAMEREPLY 0x21
typedef struct
{
t_d2cs_d2gs_header h;
bn_int result;
bn_int gameid;
} t_d2gs_d2cs_joingamereply;
#define D2GS_D2CS_JOINGAME_SUCCEED 0
#define D2GS_D2CS_JOINGAME_FAILED 1
#define D2GS_D2CS_UPDATEGAMEINFO 0x22
typedef struct
{
t_d2cs_d2gs_header h;
bn_int flag;
bn_int gameid;
bn_int charlevel;
bn_int charclass;
/* charname */
} t_d2gs_d2cs_updategameinfo;
#define D2GS_D2CS_UPDATEGAMEINFO_FLAG_UPDATE 0
#define D2GS_D2CS_UPDATEGAMEINFO_FLAG_ENTER 1
#define D2GS_D2CS_UPDATEGAMEINFO_FLAG_LEAVE 2
#define D2GS_D2CS_CLOSEGAME 0x23
typedef struct
{
t_d2cs_d2gs_header h;
bn_int gameid;
} t_d2gs_d2cs_closegame;
#ifdef D2GS
#pragma pack(pop, pack01)
#endif
#endif