| 1 | /* |
| 2 | * Copyright (C) 1998,1999,2000,2001 Ross Combs ([email protected]) |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; either version 2 |
| 7 | * of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | */ |
| 18 | #include "common/setup_before.h"cxx . . $ `<file>/src/common/setup_before.h`/ |
| 19 | #include "client_connect.h"cxx . . $ `<file>/src/client/client_connect.h`/ |
| 20 | |
| 21 | #include <cstring> |
| 22 | #include <cstdio> |
| 23 | #include <cerrno> |
| 24 | #include <ctime> |
| 25 | |
| 26 | #include "compat/gethostname.h"cxx . . $ `<file>/src/compat/gethostname.h`/ |
| 27 | #include "common/tag.h"cxx . . $ `<file>/src/common/tag.h`/ |
| 28 | #include "common/packet.h"cxx . . $ `<file>/src/common/packet.h`/ |
| 29 | #include "common/init_protocol.h"cxx . . $ `<file>/src/common/init_protocol.h`/ |
| 30 | #include "common/bnet_protocol.h"cxx . . $ `<file>/src/common/bnet_protocol.h`/ |
| 31 | #include "common/bn_type.h"cxx . . $ `<file>/src/common/bn_type.h`/ |
| 32 | #include "common/bnethash.h"cxx . . $ `<file>/src/common/bnethash.h`/ |
| 33 | #include "common/bnethashconv.h"cxx . . $ `<file>/src/common/bnethashconv.h`/ |
| 34 | #include "common/bnettime.h"cxx . . $ `<file>/src/common/bnettime.h`/ |
| 35 | #ifdef CLIENTDEBUGcxx . . $ `src/common/setup_before.h:49:9`! |
| 36 | # include "common/eventlog.h"cxx . . $ `<file>/src/common/eventlog.h`/ |
| 37 | #endif |
| 38 | #include "udptest.h"cxx . . $ `<file>/src/client/udptest.h`/ |
| 39 | #include "client.h"cxx . . $ `<file>/src/client/client.h`/ |
| 40 | |
| 41 | #ifdef HAVE_ARPA_INET_Hcxx . . $ `build/config.h:13:9`! |
| 42 | # include <arpa/inet.h> |
| 43 | #endif |
| 44 | #ifdef HAVE_WS2TCPIP_H |
| 45 | # include <Ws2tcpip.h> |
| 46 | #endif |
| 47 | |
| 48 | #include "common/setup_after.h"cxx . . $ `<file>/src/common/setup_after.h`/ |
| 49 | |
| 50 | |
| 51 | #define COMPNAMELENcxx . . $ `src/client/client_connect.cpp:51:9`! 128 |
| 52 | |
| 53 | #ifdef CLIENTDEBUGcxx . . $ `src/common/setup_before.h:49:9`! |
| 54 | # define dprintfcxx . . $ `src/client/client_connect.cpp:54:10`! printf |
| 55 | #else |
| 56 | # define dprintf if (0) printf |
| 57 | #endif |
| 58 | |
| 59 | |
| 60 | namespacecxx . . $ `$anonymous_namespace_src/client/client_connect.cpp`/ { |
| 61 | |
| 62 | int key_interpretcxx . . $ `$anonymous_namespace_src/client/client_connect.cpp`/key_interpret(eba9a92a1c55d5bc).(char const * cdkey, unsigned int * productid, unsigned int * keyvalue1, unsigned int * keyvalue2) |
| 63 | { |
| 64 | /* FIXME: implement... have example code from Eurijk! */ |
| 65 | *productid = 0; |
| 66 | *keyvalue1 = 0; |
| 67 | *keyvalue2 = 0; |
| 68 | return 0; |
| 69 | } |
| 70 | |
| 71 | |
| 72 | int get_defversioninfocxx . . $ `$anonymous_namespace_src/client/client_connect.cpp`/get_defversioninfo(9a02a8c2ff961901).(char const * progname, char const * clienttag, unsigned int * versionid, unsigned int * gameversion, char const * * exeinfo, unsigned int * checksum) |
| 73 | { |
| 74 | if (stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_DIABLORTLcxx . . $ `src/common/tag.h:92:9`!) == 0) |
| 75 | { |
| 76 | *versionid = CLIENT_VERSIONID_DRTLcxx . . $ `src/client/client_connect.h:23:9`!; |
| 77 | *gameversion = CLIENT_GAMEVERSION_DRTLcxx . . $ `src/client/client_connect.h:24:9`!; |
| 78 | *exeinfo = CLIENT_EXEINFO_DRTLcxx . . $ `src/client/client_connect.h:25:9`!; |
| 79 | *checksum = CLIENT_CHECKSUM_DRTLcxx . . $ `src/client/client_connect.h:26:9`!; |
| 80 | return 0; |
| 81 | } |
| 82 | |
| 83 | if (stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_STARCRAFTcxx . . $ `src/common/tag.h:86:9`!) == 0) |
| 84 | { |
| 85 | *versionid = CLIENT_VERSIONID_STARcxx . . $ `src/client/client_connect.h:29:9`!; |
| 86 | *gameversion = CLIENT_GAMEVERSION_STARcxx . . $ `src/client/client_connect.h:30:9`!; |
| 87 | *exeinfo = CLIENT_EXEINFO_STARcxx . . $ `src/client/client_connect.h:31:9`!; |
| 88 | *checksum = CLIENT_CHECKSUM_STARcxx . . $ `src/client/client_connect.h:32:9`!; |
| 89 | return 0; |
| 90 | } |
| 91 | |
| 92 | if (stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_SHAREWAREcxx . . $ `src/common/tag.h:90:9`!) == 0) |
| 93 | { |
| 94 | *versionid = CLIENT_VERSIONID_SSHRcxx . . $ `src/client/client_connect.h:35:9`!; |
| 95 | *gameversion = CLIENT_GAMEVERSION_SSHRcxx . . $ `src/client/client_connect.h:36:9`!; |
| 96 | *exeinfo = CLIENT_EXEINFO_SSHRcxx . . $ `src/client/client_connect.h:37:9`!; |
| 97 | *checksum = CLIENT_CHECKSUM_SSHRcxx . . $ `src/client/client_connect.h:38:9`!; |
| 98 | return 0; |
| 99 | } |
| 100 | |
| 101 | if (stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_BROODWARScxx . . $ `src/common/tag.h:88:9`!) == 0) |
| 102 | { |
| 103 | *versionid = CLIENT_VERSIONID_SEXPcxx . . $ `src/client/client_connect.h:41:9`!; |
| 104 | *gameversion = CLIENT_GAMEVERSION_SEXPcxx . . $ `src/client/client_connect.h:42:9`!; |
| 105 | *exeinfo = CLIENT_EXEINFO_SEXPcxx . . $ `src/client/client_connect.h:43:9`!; |
| 106 | *checksum = CLIENT_CHECKSUM_SEXPcxx . . $ `src/client/client_connect.h:44:9`!; |
| 107 | return 0; |
| 108 | } |
| 109 | |
| 110 | if (stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_WARCIIBNEcxx . . $ `src/common/tag.h:96:9`!) == 0) |
| 111 | { |
| 112 | *versionid = CLIENT_VERSIONID_W2BNcxx . . $ `src/client/client_connect.h:47:9`!; |
| 113 | *gameversion = CLIENT_GAMEVERSION_W2BNcxx . . $ `src/client/client_connect.h:48:9`!; |
| 114 | *exeinfo = CLIENT_EXEINFO_W2BNcxx . . $ `src/client/client_connect.h:49:9`!; |
| 115 | *checksum = CLIENT_CHECKSUM_W2BNcxx . . $ `src/client/client_connect.h:50:9`!; |
| 116 | return 0; |
| 117 | } |
| 118 | |
| 119 | if (stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_DIABLO2DVcxx . . $ `src/common/tag.h:98:9`!) == 0) |
| 120 | { |
| 121 | *versionid = CLIENT_VERSIONID_D2DVcxx . . $ `src/client/client_connect.h:53:9`!; |
| 122 | *gameversion = CLIENT_GAMEVERSION_D2DVcxx . . $ `src/client/client_connect.h:54:9`!; |
| 123 | *exeinfo = CLIENT_EXEINFO_D2DVcxx . . $ `src/client/client_connect.h:55:9`!; |
| 124 | *checksum = CLIENT_CHECKSUM_D2DVcxx . . $ `src/client/client_connect.h:56:9`!; |
| 125 | return 0; |
| 126 | } |
| 127 | |
| 128 | if (stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_DIABLO2XPcxx . . $ `src/common/tag.h:104:9`!) == 0) |
| 129 | { |
| 130 | *versionid = CLIENT_VERSIONID_D2XPcxx . . $ `src/client/client_connect.h:59:9`!; |
| 131 | *gameversion = CLIENT_GAMEVERSION_D2XPcxx . . $ `src/client/client_connect.h:60:9`!; |
| 132 | *exeinfo = CLIENT_EXEINFO_D2XPcxx . . $ `src/client/client_connect.h:61:9`!; |
| 133 | *checksum = CLIENT_CHECKSUM_D2XPcxx . . $ `src/client/client_connect.h:62:9`!; |
| 134 | return 0; |
| 135 | } |
| 136 | |
| 137 | if (stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_WARCRAFT3cxx . . $ `src/common/tag.h:110:9`!) == 0 || |
| 138 | stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_WAR3XPcxx . . $ `src/common/tag.h:112:9`!) == 0) |
| 139 | { |
| 140 | *versionid = CLIENT_VERSIONID_WAR3cxx . . $ `src/client/client_connect.h:65:9`!; |
| 141 | *gameversion = CLIENT_GAMEVERSION_WAR3cxx . . $ `src/client/client_connect.h:66:9`!; |
| 142 | *exeinfo = CLIENT_EXEINFO_WAR3cxx . . $ `src/client/client_connect.h:67:9`!; |
| 143 | *checksum = CLIENT_CHECKSUM_WAR3cxx . . $ `src/client/client_connect.h:68:9`!; |
| 144 | return 0; |
| 145 | } |
| 146 | |
| 147 | *versionid = 0; |
| 148 | *gameversion = 0; |
| 149 | *exeinfo = ""; |
| 150 | *checksum = 0; |
| 151 | |
| 152 | if (stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_BNCHATBOTcxx . . $ `src/common/tag.h:84:9`!) == 0) |
| 153 | return 0; |
| 154 | |
| 155 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: unsupported clienttag \"%s\"\n", progname, clienttag); |
| 156 | // aaron: dunno what we should return in case of this.. but returning nothing was definetly wrong |
| 157 | return -1; |
| 158 | } |
| 159 | |
| 160 | } |
| 161 | |
| 162 | namespace pvpgncxx . . $ pvpgn/ |
| 163 | { |
| 164 | |
| 165 | namespace clientcxx . . $ pvpgn/client/ |
| 166 | { |
| 167 | |
| 168 | extern int client_connectcxx . . $ pvpgn/client/client_connect(20c2760950162537).(char const * progname, char const * servname, unsigned short servport, char const * cdowner, char const * cdkey, char const * clienttag, int ignoreversion, struct sockaddr_in * saddr, unsigned int * sessionkey, unsigned int * sessionnum, char const * archtag, char const * gamelang) |
| 169 | { |
| 170 | struct hostent * host; |
| 171 | char const * username; |
| 172 | int sd; |
| 173 | t_packetcxx . . $ pvpgn/t_packet# * packet; |
| 174 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 175 | char compname[COMPNAMELENcxx . . $ `src/client/client_connect.cpp:51:9`!]; |
| 176 | int lsock; |
| 177 | unsigned short lsock_port; |
| 178 | unsigned int versionid; |
| 179 | unsigned int gameversion; |
| 180 | char const * exeinfo; |
| 181 | unsigned int checksum; |
| 182 | |
| 183 | if (!progname) |
| 184 | { |
| 185 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "got NULL progname\n"); |
| 186 | return -1; |
| 187 | } |
| 188 | if (!saddr) |
| 189 | { |
| 190 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: got NULL saddr\n", progname); |
| 191 | return -1; |
| 192 | } |
| 193 | if (!sessionkey) |
| 194 | { |
| 195 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: got NULL sessionkey\n", progname); |
| 196 | return -1; |
| 197 | } |
| 198 | if (!sessionnum) |
| 199 | { |
| 200 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: got NULL sessionnum\n", progname); |
| 201 | return -1; |
| 202 | } |
| 203 | |
| 204 | if (psock_initcxx . . $ `src/compat/psock.h:284:9`!() < 0) |
| 205 | { |
| 206 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not inialialize socket functions\n", progname); |
| 207 | return -1; |
| 208 | } |
| 209 | |
| 210 | if (!(host = gethostbyname(servname))) |
| 211 | { |
| 212 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: unknown host \"%s\"\n", progname, servname); |
| 213 | return -1; |
| 214 | } |
| 215 | if (host->h_addrtype != PSOCK_AF_INETcxx . . $ `src/compat/psock.h:189:9`!) |
| 216 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: host \"%s\" is not in IPv4 address family\n", progname, servname); |
| 217 | |
| 218 | if (gethostname(compname, COMPNAMELENcxx . . $ `src/client/client_connect.cpp:51:9`!) < 0) |
| 219 | { |
| 220 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not get host name (gethostname: %s)\n", progname, stdcxx . . $ std/::strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 221 | return -1; |
| 222 | } |
| 223 | #ifdef HAVE_GETLOGINcxx . . $ `build/config.h:47:9`! |
| 224 | if (!(username = getlogin())) |
| 225 | #endif |
| 226 | { |
| 227 | username = "unknown"; |
| 228 | dprintfcxx . . $ `src/client/client_connect.cpp:54:10`!("%s: could not get login name, using \"%s\" (getlogin: %s)\n", progname, username, stdcxx . . $ std/::strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 229 | } |
| 230 | |
| 231 | if ((sd = psock_socketcxx . . $ `src/compat/psock.h:287:9`!(PSOCK_PF_INETcxx . . $ `src/compat/psock.h:186:9`!, PSOCK_SOCK_STREAMcxx . . $ `src/compat/psock.h:192:9`!, PSOCK_IPPROTO_TCPcxx . . $ `src/compat/psock.h:197:10`!)) < 0) |
| 232 | { |
| 233 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not create socket (psock_socket: %s)\n", progname, stdcxx . . $ std/::strerror(psock_errnocxx . . $ `src/compat/psock.h:286:9`!())); |
| 234 | return -1; |
| 235 | } |
| 236 | |
| 237 | stdcxx . . $ std/::memset(saddr, 0, sizeof(*saddr)); |
| 238 | saddr->sin_family = PSOCK_AF_INETcxx . . $ `src/compat/psock.h:189:9`!; |
| 239 | saddr->sin_port = htons(servport); |
| 240 | stdcxx . . $ std/::memcpy(&saddr->sin_addr.s_addr, host->h_addr_list[0], host->h_length); |
| 241 | if (psock_connectcxx . . $ `src/compat/psock.h:294:9`!(sd, (struct sockaddr *)saddr, sizeof(*saddr)) < 0) |
| 242 | { |
| 243 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not connect to server \"%s\" port %hu (psock_connect: %s)\n", progname, servname, servport, stdcxx . . $ std/::strerror(psock_errnocxx . . $ `src/compat/psock.h:286:9`!())); |
| 244 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 245 | return -1; |
| 246 | } |
| 247 | |
| 248 | char addrstr[INET_ADDRSTRLENcxx . . $ `<external>/9581057695539925927/in.h:244:9`!] = { 0 }; |
| 249 | inet_ntop(AF_INETcxx . . $ `<external>/8962547315054503424/socket.h:97:9`!, &(saddr->sin_addr), addrstr, sizeof(addrstr)); |
| 250 | stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).("Connected to %s:%hu.\n", addrstr, servport); |
| 251 | |
| 252 | #ifdef CLIENTDEBUGcxx . . $ `src/common/setup_before.h:49:9`! |
| 253 | eventlog_setcxx . . $ pvpgn/eventlog_set(8d4262d45fc644ab).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!); |
| 254 | #endif |
| 255 | |
| 256 | if ((lsock = client_udptest_setupcxx . . $ pvpgn/client/client_udptest_setup(c9bce2f4bcd31d4).(progname, &lsock_port)) >= 0) |
| 257 | dprintfcxx . . $ `src/client/client_connect.cpp:54:10`!("Got UDP data on port %hu\n", lsock_port); |
| 258 | |
| 259 | if (!(packet = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_initcxx . . $ pvpgn/packet_class_init.))) |
| 260 | { |
| 261 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not create packet\n", progname); |
| 262 | if (lsock >= 0) |
| 263 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 264 | |
| 265 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 266 | |
| 267 | return -1; |
| 268 | } |
| 269 | bn_byte_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_initconncxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_initconn..cclasscxx . . $ pvpgn/$anonymous_type_7cca3803bac3bad7_0#cclass., CLIENT_INITCONN_CLASS_BNETcxx . . $ `src/common/init_protocol.h:59:9`!); |
| 270 | client_blocksend_packetcxx . . $ pvpgn/client/client_blocksend_packet(906e81e3c6d5802b).(sd, packet); |
| 271 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(packet); |
| 272 | |
| 273 | /* reuse this same packet over and over */ |
| 274 | if (!(rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 275 | { |
| 276 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not create packet\n", progname); |
| 277 | if (lsock >= 0) |
| 278 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 279 | |
| 280 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 281 | |
| 282 | return -1; |
| 283 | } |
| 284 | |
| 285 | get_defversioninfocxx . . $ `$anonymous_namespace_src/client/client_connect.cpp`/get_defversioninfo(9a02a8c2ff961901).(progname, clienttag, &versionid, &gameversion, &exeinfo, &checksum); |
| 286 | |
| 287 | if (stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_DIABLOSHRcxx . . $ `src/common/tag.h:94:9`!) == 0 || |
| 288 | stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_DIABLORTLcxx . . $ `src/common/tag.h:92:9`!) == 0) |
| 289 | { |
| 290 | if (!(packet = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 291 | { |
| 292 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not create packet\n", progname); |
| 293 | packet_destroycxx . . $ pvpgn/packet_destroy(5beaf79da73358e2).(rpacket); |
| 294 | |
| 295 | if (lsock >= 0) |
| 296 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 297 | |
| 298 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 299 | |
| 300 | return -1; |
| 301 | } |
| 302 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(packet, sizeof(t_client_unknown_1bcxx . . $ pvpgn/t_client_unknown_1b#)); |
| 303 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(packet, CLIENT_UNKNOWN_1Bcxx . . $ `src/common/bnet_protocol.h:2829:9`!); |
| 304 | bn_short_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_unknown_1bcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_unknown_1b..unknown1cxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_104#unknown1., CLIENT_UNKNOWN_1B_UNKNOWN3cxx . . $ `src/common/bnet_protocol.h:2842:9`!); |
| 305 | bn_short_nset(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_unknown_1bcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_unknown_1b..portcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_104#port., lsock_port); |
| 306 | bn_int_nset(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_unknown_1bcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_unknown_1b..ipcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_104#ip., 0); /* FIXME */ |
| 307 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_unknown_1bcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_unknown_1b..unknown2cxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_104#unknown2., CLIENT_UNKNOWN_1B_UNKNOWN3cxx . . $ `src/common/bnet_protocol.h:2842:9`!); |
| 308 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_unknown_1bcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_unknown_1b..unknown3cxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_104#unknown3., CLIENT_UNKNOWN_1B_UNKNOWN3cxx . . $ `src/common/bnet_protocol.h:2842:9`!); |
| 309 | client_blocksend_packetcxx . . $ pvpgn/client/client_blocksend_packet(906e81e3c6d5802b).(sd, packet); |
| 310 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(packet); |
| 311 | } |
| 312 | |
| 313 | if (!(packet = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 314 | { |
| 315 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not create packet\n", progname); |
| 316 | packet_destroycxx . . $ pvpgn/packet_destroy(5beaf79da73358e2).(rpacket); |
| 317 | |
| 318 | if (lsock >= 0) |
| 319 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 320 | |
| 321 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 322 | |
| 323 | return -1; |
| 324 | } |
| 325 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(packet, sizeof(t_client_auth_infocxx . . $ pvpgn/t_client_auth_info#)); |
| 326 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(packet, CLIENT_AUTH_INFOcxx . . $ `src/common/bnet_protocol.h:596:9`!); |
| 327 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_auth_infocxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_auth_info..protocolcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_30#protocol., CLIENT_AUTH_INFO_PROTOCOLcxx . . $ `src/client/client_connect.h:70:9`!); |
| 328 | bn_int_tag_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_auth_infocxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_auth_info..archtagcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_30#archtag., archtag); |
| 329 | bn_int_tag_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_auth_infocxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_auth_info..clienttagcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_30#clienttag., clienttag); |
| 330 | //AARON |
| 331 | |
| 332 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_auth_infocxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_auth_info..versionidcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_30#versionid., versionid); |
| 333 | bn_int_tag_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_auth_infocxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_auth_info..gamelangcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_30#gamelang., gamelang); |
| 334 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_auth_infocxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_auth_info..localipcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_30#localip., CLIENT_AUTH_INFO_LOCALIPcxx . . $ `src/client/client_connect.h:73:9`!); |
| 335 | { |
| 336 | int bias; |
| 337 | |
| 338 | bias = local_tzbiascxx . . $ pvpgn/local_tzbias(b126dc7c1de90089).(); |
| 339 | |
| 340 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_auth_infocxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_auth_info..biascxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_30#bias., (unsigned int)bias); /* rely on 2's complement */ |
| 341 | dprintfcxx . . $ `src/client/client_connect.cpp:54:10`!("my tzbias = %d (0x%08hx)\n", bias, (unsigned int)bias); |
| 342 | } |
| 343 | /* FIXME: determine from locale */ |
| 344 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_auth_infocxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_auth_info..lcidcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_30#lcid., CLIENT_AUTH_INFO_LANGID_USENGLISHcxx . . $ `src/client/client_connect.h:74:9`!); |
| 345 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_auth_infocxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_auth_info..langidcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_30#langid., CLIENT_AUTH_INFO_LANGID_USENGLISHcxx . . $ `src/client/client_connect.h:74:9`!); |
| 346 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, CLIENT_AUTH_INFO_LANGSTR_USENGLISHcxx . . $ `src/client/client_connect.h:75:9`!); |
| 347 | /* FIXME: determine from locale+timezone... from domain name... nothing really would |
| 348 | work. Maybe add some command-line options */ |
| 349 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, CLIENT_AUTH_INFO_COUNTRYNAME_USAcxx . . $ `src/client/client_connect.h:76:9`!); |
| 350 | client_blocksend_packetcxx . . $ pvpgn/client/client_blocksend_packet(906e81e3c6d5802b).(sd, packet); |
| 351 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(packet); |
| 352 | |
| 353 | do |
| 354 | if (client_blockrecv_packetcxx . . $ pvpgn/client/client_blockrecv_packet(98f963a6be74727b).(sd, rpacket) < 0) |
| 355 | { |
| 356 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: server closed connection\n", progname); |
| 357 | packet_destroycxx . . $ pvpgn/packet_destroy(5beaf79da73358e2).(rpacket); |
| 358 | |
| 359 | if (lsock >= 0) |
| 360 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 361 | |
| 362 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 363 | |
| 364 | return -1; |
| 365 | } |
| 366 | while (packet_get_typecxx . . $ pvpgn/packet_get_type(e4ac9e2b4744cb4b).(rpacket) != SERVER_AUTHREQ_109cxx . . $ `src/common/bnet_protocol.h:782:9`! && |
| 367 | packet_get_typecxx . . $ pvpgn/packet_get_type(e4ac9e2b4744cb4b).(rpacket) != SERVER_AUTHREPLY_109cxx . . $ `src/common/bnet_protocol.h:882:9`!); |
| 368 | |
| 369 | if (packet_get_typecxx . . $ pvpgn/packet_get_type(e4ac9e2b4744cb4b).(rpacket) == SERVER_AUTHREQ_109cxx . . $ `src/common/bnet_protocol.h:782:9`!) /* hmm... server wants to check the version number */ |
| 370 | { |
| 371 | dprintfcxx . . $ `src/client/client_connect.cpp:54:10`!("Got AUTHREQ_109\n"); |
| 372 | *sessionkey = bn_int_get(rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_authreq_109cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_authreq_109..sessionkeycxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_36#sessionkey.); |
| 373 | *sessionnum = bn_int_get(rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_authreq_109cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_authreq_109..sessionnumcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_36#sessionnum.); |
| 374 | /* FIXME: also get filename and equation */ |
| 375 | |
| 376 | if (!ignoreversion) |
| 377 | { |
| 378 | |
| 379 | if (!(packet = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 380 | { |
| 381 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not create packet\n", progname); |
| 382 | packet_destroycxx . . $ pvpgn/packet_destroy(5beaf79da73358e2).(rpacket); |
| 383 | |
| 384 | if (lsock >= 0) |
| 385 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 386 | |
| 387 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 388 | |
| 389 | return -1; |
| 390 | } |
| 391 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(packet, sizeof(t_client_authreq_109cxx . . $ pvpgn/t_client_authreq_109#)); |
| 392 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(packet, CLIENT_AUTHREQ_109cxx . . $ `src/common/bnet_protocol.h:907:9`!); |
| 393 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_authreq_109cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_authreq_109..tickscxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_40#ticks., stdcxx . . $ std/::timecxx . . $ std/time(a7cd306b2d326b09).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)); |
| 394 | |
| 395 | { |
| 396 | t_cdkey_infocxx . . $ pvpgn/t_cdkey_info# cdkey_info = {}; |
| 397 | |
| 398 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_authreq_109cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_authreq_109..gameversioncxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_40#gameversion., gameversion); |
| 399 | |
| 400 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_authreq_109cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_authreq_109..cdkey_numbercxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_40#cdkey_number., 1); /* only one */ |
| 401 | /* FIXME: put the input cdkey here */ |
| 402 | packet_append_datacxx . . $ pvpgn/packet_append_data(d82347a7305550af).(packet, &cdkey_info, sizeof(cdkey_info)); |
| 403 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, exeinfo); |
| 404 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, cdowner); |
| 405 | } |
| 406 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_authreq_109cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_authreq_109..spawncxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_40#spawn., 0x0000); |
| 407 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_authreq_109cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_authreq_109..checksumcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_40#checksum., checksum); |
| 408 | client_blocksend_packetcxx . . $ pvpgn/client/client_blocksend_packet(906e81e3c6d5802b).(sd, packet); |
| 409 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(packet); |
| 410 | |
| 411 | /* now wait for reply */ |
| 412 | do |
| 413 | if (client_blockrecv_packetcxx . . $ pvpgn/client/client_blockrecv_packet(98f963a6be74727b).(sd, rpacket) < 0) |
| 414 | { |
| 415 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: server closed connection\n", progname); |
| 416 | packet_destroycxx . . $ pvpgn/packet_destroy(5beaf79da73358e2).(rpacket); |
| 417 | |
| 418 | if (lsock >= 0) |
| 419 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 420 | |
| 421 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 422 | |
| 423 | return -1; |
| 424 | } |
| 425 | while (packet_get_typecxx . . $ pvpgn/packet_get_type(e4ac9e2b4744cb4b).(rpacket) != SERVER_AUTHREPLY_109cxx . . $ `src/common/bnet_protocol.h:882:9`!); |
| 426 | //FIXME: check if AUTHREPLY_109 is success or fail |
| 427 | if (bn_int_get(rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_authreply_109cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_authreply_109..messagecxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_39#message.) != SERVER_AUTHREPLY_109_MESSAGE_OKcxx . . $ `src/common/bnet_protocol.h:889:9`!) |
| 428 | { |
| 429 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "AUTHREPLY_109 failed - closing connection\n"); |
| 430 | packet_destroycxx . . $ pvpgn/packet_destroy(5beaf79da73358e2).(rpacket); |
| 431 | |
| 432 | if (lsock >= 0) |
| 433 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 434 | |
| 435 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 436 | |
| 437 | return -1; |
| 438 | } |
| 439 | } |
| 440 | } |
| 441 | else |
| 442 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "We didn't get a sessionkey, don't expect login to work!"); |
| 443 | dprintfcxx . . $ `src/client/client_connect.cpp:54:10`!("Got AUTHREPLY_109\n"); |
| 444 | |
| 445 | if (!(packet = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 446 | { |
| 447 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not create packet\n", progname); |
| 448 | packet_destroycxx . . $ pvpgn/packet_destroy(5beaf79da73358e2).(rpacket); |
| 449 | |
| 450 | if (lsock >= 0) |
| 451 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 452 | |
| 453 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 454 | |
| 455 | return -1; |
| 456 | } |
| 457 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(packet, sizeof(t_client_iconreqcxx . . $ pvpgn/t_client_iconreq#)); |
| 458 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(packet, CLIENT_ICONREQcxx . . $ `src/common/bnet_protocol.h:995:9`!); |
| 459 | client_blocksend_packetcxx . . $ pvpgn/client/client_blocksend_packet(906e81e3c6d5802b).(sd, packet); |
| 460 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(packet); |
| 461 | |
| 462 | do |
| 463 | if (client_blockrecv_packetcxx . . $ pvpgn/client/client_blockrecv_packet(98f963a6be74727b).(sd, rpacket) < 0) |
| 464 | { |
| 465 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: server closed connection\n", progname); |
| 466 | packet_destroycxx . . $ pvpgn/packet_destroy(5beaf79da73358e2).(rpacket); |
| 467 | |
| 468 | if (lsock >= 0) |
| 469 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 470 | |
| 471 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 472 | |
| 473 | return -1; |
| 474 | } |
| 475 | while (packet_get_typecxx . . $ pvpgn/packet_get_type(e4ac9e2b4744cb4b).(rpacket) != SERVER_ICONREPLYcxx . . $ `src/common/bnet_protocol.h:1011:9`!); |
| 476 | dprintfcxx . . $ `src/client/client_connect.cpp:54:10`!("Got ICONREPLY\n"); |
| 477 | |
| 478 | if (stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_STARCRAFTcxx . . $ `src/common/tag.h:86:9`!) == 0 || |
| 479 | stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_BROODWARScxx . . $ `src/common/tag.h:88:9`!) == 0 || |
| 480 | stdcxx . . $ std/::strcmp(clienttag, CLIENTTAG_WARCIIBNEcxx . . $ `src/common/tag.h:96:9`!) == 0) |
| 481 | { |
| 482 | if (!(packet = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 483 | { |
| 484 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not create packet\n", progname); |
| 485 | packet_destroycxx . . $ pvpgn/packet_destroy(5beaf79da73358e2).(rpacket); |
| 486 | |
| 487 | if (lsock >= 0) |
| 488 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 489 | |
| 490 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 491 | |
| 492 | return -1; |
| 493 | } |
| 494 | |
| 495 | { |
| 496 | structcxx . . $ pvpgn/client/client_connect(20c2760950162537).$anonymous_type_0# |
| 497 | { |
| 498 | bn_intcxx . . $ pvpgn/bn_int# sessionkeycxx . . $ pvpgn/client/client_connect(20c2760950162537).$anonymous_type_0#sessionkey.; |
| 499 | bn_intcxx . . $ pvpgn/bn_int# tickscxx . . $ pvpgn/client/client_connect(20c2760950162537).$anonymous_type_0#ticks.; |
| 500 | bn_intcxx . . $ pvpgn/bn_int# productidcxx . . $ pvpgn/client/client_connect(20c2760950162537).$anonymous_type_0#productid.; |
| 501 | bn_intcxx . . $ pvpgn/bn_int# keyvalue1cxx . . $ pvpgn/client/client_connect(20c2760950162537).$anonymous_type_0#keyvalue1.; |
| 502 | bn_intcxx . . $ pvpgn/bn_int# keyvalue2cxx . . $ pvpgn/client/client_connect(20c2760950162537).$anonymous_type_0#keyvalue2.; |
| 503 | } temp; |
| 504 | t_hash key_hash; |
| 505 | unsigned int ticks; |
| 506 | unsigned int keyvalue1, keyvalue2, productid; |
| 507 | |
| 508 | if (key_interpretcxx . . $ `$anonymous_namespace_src/client/client_connect.cpp`/key_interpret(eba9a92a1c55d5bc).(cdkey, &productid, &keyvalue1, &keyvalue2) < 0) |
| 509 | { |
| 510 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: specified key is not valid, sending junk\n", progname); |
| 511 | productid = 0; |
| 512 | keyvalue1 = 0; |
| 513 | keyvalue2 = 0; |
| 514 | } |
| 515 | |
| 516 | ticks = 0; /* FIXME: what to use here? */ |
| 517 | bn_int_set(&temp.tickscxx . . $ pvpgn/client/client_connect(20c2760950162537).$anonymous_type_0#ticks., ticks); |
| 518 | bn_int_set(&temp.sessionkeycxx . . $ pvpgn/client/client_connect(20c2760950162537).$anonymous_type_0#sessionkey., *sessionkey); |
| 519 | bn_int_set(&temp.productidcxx . . $ pvpgn/client/client_connect(20c2760950162537).$anonymous_type_0#productid., productid); |
| 520 | bn_int_set(&temp.keyvalue1cxx . . $ pvpgn/client/client_connect(20c2760950162537).$anonymous_type_0#keyvalue1., keyvalue1); |
| 521 | bn_int_set(&temp.keyvalue2cxx . . $ pvpgn/client/client_connect(20c2760950162537).$anonymous_type_0#keyvalue2., keyvalue2); |
| 522 | bnet_hashcxx . . $ pvpgn/bnet_hash(2a8392f275be648).(&key_hash, sizeof(temp), &temp); |
| 523 | |
| 524 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(packet, sizeof(t_client_cdkey2cxx . . $ pvpgn/t_client_cdkey2#)); |
| 525 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(packet, CLIENT_CDKEY2cxx . . $ `src/common/bnet_protocol.h:1112:9`!); |
| 526 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_cdkey2cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_cdkey2..spawncxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_50#spawn., CLIENT_CDKEY2_SPAWN_FALSEcxx . . $ `src/common/bnet_protocol.h:1126:9`!); /* FIXME: add option */ |
| 527 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_cdkey2cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_cdkey2..keylencxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_50#keylen., stdcxx . . $ std/::strlen(cdkey)); |
| 528 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_cdkey2cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_cdkey2..productidcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_50#productid., productid); |
| 529 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_cdkey2cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_cdkey2..keyvalue1cxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_50#keyvalue1., keyvalue1); |
| 530 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_cdkey2cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_cdkey2..sessionkeycxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_50#sessionkey., *sessionkey); |
| 531 | bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_cdkey2cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_cdkey2..tickscxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_50#ticks., ticks); |
| 532 | hash_to_bnhashcxx . . $ pvpgn/hash_to_bnhash(50eab12f45c1086c).((t_hash const *)&key_hash, packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_cdkey2cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_cdkey2..key_hashcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_50#key_hash.); /* avoid warning */ |
| 533 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, cdowner); |
| 534 | client_blocksend_packetcxx . . $ pvpgn/client/client_blocksend_packet(906e81e3c6d5802b).(sd, packet); |
| 535 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(packet); |
| 536 | } |
| 537 | |
| 538 | do |
| 539 | if (client_blockrecv_packetcxx . . $ pvpgn/client/client_blockrecv_packet(98f963a6be74727b).(sd, rpacket) < 0) |
| 540 | { |
| 541 | stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: server closed connection\n", progname); |
| 542 | packet_destroycxx . . $ pvpgn/packet_destroy(5beaf79da73358e2).(rpacket); |
| 543 | |
| 544 | if (lsock >= 0) |
| 545 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 546 | |
| 547 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd); |
| 548 | |
| 549 | return -1; |
| 550 | } |
| 551 | while (packet_get_typecxx . . $ pvpgn/packet_get_type(e4ac9e2b4744cb4b).(rpacket) != SERVER_CDKEYREPLY2cxx . . $ `src/common/bnet_protocol.h:1879:9`!); |
| 552 | dprintfcxx . . $ `src/client/client_connect.cpp:54:10`!("Got CDKEYREPLY2 (%u)\n", bn_int_get(rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_cdkeyreply2cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_cdkeyreply2..messagecxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_82#message.)); |
| 553 | } |
| 554 | |
| 555 | packet_destroycxx . . $ pvpgn/packet_destroy(5beaf79da73358e2).(rpacket); |
| 556 | |
| 557 | if (lsock >= 0) |
| 558 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(lsock); |
| 559 | |
| 560 | return sd; |
| 561 | } |
| 562 | |
| 563 | } |
| 564 | |
| 565 | } |