Debian Codegraph @

src/common/d2cs_bnetd_protocol.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2000,2001 Onlyer ([email protected])
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18 #ifndef INCLUDED_D2CS_BNETD_PROTOCOL_H
19 #define INCLUDED_D2CS_BNETD_PROTOCOL_H
20
21 #include "common/bn_type.h"
22
23 namespace pvpgn
24 {
25
26 typedef struct
27 {
28 bn_short size;
29 bn_short type;
30 bn_int seqno; /* seqno, set by the sender */
31 } t_d2cs_bnetd_header;
32
33 typedef struct
34 {
35 t_d2cs_bnetd_header h;
36 } t_d2cs_bnetd_generic;
37
38 #define BNETD_D2CS_AUTHREQ 0x01
39 typedef struct
40 {
41 t_d2cs_bnetd_header h;
42 bn_int sessionnum;
43 } t_bnetd_d2cs_authreq;
44
45 #define D2CS_BNETD_AUTHREPLY 0x02
46 typedef struct
47 {
48 t_d2cs_bnetd_header h;
49 bn_int version;
50 /* realm name */
51 } t_d2cs_bnetd_authreply;
52
53 #define BNETD_D2CS_AUTHREPLY 0x02
54 typedef struct
55 {
56 t_d2cs_bnetd_header h;
57 bn_int reply;
58 } t_bnetd_d2cs_authreply;
59 #define BNETD_D2CS_AUTHREPLY_SUCCEED 0x00
60 #define BNETD_D2CS_AUTHREPLY_BAD_VERSION 0x01
61
62 #define D2CS_BNETD_ACCOUNTLOGINREQ 0x10
63 typedef struct
64 {
65 t_d2cs_bnetd_header h;
66 bn_int seqno;
67 bn_int sessionnum;
68 bn_int sessionkey;
69 bn_int secret_hash[5];
70 /* account name */
71 } t_d2cs_bnetd_accountloginreq;
72
73 #define BNETD_D2CS_ACCOUNTLOGINREPLY 0x10
74 typedef struct
75 {
76 t_d2cs_bnetd_header h;
77 bn_int reply;
78 } t_bnetd_d2cs_accountloginreply;
79 #define BNETD_D2CS_ACCOUNTLOGINREPLY_SUCCEED 0x00
80 #define BNETD_D2CS_ACCOUNTLOGINREPLY_FAILED 0x01
81
82 #define D2CS_BNETD_CHARLOGINREQ 0x11
83 typedef struct
84 {
85 t_d2cs_bnetd_header h;
86 bn_int sessionnum;
87 /* character name */
88 /* character portrait */
89 } t_d2cs_bnetd_charloginreq;
90
91 #define BNETD_D2CS_CHARLOGINREPLY 0x11
92 typedef struct
93 {
94 t_d2cs_bnetd_header h;
95 bn_int reply;
96 } t_bnetd_d2cs_charloginreply;
97 #define BNETD_D2CS_CHARLOGINREPLY_SUCCEED 0x00
98 #define BNETD_D2CS_CHARLOGINREPLY_FAILED 0x01
99
100 #define BNETD_D2CS_GAMEINFOREQ 0x12
101 typedef struct
102 {
103 t_d2cs_bnetd_header h;
104 /* gamename */
105 } t_bnetd_d2cs_gameinforeq;
106
107 #define D2CS_BNETD_GAMEINFOREPLY 0x12
108 typedef struct
109 {
110 t_d2cs_bnetd_header h;
111 bn_byte difficulty;
112 /* gamename */
113 } t_d2cs_bnetd_gameinforeply;
114
115 }
116
117 #endif