Debian Codegraph @

src/d2dbs/dbspacket.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2001 faster ([email protected])
3 * Copyright (C) 2001 sousou ([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_DBSPACKET_H
20 #define INCLUDED_DBSPACKET_H
21
22 #include "common/bn_type.h"
23 #include "dbserver.h"
24
25 namespace pvpgn
26 {
27
28 namespace d2dbs
29 {
30
31 typedef struct {
32 bn_short size;
33 bn_short type;
34 bn_int seqno;
35 } t_d2dbs_d2gs_header;
36
37 typedef struct {
38 bn_byte cclass;
39 } t_d2gs_d2dbs_connect;
40 #define CONNECT_CLASS_D2GS_TO_D2DBS 0x65
41
42 #define D2GS_D2DBS_SAVE_DATA_REQUEST 0x30
43 typedef struct {
44 t_d2dbs_d2gs_header h;
45 bn_short datatype;
46 bn_short datalen;
47 /* AccountName */
48 /* CharName */
49 /* data */
50 } t_d2gs_d2dbs_save_data_request;
51 #define D2GS_DATA_CHARSAVE 0x01
52 #define D2GS_DATA_PORTRAIT 0x02
53
54 #define D2DBS_D2GS_SAVE_DATA_REPLY 0x30
55 typedef struct {
56 t_d2dbs_d2gs_header h;
57 bn_int result;
58 bn_short datatype;
59 /* CharName */
60 } t_d2dbs_d2gs_save_data_reply;
61 #define D2DBS_SAVE_DATA_SUCCESS 0
62 #define D2DBS_SAVE_DATA_FAILED 1
63
64 #define D2GS_D2DBS_GET_DATA_REQUEST 0x31
65 typedef struct {
66 t_d2dbs_d2gs_header h;
67 bn_short datatype;
68 /* AccountName */
69 /* CharName */
70 } t_d2gs_d2dbs_get_data_request;
71
72 #define D2DBS_D2GS_GET_DATA_REPLY 0x31
73 typedef struct {
74 t_d2dbs_d2gs_header h;
75 bn_int result;
76 bn_int charcreatetime;
77 bn_int allowladder;
78 bn_short datatype;
79 bn_short datalen;
80 /* CharName */
81 /* data */
82 } t_d2dbs_d2gs_get_data_reply;
83
84 #define D2DBS_GET_DATA_SUCCESS 0
85 #define D2DBS_GET_DATA_FAILED 1
86 #define D2DBS_GET_DATA_CHARLOCKED 2
87
88 #define D2GS_D2DBS_UPDATE_LADDER 0x32
89 typedef struct {
90 t_d2dbs_d2gs_header h;
91 bn_int charlevel;
92 bn_int charexplow;
93 bn_int charexphigh;
94 bn_short charclass;
95 bn_short charstatus;
96 /* CharName */
97 /* RealmName */
98 } t_d2gs_d2dbs_update_ladder;
99
100 #define D2GS_D2DBS_CHAR_LOCK 0x33
101 typedef struct {
102 t_d2dbs_d2gs_header h;
103 bn_int lockstatus;
104 /* CharName */
105 /* RealmName */
106 } t_d2gs_d2dbs_char_lock;
107
108 #define D2DBS_D2GS_ECHOREQUEST 0x34
109 typedef struct {
110 t_d2dbs_d2gs_header h;
111 } t_d2dbs_d2gs_echorequest;
112
113 #define D2GS_D2DBS_ECHOREPLY 0x34
114 typedef struct {
115 t_d2dbs_d2gs_header h;
116 } t_d2gs_d2dbs_echoreply;
117
118
119 extern int dbs_packet_handle(t_d2dbs_connection * conn);
120 extern int dbs_keepalive(void);
121 extern int dbs_check_timeout(void);
122
123 }
124
125 }
126
127 #endif