| 1 | /* |
| 2 | * This program is free software; you can redistribute it and/or |
| 3 | * modify it under the terms of the GNU General Public License |
| 4 | * as published by the Free Software Foundation; either version 2 |
| 5 | * of the License, or (at your option) any later version. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | * You should have received a copy of the GNU General Public License |
| 13 | * along with this program; if not, write to the Free Software |
| 14 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 15 | */ |
| 16 | #ifndef INCLUDED_ANONGAME_INFOS_TYPES |
| 17 | #define INCLUDED_ANONGAME_INFOS_TYPES |
| 18 | |
| 19 | #ifdef JUST_NEED_TYPES |
| 20 | #include "common/list.h" |
| 21 | #else |
| 22 | #define JUST_NEED_TYPES |
| 23 | #include "common/list.h" |
| 24 | #undef JUST_NEED_TYPES |
| 25 | #endif |
| 26 | |
| 27 | #define anongame_infos_URL_count 14 |
| 28 | |
| 29 | namespace pvpgn |
| 30 | { |
| 31 | |
| 32 | namespace bnetd |
| 33 | { |
| 34 | |
| 35 | typedef enum |
| 36 | { |
| 37 | URL_server, |
| 38 | URL_player, |
| 39 | URL_tourney, |
| 40 | URL_clan, |
| 41 | |
| 42 | URL_ladder_PG_1v1, |
| 43 | URL_ladder_PG_ffa, |
| 44 | URL_ladder_PG_team, |
| 45 | |
| 46 | URL_ladder_AT_2v2, |
| 47 | URL_ladder_AT_3v3, |
| 48 | URL_ladder_AT_4v4, |
| 49 | |
| 50 | URL_ladder_clan_1v1, |
| 51 | URL_ladder_clan_2v2, |
| 52 | URL_ladder_clan_3v3, |
| 53 | URL_ladder_clan_4v4 |
| 54 | } t_anongame_infos_URLs; |
| 55 | |
| 56 | #define anongame_infos_DESC_count 38 |
| 57 | |
| 58 | typedef enum { |
| 59 | ladder_PG_1v1_desc, |
| 60 | ladder_PG_ffa_desc, |
| 61 | ladder_PG_team_desc, |
| 62 | |
| 63 | ladder_AT_2v2_desc, |
| 64 | ladder_AT_3v3_desc, |
| 65 | ladder_AT_4v4_desc, |
| 66 | |
| 67 | ladder_clan_1v1_desc, |
| 68 | ladder_clan_2v2_desc, |
| 69 | ladder_clan_3v3_desc, |
| 70 | ladder_clan_4v4_desc, |
| 71 | |
| 72 | gametype_1v1_short, |
| 73 | gametype_1v1_long, |
| 74 | gametype_2v2_short, |
| 75 | gametype_2v2_long, |
| 76 | gametype_3v3_short, |
| 77 | gametype_3v3_long, |
| 78 | gametype_4v4_short, |
| 79 | gametype_4v4_long, |
| 80 | gametype_ffa_short, |
| 81 | gametype_ffa_long, |
| 82 | gametype_2v2v2_short, |
| 83 | gametype_2v2v2_long, |
| 84 | |
| 85 | gametype_sffa_short, |
| 86 | gametype_sffa_long, |
| 87 | gametype_tffa_short, |
| 88 | gametype_tffa_long, |
| 89 | gametype_3v3v3_short, |
| 90 | gametype_3v3v3_long, |
| 91 | gametype_4v4v4_short, |
| 92 | gametype_4v4v4_long, |
| 93 | gametype_2v2v2v2_short, |
| 94 | gametype_2v2v2v2_long, |
| 95 | gametype_3v3v3v3_short, |
| 96 | gametype_3v3v3v3_long, |
| 97 | gametype_5v5_short, |
| 98 | gametype_5v5_long, |
| 99 | gametype_6v6_short, |
| 100 | gametype_6v6_long |
| 101 | } t_anongame_infos_DESCs; |
| 102 | |
| 103 | typedef struct |
| 104 | { |
| 105 | char * langID; |
| 106 | char ** descs; |
| 107 | } t_anongame_infos_DESC; |
| 108 | |
| 109 | #define anongame_infos_THUMBSDOWN_count 17 |
| 110 | |
| 111 | typedef enum { |
| 112 | PG_1v1, |
| 113 | PG_2v2, |
| 114 | PG_3v3, |
| 115 | PG_4v4, |
| 116 | PG_ffa, |
| 117 | AT_2v2, |
| 118 | AT_3v3, |
| 119 | AT_4v4, |
| 120 | PG_2v2v2, |
| 121 | AT_ffa, |
| 122 | PG_5v5, |
| 123 | PG_6v6, |
| 124 | PG_3v3v3, |
| 125 | PG_4v4v4, |
| 126 | PG_2v2v2v2, |
| 127 | PG_3v3v3v3, |
| 128 | AT_2v2v2 |
| 129 | } t_anongame_infos_THUMBDOWNs; |
| 130 | |
| 131 | #define anongame_infos_ICON_REQ_count 14 |
| 132 | |
| 133 | typedef enum { |
| 134 | ICON_REQ_WAR3_Level1, |
| 135 | ICON_REQ_WAR3_Level2, |
| 136 | ICON_REQ_WAR3_Level3, |
| 137 | ICON_REQ_WAR3_Level4, |
| 138 | ICON_REQ_W3XP_Level1, |
| 139 | ICON_REQ_W3XP_Level2, |
| 140 | ICON_REQ_W3XP_Level3, |
| 141 | ICON_REQ_W3XP_Level4, |
| 142 | ICON_REQ_W3XP_Level5, |
| 143 | ICON_REQ_TRNY_Level1, |
| 144 | ICON_REQ_TRNY_Level2, |
| 145 | ICON_REQ_TRNY_Level3, |
| 146 | ICON_REQ_TRNY_Level4, |
| 147 | ICON_REQ_TRNY_Level5 |
| 148 | } t_anongame_infos_ICON_REQs; |
| 149 | |
| 150 | typedef struct { |
| 151 | char * langID; |
| 152 | |
| 153 | char * desc_data; |
| 154 | char * ladr_data; |
| 155 | |
| 156 | char * desc_comp_data; |
| 157 | char * ladr_comp_data; |
| 158 | |
| 159 | int desc_len; |
| 160 | int ladr_len; |
| 161 | |
| 162 | int desc_comp_len; |
| 163 | int ladr_comp_len; |
| 164 | } t_anongame_infos_data_lang; |
| 165 | |
| 166 | typedef struct { |
| 167 | char * langID; |
| 168 | |
| 169 | char * url_comp_data; |
| 170 | char * url_comp_data_115; |
| 171 | char * map_comp_data; |
| 172 | char * type_comp_data; |
| 173 | char * desc_comp_data; |
| 174 | char * ladr_comp_data; |
| 175 | |
| 176 | int url_comp_len; |
| 177 | int url_comp_len_115; |
| 178 | int map_comp_len; |
| 179 | int type_comp_len; |
| 180 | int desc_comp_len; |
| 181 | int ladr_comp_len; |
| 182 | } t_anongame_infos_data; |
| 183 | |
| 184 | typedef struct { |
| 185 | char ** anongame_infos_URL; |
| 186 | t_anongame_infos_DESC * anongame_infos_DESC; /* for default DESC */ |
| 187 | t_list * anongame_infos_DESC_list; /* for localized DESC's */ |
| 188 | char anongame_infos_THUMBSDOWN[anongame_infos_THUMBSDOWN_count]; |
| 189 | int anongame_infos_ICON_REQ[anongame_infos_ICON_REQ_count]; |
| 190 | t_anongame_infos_data * anongame_infos_data_war3; |
| 191 | t_anongame_infos_data * anongame_infos_data_w3xp; |
| 192 | t_list * anongame_infos_data_lang_war3; |
| 193 | t_list * anongame_infos_data_lang_w3xp; |
| 194 | } t_anongame_infos; |
| 195 | |
| 196 | } |
| 197 | |
| 198 | } |
| 199 | |
| 200 | #endif |
| 201 | |
| 202 | #ifndef JUST_NEED_TYPES |
| 203 | #ifndef INCLUDED_ANONGAME_INFOS_PROTOS |
| 204 | #define INCLUDED_ANONGAME_INFOS_PROTOS |
| 205 | |
| 206 | #define JUST_NEED_TYPES |
| 207 | #include "common/tag.h" |
| 208 | #undef JUST_NEED_TYPES |
| 209 | |
| 210 | namespace pvpgn |
| 211 | { |
| 212 | |
| 213 | namespace bnetd |
| 214 | { |
| 215 | |
| 216 | extern int anongame_infos_load(char const * filename); |
| 217 | extern int anongame_infos_unload(void); |
| 218 | |
| 219 | extern char anongame_infos_get_thumbsdown(int queue); |
| 220 | |
| 221 | extern short anongame_infos_get_ICON_REQ(int Level, t_clienttag clienttag); |
| 222 | extern short anongame_infos_get_ICON_REQ_TOURNEY(int Level); |
| 223 | |
| 224 | extern char * anongame_infos_data_get_url(t_clienttag clienttag, int versionid, int * len); |
| 225 | extern char * anongame_infos_data_get_map(t_clienttag clienttag, int versionid, int * len); |
| 226 | extern char * anongame_infos_data_get_type(t_clienttag clienttag, int versionid, int * len); |
| 227 | extern char * anongame_infos_data_get_desc(char const * langID, t_clienttag clienttag, int versionid, int * len); |
| 228 | extern char * anongame_infos_data_get_ladr(char const * langID, t_clienttag clienttag, int versionid, int * len); |
| 229 | |
| 230 | } |
| 231 | |
| 232 | } |
| 233 | |
| 234 | #endif |
| 235 | #endif |