| 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 | #include "common/setup_before.h"cxx . . $ `<file>/src/common/setup_before.h`/ |
| 17 | #include "tournament.h"cxx . . $ `<file>/src/bnetd/tournament.h`/ |
| 18 | |
| 19 | #include <cstdio> |
| 20 | #include <cerrno> |
| 21 | #include <cstring> |
| 22 | #include <ctime> |
| 23 | #include <cstdlib> |
| 24 | |
| 25 | #include "common/list.h"cxx . . $ `<file>/src/common/list.h`/ |
| 26 | #include "common/eventlog.h"cxx . . $ `<file>/src/common/eventlog.h`/ |
| 27 | #include "common/xalloc.h"cxx . . $ `<file>/src/common/xalloc.h`/ |
| 28 | #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/ |
| 29 | #include "common/tag.h"cxx . . $ `<file>/src/common/tag.h`/ |
| 30 | /* |
| 31 | #include "common/packet.h" |
| 32 | |
| 33 | */ |
| 34 | #include "anongame_maplists.h"cxx . . $ `<file>/src/bnetd/anongame_maplists.h`/ |
| 35 | #include "account.h"cxx . . $ `<file>/src/bnetd/account.h`/ |
| 36 | #include "common/setup_after.h"cxx . . $ `<file>/src/common/setup_after.h`/ |
| 37 | |
| 38 | namespace pvpgncxx . . $ pvpgn/ |
| 39 | { |
| 40 | |
| 41 | namespace bnetdcxx . . $ pvpgn/bnetd/ |
| 42 | { |
| 43 | |
| 44 | static t_tournament_infocxx . . $ pvpgn/bnetd/t_tournament_info# * tournament_infocxx . . $ pvpgn/bnetd/tournament_info. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 45 | static t_listcxx . . $ pvpgn/t_list# * tournament_headcxx . . $ pvpgn/bnetd/tournament_head. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 46 | |
| 47 | static int tournamentlist_createcxx . . $ pvpgn/bnetd/tournamentlist_create(b126dc7c1de90089).(void); |
| 48 | static int _gamelist_destroycxx . . $ pvpgn/bnetd/_gamelist_destroy(b126dc7c1de90089).(void); |
| 49 | static t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user# * tournament_get_usercxx . . $ pvpgn/bnetd/tournament_get_user(1507fc7ea5df4a88).(t_accountcxx . . $ pvpgn/bnetd/t_account# * account); |
| 50 | //static int tournament_get_in_game_status(t_account * account); |
| 51 | |
| 52 | /*****/ |
| 53 | static int tournamentlist_createcxx . . $ pvpgn/bnetd/tournamentlist_create(b126dc7c1de90089).(void) |
| 54 | { |
| 55 | tournament_headcxx . . $ pvpgn/bnetd/tournament_head. = list_create(); |
| 56 | return 0; |
| 57 | } |
| 58 | |
| 59 | static int _gamelist_destroycxx . . $ pvpgn/bnetd/_gamelist_destroy(b126dc7c1de90089).(void) |
| 60 | { |
| 61 | t_elemcxx . . $ pvpgn/t_elem# * curr; |
| 62 | t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user# * user; |
| 63 | |
| 64 | if (tournament_headcxx . . $ pvpgn/bnetd/tournament_head.) { |
| 65 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(tournament_head, curr) |
| 66 | { |
| 67 | if (!(user = (t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user#*)elem_get_data(curr))) { |
| 68 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "tournament list contains NULL item"); |
| 69 | continue; |
| 70 | } |
| 71 | |
| 72 | if (list_remove_elem(tournament_headcxx . . $ pvpgn/bnetd/tournament_head., &curr) < 0) |
| 73 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not remove item from list"); |
| 74 | |
| 75 | if (user->namecxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#name.) |
| 76 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)user->name); /* avoid warning */ |
| 77 | |
| 78 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!(user); |
| 79 | |
| 80 | } |
| 81 | |
| 82 | if (list_destroy(tournament_headcxx . . $ pvpgn/bnetd/tournament_head.) < 0) |
| 83 | return -1; |
| 84 | tournament_headcxx . . $ pvpgn/bnetd/tournament_head. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 85 | } |
| 86 | return 0; |
| 87 | } |
| 88 | |
| 89 | /*****/ |
| 90 | extern int tournament_check_clientcxx . . $ pvpgn/bnetd/tournament_check_client(4c679297bf94b9eb).(t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag) |
| 91 | { |
| 92 | if (clienttag == CLIENTTAG_WAR3XP_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:113:9`! && tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->game_clientcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#game_client. == 2) |
| 93 | return 1; |
| 94 | if (clienttag == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:111:9`! && tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->game_clientcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#game_client. == 1) |
| 95 | return 1; |
| 96 | |
| 97 | return -1; |
| 98 | } |
| 99 | |
| 100 | extern int tournament_signup_usercxx . . $ pvpgn/bnetd/tournament_signup_user(367bfb076f70247b).(t_accountcxx . . $ pvpgn/bnetd/t_account# * account) |
| 101 | { |
| 102 | t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user# * user; |
| 103 | |
| 104 | if (!(account)) |
| 105 | return -1; |
| 106 | |
| 107 | if ((user = tournament_get_usercxx . . $ pvpgn/bnetd/tournament_get_user(1507fc7ea5df4a88).(account))) { |
| 108 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "user \"{}\" already signed up in tournament", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account)); |
| 109 | return 0; |
| 110 | } |
| 111 | |
| 112 | user = (t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user#*)xmalloccxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:43:9`!(sizeof(t_tournament_user)); |
| 113 | user->namecxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#name. = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!(account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account)); |
| 114 | user->winscxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#wins. = 0; |
| 115 | user->lossescxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#losses. = 0; |
| 116 | user->tiescxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#ties. = 0; |
| 117 | user->in_gamecxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#in_game. = 0; |
| 118 | user->in_finalscxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#in_finals. = 0; |
| 119 | |
| 120 | list_prepend_data(tournament_headcxx . . $ pvpgn/bnetd/tournament_head., user); |
| 121 | |
| 122 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "added user \"{}\" to tournament", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account)); |
| 123 | return 0; |
| 124 | } |
| 125 | |
| 126 | static t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user# * tournament_get_usercxx . . $ pvpgn/bnetd/tournament_get_user(1507fc7ea5df4a88).(t_accountcxx . . $ pvpgn/bnetd/t_account# * account) |
| 127 | { |
| 128 | t_elemcxx . . $ pvpgn/t_elem# const * curr; |
| 129 | t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user# * user; |
| 130 | |
| 131 | if (tournament_headcxx . . $ pvpgn/bnetd/tournament_head.) |
| 132 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(tournament_head, curr) |
| 133 | { |
| 134 | user = (t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user#*)elem_get_data(curr); |
| 135 | if (stdcxx . . $ std/::strcmp(user->namecxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#name., account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account)) == 0) |
| 136 | return user; |
| 137 | } |
| 138 | |
| 139 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 140 | } |
| 141 | |
| 142 | extern int tournament_user_signed_upcxx . . $ pvpgn/bnetd/tournament_user_signed_up(367bfb076f70247b).(t_accountcxx . . $ pvpgn/bnetd/t_account# * account) |
| 143 | { |
| 144 | if (!(tournament_get_usercxx . . $ pvpgn/bnetd/tournament_get_user(1507fc7ea5df4a88).(account))) |
| 145 | return -1; |
| 146 | |
| 147 | return 0; |
| 148 | } |
| 149 | |
| 150 | |
| 151 | extern int tournament_add_statcxx . . $ pvpgn/bnetd/tournament_add_stat(9f6a50bf8c531a3f).(t_accountcxx . . $ pvpgn/bnetd/t_account# * account, int stat) |
| 152 | { |
| 153 | t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user# * user; |
| 154 | |
| 155 | if (!(user = tournament_get_usercxx . . $ pvpgn/bnetd/tournament_get_user(1507fc7ea5df4a88).(account))) |
| 156 | return -1; |
| 157 | |
| 158 | if (stat == 1) |
| 159 | user->winscxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#wins.++; |
| 160 | if (stat == 2) |
| 161 | user->lossescxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#losses.++; |
| 162 | if (stat == 3) |
| 163 | user->tiescxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#ties.++; |
| 164 | |
| 165 | return 0; |
| 166 | } |
| 167 | |
| 168 | extern int tournament_get_statcxx . . $ pvpgn/bnetd/tournament_get_stat(9f6a50bf8c531a3f).(t_accountcxx . . $ pvpgn/bnetd/t_account# * account, int stat) |
| 169 | { |
| 170 | t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user# * user; |
| 171 | |
| 172 | if (!(user = tournament_get_usercxx . . $ pvpgn/bnetd/tournament_get_user(1507fc7ea5df4a88).(account))) |
| 173 | return 0; |
| 174 | |
| 175 | if (stat == 1) |
| 176 | return user->winscxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#wins.; |
| 177 | if (stat == 2) |
| 178 | return user->lossescxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#losses.; |
| 179 | if (stat == 3) |
| 180 | return user->tiescxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#ties.; |
| 181 | |
| 182 | return 0; |
| 183 | } |
| 184 | |
| 185 | extern int tournament_get_player_scorecxx . . $ pvpgn/bnetd/tournament_get_player_score(367bfb076f70247b).(t_accountcxx . . $ pvpgn/bnetd/t_account# * account) |
| 186 | { |
| 187 | t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user# * user; |
| 188 | int score; |
| 189 | |
| 190 | if (!(user = tournament_get_usercxx . . $ pvpgn/bnetd/tournament_get_user(1507fc7ea5df4a88).(account))) |
| 191 | return 0; |
| 192 | |
| 193 | score = user->winscxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#wins. * 3 + user->tiescxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#ties. - user->lossescxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#losses.; |
| 194 | |
| 195 | if (score < 0) |
| 196 | return 0; |
| 197 | |
| 198 | return score; |
| 199 | } |
| 200 | |
| 201 | extern int tournament_set_in_game_statuscxx . . $ pvpgn/bnetd/tournament_set_in_game_status(9f6a50bf8c531a3f).(t_accountcxx . . $ pvpgn/bnetd/t_account# * account, int status) |
| 202 | { |
| 203 | t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user# * user; |
| 204 | |
| 205 | if (!(user = tournament_get_usercxx . . $ pvpgn/bnetd/tournament_get_user(1507fc7ea5df4a88).(account))) |
| 206 | return -1; |
| 207 | |
| 208 | user->in_gamecxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#in_game. = status; |
| 209 | |
| 210 | return 0; |
| 211 | } |
| 212 | /* |
| 213 | static int tournament_get_in_game_status(t_account * account) |
| 214 | { |
| 215 | t_tournament_user * user; |
| 216 | |
| 217 | if (!(user = tournament_get_user(account))) |
| 218 | return 0; |
| 219 | |
| 220 | return user->in_game; |
| 221 | } |
| 222 | */ |
| 223 | extern int tournament_get_in_finals_statuscxx . . $ pvpgn/bnetd/tournament_get_in_finals_status(367bfb076f70247b).(t_accountcxx . . $ pvpgn/bnetd/t_account# * account) |
| 224 | { |
| 225 | t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user# * user; |
| 226 | |
| 227 | if (!(user = tournament_get_usercxx . . $ pvpgn/bnetd/tournament_get_user(1507fc7ea5df4a88).(account))) |
| 228 | return 0; |
| 229 | |
| 230 | return user->in_finalscxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#in_finals.; |
| 231 | } |
| 232 | |
| 233 | extern int tournament_get_game_in_progresscxx . . $ pvpgn/bnetd/tournament_get_game_in_progress(b126dc7c1de90089).(void) |
| 234 | { |
| 235 | t_elemcxx . . $ pvpgn/t_elem# const * curr; |
| 236 | t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user# * user; |
| 237 | |
| 238 | if (tournament_headcxx . . $ pvpgn/bnetd/tournament_head.) |
| 239 | LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(tournament_head, curr) |
| 240 | { |
| 241 | user = (t_tournament_usercxx . . $ pvpgn/bnetd/t_tournament_user#*)elem_get_data(curr); |
| 242 | if (user->in_gamecxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_1#in_game. == 1) |
| 243 | return 1; |
| 244 | } |
| 245 | |
| 246 | return 0; |
| 247 | } |
| 248 | |
| 249 | extern int tournament_is_arrangedcxx . . $ pvpgn/bnetd/tournament_is_arranged(b126dc7c1de90089).(void) |
| 250 | { |
| 251 | if (tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->game_selectioncxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#game_selection. == 2) |
| 252 | return 1; |
| 253 | else |
| 254 | return 0; |
| 255 | } |
| 256 | |
| 257 | extern int tournament_get_totalplayerscxx . . $ pvpgn/bnetd/tournament_get_totalplayers(b126dc7c1de90089).(void) |
| 258 | { |
| 259 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->game_typecxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#game_type. * 2; |
| 260 | } |
| 261 | |
| 262 | void tournament_check_datecxx . . $ pvpgn/bnetd/tournament_check_date(d2527571e02971cc).(unsigned int *mon, unsigned int *mday, unsigned int *year, unsigned int *hour, unsigned int *min, unsigned int *sec, char const * caller) |
| 263 | { |
| 264 | if (*mon > 12) |
| 265 | { |
| 266 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got invalid month ({}) in {}", *mon, caller); |
| 267 | *mon = 12; |
| 268 | } |
| 269 | if (*mday > 31) |
| 270 | { |
| 271 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got invalid mday ({}) in {}", *mday, caller); |
| 272 | *mday = 31; |
| 273 | } |
| 274 | if (*hour > 23) |
| 275 | { |
| 276 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got invalid hour ({}) from {}", *hour, caller); |
| 277 | *hour = 23; |
| 278 | } |
| 279 | if (*min > 59) |
| 280 | { |
| 281 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got invalid min ({}) from {}", *min, caller); |
| 282 | *min = 59; |
| 283 | } |
| 284 | if (*sec > 59) |
| 285 | { |
| 286 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got invalid sec ({}) from {}", *sec, caller); |
| 287 | *sec = 59; |
| 288 | } |
| 289 | return; |
| 290 | } |
| 291 | |
| 292 | /*****/ |
| 293 | extern int tournament_initcxx . . $ pvpgn/bnetd/tournament_init(5c4306d8553b3696).(char const * filename) |
| 294 | { |
| 295 | stdcxx . . $ std/::FILEcxx . . $ std/FILE# * fp; |
| 296 | unsigned int line, pos, mon, day, year, hour, min, sec; |
| 297 | char *buff, *temp, *pointer, *value; |
| 298 | char format[30]; |
| 299 | char *variable; |
| 300 | char *sponsor = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 301 | char *have_sponsor = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 302 | char *have_icon = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 303 | struct stdcxx . . $ std/::tmcxx . . $ tm# * timestamp = (struct stdcxx . . $ std/::tmcxx . . $ tm#*)xmalloccxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:43:9`!(sizeof(struct std::tm)); |
| 304 | |
| 305 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(format, "%%02u/%%02u/%%04u %%02u:%%02u:%%02u"); |
| 306 | |
| 307 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info. = (t_tournament_infocxx . . $ pvpgn/bnetd/t_tournament_info#*)xmalloccxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:43:9`!(sizeof(t_tournament_info)); |
| 308 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_preliminarycxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_preliminary. = 0; |
| 309 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->end_signupcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#end_signup. = 0; |
| 310 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->end_preliminarycxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#end_preliminary. = 0; |
| 311 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_1cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_1. = 0; |
| 312 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_2cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_2. = 0; |
| 313 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_3cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_3. = 0; |
| 314 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_4cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_4. = 0; |
| 315 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->tournament_endcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#tournament_end. = 0; |
| 316 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->game_selectioncxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#game_selection. = 1; /* Default to PG */ |
| 317 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->game_typecxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#game_type. = 1; /* Default to 1v1 */ |
| 318 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->game_clientcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#game_client. = 2; /* Default to FT */ |
| 319 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->racescxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#races. = 0x3F; /* Default to all races */ |
| 320 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->formatcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#format. = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!(""); |
| 321 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->sponsorcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#sponsor. = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!(""); |
| 322 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->thumbs_downcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#thumbs_down. = 0; |
| 323 | |
| 324 | anongame_tournament_maplists_destroycxx . . $ pvpgn/bnetd/anongame_tournament_maplists_destroy(49f6e7a06ebc5aa8).(); |
| 325 | |
| 326 | if (!filename) { |
| 327 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL filename"); |
| 328 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)timestamp); |
| 329 | return -1; |
| 330 | } |
| 331 | |
| 332 | if (!(fp = stdcxx . . $ std/::fopencxx . . $ std/fopen(82ec0787cd37e0a3).(filename, "r"))) { |
| 333 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not open file \"{}\" for reading (std::fopen: {})", filename, stdcxx . . $ std/::strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 334 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)timestamp); |
| 335 | return -1; |
| 336 | } |
| 337 | |
| 338 | for (line = 1; (buff = file_get_linecxx . . $ pvpgn/file_get_line(e31226b218f63160).(fp)); line++) { |
| 339 | for (pos = 0; buff[pos] == '\t' || buff[pos] == ' '; pos++); |
| 340 | if (buff[pos] == '\0' || buff[pos] == '#') { |
| 341 | continue; |
| 342 | } |
| 343 | if ((temp = stdcxx . . $ std/::strrchr(buff, '#'))) { |
| 344 | unsigned int len; |
| 345 | unsigned int endpos; |
| 346 | |
| 347 | *temp = '\0'; |
| 348 | len = stdcxx . . $ std/::strlen(buff) + 1; |
| 349 | for (endpos = len - 1; buff[endpos] == '\t' || buff[endpos] == ' '; endpos--); |
| 350 | buff[endpos + 1] = '\0'; |
| 351 | } |
| 352 | |
| 353 | if (stdcxx . . $ std/::strcmp(buff, "[MAPS]") == 0) { |
| 354 | char *clienttag, *mapname, *mname; |
| 355 | t_clienttagcxx . . $ pvpgn/t_clienttag# ctag; |
| 356 | |
| 357 | for (; (buff = file_get_linecxx . . $ pvpgn/file_get_line(e31226b218f63160).(fp));) { |
| 358 | for (pos = 0; buff[pos] == '\t' || buff[pos] == ' '; pos++); |
| 359 | if (buff[pos] == '\0' || buff[pos] == '#') { |
| 360 | continue; |
| 361 | } |
| 362 | if ((temp = stdcxx . . $ std/::strrchr(buff, '#'))) { |
| 363 | unsigned int len; |
| 364 | unsigned int endpos; |
| 365 | |
| 366 | *temp = '\0'; |
| 367 | len = stdcxx . . $ std/::strlen(buff) + 1; |
| 368 | for (endpos = len - 1; buff[endpos] == '\t' || buff[endpos] == ' '; endpos--); |
| 369 | buff[endpos + 1] = '\0'; |
| 370 | } |
| 371 | /* FIXME: use next_token() */ |
| 372 | if (!(clienttag = stdcxx . . $ std/::strtok(buff, " \t"))) { /* std::strtok modifies the string it is passed */ |
| 373 | continue; |
| 374 | } |
| 375 | if (stdcxx . . $ std/::strlen(clienttag) != 4) { |
| 376 | continue; |
| 377 | } |
| 378 | if (stdcxx . . $ std/::strcmp(buff, "[ENDMAPS]") == 0) { |
| 379 | break; |
| 380 | } |
| 381 | if (!(mapname = stdcxx . . $ std/::strtok(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, " \t"))) { |
| 382 | continue; |
| 383 | } |
| 384 | if (!tag_check_client((ctag = tag_case_str_to_uint(clienttag)))) { |
| 385 | continue; |
| 386 | } |
| 387 | mname = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!(mapname); |
| 388 | |
| 389 | anongame_add_tournament_mapcxx . . $ pvpgn/bnetd/anongame_add_tournament_map(fa84e865f2d62ca9).(ctag, mname); |
| 390 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_tracecxx . . $ pvpgn/eventlog_level_trace., __FUNCTION__, "added tournament map \"{}\" for {}", mname, clienttag); |
| 391 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!(mname); |
| 392 | } |
| 393 | } |
| 394 | else { |
| 395 | variable = buff; |
| 396 | pointer = stdcxx . . $ std/::strchr(variable, '='); |
| 397 | for (pointer--; pointer[0] == ' ' || pointer[0] == '\t'; pointer--); |
| 398 | pointer[1] = '\0'; |
| 399 | pointer++; |
| 400 | pointer++; |
| 401 | pointer = stdcxx . . $ std/::strchr(pointer, '='); |
| 402 | pointer++; |
| 403 | |
| 404 | if (stdcxx . . $ std/::strcmp(variable, "start_preliminary") == 0) { |
| 405 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 406 | pointer++; |
| 407 | value = pointer; |
| 408 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 409 | pointer[0] = '\0'; |
| 410 | |
| 411 | stdcxx . . $ std/::sscanfcxx . . $ std/sscanf(6246fabbf6b5312d).(value, format, &mon, &day, &year, &hour, &min, &sec); |
| 412 | |
| 413 | tournament_check_datecxx . . $ pvpgn/bnetd/tournament_check_date(d2527571e02971cc).(&mon, &day, &year, &hour, &min, &sec, variable); |
| 414 | |
| 415 | timestamp->tm_moncxx . . $ tm#tm_mon. = mon - 1; |
| 416 | timestamp->tm_mdaycxx . . $ tm#tm_mday. = day; |
| 417 | timestamp->tm_yearcxx . . $ tm#tm_year. = year - 1900; |
| 418 | timestamp->tm_hourcxx . . $ tm#tm_hour. = hour; |
| 419 | timestamp->tm_mincxx . . $ tm#tm_min. = min; |
| 420 | timestamp->tm_seccxx . . $ tm#tm_sec. = sec; |
| 421 | timestamp->tm_isdstcxx . . $ tm#tm_isdst. = -1; |
| 422 | |
| 423 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_preliminarycxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_preliminary. = stdcxx . . $ std/::mktimecxx . . $ std/mktime(77f55e735876b1c8).(timestamp); |
| 424 | } |
| 425 | else if (stdcxx . . $ std/::strcmp(variable, "end_signup") == 0) { |
| 426 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 427 | pointer++; |
| 428 | value = pointer; |
| 429 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 430 | pointer[0] = '\0'; |
| 431 | |
| 432 | stdcxx . . $ std/::sscanfcxx . . $ std/sscanf(6246fabbf6b5312d).(value, format, &mon, &day, &year, &hour, &min, &sec); |
| 433 | |
| 434 | tournament_check_datecxx . . $ pvpgn/bnetd/tournament_check_date(d2527571e02971cc).(&mon, &day, &year, &hour, &min, &sec, variable); |
| 435 | |
| 436 | timestamp->tm_moncxx . . $ tm#tm_mon. = mon - 1; |
| 437 | timestamp->tm_mdaycxx . . $ tm#tm_mday. = day; |
| 438 | timestamp->tm_yearcxx . . $ tm#tm_year. = year - 1900; |
| 439 | timestamp->tm_hourcxx . . $ tm#tm_hour. = hour; |
| 440 | timestamp->tm_mincxx . . $ tm#tm_min. = min; |
| 441 | timestamp->tm_seccxx . . $ tm#tm_sec. = sec; |
| 442 | timestamp->tm_isdstcxx . . $ tm#tm_isdst. = -1; |
| 443 | |
| 444 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->end_signupcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#end_signup. = stdcxx . . $ std/::mktimecxx . . $ std/mktime(77f55e735876b1c8).(timestamp); |
| 445 | } |
| 446 | else if (stdcxx . . $ std/::strcmp(variable, "end_preliminary") == 0) { |
| 447 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 448 | pointer++; |
| 449 | value = pointer; |
| 450 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 451 | pointer[0] = '\0'; |
| 452 | |
| 453 | stdcxx . . $ std/::sscanfcxx . . $ std/sscanf(6246fabbf6b5312d).(value, format, &mon, &day, &year, &hour, &min, &sec); |
| 454 | |
| 455 | tournament_check_datecxx . . $ pvpgn/bnetd/tournament_check_date(d2527571e02971cc).(&mon, &day, &year, &hour, &min, &sec, variable); |
| 456 | |
| 457 | timestamp->tm_moncxx . . $ tm#tm_mon. = mon - 1; |
| 458 | timestamp->tm_mdaycxx . . $ tm#tm_mday. = day; |
| 459 | timestamp->tm_yearcxx . . $ tm#tm_year. = year - 1900; |
| 460 | timestamp->tm_hourcxx . . $ tm#tm_hour. = hour; |
| 461 | timestamp->tm_mincxx . . $ tm#tm_min. = min; |
| 462 | timestamp->tm_seccxx . . $ tm#tm_sec. = sec; |
| 463 | timestamp->tm_isdstcxx . . $ tm#tm_isdst. = -1; |
| 464 | |
| 465 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->end_preliminarycxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#end_preliminary. = stdcxx . . $ std/::mktimecxx . . $ std/mktime(77f55e735876b1c8).(timestamp); |
| 466 | } |
| 467 | else if (stdcxx . . $ std/::strcmp(variable, "start_round_1") == 0) { |
| 468 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 469 | pointer++; |
| 470 | value = pointer; |
| 471 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 472 | pointer[0] = '\0'; |
| 473 | |
| 474 | stdcxx . . $ std/::sscanfcxx . . $ std/sscanf(6246fabbf6b5312d).(value, format, &mon, &day, &year, &hour, &min, &sec); |
| 475 | |
| 476 | tournament_check_datecxx . . $ pvpgn/bnetd/tournament_check_date(d2527571e02971cc).(&mon, &day, &year, &hour, &min, &sec, variable); |
| 477 | |
| 478 | timestamp->tm_moncxx . . $ tm#tm_mon. = mon - 1; |
| 479 | timestamp->tm_mdaycxx . . $ tm#tm_mday. = day; |
| 480 | timestamp->tm_yearcxx . . $ tm#tm_year. = year - 1900; |
| 481 | timestamp->tm_hourcxx . . $ tm#tm_hour. = hour; |
| 482 | timestamp->tm_mincxx . . $ tm#tm_min. = min; |
| 483 | timestamp->tm_seccxx . . $ tm#tm_sec. = sec; |
| 484 | timestamp->tm_isdstcxx . . $ tm#tm_isdst. = -1; |
| 485 | |
| 486 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_1cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_1. = stdcxx . . $ std/::mktimecxx . . $ std/mktime(77f55e735876b1c8).(timestamp); |
| 487 | } |
| 488 | else if (stdcxx . . $ std/::strcmp(variable, "start_round_2") == 0) { |
| 489 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 490 | pointer++; |
| 491 | value = pointer; |
| 492 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 493 | pointer[0] = '\0'; |
| 494 | |
| 495 | stdcxx . . $ std/::sscanfcxx . . $ std/sscanf(6246fabbf6b5312d).(value, format, &mon, &day, &year, &hour, &min, &sec); |
| 496 | |
| 497 | tournament_check_datecxx . . $ pvpgn/bnetd/tournament_check_date(d2527571e02971cc).(&mon, &day, &year, &hour, &min, &sec, variable); |
| 498 | |
| 499 | timestamp->tm_moncxx . . $ tm#tm_mon. = mon - 1; |
| 500 | timestamp->tm_mdaycxx . . $ tm#tm_mday. = day; |
| 501 | timestamp->tm_yearcxx . . $ tm#tm_year. = year - 1900; |
| 502 | timestamp->tm_hourcxx . . $ tm#tm_hour. = hour; |
| 503 | timestamp->tm_mincxx . . $ tm#tm_min. = min; |
| 504 | timestamp->tm_seccxx . . $ tm#tm_sec. = sec; |
| 505 | timestamp->tm_isdstcxx . . $ tm#tm_isdst. = -1; |
| 506 | |
| 507 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_2cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_2. = stdcxx . . $ std/::mktimecxx . . $ std/mktime(77f55e735876b1c8).(timestamp); |
| 508 | } |
| 509 | else if (stdcxx . . $ std/::strcmp(variable, "start_round_3") == 0) { |
| 510 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 511 | pointer++; |
| 512 | value = pointer; |
| 513 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 514 | pointer[0] = '\0'; |
| 515 | |
| 516 | stdcxx . . $ std/::sscanfcxx . . $ std/sscanf(6246fabbf6b5312d).(value, format, &mon, &day, &year, &hour, &min, &sec); |
| 517 | |
| 518 | tournament_check_datecxx . . $ pvpgn/bnetd/tournament_check_date(d2527571e02971cc).(&mon, &day, &year, &hour, &min, &sec, variable); |
| 519 | |
| 520 | timestamp->tm_moncxx . . $ tm#tm_mon. = mon - 1; |
| 521 | timestamp->tm_mdaycxx . . $ tm#tm_mday. = day; |
| 522 | timestamp->tm_yearcxx . . $ tm#tm_year. = year - 1900; |
| 523 | timestamp->tm_hourcxx . . $ tm#tm_hour. = hour; |
| 524 | timestamp->tm_mincxx . . $ tm#tm_min. = min; |
| 525 | timestamp->tm_seccxx . . $ tm#tm_sec. = sec; |
| 526 | timestamp->tm_isdstcxx . . $ tm#tm_isdst. = -1; |
| 527 | |
| 528 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_3cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_3. = stdcxx . . $ std/::mktimecxx . . $ std/mktime(77f55e735876b1c8).(timestamp); |
| 529 | } |
| 530 | else if (stdcxx . . $ std/::strcmp(variable, "start_round_4") == 0) { |
| 531 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 532 | pointer++; |
| 533 | value = pointer; |
| 534 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 535 | pointer[0] = '\0'; |
| 536 | |
| 537 | stdcxx . . $ std/::sscanfcxx . . $ std/sscanf(6246fabbf6b5312d).(value, format, &mon, &day, &year, &hour, &min, &sec); |
| 538 | |
| 539 | tournament_check_datecxx . . $ pvpgn/bnetd/tournament_check_date(d2527571e02971cc).(&mon, &day, &year, &hour, &min, &sec, variable); |
| 540 | |
| 541 | timestamp->tm_moncxx . . $ tm#tm_mon. = mon - 1; |
| 542 | timestamp->tm_mdaycxx . . $ tm#tm_mday. = day; |
| 543 | timestamp->tm_yearcxx . . $ tm#tm_year. = year - 1900; |
| 544 | timestamp->tm_hourcxx . . $ tm#tm_hour. = hour; |
| 545 | timestamp->tm_mincxx . . $ tm#tm_min. = min; |
| 546 | timestamp->tm_seccxx . . $ tm#tm_sec. = sec; |
| 547 | timestamp->tm_isdstcxx . . $ tm#tm_isdst. = -1; |
| 548 | |
| 549 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_4cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_4. = stdcxx . . $ std/::mktimecxx . . $ std/mktime(77f55e735876b1c8).(timestamp); |
| 550 | } |
| 551 | else if (stdcxx . . $ std/::strcmp(variable, "tournament_end") == 0) { |
| 552 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 553 | pointer++; |
| 554 | value = pointer; |
| 555 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 556 | pointer[0] = '\0'; |
| 557 | |
| 558 | stdcxx . . $ std/::sscanfcxx . . $ std/sscanf(6246fabbf6b5312d).(value, format, &mon, &day, &year, &hour, &min, &sec); |
| 559 | |
| 560 | tournament_check_datecxx . . $ pvpgn/bnetd/tournament_check_date(d2527571e02971cc).(&mon, &day, &year, &hour, &min, &sec, variable); |
| 561 | |
| 562 | timestamp->tm_moncxx . . $ tm#tm_mon. = mon - 1; |
| 563 | timestamp->tm_mdaycxx . . $ tm#tm_mday. = day; |
| 564 | timestamp->tm_yearcxx . . $ tm#tm_year. = year - 1900; |
| 565 | timestamp->tm_hourcxx . . $ tm#tm_hour. = hour; |
| 566 | timestamp->tm_mincxx . . $ tm#tm_min. = min; |
| 567 | timestamp->tm_seccxx . . $ tm#tm_sec. = sec; |
| 568 | timestamp->tm_isdstcxx . . $ tm#tm_isdst. = -1; |
| 569 | |
| 570 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->tournament_endcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#tournament_end. = stdcxx . . $ std/::mktimecxx . . $ std/mktime(77f55e735876b1c8).(timestamp); |
| 571 | } |
| 572 | else if (stdcxx . . $ std/::strcmp(variable, "game_selection") == 0) { |
| 573 | if (stdcxx . . $ std/::atoi(pointer) >= 1 && stdcxx . . $ std/::atoi(pointer) <= 2) |
| 574 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->game_selectioncxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#game_selection. = stdcxx . . $ std/::atoi(pointer); |
| 575 | } |
| 576 | else if (stdcxx . . $ std/::strcmp(variable, "game_type") == 0) { |
| 577 | if (stdcxx . . $ std/::atoi(pointer) >= 1 && stdcxx . . $ std/::atoi(pointer) <= 4) |
| 578 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->game_typecxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#game_type. = stdcxx . . $ std/::atoi(pointer); |
| 579 | } |
| 580 | else if (stdcxx . . $ std/::strcmp(variable, "game_client") == 0) { |
| 581 | if (stdcxx . . $ std/::atoi(pointer) >= 1 && stdcxx . . $ std/::atoi(pointer) <= 2) |
| 582 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->game_clientcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#game_client. = stdcxx . . $ std/::atoi(pointer); |
| 583 | } |
| 584 | else if (stdcxx . . $ std/::strcmp(variable, "format") == 0) { |
| 585 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 586 | pointer++; |
| 587 | value = pointer; |
| 588 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 589 | pointer[0] = '\0'; |
| 590 | |
| 591 | if (tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->formatcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#format.) xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)tournament_info->format); |
| 592 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->formatcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#format. = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!(value); |
| 593 | } |
| 594 | else if (stdcxx . . $ std/::strcmp(variable, "races") == 0) { |
| 595 | unsigned int intvalue = 0; |
| 596 | unsigned int i; |
| 597 | |
| 598 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 599 | pointer++; |
| 600 | value = pointer; |
| 601 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 602 | pointer[0] = '\0'; |
| 603 | |
| 604 | size_t valuelen = stdcxx . . $ std/::strlen(value); |
| 605 | for (i = 0; i < valuelen; i++) { |
| 606 | if (value[i] == 'H') intvalue = intvalue | 0x01; |
| 607 | if (value[i] == 'O') intvalue = intvalue | 0x02; |
| 608 | if (value[i] == 'N') intvalue = intvalue | 0x04; |
| 609 | if (value[i] == 'U') intvalue = intvalue | 0x08; |
| 610 | if (value[i] == 'R') intvalue = intvalue | 0x20; |
| 611 | } |
| 612 | |
| 613 | if (intvalue == 0 || intvalue == 0x2F) |
| 614 | intvalue = 0x3F; /* hack to make all races availiable */ |
| 615 | |
| 616 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->racescxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#races. = intvalue; |
| 617 | } |
| 618 | else if (stdcxx . . $ std/::strcmp(variable, "sponsor") == 0) { |
| 619 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 620 | pointer++; |
| 621 | value = pointer; |
| 622 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 623 | pointer[0] = '\0'; |
| 624 | |
| 625 | have_sponsor = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!(value); |
| 626 | } |
| 627 | else if (stdcxx . . $ std/::strcmp(variable, "icon") == 0) { |
| 628 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 629 | pointer++; |
| 630 | value = pointer; |
| 631 | pointer = stdcxx . . $ std/::strchr(pointer, '\"'); |
| 632 | pointer[0] = '\0'; |
| 633 | |
| 634 | have_icon = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!(value); |
| 635 | } |
| 636 | else if (stdcxx . . $ std/::strcmp(variable, "thumbs_down") == 0) { |
| 637 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->thumbs_downcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#thumbs_down. = stdcxx . . $ std/::atoi(pointer); |
| 638 | } |
| 639 | else |
| 640 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad option \"{}\" in \"{}\"", variable, filename); |
| 641 | |
| 642 | if (have_sponsor && have_icon) { |
| 643 | sponsor = (char*)xmalloccxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:43:9`!(std::strlen(have_sponsor) + 6); |
| 644 | |
| 645 | if (stdcxx . . $ std/::strlen(have_icon) == 4) |
| 646 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(sponsor, "%c%c%c%c,%s", have_icon[3], have_icon[2], have_icon[1], have_icon[0], have_sponsor); |
| 647 | else if (stdcxx . . $ std/::strlen(have_icon) == 2) |
| 648 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(sponsor, "%c%c3W,%s", have_icon[1], have_icon[0], have_sponsor); |
| 649 | else { |
| 650 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(sponsor, "PX3W,%s", have_sponsor); /* default to standard FT icon */ |
| 651 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_warncxx . . $ pvpgn/eventlog_level_warn., __FUNCTION__, "bad icon length, using W3XP"); |
| 652 | } |
| 653 | |
| 654 | if (tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->sponsorcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#sponsor.) |
| 655 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)tournament_info->sponsor); |
| 656 | |
| 657 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->sponsorcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#sponsor. = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!(sponsor); |
| 658 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)have_sponsor); |
| 659 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)have_icon); |
| 660 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)sponsor); |
| 661 | have_sponsor = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 662 | have_icon = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 663 | } |
| 664 | } |
| 665 | } |
| 666 | if (have_sponsor) xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)have_sponsor); |
| 667 | if (have_icon) xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)have_icon); |
| 668 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)timestamp); |
| 669 | file_get_linecxx . . $ pvpgn/file_get_line(e31226b218f63160).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); // clear file_get_line buffer |
| 670 | stdcxx . . $ std/::fclosecxx . . $ std/fclose(89bc1efcdac0ca22).(fp); |
| 671 | |
| 672 | /* check if we have timestamps for all the times */ |
| 673 | /* if not disable tournament by setting "start_preliminary" to 0 */ |
| 674 | if (tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->end_signupcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#end_signup. == 0 || tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->end_preliminarycxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#end_preliminary. == 0 || |
| 675 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_1cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_1. == 0 || tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_2cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_2. == 0 || |
| 676 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_3cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_3. == 0 || tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_4cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_4. == 0 || |
| 677 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->tournament_endcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#tournament_end. == 0) { |
| 678 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_preliminarycxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_preliminary. = 0; |
| 679 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_warncxx . . $ pvpgn/eventlog_level_warn., __FUNCTION__, "one or more timestamps for tournaments is not valid, tournament has been disabled"); |
| 680 | } |
| 681 | else { |
| 682 | tournamentlist_createcxx . . $ pvpgn/bnetd/tournamentlist_create(b126dc7c1de90089).(); |
| 683 | } |
| 684 | |
| 685 | return 0; |
| 686 | } |
| 687 | |
| 688 | extern int tournament_destroycxx . . $ pvpgn/bnetd/tournament_destroy(b126dc7c1de90089).(void) |
| 689 | { |
| 690 | if (tournament_infocxx . . $ pvpgn/bnetd/tournament_info.) |
| 691 | { |
| 692 | if (tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->formatcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#format.) xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)tournament_info->format); |
| 693 | if (tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->sponsorcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#sponsor.) xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)tournament_info->sponsor); |
| 694 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)tournament_info); |
| 695 | } |
| 696 | tournament_infocxx . . $ pvpgn/bnetd/tournament_info. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 697 | _gamelist_destroycxx . . $ pvpgn/bnetd/_gamelist_destroy(b126dc7c1de90089).(); |
| 698 | return 0; |
| 699 | } |
| 700 | |
| 701 | extern int tournament_reloadcxx . . $ pvpgn/bnetd/tournament_reload(5c4306d8553b3696).(char const * filename) |
| 702 | { |
| 703 | stdcxx . . $ std/::time_tcxx . . $ std/time_t# tm; |
| 704 | stdcxx . . $ std/::timecxx . . $ std/time(a7cd306b2d326b09).(&tm); |
| 705 | if ((tm >= tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_preliminarycxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_preliminary.) && (tm <= tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->tournament_endcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#tournament_end.)) |
| 706 | { |
| 707 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "unable to reload tournament, tournament is in process"); |
| 708 | return -1; |
| 709 | } |
| 710 | tournament_destroycxx . . $ pvpgn/bnetd/tournament_destroy(b126dc7c1de90089).(); |
| 711 | return tournament_initcxx . . $ pvpgn/bnetd/tournament_init(5c4306d8553b3696).(filename); |
| 712 | } |
| 713 | /*****/ |
| 714 | extern unsigned int tournament_get_start_preliminarycxx . . $ pvpgn/bnetd/tournament_get_start_preliminary(db52760e79bf9054).(void) |
| 715 | { |
| 716 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_preliminarycxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_preliminary.; |
| 717 | } |
| 718 | |
| 719 | extern unsigned int tournament_get_end_signupcxx . . $ pvpgn/bnetd/tournament_get_end_signup(db52760e79bf9054).(void) |
| 720 | { |
| 721 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->end_signupcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#end_signup.; |
| 722 | } |
| 723 | |
| 724 | extern unsigned int tournament_get_end_preliminarycxx . . $ pvpgn/bnetd/tournament_get_end_preliminary(db52760e79bf9054).(void) |
| 725 | { |
| 726 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->end_preliminarycxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#end_preliminary.; |
| 727 | } |
| 728 | |
| 729 | extern unsigned int tournament_get_start_round_1cxx . . $ pvpgn/bnetd/tournament_get_start_round_1(db52760e79bf9054).(void) |
| 730 | { |
| 731 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_1cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_1.; |
| 732 | } |
| 733 | |
| 734 | extern unsigned int tournament_get_start_round_2cxx . . $ pvpgn/bnetd/tournament_get_start_round_2(db52760e79bf9054).(void) |
| 735 | { |
| 736 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_2cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_2.; |
| 737 | } |
| 738 | |
| 739 | extern unsigned int tournament_get_start_round_3cxx . . $ pvpgn/bnetd/tournament_get_start_round_3(db52760e79bf9054).(void) |
| 740 | { |
| 741 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_3cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_3.; |
| 742 | } |
| 743 | |
| 744 | extern unsigned int tournament_get_start_round_4cxx . . $ pvpgn/bnetd/tournament_get_start_round_4(db52760e79bf9054).(void) |
| 745 | { |
| 746 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->start_round_4cxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#start_round_4.; |
| 747 | } |
| 748 | |
| 749 | extern unsigned int tournament_get_tournament_endcxx . . $ pvpgn/bnetd/tournament_get_tournament_end(db52760e79bf9054).(void) |
| 750 | { |
| 751 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->tournament_endcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#tournament_end.; |
| 752 | } |
| 753 | |
| 754 | extern unsigned int tournament_get_game_selectioncxx . . $ pvpgn/bnetd/tournament_get_game_selection(db52760e79bf9054).(void) |
| 755 | { |
| 756 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->game_selectioncxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#game_selection.; |
| 757 | } |
| 758 | |
| 759 | extern unsigned int tournament_get_game_typecxx . . $ pvpgn/bnetd/tournament_get_game_type(db52760e79bf9054).(void) |
| 760 | { |
| 761 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->game_typecxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#game_type.; |
| 762 | } |
| 763 | |
| 764 | extern unsigned int tournament_get_racescxx . . $ pvpgn/bnetd/tournament_get_races(db52760e79bf9054).(void) |
| 765 | { |
| 766 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->racescxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#races.; |
| 767 | } |
| 768 | |
| 769 | extern char * tournament_get_formatcxx . . $ pvpgn/bnetd/tournament_get_format(41208ce6ca65dd58).(void) |
| 770 | { |
| 771 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->formatcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#format.; |
| 772 | } |
| 773 | |
| 774 | extern char * tournament_get_sponsorcxx . . $ pvpgn/bnetd/tournament_get_sponsor(41208ce6ca65dd58).(void) |
| 775 | { |
| 776 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->sponsorcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#sponsor.; |
| 777 | } |
| 778 | |
| 779 | extern unsigned int tournament_get_thumbs_downcxx . . $ pvpgn/bnetd/tournament_get_thumbs_down(db52760e79bf9054).(void) |
| 780 | { |
| 781 | return tournament_infocxx . . $ pvpgn/bnetd/tournament_info.->thumbs_downcxx . . $ pvpgn/bnetd/$anonymous_type_ae46d1c287e2b54c_0#thumbs_down.; |
| 782 | } |
| 783 | |
| 784 | } |
| 785 | |
| 786 | } |
| 787 | |
| 788 | /****/ |