| 1 | /* |
| 2 | * Copyright (C) 2014 HarpyWar ([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_ICONS_TYPES |
| 19 | #define INCLUDED_ICONS_TYPES |
| 20 | |
| 21 | namespace pvpgn |
| 22 | { |
| 23 | |
| 24 | namespace bnetd |
| 25 | { |
| 26 | |
| 27 | typedef struct |
| 28 | { |
| 29 | unsigned int rating; // rating or something else |
| 30 | char * rank; // any string value |
| 31 | char * icon_code; // icon code |
| 32 | } t_icon_info; |
| 33 | |
| 34 | typedef struct |
| 35 | { |
| 36 | char * clienttag; |
| 37 | char * attr_key; |
| 38 | t_list * icon_info; // list of t_icon_info |
| 39 | t_list * iconstash; // list of t_icon_var_info |
| 40 | |
| 41 | t_list * vars; // list of t_icon_var_info |
| 42 | const char * stats; |
| 43 | } t_iconset_info; |
| 44 | |
| 45 | typedef struct |
| 46 | { |
| 47 | char * key; |
| 48 | char * value; |
| 49 | } t_icon_var_info; |
| 50 | } |
| 51 | |
| 52 | } |
| 53 | |
| 54 | #endif |
| 55 | |
| 56 | #ifndef JUST_NEED_TYPES |
| 57 | #ifndef INCLUDED_ICONS_PROTOS |
| 58 | #define INCLUDED_ICONS_PROTOS |
| 59 | |
| 60 | #define JUST_NEED_TYPES |
| 61 | # include "account.h" |
| 62 | #undef JUST_NEED_TYPES |
| 63 | |
| 64 | namespace pvpgn |
| 65 | { |
| 66 | |
| 67 | namespace bnetd |
| 68 | { |
| 69 | extern int handle_icon_command(t_connection * c, char const *text); |
| 70 | extern char const * customicons_stash_find(t_clienttag clienttag, char const * code, bool return_alias = false); |
| 71 | extern std::string customicons_stash_get_list(t_clienttag clienttag, bool return_alias = false); |
| 72 | |
| 73 | extern int prefs_get_custom_icons(); |
| 74 | extern bool customicons_allowed_by_client(t_clienttag clienttag); |
| 75 | extern t_icon_info * customicons_get_icon_by_account(t_account * account, t_clienttag clienttag); |
| 76 | extern const char * customicons_get_stats_text(t_account * account, t_clienttag clienttag); |
| 77 | extern t_icon_info * customicons_get_icon_by_rating(int rating, char * clienttag); |
| 78 | |
| 79 | |
| 80 | extern int customicons_load(char const * filename); |
| 81 | extern int customicons_unload(void); |
| 82 | |
| 83 | } |
| 84 | |
| 85 | } |
| 86 | |
| 87 | /*****/ |
| 88 | #endif |
| 89 | #endif |