| 1 | /* |
| 2 | * Copyright (C) 1999,2000,2001 Ross Combs ([email protected]) |
| 3 | * Copyright (C) 1999,2000 Rob Crittenden ([email protected]) |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License |
| 7 | * as published by the Free Software Foundation; either version 2 |
| 8 | * of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 18 | */ |
| 19 | #define GAME_INTERNAL_ACCESScxx . . $ `src/bnetd/game_conv.cpp:19:9`! |
| 20 | #include "common/setup_before.h"cxx . . $ `<file>/src/common/setup_before.h`/ |
| 21 | #include "game_conv.h"cxx . . $ `<file>/src/bnetd/game_conv.h`/ |
| 22 | |
| 23 | #include <cstring> |
| 24 | |
| 25 | #include "common/eventlog.h"cxx . . $ `<file>/src/common/eventlog.h`/ |
| 26 | #include "common/tag.h"cxx . . $ `<file>/src/common/tag.h`/ |
| 27 | #include "common/bnet_protocol.h"cxx . . $ `<file>/src/common/bnet_protocol.h`/ |
| 28 | #include "common/bn_type.h"cxx . . $ `<file>/src/common/bn_type.h`/ |
| 29 | #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/ |
| 30 | |
| 31 | #include "compat/strsep.h"cxx . . $ `<file>/src/compat/strsep.h`/ |
| 32 | |
| 33 | #include "game.h"cxx . . $ `<file>/src/bnetd/game.h`/ |
| 34 | #include "common/setup_after.h"cxx . . $ `<file>/src/common/setup_after.h`/ |
| 35 | |
| 36 | |
| 37 | namespace pvpgncxx . . $ pvpgn/ |
| 38 | { |
| 39 | |
| 40 | namespace bnetdcxx . . $ pvpgn/bnetd/ |
| 41 | { |
| 42 | |
| 43 | extern t_game_typecxx . . $ pvpgn/bnetd/t_game_type# bngreqtype_to_gtypecxx . . $ pvpgn/bnetd/bngreqtype_to_gtype(32e8eaed197b8d66).(t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag, unsigned short bngtype) |
| 44 | { |
| 45 | char clienttag_str[5]; |
| 46 | |
| 47 | if (!clienttag) |
| 48 | { |
| 49 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clienttag"); |
| 50 | return game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.; |
| 51 | } |
| 52 | |
| 53 | if (clienttag == CLIENTTAG_WARCIIBNE_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:97:9`!) |
| 54 | { |
| 55 | switch (bngtype) |
| 56 | { |
| 57 | case CLIENT_GAMELISTREQ_ALLcxx . . $ `src/common/bnet_protocol.h:2649:9`!: |
| 58 | return game_type_allcxx . . $ pvpgn/bnetd/game_type_all.; |
| 59 | case CLIENT_GAMELISTREQ_TOPVBOTcxx . . $ `src/common/bnet_protocol.h:2664:9`!: |
| 60 | return game_type_topvbotcxx . . $ pvpgn/bnetd/game_type_topvbot.; |
| 61 | case CLIENT_GAMELISTREQ_MELEEcxx . . $ `src/common/bnet_protocol.h:2650:9`!: |
| 62 | return game_type_meleecxx . . $ pvpgn/bnetd/game_type_melee.; |
| 63 | case CLIENT_GAMELISTREQ_FFAcxx . . $ `src/common/bnet_protocol.h:2651:9`!: |
| 64 | return game_type_ffacxx . . $ pvpgn/bnetd/game_type_ffa.; |
| 65 | case CLIENT_GAMELISTREQ_ONEONONEcxx . . $ `src/common/bnet_protocol.h:2652:9`!: |
| 66 | return game_type_oneononecxx . . $ pvpgn/bnetd/game_type_oneonone.; |
| 67 | case CLIENT_GAMELISTREQ_LADDERcxx . . $ `src/common/bnet_protocol.h:2657:9`!: |
| 68 | return game_type_laddercxx . . $ pvpgn/bnetd/game_type_ladder.; |
| 69 | case CLIENT_GAMELISTREQ_IRONMANcxx . . $ `src/common/bnet_protocol.h:2658:9`!: |
| 70 | return game_type_ironmancxx . . $ pvpgn/bnetd/game_type_ironman.; |
| 71 | case CLIENT_GAMELISTREQ_MAPSETcxx . . $ `src/common/bnet_protocol.h:2659:9`!: |
| 72 | return game_type_mapsetcxx . . $ pvpgn/bnetd/game_type_mapset.; |
| 73 | default: |
| 74 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Warcraft bnet game type \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), bngtype); |
| 75 | return game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.; |
| 76 | } |
| 77 | } |
| 78 | else if (clienttag == CLIENTTAG_DIABLO2DV_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:99:9`! || |
| 79 | clienttag == CLIENTTAG_DIABLO2XP_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:105:9`!) |
| 80 | { |
| 81 | switch (bngtype) |
| 82 | { |
| 83 | case CLIENT_GAMELISTREQ_ALLcxx . . $ `src/common/bnet_protocol.h:2649:9`!: |
| 84 | return game_type_diablo2opencxx . . $ pvpgn/bnetd/game_type_diablo2open.; |
| 85 | default: |
| 86 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Diablo II bnet game type \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), bngtype); |
| 87 | return game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.; |
| 88 | } |
| 89 | } |
| 90 | else if (clienttag == CLIENTTAG_DIABLORTL_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:93:9`! || |
| 91 | clienttag == CLIENTTAG_DIABLOSHR_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:95:9`!) |
| 92 | { |
| 93 | switch (bngtype) |
| 94 | { |
| 95 | case CLIENT_GAMETYPE_DIABLO_0cxx . . $ `src/common/bnet_protocol.h:2668:9`!: |
| 96 | case CLIENT_GAMETYPE_DIABLO_1cxx . . $ `src/common/bnet_protocol.h:2669:9`!: |
| 97 | case CLIENT_GAMETYPE_DIABLO_2cxx . . $ `src/common/bnet_protocol.h:2670:9`!: |
| 98 | case CLIENT_GAMETYPE_DIABLO_3cxx . . $ `src/common/bnet_protocol.h:2671:9`!: |
| 99 | case CLIENT_GAMETYPE_DIABLO_4cxx . . $ `src/common/bnet_protocol.h:2672:9`!: |
| 100 | case CLIENT_GAMETYPE_DIABLO_5cxx . . $ `src/common/bnet_protocol.h:2673:9`!: |
| 101 | case CLIENT_GAMETYPE_DIABLO_6cxx . . $ `src/common/bnet_protocol.h:2674:9`!: |
| 102 | case CLIENT_GAMETYPE_DIABLO_7cxx . . $ `src/common/bnet_protocol.h:2675:9`!: |
| 103 | case CLIENT_GAMETYPE_DIABLO_8cxx . . $ `src/common/bnet_protocol.h:2676:9`!: |
| 104 | case CLIENT_GAMETYPE_DIABLO_9cxx . . $ `src/common/bnet_protocol.h:2677:9`!: |
| 105 | case CLIENT_GAMETYPE_DIABLO_acxx . . $ `src/common/bnet_protocol.h:2678:9`!: |
| 106 | case CLIENT_GAMETYPE_DIABLO_bcxx . . $ `src/common/bnet_protocol.h:2679:9`!: |
| 107 | case CLIENT_GAMETYPE_DIABLO_ccxx . . $ `src/common/bnet_protocol.h:2680:9`!: |
| 108 | case CLIENT_GAMETYPE_DIABLO_dcxx . . $ `src/common/bnet_protocol.h:2681:9`!: |
| 109 | return game_type_diablocxx . . $ pvpgn/bnetd/game_type_diablo.; |
| 110 | default: |
| 111 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Diablo bnet game type \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), bngtype); |
| 112 | return game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.; |
| 113 | } |
| 114 | } |
| 115 | else if (clienttag == CLIENTTAG_STARCRAFT_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:87:9`! || |
| 116 | clienttag == CLIENTTAG_BROODWARS_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:89:9`! || |
| 117 | clienttag == CLIENTTAG_SHAREWARE_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:91:9`!) |
| 118 | { |
| 119 | switch (bngtype) |
| 120 | { |
| 121 | case CLIENT_GAMELISTREQ_ALLcxx . . $ `src/common/bnet_protocol.h:2649:9`!: |
| 122 | return game_type_allcxx . . $ pvpgn/bnetd/game_type_all.; |
| 123 | case CLIENT_GAMELISTREQ_MELEEcxx . . $ `src/common/bnet_protocol.h:2650:9`!: |
| 124 | return game_type_meleecxx . . $ pvpgn/bnetd/game_type_melee.; |
| 125 | case CLIENT_GAMELISTREQ_FFAcxx . . $ `src/common/bnet_protocol.h:2651:9`!: |
| 126 | return game_type_ffacxx . . $ pvpgn/bnetd/game_type_ffa.; |
| 127 | case CLIENT_GAMELISTREQ_ONEONONEcxx . . $ `src/common/bnet_protocol.h:2652:9`!: |
| 128 | return game_type_oneononecxx . . $ pvpgn/bnetd/game_type_oneonone.; |
| 129 | case CLIENT_GAMELISTREQ_CTFcxx . . $ `src/common/bnet_protocol.h:2653:9`!: |
| 130 | return game_type_ctfcxx . . $ pvpgn/bnetd/game_type_ctf.; |
| 131 | case CLIENT_GAMELISTREQ_GREEDcxx . . $ `src/common/bnet_protocol.h:2654:9`!: |
| 132 | return game_type_greedcxx . . $ pvpgn/bnetd/game_type_greed.; |
| 133 | case CLIENT_GAMELISTREQ_SLAUGHTERcxx . . $ `src/common/bnet_protocol.h:2655:9`!: |
| 134 | return game_type_slaughtercxx . . $ pvpgn/bnetd/game_type_slaughter.; |
| 135 | case CLIENT_GAMELISTREQ_SDEATHcxx . . $ `src/common/bnet_protocol.h:2656:9`!: |
| 136 | return game_type_sdeathcxx . . $ pvpgn/bnetd/game_type_sdeath.; |
| 137 | case CLIENT_GAMELISTREQ_LADDERcxx . . $ `src/common/bnet_protocol.h:2657:9`!: |
| 138 | return game_type_laddercxx . . $ pvpgn/bnetd/game_type_ladder.; |
| 139 | case CLIENT_GAMELISTREQ_MAPSETcxx . . $ `src/common/bnet_protocol.h:2659:9`!: |
| 140 | return game_type_mapsetcxx . . $ pvpgn/bnetd/game_type_mapset.; |
| 141 | case CLIENT_GAMELISTREQ_TEAMMELEEcxx . . $ `src/common/bnet_protocol.h:2660:9`!: |
| 142 | return game_type_teammeleecxx . . $ pvpgn/bnetd/game_type_teammelee.; |
| 143 | case CLIENT_GAMELISTREQ_TEAMFFAcxx . . $ `src/common/bnet_protocol.h:2661:9`!: |
| 144 | return game_type_teamffacxx . . $ pvpgn/bnetd/game_type_teamffa.; |
| 145 | case CLIENT_GAMELISTREQ_TEAMCTFcxx . . $ `src/common/bnet_protocol.h:2662:9`!: |
| 146 | return game_type_teamctfcxx . . $ pvpgn/bnetd/game_type_teamctf.; |
| 147 | case CLIENT_GAMELISTREQ_PGLcxx . . $ `src/common/bnet_protocol.h:2663:9`!: |
| 148 | return game_type_pglcxx . . $ pvpgn/bnetd/game_type_pgl.; |
| 149 | case CLIENT_GAMELISTREQ_TOPVBOTcxx . . $ `src/common/bnet_protocol.h:2664:9`!: |
| 150 | return game_type_topvbotcxx . . $ pvpgn/bnetd/game_type_topvbot.; |
| 151 | default: |
| 152 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game type \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), bngtype); |
| 153 | return game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.; |
| 154 | } |
| 155 | } |
| 156 | else if (clienttag == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:111:9`! || |
| 157 | clienttag == CLIENTTAG_WAR3XP_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:113:9`!) |
| 158 | { |
| 159 | return game_type_allcxx . . $ pvpgn/bnetd/game_type_all.; |
| 160 | } |
| 161 | else |
| 162 | { |
| 163 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown game clienttag \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), bngtype); |
| 164 | return game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | |
| 169 | extern t_game_typecxx . . $ pvpgn/bnetd/t_game_type# bngtype_to_gtypecxx . . $ pvpgn/bnetd/bngtype_to_gtype(32e8eaed197b8d66).(t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag, unsigned short bngtype) |
| 170 | { |
| 171 | char clienttag_str[5]; |
| 172 | if (!clienttag) |
| 173 | { |
| 174 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clienttag"); |
| 175 | return game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.; |
| 176 | } |
| 177 | |
| 178 | if (clienttag == CLIENTTAG_WARCIIBNE_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:97:9`!) |
| 179 | { |
| 180 | switch (bngtype) |
| 181 | { |
| 182 | case CLIENT_GAMELISTREQ_TOPVBOTcxx . . $ `src/common/bnet_protocol.h:2664:9`!: |
| 183 | return game_type_topvbotcxx . . $ pvpgn/bnetd/game_type_topvbot.; |
| 184 | case CLIENT_GAMELISTREQ_MELEEcxx . . $ `src/common/bnet_protocol.h:2650:9`!: |
| 185 | return game_type_meleecxx . . $ pvpgn/bnetd/game_type_melee.; |
| 186 | case CLIENT_GAMELISTREQ_FFAcxx . . $ `src/common/bnet_protocol.h:2651:9`!: |
| 187 | return game_type_ffacxx . . $ pvpgn/bnetd/game_type_ffa.; |
| 188 | case CLIENT_GAMELISTREQ_ONEONONEcxx . . $ `src/common/bnet_protocol.h:2652:9`!: |
| 189 | return game_type_oneononecxx . . $ pvpgn/bnetd/game_type_oneonone.; |
| 190 | case CLIENT_GAMELISTREQ_LADDERcxx . . $ `src/common/bnet_protocol.h:2657:9`!: |
| 191 | return game_type_laddercxx . . $ pvpgn/bnetd/game_type_ladder.; |
| 192 | case CLIENT_GAMELISTREQ_IRONMANcxx . . $ `src/common/bnet_protocol.h:2658:9`!: |
| 193 | return game_type_ironmancxx . . $ pvpgn/bnetd/game_type_ironman.; |
| 194 | case CLIENT_GAMELISTREQ_MAPSETcxx . . $ `src/common/bnet_protocol.h:2659:9`!: |
| 195 | return game_type_mapsetcxx . . $ pvpgn/bnetd/game_type_mapset.; |
| 196 | default: |
| 197 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Warcraft bnet game type \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), bngtype); |
| 198 | return game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.; |
| 199 | } |
| 200 | } |
| 201 | else if (clienttag == CLIENTTAG_DIABLO2DV_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:99:9`! || |
| 202 | clienttag == CLIENTTAG_DIABLO2XP_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:105:9`!) |
| 203 | { |
| 204 | switch (bngtype) |
| 205 | { |
| 206 | case CLIENT_GAMETYPE_DIABLO2_OPEN_NORMALcxx . . $ `src/common/bnet_protocol.h:2685:9`!: |
| 207 | case CLIENT_GAMETYPE_DIABLO2_OPEN_NIGHTMAREcxx . . $ `src/common/bnet_protocol.h:2686:9`!: |
| 208 | case CLIENT_GAMETYPE_DIABLO2_OPEN_HELLcxx . . $ `src/common/bnet_protocol.h:2687:9`!: |
| 209 | case CLIENT_GAMETYPE_DIABLO2_OPEN_HARDCORE_NORMALcxx . . $ `src/common/bnet_protocol.h:2688:9`!: |
| 210 | case CLIENT_GAMETYPE_DIABLO2_OPEN_HARDCORE_NIGHTMAREcxx . . $ `src/common/bnet_protocol.h:2689:9`!: |
| 211 | case CLIENT_GAMETYPE_DIABLO2_OPEN_HARDCORE_HELLcxx . . $ `src/common/bnet_protocol.h:2690:9`!: |
| 212 | return game_type_diablo2opencxx . . $ pvpgn/bnetd/game_type_diablo2open.; |
| 213 | case CLIENT_GAMETYPE_DIABLO2_CLOSEcxx . . $ `src/common/bnet_protocol.h:2684:9`!: |
| 214 | return game_type_diablo2closedcxx . . $ pvpgn/bnetd/game_type_diablo2closed.; |
| 215 | default: |
| 216 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Diablo II bnet game type \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), bngtype); |
| 217 | return game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.; |
| 218 | } |
| 219 | } |
| 220 | else if (clienttag == CLIENTTAG_DIABLORTL_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:93:9`! || |
| 221 | clienttag == CLIENTTAG_DIABLOSHR_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:95:9`!) |
| 222 | { |
| 223 | switch (bngtype) |
| 224 | { |
| 225 | case CLIENT_GAMETYPE_DIABLO_0cxx . . $ `src/common/bnet_protocol.h:2668:9`!: |
| 226 | case CLIENT_GAMETYPE_DIABLO_1cxx . . $ `src/common/bnet_protocol.h:2669:9`!: |
| 227 | case CLIENT_GAMETYPE_DIABLO_2cxx . . $ `src/common/bnet_protocol.h:2670:9`!: |
| 228 | case CLIENT_GAMETYPE_DIABLO_3cxx . . $ `src/common/bnet_protocol.h:2671:9`!: |
| 229 | case CLIENT_GAMETYPE_DIABLO_4cxx . . $ `src/common/bnet_protocol.h:2672:9`!: |
| 230 | case CLIENT_GAMETYPE_DIABLO_5cxx . . $ `src/common/bnet_protocol.h:2673:9`!: |
| 231 | case CLIENT_GAMETYPE_DIABLO_6cxx . . $ `src/common/bnet_protocol.h:2674:9`!: |
| 232 | case CLIENT_GAMETYPE_DIABLO_7cxx . . $ `src/common/bnet_protocol.h:2675:9`!: |
| 233 | case CLIENT_GAMETYPE_DIABLO_8cxx . . $ `src/common/bnet_protocol.h:2676:9`!: |
| 234 | case CLIENT_GAMETYPE_DIABLO_9cxx . . $ `src/common/bnet_protocol.h:2677:9`!: |
| 235 | case CLIENT_GAMETYPE_DIABLO_acxx . . $ `src/common/bnet_protocol.h:2678:9`!: |
| 236 | case CLIENT_GAMETYPE_DIABLO_bcxx . . $ `src/common/bnet_protocol.h:2679:9`!: |
| 237 | case CLIENT_GAMETYPE_DIABLO_ccxx . . $ `src/common/bnet_protocol.h:2680:9`!: |
| 238 | return game_type_diablocxx . . $ pvpgn/bnetd/game_type_diablo.; |
| 239 | default: |
| 240 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Diablo bnet game type \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), bngtype); |
| 241 | return game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.; |
| 242 | } |
| 243 | } |
| 244 | else if (clienttag == CLIENTTAG_STARCRAFT_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:87:9`! || |
| 245 | clienttag == CLIENTTAG_BROODWARS_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:89:9`! || |
| 246 | clienttag == CLIENTTAG_SHAREWARE_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:91:9`!) |
| 247 | { |
| 248 | switch (bngtype) |
| 249 | { |
| 250 | case CLIENT_GAMELISTREQ_ALLcxx . . $ `src/common/bnet_protocol.h:2649:9`!: |
| 251 | return game_type_allcxx . . $ pvpgn/bnetd/game_type_all.; |
| 252 | case CLIENT_GAMELISTREQ_MELEEcxx . . $ `src/common/bnet_protocol.h:2650:9`!: |
| 253 | return game_type_meleecxx . . $ pvpgn/bnetd/game_type_melee.; |
| 254 | case CLIENT_GAMELISTREQ_FFAcxx . . $ `src/common/bnet_protocol.h:2651:9`!: |
| 255 | return game_type_ffacxx . . $ pvpgn/bnetd/game_type_ffa.; |
| 256 | case CLIENT_GAMELISTREQ_ONEONONEcxx . . $ `src/common/bnet_protocol.h:2652:9`!: |
| 257 | return game_type_oneononecxx . . $ pvpgn/bnetd/game_type_oneonone.; |
| 258 | case CLIENT_GAMELISTREQ_CTFcxx . . $ `src/common/bnet_protocol.h:2653:9`!: |
| 259 | return game_type_ctfcxx . . $ pvpgn/bnetd/game_type_ctf.; |
| 260 | case CLIENT_GAMELISTREQ_GREEDcxx . . $ `src/common/bnet_protocol.h:2654:9`!: |
| 261 | return game_type_greedcxx . . $ pvpgn/bnetd/game_type_greed.; |
| 262 | case CLIENT_GAMELISTREQ_SLAUGHTERcxx . . $ `src/common/bnet_protocol.h:2655:9`!: |
| 263 | return game_type_slaughtercxx . . $ pvpgn/bnetd/game_type_slaughter.; |
| 264 | case CLIENT_GAMELISTREQ_SDEATHcxx . . $ `src/common/bnet_protocol.h:2656:9`!: |
| 265 | return game_type_sdeathcxx . . $ pvpgn/bnetd/game_type_sdeath.; |
| 266 | case CLIENT_GAMELISTREQ_LADDERcxx . . $ `src/common/bnet_protocol.h:2657:9`!: |
| 267 | return game_type_laddercxx . . $ pvpgn/bnetd/game_type_ladder.; |
| 268 | case CLIENT_GAMELISTREQ_MAPSETcxx . . $ `src/common/bnet_protocol.h:2659:9`!: |
| 269 | return game_type_mapsetcxx . . $ pvpgn/bnetd/game_type_mapset.; |
| 270 | case CLIENT_GAMELISTREQ_TEAMMELEEcxx . . $ `src/common/bnet_protocol.h:2660:9`!: |
| 271 | return game_type_teammeleecxx . . $ pvpgn/bnetd/game_type_teammelee.; |
| 272 | case CLIENT_GAMELISTREQ_TEAMFFAcxx . . $ `src/common/bnet_protocol.h:2661:9`!: |
| 273 | return game_type_teamffacxx . . $ pvpgn/bnetd/game_type_teamffa.; |
| 274 | case CLIENT_GAMELISTREQ_TEAMCTFcxx . . $ `src/common/bnet_protocol.h:2662:9`!: |
| 275 | return game_type_teamctfcxx . . $ pvpgn/bnetd/game_type_teamctf.; |
| 276 | case CLIENT_GAMELISTREQ_PGLcxx . . $ `src/common/bnet_protocol.h:2663:9`!: |
| 277 | return game_type_pglcxx . . $ pvpgn/bnetd/game_type_pgl.; |
| 278 | case CLIENT_GAMELISTREQ_TOPVBOTcxx . . $ `src/common/bnet_protocol.h:2664:9`!: |
| 279 | return game_type_topvbotcxx . . $ pvpgn/bnetd/game_type_topvbot.; |
| 280 | default: |
| 281 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game type \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), bngtype); |
| 282 | return game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.; |
| 283 | } |
| 284 | } |
| 285 | else if (clienttag == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:111:9`! || |
| 286 | clienttag == CLIENTTAG_WAR3XP_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:113:9`!) |
| 287 | { |
| 288 | return game_type_allcxx . . $ pvpgn/bnetd/game_type_all.; |
| 289 | } |
| 290 | else |
| 291 | { |
| 292 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown game clienttag \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), bngtype); |
| 293 | return game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.; |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | |
| 298 | extern unsigned short gtype_to_bngtypecxx . . $ pvpgn/bnetd/gtype_to_bngtype(721927292c512a57).(t_game_typecxx . . $ pvpgn/bnetd/t_game_type# gtype) |
| 299 | { |
| 300 | switch (gtype) |
| 301 | { |
| 302 | case game_type_allcxx . . $ pvpgn/bnetd/game_type_all.: |
| 303 | return CLIENT_GAMELISTREQ_ALLcxx . . $ `src/common/bnet_protocol.h:2649:9`!; |
| 304 | case game_type_meleecxx . . $ pvpgn/bnetd/game_type_melee.: |
| 305 | return CLIENT_GAMELISTREQ_MELEEcxx . . $ `src/common/bnet_protocol.h:2650:9`!; |
| 306 | case game_type_ffacxx . . $ pvpgn/bnetd/game_type_ffa.: |
| 307 | return CLIENT_GAMELISTREQ_FFAcxx . . $ `src/common/bnet_protocol.h:2651:9`!; |
| 308 | case game_type_oneononecxx . . $ pvpgn/bnetd/game_type_oneonone.: |
| 309 | return CLIENT_GAMELISTREQ_ONEONONEcxx . . $ `src/common/bnet_protocol.h:2652:9`!; |
| 310 | case game_type_ctfcxx . . $ pvpgn/bnetd/game_type_ctf.: |
| 311 | return CLIENT_GAMELISTREQ_CTFcxx . . $ `src/common/bnet_protocol.h:2653:9`!; |
| 312 | case game_type_greedcxx . . $ pvpgn/bnetd/game_type_greed.: |
| 313 | return CLIENT_GAMELISTREQ_GREEDcxx . . $ `src/common/bnet_protocol.h:2654:9`!; |
| 314 | case game_type_slaughtercxx . . $ pvpgn/bnetd/game_type_slaughter.: |
| 315 | return CLIENT_GAMELISTREQ_SLAUGHTERcxx . . $ `src/common/bnet_protocol.h:2655:9`!; |
| 316 | case game_type_sdeathcxx . . $ pvpgn/bnetd/game_type_sdeath.: |
| 317 | return CLIENT_GAMELISTREQ_SDEATHcxx . . $ `src/common/bnet_protocol.h:2656:9`!; |
| 318 | case game_type_laddercxx . . $ pvpgn/bnetd/game_type_ladder.: |
| 319 | return CLIENT_GAMELISTREQ_LADDERcxx . . $ `src/common/bnet_protocol.h:2657:9`!; |
| 320 | case game_type_mapsetcxx . . $ pvpgn/bnetd/game_type_mapset.: |
| 321 | return CLIENT_GAMELISTREQ_MAPSETcxx . . $ `src/common/bnet_protocol.h:2659:9`!; |
| 322 | case game_type_teammeleecxx . . $ pvpgn/bnetd/game_type_teammelee.: |
| 323 | return CLIENT_GAMELISTREQ_TEAMMELEEcxx . . $ `src/common/bnet_protocol.h:2660:9`!; |
| 324 | case game_type_teamffacxx . . $ pvpgn/bnetd/game_type_teamffa.: |
| 325 | return CLIENT_GAMELISTREQ_TEAMFFAcxx . . $ `src/common/bnet_protocol.h:2661:9`!; |
| 326 | case game_type_teamctfcxx . . $ pvpgn/bnetd/game_type_teamctf.: |
| 327 | return CLIENT_GAMELISTREQ_TEAMCTFcxx . . $ `src/common/bnet_protocol.h:2662:9`!; |
| 328 | case game_type_pglcxx . . $ pvpgn/bnetd/game_type_pgl.: |
| 329 | return CLIENT_GAMELISTREQ_PGLcxx . . $ `src/common/bnet_protocol.h:2663:9`!; |
| 330 | case game_type_topvbotcxx . . $ pvpgn/bnetd/game_type_topvbot.: |
| 331 | return CLIENT_GAMELISTREQ_TOPVBOTcxx . . $ `src/common/bnet_protocol.h:2664:9`!; |
| 332 | case game_type_diablocxx . . $ pvpgn/bnetd/game_type_diablo.: |
| 333 | return CLIENT_GAMELISTREQ_DIABLOcxx . . $ `src/common/bnet_protocol.h:2665:9`!; |
| 334 | case game_type_diablo2opencxx . . $ pvpgn/bnetd/game_type_diablo2open.: |
| 335 | return SERVER_GAMELISTREPLY_TYPE_DIABLO2_OPENcxx . . $ `src/common/bnet_protocol.h:2796:9`!; |
| 336 | case game_type_diablo2closedcxx . . $ pvpgn/bnetd/game_type_diablo2closed.: |
| 337 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "don't know how to list Diablo II"); |
| 338 | return 0; |
| 339 | case game_type_anongamecxx . . $ pvpgn/bnetd/game_type_anongame.: |
| 340 | return 0; |
| 341 | case game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.: |
| 342 | default: |
| 343 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown game type {}", (unsigned int)gtype); |
| 344 | return 0xffff; |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | |
| 349 | extern t_game_optioncxx . . $ pvpgn/bnetd/t_game_option# bngoption_to_goptioncxx . . $ pvpgn/bnetd/bngoption_to_goption(683ce3e18ae389f3).(t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag, t_game_typecxx . . $ pvpgn/bnetd/t_game_type# gtype, unsigned short bngoption) |
| 350 | { |
| 351 | char clienttag_str[5]; |
| 352 | |
| 353 | if (!clienttag) |
| 354 | { |
| 355 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clienttag"); |
| 356 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 357 | } |
| 358 | |
| 359 | if (clienttag == CLIENTTAG_WARCIIBNE_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:97:9`!) |
| 360 | { |
| 361 | switch (gtype) |
| 362 | { |
| 363 | case game_type_topvbotcxx . . $ pvpgn/bnetd/game_type_topvbot.: |
| 364 | switch (bngoption) |
| 365 | { |
| 366 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_1cxx . . $ `src/common/bnet_protocol.h:2972:9`!: |
| 367 | return game_option_topvbot_1cxx . . $ pvpgn/bnetd/game_option_topvbot_1.; |
| 368 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_2cxx . . $ `src/common/bnet_protocol.h:2973:9`!: |
| 369 | return game_option_topvbot_2cxx . . $ pvpgn/bnetd/game_option_topvbot_2.; |
| 370 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_3cxx . . $ `src/common/bnet_protocol.h:2974:9`!: |
| 371 | return game_option_topvbot_3cxx . . $ pvpgn/bnetd/game_option_topvbot_3.; |
| 372 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_4cxx . . $ `src/common/bnet_protocol.h:2975:9`!: |
| 373 | return game_option_topvbot_4cxx . . $ pvpgn/bnetd/game_option_topvbot_4.; |
| 374 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_5cxx . . $ `src/common/bnet_protocol.h:2976:9`!: |
| 375 | return game_option_topvbot_5cxx . . $ pvpgn/bnetd/game_option_topvbot_5.; |
| 376 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_6cxx . . $ `src/common/bnet_protocol.h:2977:9`!: |
| 377 | return game_option_topvbot_6cxx . . $ pvpgn/bnetd/game_option_topvbot_6.; |
| 378 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_7cxx . . $ `src/common/bnet_protocol.h:2978:9`!: |
| 379 | return game_option_topvbot_7cxx . . $ pvpgn/bnetd/game_option_topvbot_7.; |
| 380 | default: |
| 381 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Warcraft II bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 382 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 383 | } |
| 384 | case game_type_meleecxx . . $ pvpgn/bnetd/game_type_melee.: |
| 385 | switch (bngoption) |
| 386 | { |
| 387 | case CLIENT_STARTGAME4_OPTION_MELEE_NORMALcxx . . $ `src/common/bnet_protocol.h:2945:9`!: |
| 388 | return game_option_melee_normalcxx . . $ pvpgn/bnetd/game_option_melee_normal.; |
| 389 | default: |
| 390 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Warcraft II bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 391 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 392 | } |
| 393 | case game_type_ffacxx . . $ pvpgn/bnetd/game_type_ffa.: |
| 394 | switch (bngoption) |
| 395 | { |
| 396 | case CLIENT_STARTGAME4_OPTION_FFA_NORMALcxx . . $ `src/common/bnet_protocol.h:2946:9`!: |
| 397 | return game_option_ffa_normalcxx . . $ pvpgn/bnetd/game_option_ffa_normal.; |
| 398 | default: |
| 399 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Warcraft II bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 400 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 401 | } |
| 402 | case game_type_oneononecxx . . $ pvpgn/bnetd/game_type_oneonone.: |
| 403 | switch (bngoption) |
| 404 | { |
| 405 | case CLIENT_STARTGAME4_OPTION_ONEONONE_NORMALcxx . . $ `src/common/bnet_protocol.h:2947:9`!: |
| 406 | return game_option_oneonone_normalcxx . . $ pvpgn/bnetd/game_option_oneonone_normal.; |
| 407 | default: |
| 408 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Warcraft II bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 409 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 410 | } |
| 411 | case game_type_laddercxx . . $ pvpgn/bnetd/game_type_ladder.: |
| 412 | switch (bngoption) |
| 413 | { |
| 414 | case CLIENT_STARTGAME4_OPTION_LADDER_COUNTASLOSScxx . . $ `src/common/bnet_protocol.h:2958:9`!: |
| 415 | return game_option_ladder_countaslosscxx . . $ pvpgn/bnetd/game_option_ladder_countasloss.; |
| 416 | case CLIENT_STARTGAME4_OPTION_LADDER_NOPENALTYcxx . . $ `src/common/bnet_protocol.h:2959:9`!: |
| 417 | return game_option_ladder_nopenaltycxx . . $ pvpgn/bnetd/game_option_ladder_nopenalty.; |
| 418 | default: |
| 419 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Warcraft II bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 420 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 421 | } |
| 422 | case game_type_ironmancxx . . $ pvpgn/bnetd/game_type_ironman.: |
| 423 | switch (bngoption) |
| 424 | { |
| 425 | default: |
| 426 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Warcraft II bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 427 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 428 | } |
| 429 | case game_type_mapsetcxx . . $ pvpgn/bnetd/game_type_mapset.: |
| 430 | switch (bngoption) |
| 431 | { |
| 432 | case CLIENT_STARTGAME4_OPTION_MAPSET_NORMALcxx . . $ `src/common/bnet_protocol.h:2961:9`!: |
| 433 | return game_option_mapset_normalcxx . . $ pvpgn/bnetd/game_option_mapset_normal.; |
| 434 | default: |
| 435 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Warcraft II bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 436 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 437 | } |
| 438 | default: |
| 439 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Warcraft II game type \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), (unsigned int)gtype); |
| 440 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 441 | } |
| 442 | } |
| 443 | else if (clienttag == CLIENTTAG_DIABLO2DV_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:99:9`! || |
| 444 | clienttag == CLIENTTAG_DIABLO2XP_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:105:9`!) |
| 445 | { |
| 446 | switch (gtype) |
| 447 | { |
| 448 | case game_type_diablo2opencxx . . $ pvpgn/bnetd/game_type_diablo2open.: |
| 449 | switch (bngoption) |
| 450 | { |
| 451 | case CLIENT_STARTGAME4_OPTION_NONEcxx . . $ `src/common/bnet_protocol.h:2981:9`!: /* FIXME: really? */ |
| 452 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 453 | default: |
| 454 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Diablo II bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 455 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 456 | } |
| 457 | case game_type_diablo2closedcxx . . $ pvpgn/bnetd/game_type_diablo2closed.: |
| 458 | switch (bngoption) |
| 459 | { |
| 460 | case CLIENT_STARTGAME4_OPTION_NONEcxx . . $ `src/common/bnet_protocol.h:2981:9`!: /* FIXME: really? */ |
| 461 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 462 | default: |
| 463 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Diablo II bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 464 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 465 | } |
| 466 | default: |
| 467 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Diablo II game type \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), (unsigned int)gtype); |
| 468 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 469 | } |
| 470 | } |
| 471 | else if (clienttag == CLIENTTAG_DIABLORTL_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:93:9`! || |
| 472 | clienttag == CLIENTTAG_DIABLOSHR_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:95:9`!) |
| 473 | { |
| 474 | switch (gtype) |
| 475 | { |
| 476 | case game_type_diablocxx . . $ pvpgn/bnetd/game_type_diablo.: |
| 477 | switch (bngoption) |
| 478 | { |
| 479 | default: |
| 480 | /* diablo doesn't use any options */ |
| 481 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 482 | } |
| 483 | default: |
| 484 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Diablo game type \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), (unsigned int)gtype); |
| 485 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 486 | } |
| 487 | } |
| 488 | else if (clienttag == CLIENTTAG_STARCRAFT_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:87:9`! || |
| 489 | clienttag == CLIENTTAG_BROODWARS_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:89:9`! || |
| 490 | clienttag == CLIENTTAG_SHAREWARE_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:91:9`!) |
| 491 | { |
| 492 | switch (gtype) |
| 493 | { |
| 494 | case game_type_meleecxx . . $ pvpgn/bnetd/game_type_melee.: |
| 495 | switch (bngoption) |
| 496 | { |
| 497 | case CLIENT_STARTGAME4_OPTION_MELEE_NORMALcxx . . $ `src/common/bnet_protocol.h:2945:9`!: |
| 498 | return game_option_melee_normalcxx . . $ pvpgn/bnetd/game_option_melee_normal.; |
| 499 | default: |
| 500 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 501 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 502 | } |
| 503 | case game_type_ffacxx . . $ pvpgn/bnetd/game_type_ffa.: |
| 504 | switch (bngoption) |
| 505 | { |
| 506 | case CLIENT_STARTGAME4_OPTION_FFA_NORMALcxx . . $ `src/common/bnet_protocol.h:2946:9`!: |
| 507 | return game_option_ffa_normalcxx . . $ pvpgn/bnetd/game_option_ffa_normal.; |
| 508 | default: |
| 509 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 510 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 511 | } |
| 512 | case game_type_oneononecxx . . $ pvpgn/bnetd/game_type_oneonone.: |
| 513 | switch (bngoption) |
| 514 | { |
| 515 | case CLIENT_STARTGAME4_OPTION_ONEONONE_NORMALcxx . . $ `src/common/bnet_protocol.h:2947:9`!: |
| 516 | return game_option_oneonone_normalcxx . . $ pvpgn/bnetd/game_option_oneonone_normal.; |
| 517 | default: |
| 518 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 519 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 520 | } |
| 521 | case game_type_ctfcxx . . $ pvpgn/bnetd/game_type_ctf.: |
| 522 | switch (bngoption) |
| 523 | { |
| 524 | case CLIENT_STARTGAME4_OPTION_CTF_NORMALcxx . . $ `src/common/bnet_protocol.h:2948:9`!: |
| 525 | return game_option_ctf_normalcxx . . $ pvpgn/bnetd/game_option_ctf_normal.; |
| 526 | default: |
| 527 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 528 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 529 | } |
| 530 | case game_type_greedcxx . . $ pvpgn/bnetd/game_type_greed.: |
| 531 | switch (bngoption) |
| 532 | { |
| 533 | case CLIENT_STARTGAME4_OPTION_GREED_10000cxx . . $ `src/common/bnet_protocol.h:2949:9`!: |
| 534 | return game_option_greed_10000cxx . . $ pvpgn/bnetd/game_option_greed_10000.; |
| 535 | case CLIENT_STARTGAME4_OPTION_GREED_7500cxx . . $ `src/common/bnet_protocol.h:2950:9`!: |
| 536 | return game_option_greed_7500cxx . . $ pvpgn/bnetd/game_option_greed_7500.; |
| 537 | case CLIENT_STARTGAME4_OPTION_GREED_5000cxx . . $ `src/common/bnet_protocol.h:2951:9`!: |
| 538 | return game_option_greed_5000cxx . . $ pvpgn/bnetd/game_option_greed_5000.; |
| 539 | case CLIENT_STARTGAME4_OPTION_GREED_2500cxx . . $ `src/common/bnet_protocol.h:2952:9`!: |
| 540 | return game_option_greed_2500cxx . . $ pvpgn/bnetd/game_option_greed_2500.; |
| 541 | default: |
| 542 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 543 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 544 | } |
| 545 | case game_type_slaughtercxx . . $ pvpgn/bnetd/game_type_slaughter.: |
| 546 | switch (bngoption) |
| 547 | { |
| 548 | case CLIENT_STARTGAME4_OPTION_SLAUGHTER_60cxx . . $ `src/common/bnet_protocol.h:2953:9`!: |
| 549 | return game_option_slaughter_60cxx . . $ pvpgn/bnetd/game_option_slaughter_60.; |
| 550 | case CLIENT_STARTGAME4_OPTION_SLAUGHTER_45cxx . . $ `src/common/bnet_protocol.h:2954:9`!: |
| 551 | return game_option_slaughter_45cxx . . $ pvpgn/bnetd/game_option_slaughter_45.; |
| 552 | case CLIENT_STARTGAME4_OPTION_SLAUGHTER_30cxx . . $ `src/common/bnet_protocol.h:2955:9`!: |
| 553 | return game_option_slaughter_30cxx . . $ pvpgn/bnetd/game_option_slaughter_30.; |
| 554 | case CLIENT_STARTGAME4_OPTION_SLAUGHTER_15cxx . . $ `src/common/bnet_protocol.h:2956:9`!: |
| 555 | return game_option_slaughter_15cxx . . $ pvpgn/bnetd/game_option_slaughter_15.; |
| 556 | default: |
| 557 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 558 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 559 | } |
| 560 | case game_type_sdeathcxx . . $ pvpgn/bnetd/game_type_sdeath.: |
| 561 | switch (bngoption) |
| 562 | { |
| 563 | case CLIENT_STARTGAME4_OPTION_SDEATH_NORMALcxx . . $ `src/common/bnet_protocol.h:2957:9`!: |
| 564 | return game_option_sdeath_normalcxx . . $ pvpgn/bnetd/game_option_sdeath_normal.; |
| 565 | default: |
| 566 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 567 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 568 | } |
| 569 | case game_type_laddercxx . . $ pvpgn/bnetd/game_type_ladder.: |
| 570 | switch (bngoption) |
| 571 | { |
| 572 | case CLIENT_STARTGAME4_OPTION_LADDER_COUNTASLOSScxx . . $ `src/common/bnet_protocol.h:2958:9`!: |
| 573 | return game_option_ladder_countaslosscxx . . $ pvpgn/bnetd/game_option_ladder_countasloss.; |
| 574 | case CLIENT_STARTGAME4_OPTION_LADDER_NOPENALTYcxx . . $ `src/common/bnet_protocol.h:2959:9`!: |
| 575 | return game_option_ladder_nopenaltycxx . . $ pvpgn/bnetd/game_option_ladder_nopenalty.; |
| 576 | default: |
| 577 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 578 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 579 | } |
| 580 | case game_type_mapsetcxx . . $ pvpgn/bnetd/game_type_mapset.: |
| 581 | switch (bngoption) |
| 582 | { |
| 583 | case CLIENT_STARTGAME4_OPTION_MAPSET_NORMALcxx . . $ `src/common/bnet_protocol.h:2961:9`!: |
| 584 | return game_option_mapset_normalcxx . . $ pvpgn/bnetd/game_option_mapset_normal.; |
| 585 | default: |
| 586 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 587 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 588 | } |
| 589 | case game_type_teammeleecxx . . $ pvpgn/bnetd/game_type_teammelee.: |
| 590 | switch (bngoption) |
| 591 | { |
| 592 | case CLIENT_STARTGAME4_OPTION_TEAMMELEE_4cxx . . $ `src/common/bnet_protocol.h:2962:9`!: |
| 593 | return game_option_teammelee_4cxx . . $ pvpgn/bnetd/game_option_teammelee_4.; |
| 594 | case CLIENT_STARTGAME4_OPTION_TEAMMELEE_3cxx . . $ `src/common/bnet_protocol.h:2963:9`!: |
| 595 | return game_option_teammelee_3cxx . . $ pvpgn/bnetd/game_option_teammelee_3.; |
| 596 | case CLIENT_STARTGAME4_OPTION_TEAMMELEE_2cxx . . $ `src/common/bnet_protocol.h:2964:9`!: |
| 597 | return game_option_teammelee_2cxx . . $ pvpgn/bnetd/game_option_teammelee_2.; |
| 598 | default: |
| 599 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 600 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 601 | } |
| 602 | case game_type_teamffacxx . . $ pvpgn/bnetd/game_type_teamffa.: |
| 603 | switch (bngoption) |
| 604 | { |
| 605 | case CLIENT_STARTGAME4_OPTION_TEAMFFA_4cxx . . $ `src/common/bnet_protocol.h:2965:9`!: |
| 606 | return game_option_teamffa_4cxx . . $ pvpgn/bnetd/game_option_teamffa_4.; |
| 607 | case CLIENT_STARTGAME4_OPTION_TEAMFFA_3cxx . . $ `src/common/bnet_protocol.h:2966:9`!: |
| 608 | return game_option_teamffa_3cxx . . $ pvpgn/bnetd/game_option_teamffa_3.; |
| 609 | case CLIENT_STARTGAME4_OPTION_TEAMFFA_2cxx . . $ `src/common/bnet_protocol.h:2967:9`!: |
| 610 | return game_option_teamffa_2cxx . . $ pvpgn/bnetd/game_option_teamffa_2.; |
| 611 | default: |
| 612 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 613 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 614 | } |
| 615 | case game_type_teamctfcxx . . $ pvpgn/bnetd/game_type_teamctf.: |
| 616 | switch (bngoption) |
| 617 | { |
| 618 | case CLIENT_STARTGAME4_OPTION_TEAMCTF_4cxx . . $ `src/common/bnet_protocol.h:2968:9`!: |
| 619 | return game_option_teamctf_4cxx . . $ pvpgn/bnetd/game_option_teamctf_4.; |
| 620 | case CLIENT_STARTGAME4_OPTION_TEAMCTF_3cxx . . $ `src/common/bnet_protocol.h:2969:9`!: |
| 621 | return game_option_teamctf_3cxx . . $ pvpgn/bnetd/game_option_teamctf_3.; |
| 622 | case CLIENT_STARTGAME4_OPTION_TEAMCTF_2cxx . . $ `src/common/bnet_protocol.h:2970:9`!: |
| 623 | return game_option_teamctf_2cxx . . $ pvpgn/bnetd/game_option_teamctf_2.; |
| 624 | default: |
| 625 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 626 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 627 | } |
| 628 | case game_type_pglcxx . . $ pvpgn/bnetd/game_type_pgl.: |
| 629 | switch (bngoption) |
| 630 | { |
| 631 | default: |
| 632 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 633 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 634 | } |
| 635 | case game_type_topvbotcxx . . $ pvpgn/bnetd/game_type_topvbot.: |
| 636 | switch (bngoption) |
| 637 | { |
| 638 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_1cxx . . $ `src/common/bnet_protocol.h:2972:9`!: |
| 639 | return game_option_topvbot_1cxx . . $ pvpgn/bnetd/game_option_topvbot_1.; |
| 640 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_2cxx . . $ `src/common/bnet_protocol.h:2973:9`!: |
| 641 | return game_option_topvbot_2cxx . . $ pvpgn/bnetd/game_option_topvbot_2.; |
| 642 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_3cxx . . $ `src/common/bnet_protocol.h:2974:9`!: |
| 643 | return game_option_topvbot_3cxx . . $ pvpgn/bnetd/game_option_topvbot_3.; |
| 644 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_4cxx . . $ `src/common/bnet_protocol.h:2975:9`!: |
| 645 | return game_option_topvbot_4cxx . . $ pvpgn/bnetd/game_option_topvbot_4.; |
| 646 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_5cxx . . $ `src/common/bnet_protocol.h:2976:9`!: |
| 647 | return game_option_topvbot_5cxx . . $ pvpgn/bnetd/game_option_topvbot_5.; |
| 648 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_6cxx . . $ `src/common/bnet_protocol.h:2977:9`!: |
| 649 | return game_option_topvbot_6cxx . . $ pvpgn/bnetd/game_option_topvbot_6.; |
| 650 | case CLIENT_STARTGAME4_OPTION_TOPVBOT_7cxx . . $ `src/common/bnet_protocol.h:2978:9`!: |
| 651 | return game_option_topvbot_7cxx . . $ pvpgn/bnetd/game_option_topvbot_7.; |
| 652 | default: |
| 653 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft bnet game option for \"{}\" game \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype), bngoption); |
| 654 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 655 | } |
| 656 | case game_type_nonecxx . . $ pvpgn/bnetd/game_type_none.: |
| 657 | default: |
| 658 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown Starcraft game type \"{}\" {}({})", tag_uint_to_str(clienttag_str, clienttag), (unsigned int)gtype, game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(gtype)); |
| 659 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 660 | } |
| 661 | } |
| 662 | else if (clienttag == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:111:9`! || |
| 663 | clienttag == CLIENTTAG_WAR3XP_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:113:9`!) |
| 664 | { |
| 665 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 666 | } |
| 667 | else |
| 668 | { |
| 669 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown game clienttag \"{}\" {}", tag_uint_to_str(clienttag_str, clienttag), (unsigned int)gtype); |
| 670 | return game_option_nonecxx . . $ pvpgn/bnetd/game_option_none.; |
| 671 | } |
| 672 | } |
| 673 | |
| 674 | |
| 675 | extern t_game_resultcxx . . $ pvpgn/bnetd/t_game_result# bngresult_to_gresultcxx . . $ pvpgn/bnetd/bngresult_to_gresult(18bda09b40921f72).(unsigned int bngresult) |
| 676 | { |
| 677 | switch (bngresult) |
| 678 | { |
| 679 | case CLIENT_GAME_REPORT_RESULT_PLAYINGcxx . . $ `src/common/bnet_protocol.h:3533:9`!: |
| 680 | return game_result_playingcxx . . $ pvpgn/bnetd/game_result_playing.; |
| 681 | case CLIENT_GAME_REPORT_RESULT_WINcxx . . $ `src/common/bnet_protocol.h:3534:9`!: |
| 682 | return game_result_wincxx . . $ pvpgn/bnetd/game_result_win.; |
| 683 | case CLIENT_GAME_REPORT_RESULT_LOSScxx . . $ `src/common/bnet_protocol.h:3535:9`!: |
| 684 | return game_result_losscxx . . $ pvpgn/bnetd/game_result_loss.; |
| 685 | case CLIENT_GAME_REPORT_RESULT_DRAWcxx . . $ `src/common/bnet_protocol.h:3536:9`!: |
| 686 | return game_result_drawcxx . . $ pvpgn/bnetd/game_result_draw.; |
| 687 | case CLIENT_GAME_REPORT_RESULT_DISCONNECTcxx . . $ `src/common/bnet_protocol.h:3537:9`!: |
| 688 | return game_result_disconnectcxx . . $ pvpgn/bnetd/game_result_disconnect.; |
| 689 | case CLIENT_GAME_REPORT_RESULT_OBSERVERcxx . . $ `src/common/bnet_protocol.h:3538:9`!: |
| 690 | return game_result_observercxx . . $ pvpgn/bnetd/game_result_observer.; |
| 691 | default: |
| 692 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "unknown bnet game result {}", bngresult); |
| 693 | return game_result_disconnectcxx . . $ pvpgn/bnetd/game_result_disconnect.; /* bad packet? */ |
| 694 | } |
| 695 | } |
| 696 | |
| 697 | |
| 698 | extern t_game_maptypecxx . . $ pvpgn/bnetd/t_game_maptype# bngmaptype_to_gmaptypecxx . . $ pvpgn/bnetd/bngmaptype_to_gmaptype(c930fcd4135f4c5).(unsigned int bngmaptype) |
| 699 | { |
| 700 | switch (bngmaptype) |
| 701 | { |
| 702 | case CLIENT_MAPTYPE_SELFMADEcxx . . $ `src/common/bnet_protocol.h:2986:9`!: |
| 703 | return game_maptype_selfmadecxx . . $ pvpgn/bnetd/game_maptype_selfmade.; |
| 704 | case CLIENT_MAPTYPE_BLIZZARDcxx . . $ `src/common/bnet_protocol.h:2987:9`!: |
| 705 | return game_maptype_blizzardcxx . . $ pvpgn/bnetd/game_maptype_blizzard.; |
| 706 | case CLIENT_MAPTYPE_LADDERcxx . . $ `src/common/bnet_protocol.h:2988:9`!: |
| 707 | return game_maptype_laddercxx . . $ pvpgn/bnetd/game_maptype_ladder.; |
| 708 | case CLIENT_MAPTYPE_PGLcxx . . $ `src/common/bnet_protocol.h:2989:9`!: |
| 709 | return game_maptype_pglcxx . . $ pvpgn/bnetd/game_maptype_pgl.; |
| 710 | case CLIENT_MAPTYPE_KBKcxx . . $ `src/common/bnet_protocol.h:2990:9`!: |
| 711 | return game_maptype_kbkcxx . . $ pvpgn/bnetd/game_maptype_kbk.; |
| 712 | case CLIENT_MAPTYPE_CompUSAcxx . . $ `src/common/bnet_protocol.h:2991:9`!: |
| 713 | return game_maptype_compusacxx . . $ pvpgn/bnetd/game_maptype_compusa.; |
| 714 | default: |
| 715 | return game_maptype_nonecxx . . $ pvpgn/bnetd/game_maptype_none.; |
| 716 | } |
| 717 | } |
| 718 | |
| 719 | |
| 720 | extern t_game_tilesetcxx . . $ pvpgn/bnetd/t_game_tileset# bngtileset_to_gtilesetcxx . . $ pvpgn/bnetd/bngtileset_to_gtileset(138d0afb307efd35).(unsigned int bngtileset) |
| 721 | { |
| 722 | switch (bngtileset) |
| 723 | { |
| 724 | case CLIENT_TILESET_BADLANDScxx . . $ `src/common/bnet_protocol.h:3003:9`!: |
| 725 | return game_tileset_badlandscxx . . $ pvpgn/bnetd/game_tileset_badlands.; |
| 726 | case CLIENT_TILESET_SPACEcxx . . $ `src/common/bnet_protocol.h:3004:9`!: |
| 727 | return game_tileset_spacecxx . . $ pvpgn/bnetd/game_tileset_space.; |
| 728 | case CLIENT_TILESET_INSTALLATIONcxx . . $ `src/common/bnet_protocol.h:3005:9`!: |
| 729 | return game_tileset_installationcxx . . $ pvpgn/bnetd/game_tileset_installation.; |
| 730 | case CLIENT_TILESET_ASHWORLDcxx . . $ `src/common/bnet_protocol.h:3006:9`!: |
| 731 | return game_tileset_ashworldcxx . . $ pvpgn/bnetd/game_tileset_ashworld.; |
| 732 | case CLIENT_TILESET_JUNGLEcxx . . $ `src/common/bnet_protocol.h:3007:9`!: |
| 733 | return game_tileset_junglecxx . . $ pvpgn/bnetd/game_tileset_jungle.; |
| 734 | case CLIENT_TILESET_DESERTcxx . . $ `src/common/bnet_protocol.h:3008:9`!: |
| 735 | return game_tileset_desertcxx . . $ pvpgn/bnetd/game_tileset_desert.; |
| 736 | case CLIENT_TILESET_ICEcxx . . $ `src/common/bnet_protocol.h:3009:9`!: |
| 737 | return game_tileset_icecxx . . $ pvpgn/bnetd/game_tileset_ice.; |
| 738 | case CLIENT_TILESET_TWILIGHTcxx . . $ `src/common/bnet_protocol.h:3010:9`!: |
| 739 | return game_tileset_twilightcxx . . $ pvpgn/bnetd/game_tileset_twilight.; |
| 740 | default: |
| 741 | return game_tileset_nonecxx . . $ pvpgn/bnetd/game_tileset_none.; |
| 742 | } |
| 743 | } |
| 744 | |
| 745 | |
| 746 | extern t_game_speedcxx . . $ pvpgn/bnetd/t_game_speed# bngspeed_to_gspeedcxx . . $ pvpgn/bnetd/bngspeed_to_gspeed(6cdfbf9cdc1ab3c1).(unsigned int bngspeed) |
| 747 | { |
| 748 | switch (bngspeed) |
| 749 | { |
| 750 | case CLIENT_GAMESPEED_SLOWESTcxx . . $ `src/common/bnet_protocol.h:2994:9`!: |
| 751 | return game_speed_slowestcxx . . $ pvpgn/bnetd/game_speed_slowest.; |
| 752 | case CLIENT_GAMESPEED_SLOWERcxx . . $ `src/common/bnet_protocol.h:2995:9`!: |
| 753 | return game_speed_slowercxx . . $ pvpgn/bnetd/game_speed_slower.; |
| 754 | case CLIENT_GAMESPEED_SLOWcxx . . $ `src/common/bnet_protocol.h:2996:9`!: |
| 755 | return game_speed_slowcxx . . $ pvpgn/bnetd/game_speed_slow.; |
| 756 | case CLIENT_GAMESPEED_NORMALcxx . . $ `src/common/bnet_protocol.h:2997:9`!: |
| 757 | return game_speed_normalcxx . . $ pvpgn/bnetd/game_speed_normal.; |
| 758 | case CLIENT_GAMESPEED_FASTcxx . . $ `src/common/bnet_protocol.h:2998:9`!: |
| 759 | return game_speed_fastcxx . . $ pvpgn/bnetd/game_speed_fast.; |
| 760 | case CLIENT_GAMESPEED_FASTERcxx . . $ `src/common/bnet_protocol.h:2999:9`!: |
| 761 | return game_speed_fastercxx . . $ pvpgn/bnetd/game_speed_faster.; |
| 762 | case CLIENT_GAMESPEED_FASTESTcxx . . $ `src/common/bnet_protocol.h:3000:9`!: |
| 763 | return game_speed_fastestcxx . . $ pvpgn/bnetd/game_speed_fastest.; |
| 764 | default: |
| 765 | return game_speed_nonecxx . . $ pvpgn/bnetd/game_speed_none.; |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | t_game_speedcxx . . $ pvpgn/bnetd/t_game_speed# w3speed_to_gspeedcxx . . $ pvpgn/bnetd/w3speed_to_gspeed(6cdfbf9cdc1ab3c1).(unsigned int w3speed) |
| 770 | { |
| 771 | switch (w3speed) |
| 772 | { |
| 773 | case 0: return game_speed_slowcxx . . $ pvpgn/bnetd/game_speed_slow.; |
| 774 | case 1: return game_speed_normalcxx . . $ pvpgn/bnetd/game_speed_normal.; |
| 775 | case 2: return game_speed_fastcxx . . $ pvpgn/bnetd/game_speed_fast.; |
| 776 | default: return game_speed_nonecxx . . $ pvpgn/bnetd/game_speed_none.; |
| 777 | } |
| 778 | } |
| 779 | |
| 780 | |
| 781 | extern t_game_difficultycxx . . $ pvpgn/bnetd/t_game_difficulty# bngdifficulty_to_gdifficultycxx . . $ pvpgn/bnetd/bngdifficulty_to_gdifficulty(e680e4a7510ede48).(unsigned int bngdifficulty) |
| 782 | { |
| 783 | switch (bngdifficulty) |
| 784 | { |
| 785 | case CLIENT_DIFFICULTY_NORMALcxx . . $ `src/common/bnet_protocol.h:3013:9`!: |
| 786 | return game_difficulty_normalcxx . . $ pvpgn/bnetd/game_difficulty_normal.; |
| 787 | case CLIENT_DIFFICULTY_NIGHTMAREcxx . . $ `src/common/bnet_protocol.h:3014:9`!: |
| 788 | return game_difficulty_nightmarecxx . . $ pvpgn/bnetd/game_difficulty_nightmare.; |
| 789 | case CLIENT_DIFFICULTY_HELLcxx . . $ `src/common/bnet_protocol.h:3015:9`!: |
| 790 | return game_difficulty_hellcxx . . $ pvpgn/bnetd/game_difficulty_hell.; |
| 791 | case CLIENT_DIFFICULTY_HARDCORE_NORMALcxx . . $ `src/common/bnet_protocol.h:3016:9`!: |
| 792 | return game_difficulty_hardcore_normalcxx . . $ pvpgn/bnetd/game_difficulty_hardcore_normal.; |
| 793 | case CLIENT_DIFFICULTY_HARDCORE_NIGHTMAREcxx . . $ `src/common/bnet_protocol.h:3017:9`!: |
| 794 | return game_difficulty_hardcore_nightmarecxx . . $ pvpgn/bnetd/game_difficulty_hardcore_nightmare.; |
| 795 | case CLIENT_DIFFICULTY_HARDCORE_HELLcxx . . $ `src/common/bnet_protocol.h:3018:9`!: |
| 796 | return game_difficulty_hardcore_hellcxx . . $ pvpgn/bnetd/game_difficulty_hardcore_hell.; |
| 797 | default: |
| 798 | return game_difficulty_nonecxx . . $ pvpgn/bnetd/game_difficulty_none.; |
| 799 | } |
| 800 | } |
| 801 | |
| 802 | |
| 803 | static const char * _w3_decrypt_mapinfocxx . . $ pvpgn/bnetd/_w3_decrypt_mapinfo(fb58d2e09a2a1ce6).(const char *enc) |
| 804 | { |
| 805 | char *mapinfo; |
| 806 | char *dec; |
| 807 | unsigned pos; |
| 808 | unsigned char bitmask; |
| 809 | |
| 810 | if (!(mapinfo = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(enc))) { |
| 811 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "not enough memory to setup temporary buffer"); |
| 812 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 813 | } |
| 814 | |
| 815 | dec = mapinfo; |
| 816 | pos = 0; |
| 817 | bitmask = 0; /* stupid gcc warning */ |
| 818 | while (*enc) |
| 819 | { |
| 820 | if (pos % 8) |
| 821 | { |
| 822 | *dec = *enc; |
| 823 | if (!(bitmask & 0x1)) (*dec)--; |
| 824 | dec++; |
| 825 | bitmask >>= 1; |
| 826 | } |
| 827 | else |
| 828 | bitmask = *enc >> 1; |
| 829 | enc++; |
| 830 | pos++; |
| 831 | } |
| 832 | *dec = '\0'; |
| 833 | |
| 834 | return mapinfo; |
| 835 | } |
| 836 | |
| 837 | |
| 838 | extern int game_parse_infocxx . . $ pvpgn/bnetd/game_parse_info(bfbe5c8efad5152b).(t_gamecxx . . $ pvpgn/bnetd/t_game# * game, char const * gameinfo) |
| 839 | { |
| 840 | t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag; |
| 841 | char * save; |
| 842 | char * line1; |
| 843 | char * line2; |
| 844 | char * currtok; |
| 845 | char const * unknown; |
| 846 | char const * mapsize; |
| 847 | char const * maxplayers; |
| 848 | char const * speed; |
| 849 | char const * maptype; |
| 850 | char const * gametype; |
| 851 | char const * option; |
| 852 | char const * checksum; |
| 853 | char const * tileset; |
| 854 | char const * player; |
| 855 | char const * mapname; |
| 856 | unsigned int bngmapsize; |
| 857 | unsigned int bngmaxplayers; |
| 858 | unsigned int bngspeed; |
| 859 | unsigned int bngmaptype; |
| 860 | unsigned int bngtileset; |
| 861 | |
| 862 | if (!game) |
| 863 | { |
| 864 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL game"); |
| 865 | return -1; |
| 866 | } |
| 867 | if (!gameinfo) |
| 868 | { |
| 869 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL gameinfo"); |
| 870 | return -1; |
| 871 | } |
| 872 | |
| 873 | /* |
| 874 | |
| 875 | BW 104: |
| 876 | 9: recv class=bnet[0x01] type=CLIENT_STARTGAME4[0x1cff] length=74 |
| 877 | 0000: FF 1C 4A 00 00 00 00 00 00 00 00 00 09 00 01 00 ..J............. |
| 878 | 0010: 00 00 00 00 01 00 00 00 4E 4F 50 45 4E 41 4C 54 ........NOPENALT |
| 879 | 0020: 59 00 00 2C 34 34 2C 31 34 2C 2C 32 2C 39 2C 31 Y..,44,14,,2,9,1 |
| 880 | 0030: 2C 33 65 33 37 61 38 34 63 2C 33 2C 52 6F 73 73 ,3e37a84c,3,Ross |
| 881 | 0040: 0D 41 73 68 72 69 67 6F 0D 00 .Ashrigo.. |
| 882 | |
| 883 | Diablo: |
| 884 | 7: cli class=bnet[0x01] type=CLIENT_STARTGAME3[0x1aff] length=105 |
| 885 | 0000: FF 1A 69 00 01 00 00 00 00 00 00 00 00 00 00 00 ..i............. |
| 886 | 0010: 0F 00 00 00 00 00 00 00 E0 17 00 00 61 73 64 66 ............asdf |
| 887 | 0020: 61 73 64 66 61 73 64 66 61 73 64 66 32 00 61 73 asdfasdfasdf2.as |
| 888 | 0030: 64 66 61 73 64 66 73 61 64 66 61 73 64 66 32 00 dfasdfsadfasdf2. |
| 889 | 0040: 30 0D 7A 62 6E 7A 62 6E 7A 62 6E 0D 4C 54 52 44 0.zbnzbnzbn.LTRD |
| 890 | 0050: 20 31 20 30 20 30 20 33 30 20 31 30 20 32 30 20 1 0 0 30 10 20 |
| 891 | 0060: 32 35 20 31 30 30 20 30 00 25 100 0. |
| 892 | |
| 893 | 10: recv class=bnet[0x01] type=CLIENT_STARTGAME3[0x1aff] length=72 |
| 894 | 0000: FF 1A 48 00 00 00 00 00 00 00 00 00 00 00 00 00 ..H............. |
| 895 | 0010: 0F 00 00 00 00 00 00 00 E0 17 00 00 61 6E 73 00 ............ans. |
| 896 | 0020: 00 30 0D 77 61 72 72 69 6F 72 0D 4C 54 52 44 20 .0.warrior.LTRD |
| 897 | 0030: 31 20 30 20 30 20 33 30 20 31 30 20 32 30 20 32 1 0 0 30 10 20 2 |
| 898 | 0040: 35 20 31 30 30 20 30 00 5 100 0. |
| 899 | |
| 900 | |
| 901 | Warcraft: |
| 902 | 4: srv class=bnet[0x01] type=SERVER_GAMELISTREPLY[0x09ff] length=524 |
| 903 | 0000: FF 09 0C 02 05 00 00 00 02 00 01 00 09 04 00 00 ................ |
| 904 | 0010: 02 00 17 E0 D0 C6 66 F0 00 00 00 00 00 00 00 00 ......f......... |
| 905 | 0020: 04 00 00 00 74 00 00 00 48 65 79 77 6F 6F 64 73 ....t...Heywoods |
| 906 | 0030: 20 47 4F 57 32 76 32 00 00 2C 2C 2C 36 2C 32 2C GOW2v2..,,,6,2, |
| 907 | 0040: 32 2C 31 2C 31 39 37 33 64 35 66 32 2C 33 30 30 2,1,1973d5f2,300 |
| 908 | 0050: 30 2C 48 65 79 77 6F 6F 64 0D 47 61 72 64 65 6E 0,Heywood.Garden |
| 909 | 0060: 20 6F 66 20 77 61 72 20 42 4E 45 2E 70 75 64 0D of war BNE.pud. |
| 910 | 0070: 00 09 00 02 00 09 04 00 00 02 00 17 E0 CF 45 3E ..............E> |
| 911 | 0080: 65 00 00 00 00 00 00 00 00 10 00 00 00 11 00 00 e............... |
| 912 | 0090: 00 67 6F 77 20 6C 61 64 64 65 72 20 31 76 31 00 .gow ladder 1v1. |
| 913 | 00A0: 00 2C 2C 2C 36 2C 32 2C 39 2C 32 2C 65 66 38 34 .,,,6,2,9,2,ef84 |
| 914 | 00B0: 33 61 35 33 2C 2C 77 63 73 63 6D 61 73 74 65 72 3a53,,wcscmaster |
| 915 | 00C0: 0D 47 61 72 64 65 6E 20 6F 66 20 77 61 72 20 42 .Garden of war B |
| 916 | 00D0: 4E 45 2E 70 75 64 0D 00 09 00 01 00 09 04 00 00 NE.pud.......... |
| 917 | 00E0: 02 00 17 E0 98 CE 7C E2 00 00 00 00 00 00 00 00 ......|......... |
| 918 | 00F0: 04 00 00 00 4D 00 00 00 4C 61 64 64 65 72 20 46 ....M...Ladder F |
| 919 | 0100: 46 41 20 6F 6E 6C 79 00 00 2C 2C 2C 36 2C 32 2C FA only..,,,6,2, |
| 920 | 0110: 39 2C 31 2C 61 65 32 66 61 61 62 37 2C 2C 6B 69 9,1,ae2faab7,,ki |
| 921 | 0120: 6C 6F 67 72 61 6D 0D 50 6C 61 69 6E 73 20 6F 66 logram.Plains of |
| 922 | 0130: 20 73 6E 6F 77 20 42 4E 45 2E 70 75 64 0D 00 0F snow BNE.pud... |
| 923 | 0140: 00 04 00 09 04 00 00 02 00 17 E0 C6 0B 13 3C 00 ..............<. |
| 924 | 0150: 00 00 00 00 00 00 00 04 00 00 00 BE 00 00 00 4C ...............L |
| 925 | 0160: 61 64 64 65 72 20 31 20 6F 6E 20 31 00 00 2C 2C adder 1 on 1..,, |
| 926 | 0170: 2C 36 2C 32 2C 66 2C 34 2C 66 63 63 35 38 65 34 ,6,2,f,4,fcc58e4 |
| 927 | 0180: 61 2C 37 32 30 30 2C 49 63 65 36 39 62 75 72 67 a,7200,Ice69burg |
| 928 | 0190: 0D 46 6F 72 65 73 74 20 54 72 61 69 6C 20 42 4E .Forest Trail BN |
| 929 | 01A0: 45 2E 70 75 64 0D 00 0F 00 04 00 09 04 00 00 02 E.pud........... |
| 930 | 01B0: 00 04 15 D1 F4 B6 6A 00 00 00 00 00 00 00 00 04 ......j......... |
| 931 | 01C0: 00 00 00 C8 03 00 00 52 6F 63 6B 20 49 74 21 21 .......Rock It!! |
| 932 | 01D0: 20 32 76 32 2B 00 00 2C 2C 2C 38 2C 31 2C 66 2C 2v2+..,,,8,1,f, |
| 933 | 01E0: 34 2C 62 30 36 38 63 62 34 62 2C 66 30 30 30 2C 4,b068cb4b,f000, |
| 934 | 01F0: 6E 75 66 74 63 72 6F 77 0D 43 72 6F 73 73 68 61 nuftcrow.Crossha |
| 935 | 0200: 69 72 20 42 4E 45 2E 70 75 64 0D 00 ir BNE.pud.. |
| 936 | |
| 937 | FIXME: |
| 938 | Note the map size and max players fields are empty. Does WCII have different |
| 939 | map sizes and starting positions? If so, are they reported here? |
| 940 | Also note the map tileset is "3000". Maybe this isn't the tileset for WCII |
| 941 | but instead the starting gold or something. |
| 942 | |
| 943 | FIXME: |
| 944 | Also, what is the upper player limit on WCII... 8 like on Starcraft? |
| 945 | */ |
| 946 | |
| 947 | if (!(clienttag = game_get_clienttagcxx . . $ pvpgn/bnetd/game_get_clienttag(d7b85b5cd2056731).(game))) |
| 948 | { |
| 949 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "NULL clienttag for game?"); |
| 950 | return -1; |
| 951 | } |
| 952 | |
| 953 | if (clienttag == CLIENTTAG_DIABLORTL_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:93:9`! || |
| 954 | clienttag == CLIENTTAG_DIABLOSHR_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:95:9`!) |
| 955 | { |
| 956 | game_set_maxplayerscxx . . $ pvpgn/bnetd/game_set_maxplayers(9a59f4516a0d09ce).(game, 4); |
| 957 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_debugcxx . . $ pvpgn/eventlog_level_debug., __FUNCTION__, "no gameinfo for Diablo"); |
| 958 | return 0; |
| 959 | } |
| 960 | else if (clienttag == CLIENTTAG_DIABLO2DV_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:99:9`! || |
| 961 | clienttag == CLIENTTAG_DIABLO2XP_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:105:9`!) |
| 962 | { |
| 963 | if ((game->typecxx . . $ pvpgn/bnetd/game#type. == game_type_diablo2closedcxx . . $ pvpgn/bnetd/game_type_diablo2closed.) && |
| 964 | (!stdcxx . . $ std/::strlen(gameinfo))) |
| 965 | |
| 966 | { |
| 967 | /* D2 closed games are handled by d2cs so we can have only have a generic startgame4 |
| 968 | without any info :(, this fix also a memory leak for description allocation */ |
| 969 | game_set_difficultycxx . . $ pvpgn/bnetd/game_set_difficulty(9a59f4516a0d09ce).(game, game_difficulty_nonecxx . . $ pvpgn/bnetd/game_difficulty_none.); |
| 970 | game_set_descriptioncxx . . $ pvpgn/bnetd/game_set_description(bfbe5c8efad5152b).(game, ""); |
| 971 | } |
| 972 | else |
| 973 | { |
| 974 | char difficulty[2]; |
| 975 | unsigned int bngdifficulty; |
| 976 | |
| 977 | if (!stdcxx . . $ std/::strlen(gameinfo)) |
| 978 | { |
| 979 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "got empty gameinfo (from D2 client)"); |
| 980 | return -1; |
| 981 | } |
| 982 | |
| 983 | difficulty[0] = gameinfo[0]; |
| 984 | difficulty[1] = '\0'; |
| 985 | if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(difficulty, &bngdifficulty) < 0) |
| 986 | { |
| 987 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing difficulty) \"{}\"", gameinfo); |
| 988 | return -1; |
| 989 | } |
| 990 | game_set_difficultycxx . . $ pvpgn/bnetd/game_set_difficulty(9a59f4516a0d09ce).(game, bngdifficulty); |
| 991 | game_set_descriptioncxx . . $ pvpgn/bnetd/game_set_description(bfbe5c8efad5152b).(game, &gameinfo[1]); |
| 992 | |
| 993 | if ((game->typecxx . . $ pvpgn/bnetd/game#type. == game_type_diablo2closedcxx . . $ pvpgn/bnetd/game_type_diablo2closed.)) |
| 994 | { |
| 995 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_debugcxx . . $ pvpgn/eventlog_level_debug., __FUNCTION__, "D2 bug workarround needed (open games tagged as closed)"); |
| 996 | game->typecxx . . $ pvpgn/bnetd/game#type. = game_type_diablo2opencxx . . $ pvpgn/bnetd/game_type_diablo2open.; |
| 997 | } |
| 998 | } |
| 999 | return 0; |
| 1000 | } |
| 1001 | else if (clienttag == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:111:9`! || |
| 1002 | clienttag == CLIENTTAG_WAR3XP_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:113:9`!) |
| 1003 | { |
| 1004 | /* Warcraft 3 game info format -- by Soar |
| 1005 | 0x00 -- 1 byte (char, Empty slots) |
| 1006 | 0x01 -- 8 bytes (char[8], Count of games created) |
| 1007 | |
| 1008 | From offset 0x11 there is a bitmask byte before every 7 bytes, offset 0x09 to 0x10 also has bitmask 0. |
| 1009 | Bit 0 corresponds to byte 0, bit 1 to byte 1, and so on. |
| 1010 | Except offset 0x09, only Byte 1-7 contribute to the info data, bit 0 seems to be always 1; |
| 1011 | Decoding these bytes works as follows: |
| 1012 | If the corresponding bit is a '1' then the character is moved over directly. |
| 1013 | If the corresponding bit is a '0' then subtract 1 from the character. |
| 1014 | (We decode info data and remove the bitmask bytes from info data in following description) |
| 1015 | 0x09 -- 5 bytes (char[5], map options) |
| 1016 | 0x0e -- 1 bytes (0, seems to be a seperate sign) |
| 1017 | 0x0f -- 2 bytes (short, mapsize x) |
| 1018 | 0x11 -- 2 bytes (short, mapsize y) |
| 1019 | 0x13 -- 4 bytes (long, unknown, map checksum ?) |
| 1020 | 0x17 -- n bytes (string, mapname \0 terminated) |
| 1021 | 0x17+n -- m bytes (string, game creator \0 terminated, but we already set this to game before, :P) |
| 1022 | 0x17+n+m -- 2 bytes: \0 \0 (first \0 might be a reserved string for password, but blizzard didn't implement it, second \0 is the info string end sign) |
| 1023 | */ |
| 1024 | const char *pstr; |
| 1025 | |
| 1026 | if (!stdcxx . . $ std/::strlen(gameinfo)) |
| 1027 | { |
| 1028 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "got empty gameinfo (from W3 client)"); |
| 1029 | return -1; |
| 1030 | } |
| 1031 | |
| 1032 | if (stdcxx . . $ std/::strlen(gameinfo) < 0xf + 2 + 1 + 2 + 4) { |
| 1033 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got too short W3 mapinfo"); |
| 1034 | return -1; |
| 1035 | } |
| 1036 | pstr = gameinfo + 9; |
| 1037 | pstr = _w3_decrypt_mapinfocxx . . $ pvpgn/bnetd/_w3_decrypt_mapinfo(fb58d2e09a2a1ce6).(pstr); |
| 1038 | if (!pstr) return -1; |
| 1039 | /* after decryption we dont have the mask bytes anymore so offsets need |
| 1040 | * to be adjusted acordingly */ |
| 1041 | game_set_speedcxx . . $ pvpgn/bnetd/game_set_speed(44398f37e1e67e30).(game, w3speed_to_gspeedcxx . . $ pvpgn/bnetd/w3speed_to_gspeed(6cdfbf9cdc1ab3c1).(bn_byte_get(*((bn_byte*)(pstr))))); |
| 1042 | game_set_mapsize_xcxx . . $ pvpgn/bnetd/game_set_mapsize_x(9a59f4516a0d09ce).(game, bn_short_get(*((bn_short*)(pstr + 5)))); |
| 1043 | game_set_mapsize_ycxx . . $ pvpgn/bnetd/game_set_mapsize_y(9a59f4516a0d09ce).(game, bn_short_get(*((bn_short*)(pstr + 7)))); |
| 1044 | game_set_mapnamecxx . . $ pvpgn/bnetd/game_set_mapname(bfbe5c8efad5152b).(game, pstr + 13); |
| 1045 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void*)pstr); |
| 1046 | |
| 1047 | return 0; |
| 1048 | } |
| 1049 | |
| 1050 | /* otherwise it's Starcraft, Brood War, or Warcraft II */ |
| 1051 | if (!(save = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(gameinfo))) |
| 1052 | { |
| 1053 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not allocate memory for save"); |
| 1054 | return -1; |
| 1055 | } |
| 1056 | |
| 1057 | if (!(line1 = stdcxx . . $ std/::strtok(save, "\r"))) /* actual game info fields */ |
| 1058 | { |
| 1059 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing line1) \"{}\"", gameinfo); |
| 1060 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1061 | return -1; |
| 1062 | } |
| 1063 | if (!(line2 = stdcxx . . $ std/::strtok(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, "\r"))) |
| 1064 | { |
| 1065 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing player) \"{}\"", gameinfo); |
| 1066 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1067 | return -1; |
| 1068 | } |
| 1069 | /* is there room for another field after that? */ |
| 1070 | |
| 1071 | /* |
| 1072 | * This is the same as the normal std::strtok() function but it doesn't skip over |
| 1073 | * empty entries. The C-library std::strtok() will skip past entries like 12,,3 |
| 1074 | * and rather than you being able to get "12", "", "3" you get "12", "3". |
| 1075 | * Since some values returned by the client contain these empty entries we |
| 1076 | * need this. Unlike std::strtok() all state is recorded in the first argument. |
| 1077 | */ |
| 1078 | currtok = line1; |
| 1079 | if (!(unknown = strsep(&currtok, ","))) /* skip past first field (always empty?) */ |
| 1080 | { |
| 1081 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing unknown)"); |
| 1082 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1083 | return -1; |
| 1084 | } |
| 1085 | if (!(mapsize = strsep(&currtok, ","))) |
| 1086 | { |
| 1087 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing mapsize)"); |
| 1088 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1089 | return -1; |
| 1090 | } |
| 1091 | if (!(maxplayers = strsep(&currtok, ","))) /* for later use (FIXME: what is upper field, max observers?) */ |
| 1092 | { |
| 1093 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing maxplayers)"); |
| 1094 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1095 | return -1; |
| 1096 | } |
| 1097 | if (!(speed = strsep(&currtok, ","))) |
| 1098 | { |
| 1099 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing speed)"); |
| 1100 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1101 | return -1; |
| 1102 | } |
| 1103 | if (!(maptype = strsep(&currtok, ","))) |
| 1104 | { |
| 1105 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing maptype)"); |
| 1106 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1107 | return -1; |
| 1108 | } |
| 1109 | if (!(gametype = strsep(&currtok, ","))) /* this is set from another field */ |
| 1110 | { |
| 1111 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing gametype)"); |
| 1112 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1113 | return -1; |
| 1114 | } |
| 1115 | if (!(option = strsep(&currtok, ","))) /* this is set from another field */ |
| 1116 | { |
| 1117 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing option)"); |
| 1118 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1119 | return -1; |
| 1120 | } |
| 1121 | if (!(checksum = strsep(&currtok, ","))) /* FIXME */ |
| 1122 | { |
| 1123 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing checksum)"); |
| 1124 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1125 | return -1; |
| 1126 | } |
| 1127 | if (!(tileset = strsep(&currtok, ","))) |
| 1128 | { |
| 1129 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing tileset)"); |
| 1130 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1131 | return -1; |
| 1132 | } |
| 1133 | if (!(player = strsep(&currtok, ","))) |
| 1134 | { |
| 1135 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "bad gameinfo format (missing player)"); |
| 1136 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1137 | return -1; |
| 1138 | } |
| 1139 | |
| 1140 | mapname = line2; /* only one item on this line */ |
| 1141 | |
| 1142 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_debugcxx . . $ pvpgn/eventlog_level_debug., __FUNCTION__, "got info \"{}\" \"{}\" \"{}\" \"{}\" \"{}\" \"{}\" \"{}\" \"{}\" \"{}\" \"{}\"", mapsize, maxplayers, speed, maptype, gametype, option, checksum, tileset, player, mapname); |
| 1143 | |
| 1144 | /* The map size is determined by breaking the number into two pieces and |
| 1145 | * multiplying each piece by 32. |
| 1146 | * for example, 34 = (32*3) x (32*4) = 96 x 128 |
| 1147 | */ |
| 1148 | /* special handling for mapsize. empty is 256x256 */ |
| 1149 | if ((mapsize[0] == '\0') || (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(mapsize, &bngmapsize) < 0)) |
| 1150 | bngmapsize = 88; /* 256x256 */ |
| 1151 | game_set_mapsize_xcxx . . $ pvpgn/bnetd/game_set_mapsize_x(9a59f4516a0d09ce).(game, (bngmapsize / 10) * 32); |
| 1152 | game_set_mapsize_ycxx . . $ pvpgn/bnetd/game_set_mapsize_y(9a59f4516a0d09ce).(game, (bngmapsize % 10) * 32); |
| 1153 | |
| 1154 | /* special handling for maxplayers, empty is 8 */ |
| 1155 | if ((maxplayers[0] == '\0') || (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(maxplayers, &bngmaxplayers) < 0)) |
| 1156 | bngmaxplayers = 8; |
| 1157 | game_set_maxplayerscxx . . $ pvpgn/bnetd/game_set_maxplayers(9a59f4516a0d09ce).(game, (bngmaxplayers % 10)); |
| 1158 | |
| 1159 | /* special handling for gamespeed. empty is fast */ |
| 1160 | if ((speed[0] == '\0') || (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(speed, &bngspeed) < 0)) |
| 1161 | bngspeed = CLIENT_GAMESPEED_FASTcxx . . $ `src/common/bnet_protocol.h:2998:9`!; |
| 1162 | game_set_speedcxx . . $ pvpgn/bnetd/game_set_speed(44398f37e1e67e30).(game, bngspeed_to_gspeedcxx . . $ pvpgn/bnetd/bngspeed_to_gspeed(6cdfbf9cdc1ab3c1).(bngspeed)); |
| 1163 | |
| 1164 | /* special handling for maptype. empty is self-made */ |
| 1165 | if ((maptype[0] == '\0') || (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(maptype, &bngmaptype) < 0)) |
| 1166 | bngmaptype = CLIENT_MAPTYPE_SELFMADEcxx . . $ `src/common/bnet_protocol.h:2986:9`!; |
| 1167 | game_set_maptypecxx . . $ pvpgn/bnetd/game_set_maptype(86556e9d61246f35).(game, bngmaptype_to_gmaptypecxx . . $ pvpgn/bnetd/bngmaptype_to_gmaptype(c930fcd4135f4c5).(bngmaptype)); |
| 1168 | |
| 1169 | /* special handling for tileset. empty is badlands */ |
| 1170 | if ((tileset[0] == '\0') || (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(tileset, &bngtileset) < 0)) |
| 1171 | bngtileset = CLIENT_TILESET_BADLANDScxx . . $ `src/common/bnet_protocol.h:3003:9`!; |
| 1172 | game_set_tilesetcxx . . $ pvpgn/bnetd/game_set_tileset(1f827d4ca92e1d0a).(game, bngtileset_to_gtilesetcxx . . $ pvpgn/bnetd/bngtileset_to_gtileset(138d0afb307efd35).(bngtileset)); |
| 1173 | |
| 1174 | game_set_mapnamecxx . . $ pvpgn/bnetd/game_set_mapname(bfbe5c8efad5152b).(game, mapname); |
| 1175 | |
| 1176 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(save); |
| 1177 | |
| 1178 | return 0; |
| 1179 | } |
| 1180 | |
| 1181 | } |
| 1182 | |
| 1183 | } |