Debian Codegraph @

src/client/bnstat.cpp

raw symbols SCIP
1 /*
2 * Copyright (C) 1998,1999,2000 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 <cstdio>
20 #include <cstdlib>
21 #include <cctype>
22 #include <cstring>
23 #include <ctime>
24
25 #ifdef HAVE_TERMIOS_Hcxx . . $ `build/config.h:15:9`!
26 # include <termios.h>
27 #endif
28
29 #include "compat/termios.h"cxx . . $ `<file>/src/compat/termios.h`/
30 #include "compat/psock.h"cxx . . $ `<file>/src/compat/psock.h`/
31 #include "common/bnet_protocol.h"cxx . . $ `<file>/src/common/bnet_protocol.h`/
32 #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/
33 #include "common/tag.h"cxx . . $ `<file>/src/common/tag.h`/
34 #include "common/packet.h"cxx . . $ `<file>/src/common/packet.h`/
35 #include "common/bn_type.h"cxx . . $ `<file>/src/common/bn_type.h`/
36 #include "common/bnettime.h"cxx . . $ `<file>/src/common/bnettime.h`/
37 /*
38 #include "common/init_protocol.h"
39 #include "common/udp_protocol.h"
40 #include "common/field_sizes.h"
41 #include "common/network.h"
42 #include "common/version.h"
43 #ifdef CLIENTDEBUG
44 # include "common/eventlog.h"
45 #endif
46 #include "udptest.h"
47 */
48 #include "client_connect.h"cxx . . $ `<file>/src/client/client_connect.h`/
49 #include "client.h"cxx . . $ `<file>/src/client/client.h`/
50
51 #ifdef HAVE_ARPA_INET_Hcxx . . $ `build/config.h:13:9`!
52 # include <arpa/inet.h>
53 #endif
54 #ifdef HAVE_WS2TCPIP_H
55 # include <Ws2tcpip.h>
56 #endif
57
58 #include "common/setup_after.h"cxx . . $ `<file>/src/common/setup_after.h`/
59
60
61 #ifdef CLIENTDEBUGcxx . . $ `src/common/setup_before.h:49:9`!
62 # define dprintfcxx . . $ `src/client/bnstat.cpp:62:10`! printf
63 #else
64 # define dprintf if (0) printf
65 #endif
66
67 using namespace pvpgn;
68 using namespace pvpgncxx . . $ pvpgn/::client;
69
70
71 namespacecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/
72 {
73
74 char const * bnclass_get_strcxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/bnclass_get_str(81a3ae90da26a711).(unsigned int cclass)
75 {
76 switch (cclass)
77 {
78 case PLAYERINFO_DRTL_CLASS_WARRIORcxx . . $ `src/common/bnet_protocol.h:2291:9`!:
79 return "warrior";
80 case PLAYERINFO_DRTL_CLASS_ROGUEcxx . . $ `src/common/bnet_protocol.h:2292:9`!:
81 return "rogue";
82 case PLAYERINFO_DRTL_CLASS_SORCERERcxx . . $ `src/common/bnet_protocol.h:2293:9`!:
83 return "sorcerer";
84 default:
85 return "unknown";
86 }
87 }
88
89
90 void usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(char const * progname)
91 {
92 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "usage: %s [<options>] [<servername> [<TCP portnumber>]]\n", progname);
93 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!,
94 " -b, --client=SEXP report client as Brood Wars\n"
95 " -d, --client=DRTL report client as Diablo Retail\n"
96 " --client=DSHR report client as Diablo Shareware\n"
97 " -s, --client=STAR report client as Starcraft (default)\n");
98 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!,
99 " --client=SSHR report client as Starcraft Shareware\n"
100 " -w, --client=W2BN report client as Warcraft II BNE\n"
101 " --client=D2DV report client as Diablo II\n"
102 " --client=D2XP report client as Diablo II: LoD\n"
103 " --client=WAR3 report client as Warcraft III\n");
104 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!,
105 " -o NAME, --owner=NAME report CD owner as NAME\n"
106 " -k KEY, --cdkey=KEY report CD key as KEY\n"
107 " -i, --ignore-version ignore version request (do not send game version, CD owner/key)\n"
108 " -p PLR, --player=PLR print stats for player PLR\n"
109 " --bnetd also print BNETD-specific stats\n"
110 " --fsgs also print FSGS-specific stats\n"
111 " -h, --help, --usage show this information and exit\n"
112 " -v, --version print version number and exit\n");
113 stdcxx . . $ std/::exit(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!);
114 }
115
116 }
117
118 extern int maincxx . . $ main(afcd3168fc1188a4).(int argc, char * argv[])
119 {
120 int a;
121 int sd;
122 int gotplayer = 0;
123 struct sockaddr_in saddr;
124 t_packetcxx . . $ pvpgn/t_packet# * packet;
125 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
126 char const * cdowner = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
127 char const * cdkey = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
128 char const * clienttag = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
129 char const * servname = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
130 unsigned short servport = 0;
131 char text[MAX_MESSAGE_LENcxx . . $ MAX_MESSAGE_LEN.] = "";
132 unsigned int commpos;
133 struct termios in_attr_old;
134 struct termios in_attr_new;
135 int changed_in;
136 unsigned int count;
137 unsigned int sessionkey;
138 unsigned int sessionnum;
139 unsigned int val;
140 int fd_stdin = 0;
141 int use_bnetd = 0;
142 int use_fsgs = 0;
143 unsigned int screen_width, screen_height;
144 int munged = 0;
145 int ignoreversion = 0;
146
147 if (argc < 1 || !argv || !argv[0])
148 {
149 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "bad arguments\n");
150 return EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!;
151 }
152
153 for (a = 1; a < argc; a++)
154 if (servname && stdcxx . . $ std/::isdigitcxx . . $ std/isdigit(a1851578aea3f541).((int)argv[a][0]) && a + 1 >= argc)
155 {
156 if (str_to_ushortcxx . . $ pvpgn/str_to_ushort(c9bce2f4bcd31d4).(argv[a], &servport) < 0)
157 {
158 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: \"%s\" should be a positive integer\n", argv[0], argv[a]);
159 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
160 }
161 }
162 else if (!servname && argv[a][0] != '-' && a + 2 >= argc)
163 servname = argv[a];
164 else if (stdcxx . . $ std/::strcmp(argv[a], "-b") == 0 || stdcxx . . $ std/::strcmp(argv[a], "--client=SEXP") == 0)
165 {
166 if (clienttag)
167 {
168 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: client type was already specified as \"%s\"\n", argv[0], clienttag);
169 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
170 }
171 clienttag = CLIENTTAG_BROODWARScxx . . $ `src/common/tag.h:88:9`!;
172 }
173 else if (stdcxx . . $ std/::strcmp(argv[a], "-d") == 0 || stdcxx . . $ std/::strcmp(argv[a], "--client=DRTL") == 0)
174 {
175 if (clienttag)
176 {
177 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: client type was already specified as \"%s\"\n", argv[0], clienttag);
178 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
179 }
180 clienttag = CLIENTTAG_DIABLORTLcxx . . $ `src/common/tag.h:92:9`!;
181 }
182 else if (stdcxx . . $ std/::strcmp(argv[a], "--client=DSHR") == 0)
183 {
184 if (clienttag)
185 {
186 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: client type was already specified as \"%s\"\n", argv[0], clienttag);
187 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
188 }
189 clienttag = CLIENTTAG_DIABLOSHRcxx . . $ `src/common/tag.h:94:9`!;
190 }
191 else if (stdcxx . . $ std/::strcmp(argv[a], "-s") == 0 || stdcxx . . $ std/::strcmp(argv[a], "--client=STAR") == 0)
192 {
193 if (clienttag)
194 {
195 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: client type was already specified as \"%s\"\n", argv[0], clienttag);
196 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
197 }
198 clienttag = CLIENTTAG_STARCRAFTcxx . . $ `src/common/tag.h:86:9`!;
199 }
200 else if (stdcxx . . $ std/::strcmp(argv[a], "--client=SSHR") == 0)
201 {
202 if (clienttag)
203 {
204 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: client type was already specified as \"%s\"\n", argv[0], clienttag);
205 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
206 }
207 clienttag = CLIENTTAG_SHAREWAREcxx . . $ `src/common/tag.h:90:9`!;
208 }
209 else if (stdcxx . . $ std/::strcmp(argv[a], "-w") == 0 || stdcxx . . $ std/::strcmp(argv[a], "--client=W2BN") == 0)
210 {
211 if (clienttag)
212 {
213 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: client type was already specified as \"%s\"\n", argv[0], clienttag);
214 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
215 }
216 clienttag = CLIENTTAG_WARCIIBNEcxx . . $ `src/common/tag.h:96:9`!;
217 }
218 else if (stdcxx . . $ std/::strcmp(argv[a], "--client=D2DV") == 0)
219 {
220 if (clienttag)
221 {
222 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: client type was already specified as \"%s\"\n", argv[0], clienttag
223 );
224 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
225 }
226 clienttag = CLIENTTAG_DIABLO2DVcxx . . $ `src/common/tag.h:98:9`!;
227 }
228 else if (stdcxx . . $ std/::strcmp(argv[a], "--client=D2XP") == 0)
229 {
230 if (clienttag)
231 {
232 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: client type was already specified as \"%s\"\n", argv[0], clienttag
233 );
234 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
235 }
236 clienttag = CLIENTTAG_DIABLO2XPcxx . . $ `src/common/tag.h:104:9`!;
237 }
238 else if (stdcxx . . $ std/::strcmp(argv[a], "--client=WAR3") == 0)
239 {
240 if (clienttag)
241 {
242 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: client type was already specified as \"%s\"\n", argv[0], clienttag
243 );
244 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
245 }
246 clienttag = CLIENTTAG_WARCRAFT3cxx . . $ `src/common/tag.h:110:9`!;
247 }
248 else if (stdcxx . . $ std/::strncmp(argv[a], "--client=", 9) == 0)
249 {
250 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: unknown client tag \"%s\"\n", argv[0], &argv[a][9]);
251 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
252 }
253 else if (stdcxx . . $ std/::strcmp(argv[a], "-o") == 0)
254 {
255 if (a + 1 >= argc)
256 {
257 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: option \"%s\" requires an argument\n", argv[0], argv[a]);
258 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
259 }
260 if (cdowner)
261 {
262 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: CD owner was already specified as \"%s\"\n", argv[0], cdowner);
263 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
264 }
265 cdowner = argv[++a];
266 }
267 else if (stdcxx . . $ std/::strncmp(argv[a], "--owner=", 8) == 0)
268 {
269 if (cdowner)
270 {
271 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: CD owner was already specified as \"%s\"\n", argv[0], cdowner);
272 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
273 }
274 cdowner = &argv[a][8];
275 }
276 else if (stdcxx . . $ std/::strcmp(argv[a], "-k") == 0)
277 {
278 if (a + 1 >= argc)
279 {
280 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: option \"%s\" requires an argument\n", argv[0], argv[a]);
281 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
282 }
283 if (cdkey)
284 {
285 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: CD key was already specified as \"%s\"\n", argv[0], cdkey);
286 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
287 }
288 cdkey = argv[++a];
289 }
290 else if (stdcxx . . $ std/::strncmp(argv[a], "--cdkey=", 8) == 0)
291 {
292 if (cdkey)
293 {
294 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: CD key was already specified as \"%s\"\n", argv[0], cdkey);
295 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
296 }
297 cdkey = &argv[a][8];
298 }
299 else if (stdcxx . . $ std/::strcmp(argv[a], "-p") == 0)
300 {
301 if (a + 1 >= argc)
302 {
303 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: option \"%s\" requires an argument\n", argv[0], argv[a]);
304 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
305 }
306 if (gotplayer)
307 {
308 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: player was already specified as \"%s\"\n", argv[0], text);
309 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
310 }
311 a++;
312 if (argv[a][0] == '\0')
313 {
314 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: player name can not be empty\n", argv[0]);
315 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
316 }
317 stdcxx . . $ std/::strncpy(text, argv[a], sizeof(text));
318 text[sizeof(text)-1] = '\0';
319 gotplayer = 1;
320 }
321 else if (stdcxx . . $ std/::strncmp(argv[a], "--player=", 9) == 0)
322 {
323 if (gotplayer)
324 {
325 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: player was already specified as \"%s\"\n", argv[0], text);
326 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
327 }
328 if (argv[a][9] == '\0')
329 {
330 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: player name can not be empty\n", argv[0]);
331 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
332 }
333 stdcxx . . $ std/::strncpy(text, &argv[a][9], sizeof(text));
334 text[sizeof(text)-1] = '\0';
335 gotplayer = 1;
336 }
337 else if (stdcxx . . $ std/::strcmp(argv[a], "--bnetd") == 0)
338 use_bnetd = 1;
339 else if (stdcxx . . $ std/::strcmp(argv[a], "--fsgs") == 0)
340 use_fsgs = 1;
341 else if (stdcxx . . $ std/::strcmp(argv[a], "-h") == 0 || stdcxx . . $ std/::strcmp(argv[a], "--help") == 0 || stdcxx . . $ std/::strcmp(argv[a], "--usage")
342 == 0)
343 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
344 else if (stdcxx . . $ std/::strcmp(argv[a], "-i") == 0 || stdcxx . . $ std/::strcmp(argv[a], "--ignore-version") == 0)
345 ignoreversion = 1;
346 else if (stdcxx . . $ std/::strcmp(argv[a], "-v") == 0 || stdcxx . . $ std/::strcmp(argv[a], "--version") == 0)
347 {
348 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).("version " PVPGN_VERSIONcxx . . $ `src/common/version.h:23:9`! "\n");
349 return EXIT_SUCCESScxx . . $ `<external>/10696550936717951914/stdlib.h:93:9`!;
350 }
351 else if (stdcxx . . $ std/::strcmp(argv[a], "--client") == 0 || stdcxx . . $ std/::strcmp(argv[a], "--owner") == 0 ||
352 stdcxx . . $ std/::strcmp(argv[a], "--cdkey") == 0 || stdcxx . . $ std/::strcmp(argv[a], "--player") == 0)
353 {
354 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: option \"%s\" requires an argument\n", argv[0], argv[a]);
355 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
356 }
357 else
358 {
359 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: unknown option \"%s\"\n", argv[0], argv[a]);
360 usagecxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/usage(85c52e162fed56f9).(argv[0]);
361 }
362
363 if (servport == 0)
364 servport = BNETD_SERV_PORTcxx . . $ BNETD_SERV_PORT.;
365 if (!cdowner)
366 cdowner = BNETD_DEFAULT_OWNERcxx . . $ BNETD_DEFAULT_OWNER.;
367 if (!cdkey)
368 cdkey = BNETD_DEFAULT_KEYcxx . . $ BNETD_DEFAULT_KEY.;
369 if (!clienttag)
370 clienttag = CLIENTTAG_STARCRAFTcxx . . $ `src/common/tag.h:86:9`!;
371 if (!servname)
372 servname = BNETD_DEFAULT_HOSTcxx . . $ BNETD_DEFAULT_HOST.;
373
374 if (gotplayer)
375 changed_in = 0; /* no need to change terminal attributes */
376 else
377 {
378 fd_stdin = fileno(stdincxx . . $ `<external>/232824719582829767/stdio.h:153:9`!);
379 if (tcgetattr(fd_stdin, &in_attr_old) >= 0)
380 {
381 in_attr_new = in_attr_old;
382 in_attr_new.c_lflag &= ~(ECHOcxx . . $ `<external>/2220421410900157355/termios-c_lflag.h:29:9`! | ICANONcxx . . $ `<external>/2220421410900157355/termios-c_lflag.h:25:9`!); /* turn off ECHO and ICANON */
383 in_attr_new.c_cc[VMINcxx . . $ `<external>/5505922754558120548/termios-c_cc.h:30:9`!] = 1; /* require reads to return at least one byte */
384 in_attr_new.c_cc[VTIMEcxx . . $ `<external>/5505922754558120548/termios-c_cc.h:29:9`!] = 0; /* no timeout */
385 tcsetattr(fd_stdin, TCSANOWcxx . . $ `<external>/7740429199341890421/termios-tcflow.h:24:9`!, &in_attr_new);
386 changed_in = 1;
387 }
388 else
389 {
390 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not set terminal attributes for stdin\n", argv[0]);
391 changed_in = 0;
392 }
393
394 if (client_get_termsizecxx . . $ pvpgn/client/client_get_termsize(1ea1e3350d45fd0e).(fd_stdin, &screen_width, &screen_height) < 0)
395 {
396 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not determine screen size, assuming 80x24\n", argv[0]);
397 screen_width = 80;
398 screen_height = 24;
399 }
400 }
401
402 if ((sd = client_connectcxx . . $ pvpgn/client/client_connect(20c2760950162537).(argv[0], servname, servport, cdowner, cdkey, clienttag, ignoreversion, &saddr, &sessionkey, &sessionnum, ARCHTAG_WINX86cxx . . $ `src/common/tag.h:155:9`!, CLIENT_AUTH_INFO_GAMELANGcxx . . $ `src/client/client_connect.h:72:9`!)) < 0)
403 {
404 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: fatal error during handshake\n", argv[0]);
405 if (changed_in)
406 tcsetattr(fd_stdin, TCSAFLUSHcxx . . $ `<external>/7740429199341890421/termios-tcflow.h:26:9`!, &in_attr_old);
407 return EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!;
408 }
409
410 /* reuse this same packet over and over */
411 if (!(rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.)))
412 {
413 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not create packet\n", argv[0]);
414 psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd);
415 if (changed_in)
416 tcsetattr(fd_stdin, TCSAFLUSHcxx . . $ `<external>/7740429199341890421/termios-tcflow.h:26:9`!, &in_attr_old);
417 return EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!;
418 }
419
420 if (!(packet = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.)))
421 {
422 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not create packet\n", argv[0]);
423 psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd);
424 if (changed_in)
425 tcsetattr(fd_stdin, TCSAFLUSHcxx . . $ `<external>/7740429199341890421/termios-tcflow.h:26:9`!, &in_attr_old);
426 return EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!;
427 }
428 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(packet, sizeof(t_client_fileinforeqcxx . . $ pvpgn/t_client_fileinforeq#));
429 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(packet, CLIENT_FILEINFOREQcxx . . $ `src/common/bnet_protocol.h:1917:9`!);
430 bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_fileinforeqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_fileinforeq..typecxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_84#type., CLIENT_FILEINFOREQ_TYPE_TOScxx . . $ `src/common/bnet_protocol.h:1925:9`!);
431 bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_fileinforeqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_fileinforeq..unknown2cxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_84#unknown2., CLIENT_FILEINFOREQ_UNKNOWN2cxx . . $ `src/common/bnet_protocol.h:1930:9`!);
432 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, CLIENT_FILEINFOREQ_FILE_TOSUSAcxx . . $ `src/common/bnet_protocol.h:1931:9`!);
433 client_blocksend_packetcxx . . $ pvpgn/client/client_blocksend_packet(906e81e3c6d5802b).(sd, packet);
434 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(packet);
435 do
436 if (client_blockrecv_packetcxx . . $ pvpgn/client/client_blockrecv_packet(98f963a6be74727b).(sd, rpacket) < 0)
437 {
438 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: server closed connection\n", argv[0]);
439 psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd);
440 if (changed_in)
441 tcsetattr(fd_stdin, TCSAFLUSHcxx . . $ `<external>/7740429199341890421/termios-tcflow.h:26:9`!, &in_attr_old);
442 return EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!;
443 }
444 while (packet_get_typecxx . . $ pvpgn/packet_get_type(e4ac9e2b4744cb4b).(rpacket) != SERVER_FILEINFOREPLYcxx . . $ `src/common/bnet_protocol.h:1945:9`!);
445 dprintfcxx . . $ `src/client/bnstat.cpp:62:10`!("Got FILEINFOREPLY\n");
446
447 if (!gotplayer)
448 {
449 munged = 1;
450 commpos = 0;
451 text[0] = '\0';
452 }
453
454 for (;;)
455 {
456 unsigned int i;
457
458 if (!gotplayer)
459 {
460 switch (client_get_commcxx . . $ pvpgn/client/client_get_comm(e9a6a98b384956c7).("player: ", text, sizeof(text), &commpos, 1, munged, screen_width))
461 {
462 case -1: /* cancel or error */
463 break;
464
465 case 0: /* timeout */
466 munged = 0;
467 continue;
468
469 case 1:
470 munged = 0;
471 if (text[0] == '\0')
472 continue;
473 }
474
475 if (text[0] == '\0')
476 break;
477 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).("\r");
478 for (i = 0; i < stdcxx . . $ std/::strlen(text) && i < screen_width; i++)
479 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" ");
480 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).("\r");
481 }
482
483 if (!(packet = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.)))
484 {
485 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: could not create packet\n", argv[0]);
486 psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd);
487 if (changed_in)
488 tcsetattr(fd_stdin, TCSAFLUSHcxx . . $ `<external>/7740429199341890421/termios-tcflow.h:26:9`!, &in_attr_old);
489 return EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!;
490 }
491 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(packet, sizeof(t_client_statsreqcxx . . $ pvpgn/t_client_statsreq#));
492 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(packet, CLIENT_STATSREQcxx . . $ `src/common/bnet_protocol.h:2023:9`!);
493 bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_statsreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_statsreq..name_countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_86#name_count., 1);
494 bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_statsreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_statsreq..requestidcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_86#requestid., 0);
495 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, text);
496 count = 0;
497
498 if (use_bnetd)
499 {
500 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\acct\\username");
501 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\acct\\userid");
502 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\acct\\lastlogin_clienttag");
503 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\acct\\lastlogin_connection");
504 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\acct\\lastlogin_time");
505 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\acct\\firstlogin_clienttag");
506 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\acct\\firstlogin_connection");
507 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\acct\\firstlogin_time");
508 count += 8;
509 }
510 if (use_fsgs)
511 {
512 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "FSGS\\Created");
513 count += 1;
514 }
515
516 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "profile\\sex");
517 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "profile\\age");
518 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "profile\\location");
519 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "profile\\description");
520 count += 4;
521
522 if (stdcxx . . $ std/::strcmp(clienttag, "STAR") == 0)
523 {
524 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\0\\last game");
525 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\0\\last game result");
526 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\0\\wins");
527 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\0\\losses");
528 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\0\\disconnects");
529 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\0\\draws");
530 count += 6;
531
532 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\1\\last game");
533 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\1\\last game result");
534 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\1\\rating");
535 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\1\\active rating");
536 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\1\\high rating");
537 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\1\\rank");
538 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\1\\active rank");
539 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\1\\high rank");
540 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\1\\wins");
541 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\1\\losses");
542 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\1\\disconnects");
543 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\STAR\\1\\draws");
544 count += 12;
545 }
546 else if (stdcxx . . $ std/::strcmp(clienttag, "SEXP") == 0)
547 {
548 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\0\\last game");
549 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\0\\last game result");
550 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\0\\wins");
551 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\0\\losses");
552 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\0\\disconnects");
553 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\0\\draws");
554 count += 6;
555
556 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\1\\last game");
557 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\1\\last game result");
558 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\1\\rating");
559 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\1\\active rating");
560 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\1\\high rating");
561 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\1\\rank");
562 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\1\\active rank");
563 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\1\\high rank");
564 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\1\\wins");
565 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\1\\losses");
566 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\1\\disconnects");
567 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SEXP\\1\\draws");
568 count += 12;
569 }
570 else if (stdcxx . . $ std/::strcmp(clienttag, "SSHR") == 0)
571 {
572 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SSHR\\0\\last game");
573 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SSHR\\0\\last game result");
574 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SSHR\\0\\wins");
575 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SSHR\\0\\losses");
576 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SSHR\\0\\disconnects");
577 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\SSHR\\0\\draws");
578 count += 6;
579 }
580 else if (stdcxx . . $ std/::strcmp(clienttag, "DSHR") == 0 ||
581 stdcxx . . $ std/::strcmp(clienttag, "DRTL") == 0)
582 {
583 if (use_bnetd)
584 {
585 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\Record\\DRTL\\0\\level");
586 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\Record\\DRTL\\0\\class");
587 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\Record\\DRTL\\0\\strength");
588 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\Record\\DRTL\\0\\magic");
589 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\Record\\DRTL\\0\\dexterity");
590 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\Record\\DRTL\\0\\vitality");
591 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\Record\\DRTL\\0\\gold");
592 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "BNET\\Record\\DRTL\\0\\diablo kills");
593 count += 8;
594 }
595 }
596 else if (stdcxx . . $ std/::strcmp(clienttag, "W2BN") == 0)
597 {
598 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\0\\last game");
599 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\0\\last game result");
600 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\0\\wins");
601 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\0\\losses");
602 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\0\\disconnects");
603 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\0\\draws");
604 count += 6;
605
606 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\1\\last game");
607 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\1\\last game result");
608 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\1\\rating");
609 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\1\\active rating");
610 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\1\\high rating");
611 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\1\\rank");
612 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\1\\active rank");
613 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\1\\high rank");
614 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\1\\wins");
615 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\1\\losses");
616 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\1\\disconnects");
617 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\1\\draws");
618 count += 12;
619
620 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\3\\last game");
621 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\3\\last game result");
622 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\3\\rating");
623 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\3\\active rating");
624 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\3\\high rating");
625 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\3\\rank");
626 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\3\\active rank");
627 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\3\\high rank");
628 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\3\\wins");
629 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\3\\losses");
630 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\3\\disconnects");
631 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(packet, "Record\\W2BN\\3\\draws");
632 count += 12;
633 }
634 bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_statsreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_statsreq..key_countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_86#key_count., count);
635 client_blocksend_packetcxx . . $ pvpgn/client/client_blocksend_packet(906e81e3c6d5802b).(sd, packet);
636 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(packet);
637
638 do
639 if (client_blockrecv_packetcxx . . $ pvpgn/client/client_blockrecv_packet(98f963a6be74727b).(sd, rpacket) < 0)
640 {
641 stdcxx . . $ std/::fprintfcxx . . $ std/fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: server closed connection\n", argv[0]);
642 if (changed_in)
643 tcsetattr(fd_stdin, TCSAFLUSHcxx . . $ `<external>/7740429199341890421/termios-tcflow.h:26:9`!, &in_attr_old);
644 return EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!;
645 }
646 while (packet_get_typecxx . . $ pvpgn/packet_get_type(e4ac9e2b4744cb4b).(rpacket) != SERVER_STATSREPLYcxx . . $ `src/common/bnet_protocol.h:2078:9`!);
647 dprintfcxx . . $ `src/client/bnstat.cpp:62:10`!("Got STATSREPLY\n");
648
649 {
650 unsigned int names, keys;
651 unsigned int j;
652 unsigned int strpos;
653 char const * temp;
654 unsigned int uid;
655 struct in_addr laddr;
656 stdcxx . . $ std/::time_tcxx . . $ std/time_t# tm;
657 char timestr[STAT_TIME_MAXLENcxx . . $ STAT_TIME_MAXLEN.];
658
659 names = bn_int_get(rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_statsreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_statsreply..name_countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_87#name_count.);
660 keys = bn_int_get(rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_statsreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_statsreply..key_countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_87#key_count.);
661
662 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).("----\n");
663
664 strpos = sizeof(t_server_statsreplycxx . . $ pvpgn/t_server_statsreply#);
665 for (i = 0; i < names; i++)
666 {
667 j = 0;
668 if (use_bnetd)
669 {
670 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
671 strpos += stdcxx . . $ std/::strlen(temp) + 1;
672 else
673 temp = "";
674 j++;
675 if (temp[0] == '\0')
676 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Username: UNKNOWN\n");
677 else
678 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Username: %s\n", temp);
679
680 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
681 strpos += stdcxx . . $ std/::strlen(temp) + 1;
682 else
683 temp = "";
684 j++;
685 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &uid) < 0 || uid < 1)
686 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Account: UNKNOWN\n");
687 else
688 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Account: " UID_FORMATFcxx . . $ `src/common/setup_before.h:84:9`! "\n", uid);
689
690 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
691 strpos += stdcxx . . $ std/::strlen(temp) + 1;
692 else
693 temp = "";
694 j++;
695 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Last login client: %s\n", temp);
696
697 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
698 strpos += stdcxx . . $ std/::strlen(temp) + 1;
699 else
700 temp = "";
701 j++;
702 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &val) < 0)
703 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Last login host: UNKNOWN\n");
704 else
705 {
706 laddr.s_addr = htonl(val);
707 char addrstr[INET_ADDRSTRLENcxx . . $ `<external>/9581057695539925927/in.h:244:9`!] = { 0 };
708 inet_ntop(AF_INETcxx . . $ `<external>/8962547315054503424/socket.h:97:9`!, &(laddr), addrstr, sizeof(addrstr));
709 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Last login host: %s\n", addrstr);
710 }
711
712 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
713 strpos += stdcxx . . $ std/::strlen(temp) + 1;
714 else
715 temp = "";
716 j++;
717 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &val) < 0 || val == 0)
718 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Last login time: NEVER\n");
719 else
720 {
721 tm = (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)val;
722 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(timestr, STAT_TIME_MAXLENcxx . . $ STAT_TIME_MAXLEN., STAT_TIME_FORMATcxx . . $ `src/common/setup_before.h:99:9`!, stdcxx . . $ std/::localtimecxx . . $ std/localtime(7d91c9e5f6bb884b).(&tm));
723 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Last login time: %s\n", timestr);
724 }
725
726 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
727 strpos += stdcxx . . $ std/::strlen(temp) + 1;
728 else
729 temp = "";
730 j++;
731 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" First login client: %s\n", temp);
732
733 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
734 strpos += stdcxx . . $ std/::strlen(temp) + 1;
735 else
736 temp = "";
737 j++;
738 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &val) < 0)
739 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" First login host: UNKNOWN\n");
740 else
741 {
742 laddr.s_addr = htonl(val);
743 char addrstr[INET_ADDRSTRLENcxx . . $ `<external>/9581057695539925927/in.h:244:9`!] = { 0 };
744 inet_ntop(AF_INETcxx . . $ `<external>/8962547315054503424/socket.h:97:9`!, &(laddr), addrstr, sizeof(addrstr));
745 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" First login host: %s\n", addrstr);
746 }
747
748 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
749 strpos += stdcxx . . $ std/::strlen(temp) + 1;
750 else
751 temp = "";
752 j++;
753 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &val) < 0 || val == 0)
754 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" First login time: NEVER\n");
755 else
756 {
757 tm = (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)val;
758 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(timestr, STAT_TIME_MAXLENcxx . . $ STAT_TIME_MAXLEN., STAT_TIME_FORMATcxx . . $ `src/common/setup_before.h:99:9`!, stdcxx . . $ std/::localtimecxx . . $ std/localtime(7d91c9e5f6bb884b).(&tm));
759 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" First login time: %s\n", timestr);
760 }
761 }
762 else
763 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Username: %s\n", text);
764 if (use_fsgs)
765 {
766 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
767 strpos += stdcxx . . $ std/::strlen(temp) + 1;
768 else
769 temp = "";
770 j++;
771 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &val) < 0 || val == 0)
772 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Creation time: NEVER\n");
773 else
774 {
775 tm = (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)val;
776 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(timestr, STAT_TIME_MAXLENcxx . . $ STAT_TIME_MAXLEN., STAT_TIME_FORMATcxx . . $ `src/common/setup_before.h:99:9`!, stdcxx . . $ std/::localtimecxx . . $ std/localtime(7d91c9e5f6bb884b).(&tm));
777 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Creation time: %s\n", timestr);
778 }
779 }
780
781 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
782 strpos += stdcxx . . $ std/::strlen(temp) + 1;
783 else
784 temp = "";
785 j++;
786 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Sex: %s\n", temp);
787
788 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
789 strpos += stdcxx . . $ std/::strlen(temp) + 1;
790 else
791 temp = "";
792 j++;
793 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Age: %s\n", temp);
794
795 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
796 strpos += stdcxx . . $ std/::strlen(temp) + 1;
797 else
798 temp = "";
799 j++;
800 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Location: %s\n", temp);
801
802 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
803 strpos += stdcxx . . $ std/::strlen(temp) + 1;
804 else
805 temp = "";
806 j++;
807 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Description: %s\n", temp);
808
809 if (stdcxx . . $ std/::strcmp(clienttag, "STAR") == 0 ||
810 stdcxx . . $ std/::strcmp(clienttag, "SSHR") == 0 ||
811 stdcxx . . $ std/::strcmp(clienttag, "SEXP") == 0 ||
812 stdcxx . . $ std/::strcmp(clienttag, "W2BN") == 0)
813 {
814 t_bnettimecxx . . $ pvpgn/t_bnettime# bntime;
815 unsigned int wins, losses, disconnects, draws;
816
817 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
818 strpos += stdcxx . . $ std/::strlen(temp) + 1;
819 else
820 temp = "";
821 j++;
822 if (bnettime_set_strcxx . . $ pvpgn/bnettime_set_str(faeb564d2075bce7).(&bntime, temp) < 0)
823 stdcxx . . $ std/::strcpy(timestr, "NEVER");
824 else
825 {
826 tm = bnettime_to_timecxx . . $ pvpgn/bnettime_to_time(f37c7c75a9c2d829).(bntime);
827 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(timestr, STAT_TIME_MAXLENcxx . . $ STAT_TIME_MAXLEN., STAT_TIME_FORMATcxx . . $ `src/common/setup_before.h:99:9`!, stdcxx . . $ std/::localtimecxx . . $ std/localtime(7d91c9e5f6bb884b).(&tm));
828 }
829 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Last game time: %s\n", timestr);
830
831 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
832 strpos += stdcxx . . $ std/::strlen(temp) + 1;
833 else
834 temp = "";
835 j++;
836 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Last game result: %s\n", temp);
837
838 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
839 strpos += stdcxx . . $ std/::strlen(temp) + 1;
840 else
841 temp = "";
842 j++;
843 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &wins) < 0)
844 wins = 0;
845 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
846 strpos += stdcxx . . $ std/::strlen(temp) + 1;
847 else
848 temp = "";
849 j++;
850 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &losses) < 0)
851 losses = 0;
852 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
853 strpos += stdcxx . . $ std/::strlen(temp) + 1;
854 else
855 temp = "";
856 j++;
857 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &disconnects) < 0)
858 disconnects = 0;
859 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
860 strpos += stdcxx . . $ std/::strlen(temp) + 1;
861 else
862 temp = "";
863 j++;
864 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &draws) < 0)
865 draws = 0;
866 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Record: (%u/%u/%u) %u draws\n", wins, losses, disconnects, draws);
867 }
868
869 if (stdcxx . . $ std/::strcmp(clienttag, "STAR") == 0 ||
870 stdcxx . . $ std/::strcmp(clienttag, "SEXP") == 0 ||
871 stdcxx . . $ std/::strcmp(clienttag, "W2BN") == 0)
872 {
873 t_bnettimecxx . . $ pvpgn/t_bnettime# bntime;
874 unsigned int wins, losses, disconnects, draws;
875 unsigned int rating, rank;
876 unsigned int active_rating, active_rank;
877 unsigned int high_rating, high_rank;
878
879 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
880 strpos += stdcxx . . $ std/::strlen(temp) + 1;
881 else
882 temp = "";
883 j++;
884 if (bnettime_set_strcxx . . $ pvpgn/bnettime_set_str(faeb564d2075bce7).(&bntime, temp) < 0)
885 stdcxx . . $ std/::strcpy(timestr, "NEVER");
886 else
887 {
888 tm = bnettime_to_timecxx . . $ pvpgn/bnettime_to_time(f37c7c75a9c2d829).(bntime);
889 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(timestr, STAT_TIME_MAXLENcxx . . $ STAT_TIME_MAXLEN., STAT_TIME_FORMATcxx . . $ `src/common/setup_before.h:99:9`!, stdcxx . . $ std/::localtimecxx . . $ std/localtime(7d91c9e5f6bb884b).(&tm));
890 }
891 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Last standard ladder game time: %s\n", timestr);
892
893 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
894 strpos += stdcxx . . $ std/::strlen(temp) + 1;
895 else
896 temp = "";
897 j++;
898 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).("Last standard ladder game result: %s\n", temp);
899
900 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
901 strpos += stdcxx . . $ std/::strlen(temp) + 1;
902 else
903 temp = "";
904 j++;
905 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &rating) < 0)
906 rating = 0;
907 if (rating)
908 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Current standard ladder rating: %u\n", rating);
909 else
910 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Current standard ladder rating: UNRATED\n");
911
912 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
913 strpos += stdcxx . . $ std/::strlen(temp) + 1;
914 else
915 temp = "";
916 j++;
917 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &active_rating) < 0)
918 active_rating = 0;
919 if (active_rating)
920 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Active standard ladder rating: %u\n", active_rating);
921 else
922 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Active standard ladder rating: UNRATED\n");
923
924 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
925 strpos += stdcxx . . $ std/::strlen(temp) + 1;
926 else
927 temp = "";
928 j++;
929 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &high_rating) < 0)
930 high_rating = 0;
931 if (high_rating)
932 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" High standard ladder rating: %u\n", high_rating);
933 else
934 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" High standard ladder rating: UNRATED\n");
935
936 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
937 strpos += stdcxx . . $ std/::strlen(temp) + 1;
938 else
939 temp = "";
940 j++;
941 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &rank) < 0)
942 rank = 0;
943 if (rank)
944 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Current standard ladder rank: #%u\n", rank);
945 else
946 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Current standard ladder rank: UNRANKED\n");
947
948 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
949 strpos += stdcxx . . $ std/::strlen(temp) + 1;
950 else
951 temp = "";
952 j++;
953 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &active_rank) < 0)
954 active_rank = 0;
955 if (active_rank)
956 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Active standard ladder rank: #%u\n", active_rank);
957 else
958 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Active standard ladder rank: UNRANKED\n");
959
960 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
961 strpos += stdcxx . . $ std/::strlen(temp) + 1;
962 else
963 temp = "";
964 j++;
965 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &high_rank) < 0)
966 high_rank = 0;
967 if (high_rank)
968 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" High standard ladder rank: #%u\n", high_rank);
969 else
970 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" High standard ladder rank: UNRANKED\n");
971
972 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
973 strpos += stdcxx . . $ std/::strlen(temp) + 1;
974 else
975 temp = "";
976 j++;
977 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &wins) < 0)
978 wins = 0;
979 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
980 strpos += stdcxx . . $ std/::strlen(temp) + 1;
981 else
982 temp = "";
983 j++;
984 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &losses) < 0)
985 losses = 0;
986 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
987 strpos += stdcxx . . $ std/::strlen(temp) + 1;
988 else
989 temp = "";
990 j++;
991 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &disconnects) < 0)
992 disconnects = 0;
993 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
994 strpos += stdcxx . . $ std/::strlen(temp) + 1;
995 else
996 temp = "";
997 j++;
998 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &draws) < 0)
999 draws = 0;
1000 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Standard ladder record: (%u/%u/%u) %u draws\n", wins, losses, disconnects, draws);
1001 }
1002
1003 if (stdcxx . . $ std/::strcmp(clienttag, "W2BN") == 0)
1004 {
1005 t_bnettimecxx . . $ pvpgn/t_bnettime# bntime;
1006 unsigned int wins, losses, disconnects, draws;
1007 unsigned int rating, rank;
1008 unsigned int active_rating, active_rank;
1009 unsigned int high_rating, high_rank;
1010
1011 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1012 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1013 else
1014 temp = "";
1015 j++;
1016 if (bnettime_set_strcxx . . $ pvpgn/bnettime_set_str(faeb564d2075bce7).(&bntime, temp) < 0)
1017 stdcxx . . $ std/::strcpy(timestr, "NEVER");
1018 else
1019 {
1020 tm = bnettime_to_timecxx . . $ pvpgn/bnettime_to_time(f37c7c75a9c2d829).(bntime);
1021 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(timestr, STAT_TIME_MAXLENcxx . . $ STAT_TIME_MAXLEN., STAT_TIME_FORMATcxx . . $ `src/common/setup_before.h:99:9`!, stdcxx . . $ std/::localtimecxx . . $ std/localtime(7d91c9e5f6bb884b).(&tm));
1022 }
1023 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Last Ironman ladder game time: %s\n", timestr);
1024
1025 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1026 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1027 else
1028 temp = "";
1029 j++;
1030 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Last Ironman ladder game result: %s\n", temp);
1031
1032 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1033 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1034 else
1035 temp = "";
1036 j++;
1037 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &rating) < 0)
1038 rating = 0;
1039 if (rating)
1040 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Current Ironman ladder rating: %u\n", rating);
1041 else
1042 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Current Ironman ladder rating: UNRATED\n");
1043
1044 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1045 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1046 else
1047 temp = "";
1048 j++;
1049 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &active_rating) < 0)
1050 active_rating = 0;
1051 if (active_rating)
1052 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Active Ironman ladder rating: %u\n", active_rating);
1053 else
1054 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Active Ironman ladder rating: UNRATED\n");
1055
1056 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1057 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1058 else
1059 temp = "";
1060 j++;
1061 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &high_rating) < 0)
1062 high_rating = 0;
1063 if (high_rating)
1064 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" High Ironman ladder rating: %u\n", high_rating);
1065 else
1066 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" High Ironman ladder rating: UNRATED\n");
1067
1068 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1069 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1070 else
1071 temp = "";
1072 j++;
1073 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &rank) < 0)
1074 rank = 0;
1075 if (rank)
1076 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Current Ironman ladder rank: #%u\n", rank);
1077 else
1078 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Current Ironman ladder rank: UNRANKED\n");
1079
1080 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1081 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1082 else
1083 temp = "";
1084 j++;
1085 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &active_rank) < 0)
1086 active_rank = 0;
1087 if (active_rank)
1088 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Active Ironman ladder rank: #%u\n", active_rank);
1089 else
1090 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Active Ironman ladder rank: UNRANKED\n");
1091
1092 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1093 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1094 else
1095 temp = "";
1096 j++;
1097 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &high_rank) < 0)
1098 high_rank = 0;
1099 if (high_rank)
1100 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" High Ironman ladder rank: #%u\n", high_rank);
1101 else
1102 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" High Ironman ladder rank: UNRANKED\n");
1103
1104 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1105 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1106 else
1107 temp = "";
1108 j++;
1109 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &wins) < 0)
1110 wins = 0;
1111 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1112 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1113 else
1114 temp = "";
1115 j++;
1116 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &losses) < 0)
1117 losses = 0;
1118 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1119 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1120 else
1121 temp = "";
1122 j++;
1123 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &disconnects) < 0)
1124 disconnects = 0;
1125 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1126 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1127 else
1128 temp = "";
1129 j++;
1130 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &draws) < 0)
1131 draws = 0;
1132 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Ironman ladder record: (%u/%u/%u) %u draws\n", wins, losses, disconnects, draws);
1133 }
1134
1135 if (stdcxx . . $ std/::strcmp(clienttag, "DSHR") == 0 ||
1136 stdcxx . . $ std/::strcmp(clienttag, "DRTL") == 0)
1137 {
1138 unsigned int level;
1139 unsigned int chclass;
1140 unsigned int diablo_kills;
1141 unsigned int strength;
1142 unsigned int magic;
1143 unsigned int dexterity;
1144 unsigned int vitality;
1145 unsigned int gold;
1146
1147 if (use_bnetd)
1148 {
1149 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1150 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1151 else
1152 temp = "";
1153 j++;
1154 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &level)<0)
1155 level = 0;
1156 if (level>0)
1157 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Level: %u\n", level);
1158 else
1159 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Level: NONE\n");
1160
1161 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1162 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1163 else
1164 temp = "";
1165 j++;
1166 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &chclass) < 0)
1167 chclass = 99;
1168 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Class: %s\n", bnclass_get_strcxx . . $ `$anonymous_namespace_src/client/bnstat.cpp`/bnclass_get_str(81a3ae90da26a711).(chclass));
1169
1170 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1171 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1172 else
1173 temp = "";
1174 j++;
1175 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &strength) < 0)
1176 strength = 0;
1177
1178 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1179 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1180 else
1181 temp = "";
1182 j++;
1183 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &magic) < 0)
1184 magic = 0;
1185
1186 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1187 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1188 else
1189 temp = "";
1190 j++;
1191 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &dexterity) < 0)
1192 dexterity = 0;
1193
1194 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1195 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1196 else
1197 temp = "";
1198 j++;
1199 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &vitality) < 0)
1200 vitality = 0;
1201
1202 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1203 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1204 else
1205 temp = "";
1206 j++;
1207 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &gold) < 0)
1208 gold = 0;
1209
1210 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Stats: %u str %u mag %u dex %u vit %u gld\n",
1211 strength,
1212 magic,
1213 dexterity,
1214 vitality,
1215 gold);
1216
1217 if (j < keys && (temp = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(rpacket, strpos, 256)))
1218 strpos += stdcxx . . $ std/::strlen(temp) + 1;
1219 else
1220 temp = "";
1221 j++;
1222 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(temp, &diablo_kills) < 0)
1223 diablo_kills = 0;
1224 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).(" Diablo Kills: %u\n", diablo_kills);
1225 }
1226 }
1227 }
1228 stdcxx . . $ std/::printfcxx . . $ std/printf(581fddd72a8db8fc).("----\n");
1229 }
1230
1231 if (gotplayer)
1232 break;
1233 commpos = 0;
1234 text[0] = '\0';
1235 }
1236
1237 psock_closecxx . . $ `src/compat/psock.h:300:9`!(sd);
1238 if (changed_in)
1239 tcsetattr(fd_stdin, TCSAFLUSHcxx . . $ `<external>/7740429199341890421/termios-tcflow.h:26:9`!, &in_attr_old);
1240 return EXIT_SUCCESScxx . . $ `<external>/10696550936717951914/stdlib.h:93:9`!;
1241 }