Debian Codegraph @

src/bnetd/character.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2000 Ross Combs ([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_CHARACTER_TYPES
19 #define INCLUDED_CHARACTER_TYPES
20
21 #include <cstdint>
22
23 namespace pvpgn
24 {
25
26 namespace bnetd
27 {
28
29 typedef enum
30 {
31 character_class_none,
32 character_class_amazon,
33 character_class_sorceress,
34 character_class_necromancer,
35 character_class_paladin,
36 character_class_barbarian,
37 character_class_druid,
38 character_class_assassin
39 } t_character_class;
40
41 typedef enum
42 {
43 character_expansion_none,
44 character_expansion_classic,
45 character_expansion_lod
46 } t_character_expansion;
47
48 typedef struct character
49 #ifdef CHARACTER_INTERNAL_ACCESS
50 {
51 char const * name; /* max 15 chars */
52 char const * realmname;
53 char const * guildname; /* max 3 chars */
54
55 /* stored in Battle.net format for now */
56 std::uint8_t helmgfx;
57 std::uint8_t bodygfx;
58 std::uint8_t leggfx;
59 std::uint8_t lhandweapon;
60 std::uint8_t lhandgfx;
61 std::uint8_t rhandweapon;
62 std::uint8_t rhandgfx;
63 std::uint8_t chclass;
64 std::uint8_t level;
65 std::uint8_t status;
66 std::uint8_t title;
67 std::uint8_t emblembgc;
68 std::uint8_t emblemfgc;
69 std::uint8_t emblemnum;
70
71 /* not sure what these represent */
72 std::uint32_t unknown1;
73 std::uint32_t unknown2;
74 std::uint32_t unknown3;
75 std::uint32_t unknown4;
76 std::uint8_t unknownb1;
77 std::uint8_t unknownb2;
78 std::uint8_t unknownb3;
79 std::uint8_t unknownb4;
80 std::uint8_t unknownb5;
81 std::uint8_t unknownb6;
82 std::uint8_t unknownb7;
83 std::uint8_t unknownb8;
84 std::uint8_t unknownb9;
85 std::uint8_t unknownb10;
86 std::uint8_t unknownb11;
87 std::uint8_t unknownb13;
88 std::uint8_t unknownb14;
89
90 /* Keep some generic "data", basically the blob that is sent between client and server, in an array */
91 std::uint8_t data[64];
92 std::uint8_t datalen;
93 }
94 #endif
95 t_character;
96
97 }
98
99 }
100
101 #endif
102
103
104 /*****/
105 #ifndef JUST_NEED_TYPES
106 #ifndef INCLUDED_CHARACTER_PROTOS
107 #define INCLUDED_CHARACTER_PROTOS
108
109 #define JUST_NEED_TYPES
110 #include "account.h"
111 #undef JUST_NEED_TYPES
112
113 namespace pvpgn
114 {
115
116 namespace bnetd
117 {
118
119 extern int character_create(t_account * account, t_clienttag clienttag, char const * realmname, char const * name, t_character_class chclass, t_character_expansion expansion);
120 extern char const * character_get_name(t_character const * ch);
121 extern char const * character_get_realmname(t_character const * ch);
122 extern char const * character_get_playerinfo(t_character const * ch);
123 extern char const * character_get_guildname(t_character const * ch);
124 extern t_character_class character_get_class(t_character const * ch);
125 extern int character_verify_charlist(t_character const * ch, char const * charlist);
126
127 extern int characterlist_create(char const * dirname);
128 extern int characterlist_destroy(void);
129 extern t_character * characterlist_find_character(char const * realmname, char const * charname);
130
131 }
132
133 }
134
135 #endif
136 #endif