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