| 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_TOURNAMENT_TYPES |
| 17 | #define INCLUDED_TOURNAMENT_TYPES |
| 18 | |
| 19 | #include <ctime> |
| 20 | |
| 21 | namespace pvpgn |
| 22 | { |
| 23 | |
| 24 | namespace bnetd |
| 25 | { |
| 26 | |
| 27 | typedef struct |
| 28 | { |
| 29 | std::time_t start_preliminary; |
| 30 | std::time_t end_signup; |
| 31 | std::time_t end_preliminary; |
| 32 | std::time_t start_round_1; |
| 33 | std::time_t start_round_2; |
| 34 | std::time_t start_round_3; |
| 35 | std::time_t start_round_4; |
| 36 | std::time_t tournament_end; |
| 37 | unsigned int game_selection; |
| 38 | unsigned int game_type; |
| 39 | unsigned int game_client; |
| 40 | unsigned int races; |
| 41 | char * format; |
| 42 | char * sponsor; /* format: "ricon,sponsor" |
| 43 | * ricon = W3+icon reversed , if 2 char icon is selected |
| 44 | * or reversed icon if 4 char icon is selected |
| 45 | * ie. "4R3W,The PvPGN Team" |
| 46 | */ |
| 47 | unsigned int thumbs_down; |
| 48 | } t_tournament_info; |
| 49 | |
| 50 | typedef struct |
| 51 | { |
| 52 | char * name; |
| 53 | unsigned int wins; |
| 54 | unsigned int losses; |
| 55 | unsigned int ties; |
| 56 | int in_game; |
| 57 | int in_finals; |
| 58 | } t_tournament_user; |
| 59 | |
| 60 | } |
| 61 | |
| 62 | } |
| 63 | |
| 64 | #endif |
| 65 | |
| 66 | #ifndef JUST_NEED_TYPES |
| 67 | #ifndef INCLUDED_TOURNAMENT_PROTOS |
| 68 | #define INCLUDED_TOURNAMENT_PROTOS |
| 69 | |
| 70 | #define JUST_NEED_TYPES |
| 71 | # include "account.h" |
| 72 | #undef JUST_NEED_TYPES |
| 73 | |
| 74 | namespace pvpgn |
| 75 | { |
| 76 | |
| 77 | namespace bnetd |
| 78 | { |
| 79 | |
| 80 | extern int tournament_signup_user(t_account * account); |
| 81 | extern int tournament_user_signed_up(t_account * account); |
| 82 | extern int tournament_add_stat(t_account * account, int stat); |
| 83 | extern int tournament_get_stat(t_account * account, int stat); |
| 84 | extern int tournament_get_player_score(t_account * account); |
| 85 | extern int tournament_set_in_game_status(t_account * account, int status); |
| 86 | extern int tournament_get_in_finals_status(t_account * account); |
| 87 | extern int tournament_get_game_in_progress(void); |
| 88 | extern int tournament_check_client(t_clienttag clienttag); |
| 89 | |
| 90 | extern int tournament_get_totalplayers(void); |
| 91 | extern int tournament_is_arranged(void); |
| 92 | |
| 93 | /*****/ |
| 94 | extern int tournament_init(char const * filename); |
| 95 | extern int tournament_destroy(void); |
| 96 | extern int tournament_reload(char const * filename); |
| 97 | |
| 98 | /*****/ |
| 99 | extern unsigned int tournament_get_start_preliminary(void); |
| 100 | extern unsigned int tournament_get_end_signup(void); |
| 101 | extern unsigned int tournament_get_end_preliminary(void); |
| 102 | extern unsigned int tournament_get_start_round_1(void); |
| 103 | extern unsigned int tournament_get_start_round_2(void); |
| 104 | extern unsigned int tournament_get_start_round_3(void); |
| 105 | extern unsigned int tournament_get_start_round_4(void); |
| 106 | extern unsigned int tournament_get_tournament_end(void); |
| 107 | extern unsigned int tournament_get_game_selection(void); |
| 108 | extern unsigned int tournament_get_game_type(void); |
| 109 | extern unsigned int tournament_get_races(void); |
| 110 | extern char * tournament_get_format(void); |
| 111 | extern char * tournament_get_sponsor(void); |
| 112 | extern unsigned int tournament_get_thumbs_down(void); |
| 113 | |
| 114 | } |
| 115 | |
| 116 | } |
| 117 | |
| 118 | /*****/ |
| 119 | #endif |
| 120 | #endif |