| 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_GAMERESULT_TYPES |
| 17 | #define INCLUDED_ANONGAME_GAMERESULT_TYPES |
| 18 | |
| 19 | namespace pvpgn |
| 20 | { |
| 21 | |
| 22 | namespace bnetd |
| 23 | { |
| 24 | |
| 25 | #ifdef ANONGAME_GAMERESULT_INTERNAL_ACCESS |
| 26 | typedef struct |
| 27 | { |
| 28 | char number; |
| 29 | int result; |
| 30 | int race; |
| 31 | } t_anongame_player; |
| 32 | |
| 33 | typedef struct |
| 34 | { |
| 35 | int level; |
| 36 | int race_and_name; |
| 37 | int hero_xp; |
| 38 | } t_anongame_hero; |
| 39 | #endif |
| 40 | |
| 41 | typedef struct anongame_gameresult_struct |
| 42 | #ifdef ANONGAME_GAMERESULT_INTERNAL_ACCESS |
| 43 | { |
| 44 | char number_of_results; |
| 45 | t_anongame_player *players; |
| 46 | int unit_score; |
| 47 | int heroes_score; |
| 48 | int resource_score; |
| 49 | int units_produced; |
| 50 | int units_killed; |
| 51 | int buildings_produced; |
| 52 | int buildings_razed; |
| 53 | int largest_army; |
| 54 | int heroes_used_count; |
| 55 | t_anongame_hero *heroes; |
| 56 | int heroes_killed; |
| 57 | int items_obtained; |
| 58 | int mercenaries_hired; |
| 59 | int total_hero_xp; |
| 60 | int gold_mined; |
| 61 | int lumber_harvested; |
| 62 | int resources_traded_given; |
| 63 | int resources_traded_taken; |
| 64 | int tech_percentage; |
| 65 | int gold_lost_to_upkeep; |
| 66 | } |
| 67 | #endif |
| 68 | t_anongame_gameresult; |
| 69 | |
| 70 | } |
| 71 | |
| 72 | } |
| 73 | |
| 74 | #endif |
| 75 | |
| 76 | #ifndef JUST_NEED_TYPES |
| 77 | #ifndef INCLUDED_ANONGAME_GAMERESULT_PROTOS |
| 78 | #define INCLUDED_ANONGAME_GAMERESULT_PROTOS |
| 79 | |
| 80 | #define JUST_NEED_TYPES |
| 81 | # include "common/packet.h" |
| 82 | #undef JUST_NEED_TYPES |
| 83 | |
| 84 | namespace pvpgn |
| 85 | { |
| 86 | |
| 87 | namespace bnetd |
| 88 | { |
| 89 | |
| 90 | extern t_anongame_gameresult * anongame_gameresult_parse(t_packet const * const packet); |
| 91 | extern int gameresult_destroy(t_anongame_gameresult * gameresult); |
| 92 | |
| 93 | extern char gameresult_get_number_of_results(t_anongame_gameresult * gameresult); |
| 94 | extern int gameresult_get_player_result(t_anongame_gameresult * gameresult, int player); |
| 95 | extern int gameresult_get_player_number(t_anongame_gameresult * gameresult, int player); |
| 96 | |
| 97 | } |
| 98 | |
| 99 | } |
| 100 | |
| 101 | #endif |
| 102 | #endif |