character.h
上传用户:tany51
上传日期:2013-06-12
资源大小:1397k
文件大小:4k
源码类别:

MySQL数据库

开发平台:

Visual C++

  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. #ifdef CHARACTER_INTERNAL_ACCESS
  21. #ifdef JUST_NEED_TYPES
  22. # include "compat/uint.h"
  23. #else
  24. # define JUST_NEED_TYPES
  25. # include "compat/uint.h"
  26. # undef JUST_NEED_TYPES
  27. #endif
  28. #endif
  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. typedef enum
  41. {
  42.     character_expansion_none,
  43.     character_expansion_classic,
  44.     character_expansion_lod
  45. } t_character_expansion;
  46. typedef struct character
  47. #ifdef CHARACTER_INTERNAL_ACCESS
  48. {
  49.     char const * name; /* max 15 chars */
  50.     char const * realmname;
  51.     char const * guildname; /* max 3 chars */
  52.     
  53.     /* stored in Battle.net format for now */
  54.     t_uint8      helmgfx;
  55.     t_uint8      bodygfx;
  56.     t_uint8      leggfx;
  57.     t_uint8      lhandweapon;
  58.     t_uint8      lhandgfx;
  59.     t_uint8      rhandweapon;
  60.     t_uint8      rhandgfx;
  61.     t_uint8      class;
  62.     t_uint8      level;
  63.     t_uint8      status;
  64.     t_uint8      title;
  65.     t_uint8      emblembgc;
  66.     t_uint8      emblemfgc;
  67.     t_uint8      emblemnum;
  68.     /* not sure what these represent */
  69.     t_uint32     unknown1;
  70.     t_uint32     unknown2;
  71.     t_uint32     unknown3;
  72.     t_uint32     unknown4;
  73.     t_uint8      unknownb1;
  74.     t_uint8      unknownb2;
  75.     t_uint8      unknownb3;
  76.     t_uint8      unknownb4;
  77.     t_uint8      unknownb5;
  78.     t_uint8      unknownb6;
  79.     t_uint8      unknownb7;
  80.     t_uint8      unknownb8;
  81.     t_uint8      unknownb9;
  82.     t_uint8      unknownb10;
  83.     t_uint8      unknownb11;
  84.     t_uint8      unknownb13;
  85.     t_uint8      unknownb14;
  86.     /* Keep some generic "data", basically the blob that is sent between client and server, in an array */
  87.     t_uint8      data[64];
  88.     t_uint8      datalen;
  89. }
  90. #endif
  91. t_character;
  92. #endif
  93. /*****/
  94. #ifndef JUST_NEED_TYPES
  95. #ifndef INCLUDED_CHARACTER_PROTOS
  96. #define INCLUDED_CHARACTER_PROTOS
  97. #define JUST_NEED_TYPES
  98. #include "compat/uint.h"
  99. #include "account.h"
  100. #undef JUST_NEED_TYPES
  101. extern int character_create(t_account * account, char const * clienttag, char const * realmname, char const * name, t_character_class class, t_character_expansion expansion);
  102. extern char const * character_get_name(t_character const * ch);
  103. extern char const * character_get_realmname(t_character const * ch);
  104. extern char const * character_get_playerinfo(t_character const * ch);
  105. extern char const * character_get_guildname(t_character const * ch);
  106. extern t_character_class character_get_class(t_character const * ch);
  107. extern int character_verify_charlist(t_character const * ch, char const * charlist);
  108. extern int characterlist_create(char const * dirname);
  109. extern int characterlist_destroy(void);
  110. extern t_character * characterlist_find_character(char const * realmname, char const * charname);
  111. #endif
  112. #endif