Debian Codegraph @

src/bnetd/command.cpp

raw symbols SCIP
1 /*
2 * Copyright (C) 1998 Mark Baysinger ([email protected])
3 * Copyright (C) 1998,1999,2000,2001 Ross Combs ([email protected])
4 * Copyright (C) 1999 Gediminas ([email protected])
5 * Copyright (C) 1999 Rob Crittenden ([email protected])
6 * Copyright (C) 2000,2001 Marco Ziech ([email protected])
7 * Copyright (C) 2000 Dizzy
8 * Copyright (C) 2000 Onlyer ([email protected])
9 * Copyright (C) 2003,2004 Aaron
10 * Copyright (C) 2004 Donny Redmond ([email protected])
11 * Copyright (C) 2008 Pelish ([email protected])
12 * Copyright (C) 2014 HarpyWar ([email protected])
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 */
28 #include "common/setup_before.h"cxx . . $ `<file>/src/common/setup_before.h`/
29 #include "command.h"cxx . . $ `<file>/src/bnetd/command.h`/
30
31 #include <algorithm>
32 #include <cctype>
33 #include <cerrno>
34 #include <cstring>
35 #include <cstdlib>
36 #include <iostream>
37 #include <string>
38
39 #include "compat/strcasecmp.h"cxx . . $ `<file>/src/compat/strcasecmp.h`/
40 #include "common/tag.h"cxx . . $ `<file>/src/common/tag.h`/
41 #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/
42 #include "common/version.h"cxx . . $ `<file>/src/common/version.h`/
43 #include "common/eventlog.h"cxx . . $ `<file>/src/common/eventlog.h`/
44 #include "common/bnettime.h"cxx . . $ `<file>/src/common/bnettime.h`/
45 #include "common/addr.h"cxx . . $ `<file>/src/common/addr.h`/
46 #include "common/packet.h"cxx . . $ `<file>/src/common/packet.h`/
47 #include "common/bnethash.h"cxx . . $ `<file>/src/common/bnethash.h`/
48 #include "common/list.h"cxx . . $ `<file>/src/common/list.h`/
49 #include "common/proginfo.h"cxx . . $ `<file>/src/common/proginfo.h`/
50 #include "common/queue.h"cxx . . $ `<file>/src/common/queue.h`/
51 #include "common/bn_type.h"cxx . . $ `<file>/src/common/bn_type.h`/
52 #include "common/xalloc.h"cxx . . $ `<file>/src/common/xalloc.h`/
53 #include "common/xstr.h"cxx . . $ `<file>/src/common/xstr.h`/
54 #include "common/trans.h"cxx . . $ `<file>/src/common/trans.h`/
55 #include "common/lstr.h"cxx . . $ `<file>/src/common/lstr.h`/
56 #include "common/hashtable.h"cxx . . $ `<file>/src/common/hashtable.h`/
57 #include "common/xstring.h"cxx . . $ `<file>/src/common/xstring.h`/
58
59 #include "connection.h"cxx . . $ `<file>/src/bnetd/connection.h`/
60 #include "message.h"cxx . . $ `<file>/src/bnetd/message.h`/
61 #include "channel.h"cxx . . $ `<file>/src/bnetd/channel.h`/
62 #include "game.h"cxx . . $ `<file>/src/bnetd/game.h`/
63 #include "team.h"cxx . . $ `<file>/src/bnetd/team.h`/
64 #include "account.h"cxx . . $ `<file>/src/bnetd/account.h`/
65 #include "account_wrap.h"cxx . . $ `<file>/src/bnetd/account_wrap.h`/
66 #include "server.h"cxx . . $ `<file>/src/bnetd/server.h`/
67 #include "prefs.h"cxx . . $ `<file>/src/bnetd/prefs.h`/
68 #include "ladder.h"cxx . . $ `<file>/src/bnetd/ladder.h`/
69 #include "timer.h"cxx . . $ `<file>/src/bnetd/timer.h`/
70 #include "helpfile.h"cxx . . $ `<file>/src/bnetd/helpfile.h`/
71 #include "mail.h"cxx . . $ `<file>/src/bnetd/mail.h`/
72 #include "runprog.h"cxx . . $ `<file>/src/bnetd/runprog.h`/
73 #include "alias_command.h"cxx . . $ `<file>/src/bnetd/alias_command.h`/
74 #include "realm.h"cxx . . $ `<file>/src/bnetd/realm.h`/
75 #include "ipban.h"cxx . . $ `<file>/src/bnetd/ipban.h`/
76 #include "command_groups.h"cxx . . $ `<file>/src/bnetd/command_groups.h`/
77 #include "news.h"cxx . . $ `<file>/src/bnetd/news.h`/
78 #include "topic.h"cxx . . $ `<file>/src/bnetd/topic.h`/
79 #include "friends.h"cxx . . $ `<file>/src/bnetd/friends.h`/
80 #include "clan.h"cxx . . $ `<file>/src/bnetd/clan.h`/
81 #include "common/flags.h"cxx . . $ `<file>/src/common/flags.h`/
82 #include "icons.h"cxx . . $ `<file>/src/bnetd/icons.h`/
83 #include "userlog.h"cxx . . $ `<file>/src/bnetd/userlog.h`/
84 #include "i18n.h"cxx . . $ `<file>/src/bnetd/i18n.h`/
85
86 #include "attrlayer.h"cxx . . $ `<file>/src/bnetd/attrlayer.h`/
87
88 #ifdef WITH_LUA
89 #include "luainterface.h"
90 #endif
91 #include "common/setup_after.h"cxx . . $ `<file>/src/common/setup_after.h`/
92
93 namespace pvpgncxx . . $ pvpgn/
94 {
95
96 namespace bnetdcxx . . $ pvpgn/bnetd/
97 {
98 static char const * bnclass_get_strcxx . . $ pvpgn/bnetd/bnclass_get_str(81a3ae90da26a711).(unsigned int cclass);
99 static void do_whispercxx . . $ pvpgn/bnetd/do_whisper(eaaa44a2dcaaa0e3).(t_connection * user_c, char const * dest, char const * text);
100 static void do_whoiscxx . . $ pvpgn/bnetd/do_whois(c8fb97a9af134824).(t_connection * c, char const * dest);
101 static void user_timer_cbcxx . . $ pvpgn/bnetd/user_timer_cb(9b6c929c3dbc4c93).(t_connection * c, stdcxx . . $ std/::time_tcxx . . $ std/time_t# now, t_timer_datacxx . . $ pvpgn/bnetd/t_timer_data# str);
102
103 stdcxx . . $ std/::stringcxx . . $ std/string# msgtempcxx . . $ pvpgn/bnetd/msgtemp., msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2.;
104 char msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.[MAX_MESSAGE_LENcxx . . $ MAX_MESSAGE_LEN.];
105
106
107 static char const * bnclass_get_strcxx . . $ pvpgn/bnetd/bnclass_get_str(81a3ae90da26a711).(unsigned int cclass)
108 {
109 switch (cclass)
110 {
111 case PLAYERINFO_DRTL_CLASS_WARRIORcxx . . $ `src/common/bnet_protocol.h:2291:9`!:
112 return "warrior";
113 case PLAYERINFO_DRTL_CLASS_ROGUEcxx . . $ `src/common/bnet_protocol.h:2292:9`!:
114 return "rogue";
115 case PLAYERINFO_DRTL_CLASS_SORCERERcxx . . $ `src/common/bnet_protocol.h:2293:9`!:
116 return "sorcerer";
117 default:
118 return "unknown";
119 }
120 }
121
122 /*
123 * Split text by spaces and return array of arguments.
124 * First text argument is a command name (index = 0)
125 * Last text argument always reads to end
126 */
127 extern stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(char const * text, int args_count)
128 {
129 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> resultcxx . . $ std/vector#vector(83fdeebbe0501a83).(args_count + 1);
130
131 stdcxx . . $ std/::stringcxx . . $ std/string# scxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).(text);
132 // remove slash from the command
133 if (!s.emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
134 s.erasecxx . . $ std/__cxx11/basic_string#erase(710c914f019a9041).(0, 1);
135
136 stdcxx . . $ std/::istringstreamcxx . . $ std/istringstream# isscxx . . $ std/__cxx11/basic_istringstream#basic_istringstream(d3c8ea0e6521074c).(s);
137
138 int i = 0;
139 stdcxx . . $ std/::stringcxx . . $ std/string# tmp = stdcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).::stringcxx . . $ std/string#(); // to end
140 do
141 {
142 stdcxx . . $ std/::stringcxx . . $ std/string# subcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).;
143 iss >>cxx . . $ std/`operator>>`(567ac654e2f44b5d). sub;
144
145 if (sub.emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
146 continue;
147
148 if (i < args_count)
149 {
150 result[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i] =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). sub;
151 i++;
152 }
153 else
154 {
155 if (!tmp.emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
156 tmp +=cxx . . $ std/__cxx11/basic_string#`operator+=`(978ca1133b5f6e74). " ";
157 tmp +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). sub;
158 }
159
160 } while (iss);
161
162 // push remaining text at the end
163 if (tmp.lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).() > 0)
164 result[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).args_count] =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). tmp;
165
166 return resultcxx . . $ std/vector#vector(6f559d22b039ccdb).;
167 }
168 stdcxx . . $ std/::stringcxx . . $ std/string# msgtcxx . . $ pvpgn/bnetd/msgt.;
169 static void do_whispercxx . . $ pvpgn/bnetd/do_whisper(eaaa44a2dcaaa0e3).(t_connection * user_c, char const * dest, char const * text)
170 {
171 t_connection * dest_c;
172 char const * tname;
173
174 if (account_get_auth_mutecxx . . $ pvpgn/bnetd/account_get_auth_mute(367bfb076f70247b).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(user_c)) == 1)
175 {
176 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(user_c, message_type_error, user_c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(user_c, "Your account has been muted, you can't whisper to other users."));
177 return;
178 }
179
180 if (!(dest_c = connlist_find_connection_by_namecxx . . $ pvpgn/bnetd/connlist_find_connection_by_name(5be23fbfec631fd6).(dest, conn_get_realmcxx . . $ pvpgn/bnetd/conn_get_realm(c743a4e7d4d1463d).(user_c))))
181 {
182 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(user_c, message_type_error, user_c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(user_c, "That user is not logged on."));
183 return;
184 }
185
186
187 #ifdef WITH_LUA
188 if (lua_handle_user(user_c, dest_c, text, luaevent_user_whisper) == 1)
189 return;
190 #endif
191
192 if (conn_get_dndstrcxx . . $ pvpgn/bnetd/conn_get_dndstr(c99dbccf638f5c6).(dest_c))
193 {
194 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(user_c, "{} is unavailable ({})", conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(dest_c), conn_get_dndstr(dest_c));
195 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(user_c, message_type_info, user_c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
196 return;
197 }
198
199 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(user_c, message_type_whisperack, dest_c, text);
200
201 if (conn_get_awaystrcxx . . $ pvpgn/bnetd/conn_get_awaystr(c99dbccf638f5c6).(dest_c))
202 {
203 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(user_c, "{} is away ({})", conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(dest_c), conn_get_awaystr(dest_c));
204 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(user_c, message_type_info, user_c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
205 }
206
207 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(dest_c, message_type_whisper, user_c, text);
208
209 if ((tname = conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(user_c)))
210 {
211 char username[1 + MAX_USERNAME_LENcxx . . $ MAX_USERNAME_LEN.]; /* '*' + username (including NUL) */
212
213 if (stdcxx . . $ std/::strlen(tname) < MAX_USERNAME_LENcxx . . $ MAX_USERNAME_LEN.)
214 {
215 stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(username, "*%s", tname);
216 conn_set_lastsendercxx . . $ pvpgn/bnetd/conn_set_lastsender(2e9022cda97b266d).(dest_c, username);
217 }
218 }
219 }
220
221
222 static void do_whoiscxx . . $ pvpgn/bnetd/do_whois(c8fb97a9af134824).(t_connection * c, char const * dest)
223 {
224 t_connection * dest_c;
225 stdcxx . . $ std/::stringcxx . . $ std/string# namepartcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391)., verbcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).; /* 64 + " (" + 64 + ")" + NUL */
226 t_game const * game;
227 t_channelcxx . . $ pvpgn/bnetd/t_channel# const * channel;
228
229 if ((!(dest_c = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(dest))) &&
230 (!(dest_c = connlist_find_connection_by_namecxx . . $ pvpgn/bnetd/connlist_find_connection_by_name(5be23fbfec631fd6).(dest, conn_get_realmcxx . . $ pvpgn/bnetd/conn_get_realm(c743a4e7d4d1463d).(c)))))
231 {
232 t_accountcxx . . $ pvpgn/bnetd/t_account# * dest_a;
233 t_bnettimecxx . . $ pvpgn/t_bnettime# btlogin;
234 stdcxx . . $ std/::time_tcxx . . $ std/time_t# ulogin;
235 struct stdcxx . . $ std/::tmcxx . . $ tm# * tmlogin;
236
237 if (!(dest_a = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(dest))) {
238 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Unknown user."));
239 return;
240 }
241
242 if (conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(c) == conn_class_bnet) {
243 btlogin =cxx . . $ pvpgn/$anonymous_type_c83edbf674c01669_0#`operator=`(372276d12cbccf26). time_to_bnettimecxx . . $ pvpgn/time_to_bnettime(f96d2c3d06d968c9).((stdcxx . . $ std/::time_tcxx . . $ std/time_t#)account_get_ll_timecxx . . $ pvpgn/bnetd/account_get_ll_time(c7ab9369555c44b8).(dest_a), 0);
244 btlogin =cxx . . $ pvpgn/$anonymous_type_c83edbf674c01669_0#`operator=`(372276d12cbccf26). bnettime_add_tzbiascxx . . $ pvpgn/bnettime_add_tzbias(f1f1310dc900a45f).(btlogin, conn_get_tzbiascxx . . $ pvpgn/bnetd/conn_get_tzbias(b5160de3e9803af4).(c));
245 ulogin = bnettime_to_timecxx . . $ pvpgn/bnettime_to_time(f37c7c75a9c2d829).(btlogin);
246 if (!(tmlogin = stdcxx . . $ std/::gmtimecxx . . $ std/gmtime(7d91c9e5f6bb884b).(&ulogin)))
247 stdcxx . . $ std/::strcpy(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "?");
248 else
249 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "%a %b %d %H:%M:%S", tmlogin);
250 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "User was last seen on: {}", msgtemp0);
251 }
252 else
253 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "User is offline");
254 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
255 return;
256 }
257
258 if (c == dest_c)
259 {
260 namepart =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You");
261 verb =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "are");
262 }
263 else
264 {
265 char const * tname;
266
267 namepart =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). (tname = conn_get_chatcharnamecxx . . $ pvpgn/bnetd/conn_get_chatcharname(f9b74edfe4109401).(dest_c, c));
268 conn_unget_chatcharnamecxx . . $ pvpgn/bnetd/conn_unget_chatcharname(6b2655da947c846f).(dest_c, tname);
269 verb =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "is");
270 }
271
272 if ((game = conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(dest_c)))
273 {
274 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} {} using {} and {} currently in {} game \"{}\".",
275 namepart,
276 verb,
277 clienttag_get_title(conn_get_clienttag(dest_c)),
278 verb,
279 game_get_flag(game) == game_flag_private ? localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "private") : "",
280 game_get_name(game));
281 }
282 else if ((channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(dest_c)))
283 {
284 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} {} using {} and {} currently in channel \"{}\".",
285 namepart,
286 verb,
287 clienttag_get_title(conn_get_clienttag(dest_c)),
288 verb,
289 channel_get_name(channel));
290 }
291 else
292 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} {} using {}.",
293 namepart,
294 verb,
295 clienttag_get_title(conn_get_clienttag(dest_c)));
296 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
297
298 if (conn_get_dndstrcxx . . $ pvpgn/bnetd/conn_get_dndstr(c99dbccf638f5c6).(dest_c))
299 {
300 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} {} refusing messages ({})",
301 namepart,
302 verb,
303 conn_get_dndstr(dest_c));
304 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
305 }
306 else
307 if (conn_get_awaystrcxx . . $ pvpgn/bnetd/conn_get_awaystr(c99dbccf638f5c6).(dest_c))
308 {
309 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} away ({})",
310 namepart,
311 conn_get_awaystr(dest_c));
312 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
313 }
314 }
315
316
317 static void user_timer_cbcxx . . $ pvpgn/bnetd/user_timer_cb(9b6c929c3dbc4c93).(t_connection * c, stdcxx . . $ std/::time_tcxx . . $ std/time_t# now, t_timer_datacxx . . $ pvpgn/bnetd/t_timer_data# str)
318 {
319 if (!c)
320 {
321 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection");
322 return;
323 }
324 if (!str.pcxx . . $ pvpgn/bnetd/$anonymous_type_64e82d6b10ad28f9_0#p.)
325 {
326 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL str");
327 return;
328 }
329
330 if (now != (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)0) /* zero means user logged out before expiration */
331 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, (char*)str.pcxx . . $ pvpgn/bnetd/$anonymous_type_64e82d6b10ad28f9_0#p.);
332 xfreecxx . . $ `src/common/xalloc.h:51:9`!(str.p);
333 }
334
335 typedef int(*t_commandcxx . . $ pvpgn/bnetd/t_command#)(t_connection * c, char const * text);
336
337 typedef structcxx . . $ pvpgn/bnetd/$anonymous_type_91817c0bf523d570_0# {
338 const char * command_stringcxx . . $ pvpgn/bnetd/$anonymous_type_91817c0bf523d570_0#command_string.;
339 t_commandcxx . . $ pvpgn/bnetd/t_command# command_handlercxx . . $ pvpgn/bnetd/$anonymous_type_91817c0bf523d570_0#command_handler.;
340 } t_command_table_rowcxx . . $ pvpgn/bnetd/t_command_table_row#;
341
342 static int command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(t_connection * c); // [Omega]
343 // command handler prototypes
344 static int _handle_clan_commandcxx . . $ pvpgn/bnetd/_handle_clan_command(2e9022cda97b266d).(t_connection * c, char const * text);
345 static int _handle_admin_commandcxx . . $ pvpgn/bnetd/_handle_admin_command(2e9022cda97b266d).(t_connection * c, char const * text);
346 static int _handle_aop_commandcxx . . $ pvpgn/bnetd/_handle_aop_command(2e9022cda97b266d).(t_connection * c, char const * text);
347 static int _handle_op_commandcxx . . $ pvpgn/bnetd/_handle_op_command(2e9022cda97b266d).(t_connection * c, char const * text);
348 static int _handle_tmpop_commandcxx . . $ pvpgn/bnetd/_handle_tmpop_command(2e9022cda97b266d).(t_connection * c, char const * text);
349 static int _handle_deop_commandcxx . . $ pvpgn/bnetd/_handle_deop_command(2e9022cda97b266d).(t_connection * c, char const * text);
350 static int _handle_voice_commandcxx . . $ pvpgn/bnetd/_handle_voice_command(2e9022cda97b266d).(t_connection * c, char const * text);
351 static int _handle_devoice_commandcxx . . $ pvpgn/bnetd/_handle_devoice_command(2e9022cda97b266d).(t_connection * c, char const * text);
352 static int _handle_vop_commandcxx . . $ pvpgn/bnetd/_handle_vop_command(2e9022cda97b266d).(t_connection * c, char const * text);
353 static int _handle_friends_commandcxx . . $ pvpgn/bnetd/_handle_friends_command(2e9022cda97b266d).(t_connection * c, char const * text);
354 static int _handle_me_commandcxx . . $ pvpgn/bnetd/_handle_me_command(2e9022cda97b266d).(t_connection * c, char const * text);
355 static int _handle_whisper_commandcxx . . $ pvpgn/bnetd/_handle_whisper_command(2e9022cda97b266d).(t_connection * c, char const * text);
356 static int _handle_status_commandcxx . . $ pvpgn/bnetd/_handle_status_command(2e9022cda97b266d).(t_connection * c, char const * text);
357 static int _handle_who_commandcxx . . $ pvpgn/bnetd/_handle_who_command(2e9022cda97b266d).(t_connection * c, char const * text);
358 static int _handle_whois_commandcxx . . $ pvpgn/bnetd/_handle_whois_command(2e9022cda97b266d).(t_connection * c, char const * text);
359 static int _handle_whoami_commandcxx . . $ pvpgn/bnetd/_handle_whoami_command(2e9022cda97b266d).(t_connection * c, char const * text);
360 static int _handle_announce_commandcxx . . $ pvpgn/bnetd/_handle_announce_command(2e9022cda97b266d).(t_connection * c, char const * text);
361 static int _handle_beep_commandcxx . . $ pvpgn/bnetd/_handle_beep_command(2e9022cda97b266d).(t_connection * c, char const * text);
362 static int _handle_nobeep_commandcxx . . $ pvpgn/bnetd/_handle_nobeep_command(2e9022cda97b266d).(t_connection * c, char const * text);
363 static int _handle_version_commandcxx . . $ pvpgn/bnetd/_handle_version_command(2e9022cda97b266d).(t_connection * c, char const * text);
364 static int _handle_copyright_commandcxx . . $ pvpgn/bnetd/_handle_copyright_command(2e9022cda97b266d).(t_connection * c, char const * text);
365 static int _handle_uptime_commandcxx . . $ pvpgn/bnetd/_handle_uptime_command(2e9022cda97b266d).(t_connection * c, char const * text);
366 static int _handle_stats_commandcxx . . $ pvpgn/bnetd/_handle_stats_command(2e9022cda97b266d).(t_connection * c, char const * text);
367 static int _handle_time_commandcxx . . $ pvpgn/bnetd/_handle_time_command(2e9022cda97b266d).(t_connection * c, char const * text);
368 static int _handle_channel_commandcxx . . $ pvpgn/bnetd/_handle_channel_command(2e9022cda97b266d).(t_connection * c, char const * text);
369 static int _handle_rejoin_commandcxx . . $ pvpgn/bnetd/_handle_rejoin_command(2e9022cda97b266d).(t_connection * c, char const * text);
370 static int _handle_away_commandcxx . . $ pvpgn/bnetd/_handle_away_command(2e9022cda97b266d).(t_connection * c, char const * text);
371 static int _handle_dnd_commandcxx . . $ pvpgn/bnetd/_handle_dnd_command(2e9022cda97b266d).(t_connection * c, char const * text);
372 static int _handle_squelch_commandcxx . . $ pvpgn/bnetd/_handle_squelch_command(2e9022cda97b266d).(t_connection * c, char const * text);
373 static int _handle_unsquelch_commandcxx . . $ pvpgn/bnetd/_handle_unsquelch_command(2e9022cda97b266d).(t_connection * c, char const * text);
374 static int _handle_kick_commandcxx . . $ pvpgn/bnetd/_handle_kick_command(2e9022cda97b266d).(t_connection * c, char const * text);
375 static int _handle_ban_commandcxx . . $ pvpgn/bnetd/_handle_ban_command(2e9022cda97b266d).(t_connection * c, char const * text);
376 static int _handle_unban_commandcxx . . $ pvpgn/bnetd/_handle_unban_command(2e9022cda97b266d).(t_connection * c, char const * text);
377 static int _handle_reply_commandcxx . . $ pvpgn/bnetd/_handle_reply_command(2e9022cda97b266d).(t_connection * c, char const * text);
378 static int _handle_realmann_commandcxx . . $ pvpgn/bnetd/_handle_realmann_command(2e9022cda97b266d).(t_connection * c, char const * text);
379 static int _handle_watch_commandcxx . . $ pvpgn/bnetd/_handle_watch_command(2e9022cda97b266d).(t_connection * c, char const * text);
380 static int _handle_unwatch_commandcxx . . $ pvpgn/bnetd/_handle_unwatch_command(2e9022cda97b266d).(t_connection * c, char const * text);
381 static int _handle_watchall_commandcxx . . $ pvpgn/bnetd/_handle_watchall_command(2e9022cda97b266d).(t_connection * c, char const * text);
382 static int _handle_unwatchall_commandcxx . . $ pvpgn/bnetd/_handle_unwatchall_command(2e9022cda97b266d).(t_connection * c, char const * text);
383 static int _handle_lusers_commandcxx . . $ pvpgn/bnetd/_handle_lusers_command(2e9022cda97b266d).(t_connection * c, char const * text);
384 static int _handle_news_commandcxx . . $ pvpgn/bnetd/_handle_news_command(2e9022cda97b266d).(t_connection * c, char const * text);
385 static int _handle_games_commandcxx . . $ pvpgn/bnetd/_handle_games_command(2e9022cda97b266d).(t_connection * c, char const * text);
386 static int _handle_channels_commandcxx . . $ pvpgn/bnetd/_handle_channels_command(2e9022cda97b266d).(t_connection * c, char const * text);
387 static int _handle_addacct_commandcxx . . $ pvpgn/bnetd/_handle_addacct_command(2e9022cda97b266d).(t_connection * c, char const * text);
388 static int _handle_chpass_commandcxx . . $ pvpgn/bnetd/_handle_chpass_command(2e9022cda97b266d).(t_connection * c, char const * text);
389 static int _handle_connections_commandcxx . . $ pvpgn/bnetd/_handle_connections_command(2e9022cda97b266d).(t_connection * c, char const * text);
390 static int _handle_finger_commandcxx . . $ pvpgn/bnetd/_handle_finger_command(2e9022cda97b266d).(t_connection * c, char const * text);
391 static int _handle_operator_commandcxx . . $ pvpgn/bnetd/_handle_operator_command(2e9022cda97b266d).(t_connection * c, char const * text);
392 static int _handle_admins_commandcxx . . $ pvpgn/bnetd/_handle_admins_command(2e9022cda97b266d).(t_connection * c, char const * text);
393 static int _handle_quit_commandcxx . . $ pvpgn/bnetd/_handle_quit_command(2e9022cda97b266d).(t_connection * c, char const * text);
394 static int _handle_kill_commandcxx . . $ pvpgn/bnetd/_handle_kill_command(2e9022cda97b266d).(t_connection * c, char const * text);
395 static int _handle_killsession_commandcxx . . $ pvpgn/bnetd/_handle_killsession_command(2e9022cda97b266d).(t_connection * c, char const * text);
396 static int _handle_gameinfo_commandcxx . . $ pvpgn/bnetd/_handle_gameinfo_command(2e9022cda97b266d).(t_connection * c, char const * text);
397 static int _handle_ladderactivate_commandcxx . . $ pvpgn/bnetd/_handle_ladderactivate_command(2e9022cda97b266d).(t_connection * c, char const * text);
398 static int _handle_rehash_commandcxx . . $ pvpgn/bnetd/_handle_rehash_command(2e9022cda97b266d).(t_connection * c, char const * text);
399 static int _handle_find_commandcxx . . $ pvpgn/bnetd/_handle_find_command(2e9022cda97b266d).(t_connection * c, char const *text);
400 static int _handle_save_commandcxx . . $ pvpgn/bnetd/_handle_save_command(2e9022cda97b266d).(t_connection * c, char const * text);
401
402 static int _handle_shutdown_commandcxx . . $ pvpgn/bnetd/_handle_shutdown_command(2e9022cda97b266d).(t_connection * c, char const * text);
403 static int _handle_ladderinfo_commandcxx . . $ pvpgn/bnetd/_handle_ladderinfo_command(2e9022cda97b266d).(t_connection * c, char const * text);
404 static int _handle_timer_commandcxx . . $ pvpgn/bnetd/_handle_timer_command(2e9022cda97b266d).(t_connection * c, char const * text);
405 static int _handle_serverban_commandcxx . . $ pvpgn/bnetd/_handle_serverban_command(2e9022cda97b266d).(t_connection * c, char const * text);
406 static int _handle_netinfo_commandcxx . . $ pvpgn/bnetd/_handle_netinfo_command(2e9022cda97b266d).(t_connection * c, char const * text);
407 static int _handle_quota_commandcxx . . $ pvpgn/bnetd/_handle_quota_command(2e9022cda97b266d).(t_connection * c, char const * text);
408 static int _handle_lockacct_commandcxx . . $ pvpgn/bnetd/_handle_lockacct_command(2e9022cda97b266d).(t_connection * c, char const * text);
409 static int _handle_unlockacct_commandcxx . . $ pvpgn/bnetd/_handle_unlockacct_command(2e9022cda97b266d).(t_connection * c, char const * text);
410 static int _handle_muteacct_commandcxx . . $ pvpgn/bnetd/_handle_muteacct_command(2e9022cda97b266d).(t_connection * c, char const * text);
411 static int _handle_unmuteacct_commandcxx . . $ pvpgn/bnetd/_handle_unmuteacct_command(2e9022cda97b266d).(t_connection * c, char const * text);
412 static int _handle_flag_commandcxx . . $ pvpgn/bnetd/_handle_flag_command(2e9022cda97b266d).(t_connection * c, char const * text);
413 static int _handle_tag_commandcxx . . $ pvpgn/bnetd/_handle_tag_command(2e9022cda97b266d).(t_connection * c, char const * text);
414 static int _handle_ipscan_commandcxx . . $ pvpgn/bnetd/_handle_ipscan_command(2e9022cda97b266d).(t_connection * c, char const * text);
415 static int _handle_set_commandcxx . . $ pvpgn/bnetd/_handle_set_command(2e9022cda97b266d).(t_connection * c, char const * text);
416 static int _handle_motd_commandcxx . . $ pvpgn/bnetd/_handle_motd_command(2e9022cda97b266d).(t_connection * c, char const * text);
417 static int _handle_ping_commandcxx . . $ pvpgn/bnetd/_handle_ping_command(2e9022cda97b266d).(t_connection * c, char const * text);
418 static int _handle_commandgroups_commandcxx . . $ pvpgn/bnetd/_handle_commandgroups_command(2e9022cda97b266d).(t_connection * c, char const * text);
419 static int _handle_topic_commandcxx . . $ pvpgn/bnetd/_handle_topic_command(2e9022cda97b266d).(t_connection * c, char const * text);
420 static int _handle_moderate_commandcxx . . $ pvpgn/bnetd/_handle_moderate_command(2e9022cda97b266d).(t_connection * c, char const * text);
421 static int _handle_clearstats_commandcxx . . $ pvpgn/bnetd/_handle_clearstats_command(2e9022cda97b266d).(t_connection * c, char const * text);
422 static int _handle_tos_commandcxx . . $ pvpgn/bnetd/_handle_tos_command(2e9022cda97b266d).(t_connection * c, char const * text);
423 static int _handle_alert_commandcxx . . $ pvpgn/bnetd/_handle_alert_command(2e9022cda97b266d).(t_connection * c, char const * text);
424
425 static const t_command_table_rowcxx . . $ pvpgn/bnetd/t_command_table_row# standard_command_tablecxx . . $ pvpgn/bnetd/standard_command_table.[] =
426 {
427 { "/clan", _handle_clan_commandcxx . . $ pvpgn/bnetd/_handle_clan_command(2e9022cda97b266d). },
428 { "/c", _handle_clan_commandcxx . . $ pvpgn/bnetd/_handle_clan_command(2e9022cda97b266d). },
429 { "/admin", _handle_admin_commandcxx . . $ pvpgn/bnetd/_handle_admin_command(2e9022cda97b266d). },
430 { "/f", _handle_friends_commandcxx . . $ pvpgn/bnetd/_handle_friends_command(2e9022cda97b266d). },
431 { "/friends", _handle_friends_commandcxx . . $ pvpgn/bnetd/_handle_friends_command(2e9022cda97b266d). },
432 { "/me", _handle_me_commandcxx . . $ pvpgn/bnetd/_handle_me_command(2e9022cda97b266d). },
433 { "/emote", _handle_me_commandcxx . . $ pvpgn/bnetd/_handle_me_command(2e9022cda97b266d). },
434 { "/msg", _handle_whisper_commandcxx . . $ pvpgn/bnetd/_handle_whisper_command(2e9022cda97b266d). },
435 { "/whisper", _handle_whisper_commandcxx . . $ pvpgn/bnetd/_handle_whisper_command(2e9022cda97b266d). },
436 { "/w", _handle_whisper_commandcxx . . $ pvpgn/bnetd/_handle_whisper_command(2e9022cda97b266d). },
437 { "/m", _handle_whisper_commandcxx . . $ pvpgn/bnetd/_handle_whisper_command(2e9022cda97b266d). },
438 { "/status", _handle_status_commandcxx . . $ pvpgn/bnetd/_handle_status_command(2e9022cda97b266d). },
439 { "/users", _handle_status_commandcxx . . $ pvpgn/bnetd/_handle_status_command(2e9022cda97b266d). },
440 { "/who", _handle_who_commandcxx . . $ pvpgn/bnetd/_handle_who_command(2e9022cda97b266d). },
441 { "/whois", _handle_whois_commandcxx . . $ pvpgn/bnetd/_handle_whois_command(2e9022cda97b266d). },
442 { "/whereis", _handle_whois_commandcxx . . $ pvpgn/bnetd/_handle_whois_command(2e9022cda97b266d). },
443 { "/where", _handle_whois_commandcxx . . $ pvpgn/bnetd/_handle_whois_command(2e9022cda97b266d). },
444 { "/whoami", _handle_whoami_commandcxx . . $ pvpgn/bnetd/_handle_whoami_command(2e9022cda97b266d). },
445 { "/announce", _handle_announce_commandcxx . . $ pvpgn/bnetd/_handle_announce_command(2e9022cda97b266d). },
446 { "/beep", _handle_beep_commandcxx . . $ pvpgn/bnetd/_handle_beep_command(2e9022cda97b266d). },
447 { "/nobeep", _handle_nobeep_commandcxx . . $ pvpgn/bnetd/_handle_nobeep_command(2e9022cda97b266d). },
448 { "/version", _handle_version_commandcxx . . $ pvpgn/bnetd/_handle_version_command(2e9022cda97b266d). },
449 { "/copyright", _handle_copyright_commandcxx . . $ pvpgn/bnetd/_handle_copyright_command(2e9022cda97b266d). },
450 { "/warranty", _handle_copyright_commandcxx . . $ pvpgn/bnetd/_handle_copyright_command(2e9022cda97b266d). },
451 { "/license", _handle_copyright_commandcxx . . $ pvpgn/bnetd/_handle_copyright_command(2e9022cda97b266d). },
452 { "/uptime", _handle_uptime_commandcxx . . $ pvpgn/bnetd/_handle_uptime_command(2e9022cda97b266d). },
453 { "/stats", _handle_stats_commandcxx . . $ pvpgn/bnetd/_handle_stats_command(2e9022cda97b266d). },
454 { "/astat", _handle_stats_commandcxx . . $ pvpgn/bnetd/_handle_stats_command(2e9022cda97b266d). },
455 { "/time", _handle_time_commandcxx . . $ pvpgn/bnetd/_handle_time_command(2e9022cda97b266d). },
456 { "/channel", _handle_channel_commandcxx . . $ pvpgn/bnetd/_handle_channel_command(2e9022cda97b266d). },
457 { "/join", _handle_channel_commandcxx . . $ pvpgn/bnetd/_handle_channel_command(2e9022cda97b266d). },
458 { "/j", _handle_channel_commandcxx . . $ pvpgn/bnetd/_handle_channel_command(2e9022cda97b266d). },
459 { "/rejoin", _handle_rejoin_commandcxx . . $ pvpgn/bnetd/_handle_rejoin_command(2e9022cda97b266d). },
460 { "/away", _handle_away_commandcxx . . $ pvpgn/bnetd/_handle_away_command(2e9022cda97b266d). },
461 { "/dnd", _handle_dnd_commandcxx . . $ pvpgn/bnetd/_handle_dnd_command(2e9022cda97b266d). },
462 { "/ignore", _handle_squelch_commandcxx . . $ pvpgn/bnetd/_handle_squelch_command(2e9022cda97b266d). },
463 { "/squelch", _handle_squelch_commandcxx . . $ pvpgn/bnetd/_handle_squelch_command(2e9022cda97b266d). },
464 { "/unignore", _handle_unsquelch_commandcxx . . $ pvpgn/bnetd/_handle_unsquelch_command(2e9022cda97b266d). },
465 { "/unsquelch", _handle_unsquelch_commandcxx . . $ pvpgn/bnetd/_handle_unsquelch_command(2e9022cda97b266d). },
466 { "/kick", _handle_kick_commandcxx . . $ pvpgn/bnetd/_handle_kick_command(2e9022cda97b266d). },
467 { "/ban", _handle_ban_commandcxx . . $ pvpgn/bnetd/_handle_ban_command(2e9022cda97b266d). },
468 { "/unban", _handle_unban_commandcxx . . $ pvpgn/bnetd/_handle_unban_command(2e9022cda97b266d). },
469 { "/tos", _handle_tos_commandcxx . . $ pvpgn/bnetd/_handle_tos_command(2e9022cda97b266d). },
470
471 { "/ann", _handle_announce_commandcxx . . $ pvpgn/bnetd/_handle_announce_command(2e9022cda97b266d). },
472 { "/r", _handle_reply_commandcxx . . $ pvpgn/bnetd/_handle_reply_command(2e9022cda97b266d). },
473 { "/reply", _handle_reply_commandcxx . . $ pvpgn/bnetd/_handle_reply_command(2e9022cda97b266d). },
474 { "/realmann", _handle_realmann_commandcxx . . $ pvpgn/bnetd/_handle_realmann_command(2e9022cda97b266d). },
475 { "/watch", _handle_watch_commandcxx . . $ pvpgn/bnetd/_handle_watch_command(2e9022cda97b266d). },
476 { "/unwatch", _handle_unwatch_commandcxx . . $ pvpgn/bnetd/_handle_unwatch_command(2e9022cda97b266d). },
477 { "/watchall", _handle_watchall_commandcxx . . $ pvpgn/bnetd/_handle_watchall_command(2e9022cda97b266d). },
478 { "/unwatchall", _handle_unwatchall_commandcxx . . $ pvpgn/bnetd/_handle_unwatchall_command(2e9022cda97b266d). },
479 { "/lusers", _handle_lusers_commandcxx . . $ pvpgn/bnetd/_handle_lusers_command(2e9022cda97b266d). },
480 { "/news", _handle_news_commandcxx . . $ pvpgn/bnetd/_handle_news_command(2e9022cda97b266d). },
481 { "/games", _handle_games_commandcxx . . $ pvpgn/bnetd/_handle_games_command(2e9022cda97b266d). },
482 { "/channels", _handle_channels_commandcxx . . $ pvpgn/bnetd/_handle_channels_command(2e9022cda97b266d). },
483 { "/chs", _handle_channels_commandcxx . . $ pvpgn/bnetd/_handle_channels_command(2e9022cda97b266d). },
484 { "/addacct", _handle_addacct_commandcxx . . $ pvpgn/bnetd/_handle_addacct_command(2e9022cda97b266d). },
485 { "/chpass", _handle_chpass_commandcxx . . $ pvpgn/bnetd/_handle_chpass_command(2e9022cda97b266d). },
486 { "/connections", _handle_connections_commandcxx . . $ pvpgn/bnetd/_handle_connections_command(2e9022cda97b266d). },
487 { "/con", _handle_connections_commandcxx . . $ pvpgn/bnetd/_handle_connections_command(2e9022cda97b266d). },
488 { "/finger", _handle_finger_commandcxx . . $ pvpgn/bnetd/_handle_finger_command(2e9022cda97b266d). },
489 { "/operator", _handle_operator_commandcxx . . $ pvpgn/bnetd/_handle_operator_command(2e9022cda97b266d). },
490 { "/aop", _handle_aop_commandcxx . . $ pvpgn/bnetd/_handle_aop_command(2e9022cda97b266d). },
491 { "/op", _handle_op_commandcxx . . $ pvpgn/bnetd/_handle_op_command(2e9022cda97b266d). },
492 { "/tmpop", _handle_tmpop_commandcxx . . $ pvpgn/bnetd/_handle_tmpop_command(2e9022cda97b266d). },
493 { "/deop", _handle_deop_commandcxx . . $ pvpgn/bnetd/_handle_deop_command(2e9022cda97b266d). },
494 { "/voice", _handle_voice_commandcxx . . $ pvpgn/bnetd/_handle_voice_command(2e9022cda97b266d). },
495 { "/devoice", _handle_devoice_commandcxx . . $ pvpgn/bnetd/_handle_devoice_command(2e9022cda97b266d). },
496 { "/vop", _handle_vop_commandcxx . . $ pvpgn/bnetd/_handle_vop_command(2e9022cda97b266d). },
497 { "/admins", _handle_admins_commandcxx . . $ pvpgn/bnetd/_handle_admins_command(2e9022cda97b266d). },
498 { "/logout", _handle_quit_commandcxx . . $ pvpgn/bnetd/_handle_quit_command(2e9022cda97b266d). },
499 { "/quit", _handle_quit_commandcxx . . $ pvpgn/bnetd/_handle_quit_command(2e9022cda97b266d). },
500 { "/exit", _handle_quit_commandcxx . . $ pvpgn/bnetd/_handle_quit_command(2e9022cda97b266d). },
501 { "/kill", _handle_kill_commandcxx . . $ pvpgn/bnetd/_handle_kill_command(2e9022cda97b266d). },
502 { "/killsession", _handle_killsession_commandcxx . . $ pvpgn/bnetd/_handle_killsession_command(2e9022cda97b266d). },
503 { "/gameinfo", _handle_gameinfo_commandcxx . . $ pvpgn/bnetd/_handle_gameinfo_command(2e9022cda97b266d). },
504 { "/ladderactivate", _handle_ladderactivate_commandcxx . . $ pvpgn/bnetd/_handle_ladderactivate_command(2e9022cda97b266d). },
505 { "/rehash", _handle_rehash_commandcxx . . $ pvpgn/bnetd/_handle_rehash_command(2e9022cda97b266d). },
506 { "/find", _handle_find_commandcxx . . $ pvpgn/bnetd/_handle_find_command(2e9022cda97b266d). },
507 { "/save", _handle_save_commandcxx . . $ pvpgn/bnetd/_handle_save_command(2e9022cda97b266d). },
508 { "/shutdown", _handle_shutdown_commandcxx . . $ pvpgn/bnetd/_handle_shutdown_command(2e9022cda97b266d). },
509 { "/ladderinfo", _handle_ladderinfo_commandcxx . . $ pvpgn/bnetd/_handle_ladderinfo_command(2e9022cda97b266d). },
510 { "/timer", _handle_timer_commandcxx . . $ pvpgn/bnetd/_handle_timer_command(2e9022cda97b266d). },
511 { "/serverban", _handle_serverban_commandcxx . . $ pvpgn/bnetd/_handle_serverban_command(2e9022cda97b266d). },
512 { "/netinfo", _handle_netinfo_commandcxx . . $ pvpgn/bnetd/_handle_netinfo_command(2e9022cda97b266d). },
513 { "/quota", _handle_quota_commandcxx . . $ pvpgn/bnetd/_handle_quota_command(2e9022cda97b266d). },
514 { "/lockacct", _handle_lockacct_commandcxx . . $ pvpgn/bnetd/_handle_lockacct_command(2e9022cda97b266d). },
515 { "/lock", _handle_lockacct_commandcxx . . $ pvpgn/bnetd/_handle_lockacct_command(2e9022cda97b266d). },
516 { "/unlockacct", _handle_unlockacct_commandcxx . . $ pvpgn/bnetd/_handle_unlockacct_command(2e9022cda97b266d). },
517 { "/unlock", _handle_unlockacct_commandcxx . . $ pvpgn/bnetd/_handle_unlockacct_command(2e9022cda97b266d). },
518 { "/muteacct", _handle_muteacct_commandcxx . . $ pvpgn/bnetd/_handle_muteacct_command(2e9022cda97b266d). },
519 { "/mute", _handle_muteacct_commandcxx . . $ pvpgn/bnetd/_handle_muteacct_command(2e9022cda97b266d). },
520 { "/unmuteacct", _handle_unmuteacct_commandcxx . . $ pvpgn/bnetd/_handle_unmuteacct_command(2e9022cda97b266d). },
521 { "/unmute", _handle_unmuteacct_commandcxx . . $ pvpgn/bnetd/_handle_unmuteacct_command(2e9022cda97b266d). },
522 { "/flag", _handle_flag_commandcxx . . $ pvpgn/bnetd/_handle_flag_command(2e9022cda97b266d). },
523 { "/tag", _handle_tag_commandcxx . . $ pvpgn/bnetd/_handle_tag_command(2e9022cda97b266d). },
524 { "/help", handle_help_commandcxx . . $ pvpgn/bnetd/handle_help_command(2e9022cda97b266d). },
525 { "/?", handle_help_commandcxx . . $ pvpgn/bnetd/handle_help_command(2e9022cda97b266d). },
526 { "/mail", handle_mail_commandcxx . . $ pvpgn/bnetd/handle_mail_command(2e9022cda97b266d). },
527 { "/ipban", handle_ipban_commandcxx . . $ pvpgn/bnetd/handle_ipban_command(2e9022cda97b266d). }, // in ipban.c
528 { "/ipscan", _handle_ipscan_commandcxx . . $ pvpgn/bnetd/_handle_ipscan_command(2e9022cda97b266d). },
529 { "/set", _handle_set_commandcxx . . $ pvpgn/bnetd/_handle_set_command(2e9022cda97b266d). },
530 { "/motd", _handle_motd_commandcxx . . $ pvpgn/bnetd/_handle_motd_command(2e9022cda97b266d). },
531 { "/latency", _handle_ping_commandcxx . . $ pvpgn/bnetd/_handle_ping_command(2e9022cda97b266d). },
532 { "/ping", _handle_ping_commandcxx . . $ pvpgn/bnetd/_handle_ping_command(2e9022cda97b266d). },
533 { "/p", _handle_ping_commandcxx . . $ pvpgn/bnetd/_handle_ping_command(2e9022cda97b266d). },
534 { "/commandgroups", _handle_commandgroups_commandcxx . . $ pvpgn/bnetd/_handle_commandgroups_command(2e9022cda97b266d). },
535 { "/cg", _handle_commandgroups_commandcxx . . $ pvpgn/bnetd/_handle_commandgroups_command(2e9022cda97b266d). },
536 { "/topic", _handle_topic_commandcxx . . $ pvpgn/bnetd/_handle_topic_command(2e9022cda97b266d). },
537 { "/moderate", _handle_moderate_commandcxx . . $ pvpgn/bnetd/_handle_moderate_command(2e9022cda97b266d). },
538 { "/clearstats", _handle_clearstats_commandcxx . . $ pvpgn/bnetd/_handle_clearstats_command(2e9022cda97b266d). },
539 { "/icon", handle_icon_commandcxx . . $ pvpgn/bnetd/handle_icon_command(2e9022cda97b266d). },
540 { "/alert", _handle_alert_commandcxx . . $ pvpgn/bnetd/_handle_alert_command(2e9022cda97b266d). },
541 { "/language", handle_language_commandcxx . . $ pvpgn/bnetd/handle_language_command(2e9022cda97b266d). },
542 { "/lang", handle_language_commandcxx . . $ pvpgn/bnetd/handle_language_command(2e9022cda97b266d). },
543 { "/log", handle_log_commandcxx . . $ pvpgn/bnetd/handle_log_command(2e9022cda97b266d). },
544
545 { NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! }
546
547 };
548
549
550 extern int handle_commandcxx . . $ pvpgn/bnetd/handle_command(2e9022cda97b266d).(t_connection * c, char const * text)
551 {
552 int result = 0;
553 t_command_table_rowcxx . . $ pvpgn/bnetd/t_command_table_row# const *p;
554
555 #ifdef WITH_LUA
556 // feature to ignore flood protection
557 result = lua_handle_command(c, text, luaevent_command_before);
558 #endif
559 if (result == -1)
560 return result;
561
562 if (result == 0)
563 if ((text[0] != '\0') && (conn_quota_exceededcxx . . $ pvpgn/bnetd/conn_quota_exceeded(2e9022cda97b266d).(c, text)))
564 {
565 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are sending commands to {} too quickly and risk being disconnected for flooding. Please slow down.", prefs_get_servername());
566 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
567 return 0;
568 }
569
570 #ifdef WITH_LUA
571 result = lua_handle_command(c, text, luaevent_command);
572 // -1 = unsuccess, 0 = success, 1 = execute next c++ code
573 if (result == 0)
574 {
575 // log command
576 if (t_account * account = conn_get_account(c))
577 userlog_append(account, text);
578 }
579 if (result == 0 || result == -1)
580 return result;
581 #endif
582
583 for (p = standard_command_tablecxx . . $ pvpgn/bnetd/standard_command_table.; p->command_stringcxx . . $ pvpgn/bnetd/$anonymous_type_91817c0bf523d570_0#command_string. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; p++)
584 {
585 if (strstartcxx . . $ pvpgn/strstart(5ae29d726ae57f88).(text, p->command_stringcxx . . $ pvpgn/bnetd/$anonymous_type_91817c0bf523d570_0#command_string.) == 0)
586 {
587 if (!(command_get_groupcxx . . $ pvpgn/bnetd/command_get_group(c61c63047ce273de).(p->command_stringcxx . . $ pvpgn/bnetd/$anonymous_type_91817c0bf523d570_0#command_string.)))
588 {
589 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command has been deactivated"));
590 return 0;
591 }
592 if (!((command_get_groupcxx . . $ pvpgn/bnetd/command_get_group(c61c63047ce273de).(p->command_stringcxx . . $ pvpgn/bnetd/$anonymous_type_91817c0bf523d570_0#command_string.) & account_get_command_groupscxx . . $ pvpgn/bnetd/account_get_command_groups(c7ab9369555c44b8).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)))))
593 {
594 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command is reserved for admins."));
595 return 0;
596 }
597 if (p->command_handlercxx . . $ pvpgn/bnetd/$anonymous_type_91817c0bf523d570_0#command_handler. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
598 {
599 result = ((p->command_handlercxx . . $ pvpgn/bnetd/$anonymous_type_91817c0bf523d570_0#command_handler.)(c, text));
600 // -1 = unsuccess, 0 = success
601 if (result == 0)
602 {
603 // log command
604 if (t_accountcxx . . $ pvpgn/bnetd/t_account# * account = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c))
605 userlog_appendcxx . . $ pvpgn/bnetd/userlog_append(d148c2d7cf6cba0).(account, text);
606 }
607 return result;
608 }
609 }
610 }
611
612 if (stdcxx . . $ std/::strlen(text) >= 2 && stdcxx . . $ std/::strncmp(text, "//", 2) == 0)
613 {
614 handle_alias_commandcxx . . $ pvpgn/bnetd/handle_alias_command(2e9022cda97b266d).(c, text);
615 return 0;
616 }
617
618 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Unknown command."));
619 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_debugcxx . . $ pvpgn/eventlog_level_debug., __FUNCTION__, "got unknown command \"{}\"", text);
620 return -1;
621 }
622
623
624
625
626
627 // +++++++++++++++++++++++++++++++++ command implementations +++++++++++++++++++++++++++++++++++++++
628
629 static int _handle_clan_commandcxx . . $ pvpgn/bnetd/_handle_clan_command(2e9022cda97b266d).(t_connection * c, char const * text)
630 {
631 t_accountcxx . . $ pvpgn/bnetd/t_account# * acc;
632 t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member;
633 t_clancxx . . $ pvpgn/bnetd/t_clan# * clan;
634
635 if (!(acc = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c))){
636 ERROR0cxx . . $ `src/common/eventlog.h:73:9`!("got NULL account");
637 }
638
639 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
640
641 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
642 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
643 return -1;
644 }
645
646 /* FIXME: can get clan as is in creating process */
647
648 // user in clan
649 if ((member = account_get_clanmember_forcedcxx . . $ pvpgn/bnetd/account_get_clanmember_forced(4ce48d4e65930331).(acc)) && (clan = clanmember_get_clancxx . . $ pvpgn/bnetd/clanmember_get_clan(18fc6df730a9c54c).(member)))
650 {
651 // user is full member of clan
652 if (clanmember_get_fullmembercxx . . $ pvpgn/bnetd/clanmember_get_fullmember(d12aaa857ef4d493).(member) == 1)
653 {
654 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "msg" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "m" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "w" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "whisper")
655 {
656 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
657 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
658 return -1;
659 }
660 char const *msg = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // message
661
662 if (clan_send_message_to_online_memberscxx . . $ pvpgn/bnetd/clan_send_message_to_online_members(5b3f105ee82e5d9c).(clan, message_type_whisper, c, msg) >= 1)
663 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Message was sent to all currently available clan members."));
664 else
665 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "All fellow members of your clan are currently offline."));
666
667 return 0;
668 }
669
670 if (clanmember_get_statuscxx . . $ pvpgn/bnetd/clanmember_get_status(54878624261d8c60).(member) >= CLAN_SHAMANcxx . . $ `src/bnetd/clan.h:99:9`!)
671 {
672 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "public" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "pub")
673 {
674 if (clan_get_channel_typecxx . . $ pvpgn/bnetd/clan_get_channel_type(3931364155ee2c56).(clan) != 0) {
675 clan_set_channel_typecxx . . $ pvpgn/bnetd/clan_set_channel_type(a93227109bec7ad3).(clan, 0);
676 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Clan channel is opened up!"));
677 }
678 else
679 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Clan channel has already been opened up!"));
680 return 0;
681 }
682 else if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "private" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "priv")
683 {
684 if (clan_get_channel_typecxx . . $ pvpgn/bnetd/clan_get_channel_type(3931364155ee2c56).(clan) != 1) {
685 clan_set_channel_typecxx . . $ pvpgn/bnetd/clan_set_channel_type(a93227109bec7ad3).(clan, 1);
686 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Clan channel is closed!"));
687 }
688 else
689 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Clan channel has already been closed!"));
690 return 0;
691 }
692 else if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "motd")
693 {
694 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
695 {
696 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
697 return 0;
698 }
699 const char * msg = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // message
700
701 clan_set_motdcxx . . $ pvpgn/bnetd/clan_set_motd(aba9c10be9ace918).(clan, msg);
702 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Clan message of day is updated!"));
703 return 0;
704 }
705 else if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "invite" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "inv")
706 {
707 t_accountcxx . . $ pvpgn/bnetd/t_account# * dest_account;
708 t_connection * dest_conn;
709 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
710 {
711 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
712 return -1;
713 }
714 const char * username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
715
716 if ((dest_account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username)) && (dest_conn = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(dest_account))
717 && (account_get_clancxx . . $ pvpgn/bnetd/account_get_clan(b1e25e267411fd2e).(dest_account) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) && (account_get_creating_clancxx . . $ pvpgn/bnetd/account_get_creating_clan(b1e25e267411fd2e).(dest_account) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!))
718 {
719 if (prefs_get_clan_newer_timecxx . . $ pvpgn/bnetd/prefs_get_clan_newer_time(db52760e79bf9054).() > 0)
720 clan_add_membercxx . . $ pvpgn/bnetd/clan_add_member(d2839d873797151a).(clan, dest_account, CLAN_NEWcxx . . $ `src/bnetd/clan.h:102:9`!);
721 else
722 clan_add_membercxx . . $ pvpgn/bnetd/clan_add_member(d2839d873797151a).(clan, dest_account, CLAN_PEONcxx . . $ `src/bnetd/clan.h:101:9`!);
723 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "User {} was invited to your clan!", username);
724 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
725 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are invited to {} by {}!", clan_get_name(clan), conn_get_chatname(c));
726 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dest_conn, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
727 }
728 else {
729 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "User {} is not online or is already member of clan!", username);
730 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
731 }
732 return 0;
733 }
734 else if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "disband" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "dis")
735 {
736 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2] !=cxx . . $ std/`operator!=`(4b17aa87c9f300c6). "yes") {
737 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This is one-way action! If you really want"));
738 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "to disband your clan, type /clan disband yes"));
739 }
740 /* PELISH: fixme - Find out better solution! */
741 if (clanlist_remove_clancxx . . $ pvpgn/bnetd/clanlist_remove_clan(6091e08b3a5a3db6).(clan) == 0) {
742 if (clan_get_createdcxx . . $ pvpgn/bnetd/clan_get_created(6091e08b3a5a3db6).(clan) == 1)
743 clan_removecxx . . $ pvpgn/bnetd/clan_remove(4c679297bf94b9eb).(clan_get_clantagcxx . . $ pvpgn/bnetd/clan_get_clantag(1e16ca1cec114489).(clan));
744 clan_destroycxx . . $ pvpgn/bnetd/clan_destroy(6091e08b3a5a3db6).(clan);
745 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your clan was disbanded."));
746 }
747 return 0;
748 }
749 }
750 }
751 // user is not full member (invitation was not accepted yet)
752 else if (clanmember_get_fullmembercxx . . $ pvpgn/bnetd/clanmember_get_fullmember(d12aaa857ef4d493).(member) == 0)
753 {
754 /* User is not in clan, but he can accept invitation to someone */
755 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] !=cxx . . $ std/`operator!=`(4b17aa87c9f300c6). "invite" && args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] !=cxx . . $ std/`operator!=`(4b17aa87c9f300c6). "inv")
756 {
757 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
758 return -1;
759 }
760
761 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "get") {
762 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You have been invited to {}", clan_get_name(clan));
763 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
764 return 0;
765 }
766 else if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "accept" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "acc") {
767 int created = clan_get_createdcxx . . $ pvpgn/bnetd/clan_get_created(6091e08b3a5a3db6).(clan);
768
769 clanmember_set_fullmembercxx . . $ pvpgn/bnetd/clanmember_set_fullmember(7ffb9f43622f570).(member, 1);
770 clanmember_set_join_timecxx . . $ pvpgn/bnetd/clanmember_set_join_time(8f87cdd393e525cc).(member, stdcxx . . $ std/::timecxx . . $ std/time(a7cd306b2d326b09).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!));
771 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are now a clan member of {}", clan_get_name(clan));
772 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
773 if (created > 0) {
774 DEBUG1cxx . . $ `src/common/eventlog.h:89:9`!("clan {} has already been created", clan_get_name(clan));
775 return -1;
776 }
777 created++;
778 if (created >= 0) {
779 clan_set_createdcxx . . $ pvpgn/bnetd/clan_set_created(3a82cfd82b391e24).(clan, 1);
780 clan_set_creation_timecxx . . $ pvpgn/bnetd/clan_set_creation_time(ac2f83eebe36ee1e).(clan, stdcxx . . $ std/::timecxx . . $ std/time(a7cd306b2d326b09).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!));
781 /* FIXME: send message "CLAN was be created" to members */
782 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Clan {} was be created", clan_get_name(clan));
783 clan_send_message_to_online_memberscxx . . $ pvpgn/bnetd/clan_send_message_to_online_members(5b3f105ee82e5d9c).(clan, message_type_whisper, c, msgtempcxx . . $ pvpgn/bnetd/msgtemp..c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).()); /* Send message to all members */
784 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_whisper, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).); /* also to self */
785 clan_savecxx . . $ pvpgn/bnetd/clan_save(6091e08b3a5a3db6).(clan);
786 }
787 else
788 clan_set_createdcxx . . $ pvpgn/bnetd/clan_set_created(3a82cfd82b391e24).(clan, created);
789 return 0;
790 }
791 else if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "decline" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "dec") {
792 clan_remove_membercxx . . $ pvpgn/bnetd/clan_remove_member(b047ad00324891dc).(clan, member);
793 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are no longer ivited to {}", clan_get_name(clan));
794 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
795 return 0;
796 }
797 }
798
799 if ((args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "create" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "cre"))
800 {
801 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are already in clan \"{}\"", clan_get_name(clan)));
802 return -1;
803 }
804 }
805 // user not in clan
806 else
807 {
808 if ((args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "create" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "cre"))
809 {
810 char const *clantag, *clanname;
811 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 3);
812
813 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).3].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
814 {
815 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
816 return -1;
817 }
818 clantag = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // clan tag
819 clanname = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).3].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // clan name
820
821 if (clan = clanlist_find_clan_by_clantagcxx . . $ pvpgn/bnetd/clanlist_find_clan_by_clantag(8e7bfb2a07f0508e).(str_to_clantagcxx . . $ pvpgn/bnetd/str_to_clantag(c61c63047ce273de).(clantag))) {
822 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Clan with your specified <clantag> already exist!"));
823 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Please choice another one."));
824 return -1;
825 }
826
827 if ((clan = clan_createcxx . . $ pvpgn/bnetd/clan_create(52cf30ee556d2195).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), str_to_clantagcxx . . $ pvpgn/bnetd/str_to_clantag(c61c63047ce273de).(clantag), clanname, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)) && clanlist_add_clancxx . . $ pvpgn/bnetd/clanlist_add_clan(6091e08b3a5a3db6).(clan))
828 {
829 member = account_get_clanmember_forcedcxx . . $ pvpgn/bnetd/account_get_clanmember_forced(4ce48d4e65930331).(acc);
830 if (prefs_get_clan_min_invitescxx . . $ pvpgn/bnetd/prefs_get_clan_min_invites(db52760e79bf9054).() == 0) {
831 clan_set_createdcxx . . $ pvpgn/bnetd/clan_set_created(3a82cfd82b391e24).(clan, 1);
832 clan_set_creation_timecxx . . $ pvpgn/bnetd/clan_set_creation_time(ac2f83eebe36ee1e).(clan, stdcxx . . $ std/::timecxx . . $ std/time(a7cd306b2d326b09).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!));
833 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Clan {} is created!", clan_get_name(clan));
834 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
835 clan_savecxx . . $ pvpgn/bnetd/clan_save(6091e08b3a5a3db6).(clan);
836 }
837 else {
838 clan_set_createdcxx . . $ pvpgn/bnetd/clan_set_created(3a82cfd82b391e24).(clan, -prefs_get_clan_min_invitescxx . . $ pvpgn/bnetd/prefs_get_clan_min_invites(db52760e79bf9054).() + 1); //Pelish: +1 means that creator of clan is already invited
839 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Clan {} is pre-created, please invite", clan_get_name(clan));
840 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
841 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "at least {} players to your clan by using", prefs_get_clan_min_invites());
842 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
843 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "/clan invite <username> command."));
844 }
845 }
846 return 0;
847 }
848 }
849
850 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
851 return -1;
852 }
853
854 static int command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(t_connection * c)
855 {
856 return channel_set_userflagscxx . . $ pvpgn/bnetd/channel_set_userflags(c4dfbc2386fe4fc3).(c);
857 }
858
859 static int _handle_admin_commandcxx . . $ pvpgn/bnetd/_handle_admin_command(2e9022cda97b266d).(t_connection * c, char const * text)
860 {
861 char const * username;
862 char command;
863 t_accountcxx . . $ pvpgn/bnetd/t_account# * acc;
864 t_connection * dst_c;
865 int changed = 0;
866
867 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
868
869 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() || (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1][cxx . . $ std/__cxx11/basic_string#`operator[]`(7b73c3179b3cb3ad).0] != '+' && args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1][cxx . . $ std/__cxx11/basic_string#`operator[]`(7b73c3179b3cb3ad).0] != '-')) {
870 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
871 return -1;
872 }
873
874 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
875 command = text[0]; // command type (+/-)
876 username = &text[1]; // username
877
878 if (!*username) {
879 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must supply a username."));
880 return -1;
881 }
882
883 if (!(acc = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username))) {
884 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "There's no account with username {}.", username);
885 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
886 return -1;
887 }
888 dst_c = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc);
889
890 if (command == '+') {
891 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(acc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1) {
892 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is already a Server Admin", username);
893 }
894 else {
895 account_set_auth_admincxx . . $ pvpgn/bnetd/account_set_auth_admin(d0c9ea181933058d).(acc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 1);
896 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been promoted to a Server Admin", username);
897 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has promoted you to a Server Admin", conn_get_loggeduser(c));
898 changed = 1;
899 }
900 }
901 else {
902 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(acc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) != 1)
903 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is not a Server Admin.", username);
904 else {
905 account_set_auth_admincxx . . $ pvpgn/bnetd/account_set_auth_admin(d0c9ea181933058d).(acc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0);
906 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been demoted from a Server Admin", username);
907 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has demoted you from a Server Admin", conn_get_loggeduser(c));
908 changed = 1;
909 }
910 }
911
912 if (changed && dst_c) message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
913 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
914 command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(dst_c);
915 return 0;
916 }
917
918 static int _handle_operator_commandcxx . . $ pvpgn/bnetd/_handle_operator_command(2e9022cda97b266d).(t_connection * c, char const * text)
919 {
920 char const * username;
921 char command;
922 t_accountcxx . . $ pvpgn/bnetd/t_account# * acc;
923 t_connection * dst_c;
924 int changed = 0;
925
926 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
927
928 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() || (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1][cxx . . $ std/__cxx11/basic_string#`operator[]`(7b73c3179b3cb3ad).0] != '+' && args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1][cxx . . $ std/__cxx11/basic_string#`operator[]`(7b73c3179b3cb3ad).0] != '-')) {
929 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
930 return -1;
931 }
932
933 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
934 command = text[0]; // command type (+/-)
935 username = &text[1]; // username
936
937 if (!*username) {
938 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must supply a username."));
939 return -1;
940 }
941
942 if (!(acc = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username))) {
943 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "There's no account with username {}.", username);
944 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
945 return -1;
946 }
947 dst_c = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc);
948
949 if (command == '+') {
950 if (account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(acc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1)
951 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is already a Server Operator", username);
952 else {
953 account_set_auth_operatorcxx . . $ pvpgn/bnetd/account_set_auth_operator(d0c9ea181933058d).(acc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 1);
954 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been promoted to a Server Operator", username);
955 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has promoted you to a Server Operator", conn_get_loggeduser(c));
956 changed = 1;
957 }
958 }
959 else {
960 if (account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(acc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) != 1)
961 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is no Server Operator, so you can't demote him", username);
962 else {
963 account_set_auth_operatorcxx . . $ pvpgn/bnetd/account_set_auth_operator(d0c9ea181933058d).(acc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0);
964 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been demoted from a Server Operator", username);
965 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has promoted you to a Server Operator", conn_get_loggeduser(c));
966 changed = 1;
967 }
968 }
969
970 if (changed && dst_c) message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
971 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
972 command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(dst_c);
973 return 0;
974 }
975
976 static int _handle_aop_commandcxx . . $ pvpgn/bnetd/_handle_aop_command(2e9022cda97b266d).(t_connection * c, char const * text)
977 {
978 char const * username;
979 char const * channel;
980 t_accountcxx . . $ pvpgn/bnetd/t_account# * acc;
981 t_connection * dst_c;
982 int changed = 0;
983
984 if (!(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)) || !(channel = channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)))) {
985 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
986 return -1;
987 }
988
989 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) != 1 && account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel) != 1) {
990 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must be at least a Channel Admin to use this command."));
991 return -1;
992 }
993
994 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
995
996 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
997 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
998 return -1;
999 }
1000 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1001
1002 if (!(acc = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username))) {
1003 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "There's no account with username {}.", username);
1004 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1005 return -1;
1006 }
1007
1008 dst_c = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc);
1009
1010 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(acc, channel) == 1)
1011 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is already a Channel Admin", username);
1012 else {
1013 account_set_auth_admincxx . . $ pvpgn/bnetd/account_set_auth_admin(d0c9ea181933058d).(acc, channel, 1);
1014 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been promoted to a Channel Admin", username);
1015 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has promoted you to a Channel Admin for channel \"{}\"", conn_get_loggeduser(c), channel);
1016 changed = 1;
1017 }
1018
1019 if (changed && dst_c) message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1020 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1021 command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(dst_c);
1022 return 0;
1023 }
1024
1025 static int _handle_vop_commandcxx . . $ pvpgn/bnetd/_handle_vop_command(2e9022cda97b266d).(t_connection * c, char const * text)
1026 {
1027 char const * username;
1028 char const * channel;
1029 t_accountcxx . . $ pvpgn/bnetd/t_account# * acc;
1030 t_connection * dst_c;
1031 int changed = 0;
1032
1033 if (!(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)) || !(channel = channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)))) {
1034 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
1035 return -1;
1036 }
1037
1038 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) != 1 && account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel) != 1) {
1039 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must be at least a Channel Admin to use this command."));
1040 return -1;
1041 }
1042
1043 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
1044
1045 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
1046 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1047 return -1;
1048 }
1049 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1050
1051 if (!(acc = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username))) {
1052 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "There's no account with username {}.", username);
1053 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1054 return -1;
1055 }
1056
1057 dst_c = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc);
1058
1059 if (account_get_auth_voicecxx . . $ pvpgn/bnetd/account_get_auth_voice(4b12bc5edcfaeac7).(acc, channel) == 1)
1060 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is already on VOP list", username);
1061 else {
1062 account_set_auth_voicecxx . . $ pvpgn/bnetd/account_set_auth_voice(d0c9ea181933058d).(acc, channel, 1);
1063 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been added to the VOP list", username);
1064 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has added you to the VOP list of channel \"{}\"", conn_get_loggeduser(c), channel);
1065 changed = 1;
1066 }
1067
1068 if (changed && dst_c) message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1069 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1070 command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(dst_c);
1071 return 0;
1072 }
1073
1074 static int _handle_voice_commandcxx . . $ pvpgn/bnetd/_handle_voice_command(2e9022cda97b266d).(t_connection * c, char const * text)
1075 {
1076 char const * username;
1077 char const * channel;
1078 t_accountcxx . . $ pvpgn/bnetd/t_account# * acc;
1079 t_connection * dst_c;
1080 int changed = 0;
1081
1082 if (!(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)) || !(channel = channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)))) {
1083 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
1084 return -1;
1085 }
1086
1087 if (!(account_is_operator_or_admincxx . . $ pvpgn/bnetd/account_is_operator_or_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c))))) {
1088 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must be at least a Channel Operator to use this command."));
1089 return -1;
1090 }
1091
1092 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
1093
1094 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
1095 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1096 return -1;
1097 }
1098 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1099
1100 if (!(acc = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username))) {
1101 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "There's no account with username {}.", username);
1102 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1103 return -1;
1104 }
1105 dst_c = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc);
1106 if (account_get_auth_voicecxx . . $ pvpgn/bnetd/account_get_auth_voice(4b12bc5edcfaeac7).(acc, channel) == 1)
1107 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is already on VOP list, no need to Voice him", username);
1108 else
1109 {
1110 if ((!dst_c) || conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c) != conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(dst_c))
1111 {
1112 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} must be on the same channel to voice him", username);
1113 }
1114 else
1115 {
1116 if (channel_conn_has_tmpVOICEcxx . . $ pvpgn/bnetd/channel_conn_has_tmpVOICE(7159c29bb3f93f5f).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c), dst_c))
1117 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} already has Voice in this channel", username);
1118 else {
1119 if (account_is_operator_or_admincxx . . $ pvpgn/bnetd/account_is_operator_or_admin(4b12bc5edcfaeac7).(acc, channel))
1120 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is already an operator or admin.", username);
1121 else
1122 {
1123 conn_set_tmpVOICE_channelcxx . . $ pvpgn/bnetd/conn_set_tmpVOICE_channel(2e9022cda97b266d).(dst_c, channel);
1124 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been granted Voice in this channel", username);
1125 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has granted you Voice in this channel", conn_get_loggeduser(c));
1126 changed = 1;
1127 }
1128 }
1129 }
1130 }
1131
1132 if (changed && dst_c) message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1133 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1134 command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(dst_c);
1135 return 0;
1136 }
1137
1138 static int _handle_devoice_commandcxx . . $ pvpgn/bnetd/_handle_devoice_command(2e9022cda97b266d).(t_connection * c, char const * text)
1139 {
1140 char const * username;
1141 char const * channel;
1142 t_accountcxx . . $ pvpgn/bnetd/t_account# * acc;
1143 t_connection * dst_c;
1144 int done = 0;
1145 int changed = 0;
1146
1147 if (!(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)) || !(channel = channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)))) {
1148 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
1149 return -1;
1150 }
1151
1152 if (!(account_is_operator_or_admincxx . . $ pvpgn/bnetd/account_is_operator_or_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c))))) {
1153 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must be at least a Channel Operator to use this command."));
1154 return -1;
1155 }
1156
1157 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
1158
1159 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
1160 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1161 return -1;
1162 }
1163 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1164
1165 if (!(acc = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username))) {
1166 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "There's no account with username {}.", username);
1167 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1168 return -1;
1169 }
1170 dst_c = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc);
1171
1172 if (account_get_auth_voicecxx . . $ pvpgn/bnetd/account_get_auth_voice(4b12bc5edcfaeac7).(acc, channel) == 1)
1173 {
1174 if ((account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel) == 1) || (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1))
1175 {
1176 account_set_auth_voicecxx . . $ pvpgn/bnetd/account_set_auth_voice(d0c9ea181933058d).(acc, channel, 0);
1177 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been removed from VOP list.", username);
1178 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has removed you from VOP list of channel \"{}\"", conn_get_loggeduser(c), channel);
1179 changed = 1;
1180 }
1181 else
1182 {
1183 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must be at least Channel Admin to remove {} from the VOP list", username);
1184 }
1185 done = 1;
1186 }
1187
1188 if (changed && dst_c) message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1189 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1190 changed = 0;
1191
1192 if ((dst_c) && channel_conn_has_tmpVOICEcxx . . $ pvpgn/bnetd/channel_conn_has_tmpVOICE(7159c29bb3f93f5f).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c), dst_c) == 1)
1193 {
1194 conn_set_tmpVOICE_channelcxx . . $ pvpgn/bnetd/conn_set_tmpVOICE_channel(2e9022cda97b266d).(dst_c, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1195 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Voice has been taken from {} in this channel", username);
1196 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has taken your Voice in channel \"{}\"", conn_get_loggeduser(c), channel);
1197 changed = 1;
1198 done = 1;
1199 }
1200
1201 if (changed && dst_c) message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1202 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1203
1204 if (!done)
1205 {
1206 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has no Voice in this channel, so it can't be taken away", username);
1207 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1208 }
1209
1210 command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(dst_c);
1211 return 0;
1212 }
1213
1214 static int _handle_op_commandcxx . . $ pvpgn/bnetd/_handle_op_command(2e9022cda97b266d).(t_connection * c, char const * text)
1215 {
1216 char const * username;
1217 char const * channel;
1218 t_accountcxx . . $ pvpgn/bnetd/t_account# * acc;
1219 int OP_lvl;
1220 t_connection * dst_c;
1221 int changed = 0;
1222
1223 if (!(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)) || !(channel = channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)))) {
1224 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
1225 return -1;
1226 }
1227
1228 acc = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c);
1229 OP_lvl = 0;
1230
1231 if (account_is_operator_or_admincxx . . $ pvpgn/bnetd/account_is_operator_or_admin(4b12bc5edcfaeac7).(acc, channel))
1232 OP_lvl = 1;
1233 else if (channel_conn_is_tmpOPcxx . . $ pvpgn/bnetd/channel_conn_is_tmpOP(7159c29bb3f93f5f).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c), c))
1234 OP_lvl = 2;
1235
1236 if (OP_lvl == 0)
1237 {
1238 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must be at least a Channel Operator or tempOP to use this command."));
1239 return -1;
1240 }
1241
1242 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
1243
1244 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
1245 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1246 return -1;
1247 }
1248 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1249
1250 if (!(acc = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username))) {
1251 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "There's no account with username {}.", username);
1252 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1253 return -1;
1254 }
1255
1256 dst_c = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc);
1257
1258 if (OP_lvl == 1) // user is full op so he may fully op others
1259 {
1260 if (account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(acc, channel) == 1)
1261 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is already a Channel Operator", username);
1262 else {
1263 account_set_auth_operatorcxx . . $ pvpgn/bnetd/account_set_auth_operator(d0c9ea181933058d).(acc, channel, 1);
1264 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been promoted to a Channel Operator", username);
1265 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has promoted you to a Channel Operator in channel \"{}\"", conn_get_loggeduser(c), channel);
1266 changed = 1;
1267 }
1268 }
1269 else { // user is only tempOP so he may only tempOP others
1270 if ((!(dst_c)) || (conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c) != conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(dst_c)))
1271 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} must be on the same channel to tempOP him", username);
1272 else
1273 {
1274 if (account_is_operator_or_admincxx . . $ pvpgn/bnetd/account_is_operator_or_admin(4b12bc5edcfaeac7).(acc, channel))
1275 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} already is operator or admin, no need to tempOP him", username);
1276 else
1277 {
1278 conn_set_tmpOP_channelcxx . . $ pvpgn/bnetd/conn_set_tmpOP_channel(2e9022cda97b266d).(dst_c, channel);
1279 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been promoted to a tempOP", username);
1280 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has promoted you to a tempOP in this channel", conn_get_loggeduser(c));
1281 changed = 1;
1282 }
1283 }
1284 }
1285
1286 if (changed && dst_c) message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1287 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1288 command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(dst_c);
1289 return 0;
1290 }
1291
1292 static int _handle_tmpop_commandcxx . . $ pvpgn/bnetd/_handle_tmpop_command(2e9022cda97b266d).(t_connection * c, char const * text)
1293 {
1294 char const * username;
1295 char const * channel;
1296 t_accountcxx . . $ pvpgn/bnetd/t_account# * acc;
1297 t_connection * dst_c;
1298 int changed = 0;
1299
1300 if (!(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)) || !(channel = channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)))) {
1301 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
1302 return -1;
1303 }
1304
1305 if (!(account_is_operator_or_admincxx . . $ pvpgn/bnetd/account_is_operator_or_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c))) || channel_conn_is_tmpOPcxx . . $ pvpgn/bnetd/channel_conn_is_tmpOP(7159c29bb3f93f5f).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c), c))) {
1306 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must be at least a Channel Operator or tmpOP to use this command."));
1307 return -1;
1308 }
1309
1310 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
1311
1312 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
1313 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1314 return -1;
1315 }
1316 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1317
1318 if (!(acc = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username))) {
1319 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "There's no account with username {}.", username);
1320 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1321 return -1;
1322 }
1323
1324 dst_c = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc);
1325
1326 if (channel_conn_is_tmpOPcxx . . $ pvpgn/bnetd/channel_conn_is_tmpOP(7159c29bb3f93f5f).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c), dst_c))
1327 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has already tmpOP in this channel", username);
1328 else
1329 {
1330 if ((!(dst_c)) || (conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c) != conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(dst_c)))
1331 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} must be on the same channel to tempOP him", username);
1332 else
1333 {
1334 if (account_is_operator_or_admincxx . . $ pvpgn/bnetd/account_is_operator_or_admin(4b12bc5edcfaeac7).(acc, channel))
1335 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} already is operator or admin, no need to tempOP him", username);
1336 else
1337 {
1338 conn_set_tmpOP_channelcxx . . $ pvpgn/bnetd/conn_set_tmpOP_channel(2e9022cda97b266d).(dst_c, channel);
1339 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been promoted to tmpOP in this channel", username);
1340 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has promoted you to a tempOP in this channel", conn_get_loggeduser(c));
1341 changed = 1;
1342 }
1343 }
1344 }
1345
1346 if (changed && dst_c) message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1347 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1348 command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(dst_c);
1349 return 0;
1350 }
1351
1352 static int _handle_deop_commandcxx . . $ pvpgn/bnetd/_handle_deop_command(2e9022cda97b266d).(t_connection * c, char const * text)
1353 {
1354 char const * username;
1355 char const * channel;
1356 t_accountcxx . . $ pvpgn/bnetd/t_account# * acc;
1357 int OP_lvl;
1358 t_connection * dst_c;
1359 int done = 0;
1360
1361 if (!(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)) || !(channel = channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)))) {
1362 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
1363 return -1;
1364 }
1365
1366 acc = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c);
1367 OP_lvl = 0;
1368
1369 if (account_is_operator_or_admincxx . . $ pvpgn/bnetd/account_is_operator_or_admin(4b12bc5edcfaeac7).(acc, channel))
1370 OP_lvl = 1;
1371 else if (channel_conn_is_tmpOPcxx . . $ pvpgn/bnetd/channel_conn_is_tmpOP(7159c29bb3f93f5f).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c), account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc)))
1372 OP_lvl = 2;
1373
1374 if (OP_lvl == 0)
1375 {
1376 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must be at least a Channel Operator or tempOP to use this command."));
1377 return -1;
1378 }
1379
1380 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
1381
1382 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
1383 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1384 return -1;
1385 }
1386 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1387
1388
1389 if (!(acc = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username))) {
1390 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "There's no account with username {}.", username);
1391 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1392 return -1;
1393 }
1394
1395 dst_c = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc);
1396
1397 if (OP_lvl == 1) // user is real OP and allowed to deOP
1398 {
1399 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(acc, channel) == 1 || account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(acc, channel) == 1) {
1400 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(acc, channel) == 1) {
1401 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel) != 1 && account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) != 1)
1402 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must be at least a Channel Admin to demote another Channel Admin"));
1403 else {
1404 account_set_auth_admincxx . . $ pvpgn/bnetd/account_set_auth_admin(d0c9ea181933058d).(acc, channel, 0);
1405 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been demoted from a Channel Admin.", username);
1406 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1407 if (dst_c)
1408 {
1409 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has demoted you from a Channel Admin of channel \"{}\"", conn_get_loggeduser(c), channel);
1410 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1411 }
1412 }
1413 }
1414 if (account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(acc, channel) == 1) {
1415 account_set_auth_operatorcxx . . $ pvpgn/bnetd/account_set_auth_operator(d0c9ea181933058d).(acc, channel, 0);
1416 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been demoted from a Channel Operator", username);
1417 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1418 if (dst_c)
1419 {
1420 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has demoted you from a Channel Operator of channel \"{}\"", conn_get_loggeduser(c), channel);
1421 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1422 }
1423 }
1424 done = 1;
1425 }
1426 if ((dst_c) && channel_conn_is_tmpOPcxx . . $ pvpgn/bnetd/channel_conn_is_tmpOP(7159c29bb3f93f5f).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c), dst_c))
1427 {
1428 conn_set_tmpOP_channelcxx . . $ pvpgn/bnetd/conn_set_tmpOP_channel(2e9022cda97b266d).(dst_c, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1429 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been demoted from a tempOP of this channel", username);
1430 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1431 if (dst_c)
1432 {
1433 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has demoted you from a tmpOP of channel \"{}\"", conn_get_loggeduser(c), channel);
1434 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1435 }
1436 done = 1;
1437 }
1438 if (!done) {
1439 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is no Channel Admin or Channel Operator or tempOP, so you can't demote him.", username);
1440 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1441 }
1442 }
1443 else //user is just a tempOP and may only deOP other tempOPs
1444 {
1445 if (dst_c && channel_conn_is_tmpOPcxx . . $ pvpgn/bnetd/channel_conn_is_tmpOP(7159c29bb3f93f5f).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c), dst_c))
1446 {
1447 conn_set_tmpOP_channelcxx . . $ pvpgn/bnetd/conn_set_tmpOP_channel(2e9022cda97b266d).(account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1448 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been demoted from a tempOP of this channel", username);
1449 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1450 msgtemp2cxx . . $ pvpgn/bnetd/msgtemp2. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has demoted you from a tempOP of channel \"{}\"", conn_get_loggeduser(c), channel);
1451 if (dst_c) message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dst_c, message_type_info, c, msgtemp2cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1452 }
1453 else
1454 {
1455 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is no tempOP in this channel, so you can't demote him", username);
1456 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1457 }
1458 }
1459
1460 command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(username));
1461 return 0;
1462 }
1463
1464 static int _handle_friends_commandcxx . . $ pvpgn/bnetd/_handle_friends_command(2e9022cda97b266d).(t_connection * c, char const * text)
1465 {
1466 int i;
1467 t_accountcxx . . $ pvpgn/bnetd/t_account# *my_acc = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c);
1468
1469 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
1470
1471 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "add" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "a") {
1472 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
1473 t_connection * dest_c;
1474 t_accountcxx . . $ pvpgn/bnetd/t_account# * friend_acc;
1475 t_server_friendslistreply_statuscxx . . $ pvpgn/t_server_friendslistreply_status# status;
1476 t_game * game;
1477 t_channelcxx . . $ pvpgn/bnetd/t_channel# * channel;
1478 char stat;
1479 t_listcxx . . $ pvpgn/t_list# * flist;
1480 t_friendcxx . . $ pvpgn/bnetd/t_friend# * fr;
1481
1482 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
1483 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1484 return -1;
1485 }
1486 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1487
1488 if (!(friend_acc = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(text))) {
1489 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That user does not exist."));
1490 return -1;
1491 }
1492
1493 switch (account_add_friendcxx . . $ pvpgn/bnetd/account_add_friend(1a0c18bb6c50312f).(my_acc, friend_acc)) {
1494 case -1:
1495 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Server error."));
1496 return -1;
1497 case -2:
1498 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You can't add yourself to your friends list."));
1499 return -1;
1500 case -3:
1501 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You can only have a maximum of {} friends.", prefs_get_max_friends());
1502 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1503 return -1;
1504 case -4:
1505 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is already on your friends list!", text);
1506 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1507 return -1;
1508 }
1509
1510 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Added {} to your friends list.", text);
1511 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1512 dest_c = connlist_find_connection_by_accountcxx . . $ pvpgn/bnetd/connlist_find_connection_by_account(831fe2ed2f0bd703).(friend_acc);
1513 if (dest_c != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
1514 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} added you to his/her friends list.", conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(c));
1515 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dest_c, message_type_info, dest_c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1516 }
1517
1518 if ((conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(c) != conn_class_bnet) || (!(rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))))
1519 return 0;
1520
1521 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_friendadd_ackcxx . . $ pvpgn/t_server_friendadd_ack#));
1522 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_FRIENDADD_ACKcxx . . $ `src/common/anongame_protocol.h:652:9`!);
1523
1524 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(friend_acc));
1525
1526 game = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1527 channel = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1528
1529 if (!(dest_c))
1530 {
1531 bn_byte_setcxx . . $ pvpgn/bn_byte_set(9656657e14223459).(&status.locationcxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_26#location., FRIENDSTATUS_OFFLINEcxx . . $ `src/common/anongame_protocol.h:679:9`!);
1532 bn_byte_setcxx . . $ pvpgn/bn_byte_set(9656657e14223459).(&status.statuscxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_26#status., 0);
1533 bn_int_setcxx . . $ pvpgn/bn_int_set(e97e500db3ec3c79).(&status.clienttagcxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_26#clienttag., 0);
1534 }
1535 else
1536 {
1537 bn_int_setcxx . . $ pvpgn/bn_int_set(e97e500db3ec3c79).(&status.clienttagcxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_26#clienttag., conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(dest_c));
1538 stat = 0;
1539 flist = account_get_friendscxx . . $ pvpgn/bnetd/account_get_friends(27f2e57ffe21264).(my_acc);
1540 fr = friendlist_find_accountcxx . . $ pvpgn/bnetd/friendlist_find_account(b551094904635f5).(flist, friend_acc);
1541 if ((friend_get_mutualcxx . . $ pvpgn/bnetd/friend_get_mutual(1bd0d6ddce271d17).(fr))) stat |= FRIEND_TYPE_MUTUALcxx . . $ `src/common/anongame_protocol.h:643:9`!;
1542 if ((conn_get_dndstrcxx . . $ pvpgn/bnetd/conn_get_dndstr(c99dbccf638f5c6).(dest_c))) stat |= FRIEND_TYPE_DNDcxx . . $ `src/common/anongame_protocol.h:644:9`!;
1543 if ((conn_get_awaystrcxx . . $ pvpgn/bnetd/conn_get_awaystr(c99dbccf638f5c6).(dest_c))) stat |= FRIEND_TYPE_AWAYcxx . . $ `src/common/anongame_protocol.h:645:9`!;
1544 bn_byte_setcxx . . $ pvpgn/bn_byte_set(9656657e14223459).(&status.statuscxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_26#status., stat);
1545 if ((game = conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(dest_c)))
1546 {
1547 if (game_get_flagcxx . . $ pvpgn/bnetd/game_get_flag(98b2c43fe55f6682).(game) != game_flag_private)
1548 bn_byte_setcxx . . $ pvpgn/bn_byte_set(9656657e14223459).(&status.locationcxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_26#location., FRIENDSTATUS_PUBLIC_GAMEcxx . . $ `src/common/anongame_protocol.h:682:9`!);
1549 else
1550 bn_byte_setcxx . . $ pvpgn/bn_byte_set(9656657e14223459).(&status.locationcxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_26#location., FRIENDSTATUS_PRIVATE_GAMEcxx . . $ `src/common/anongame_protocol.h:683:9`!);
1551 }
1552 else if ((channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(dest_c)))
1553 {
1554 bn_byte_setcxx . . $ pvpgn/bn_byte_set(9656657e14223459).(&status.locationcxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_26#location., FRIENDSTATUS_CHATcxx . . $ `src/common/anongame_protocol.h:681:9`!);
1555 }
1556 else
1557 {
1558 bn_byte_setcxx . . $ pvpgn/bn_byte_set(9656657e14223459).(&status.locationcxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_26#location., FRIENDSTATUS_ONLINEcxx . . $ `src/common/anongame_protocol.h:680:9`!);
1559 }
1560 }
1561
1562 packet_append_datacxx . . $ pvpgn/packet_append_data(d82347a7305550af).(rpacket, &status, sizeof(status));
1563
1564 if (game) packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, game_get_namecxx . . $ pvpgn/bnetd/game_get_name(743fb6d1aa411c4e).(game));
1565 else if (channel) packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel));
1566 else packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, "");
1567
1568 conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket);
1569 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
1570 }
1571 else if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "msg" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "w" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "whisper" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "m")
1572 {
1573 char const *msg;
1574 int cnt = 0;
1575 t_connection * dest_c;
1576 t_elemcxx . . $ pvpgn/t_elem# * curr;
1577 t_friendcxx . . $ pvpgn/bnetd/t_friend# * fr;
1578 t_listcxx . . $ pvpgn/t_list# * flist;
1579
1580 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
1581 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1582 return -1;
1583 }
1584 msg = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // message
1585
1586 flist = account_get_friendscxx . . $ pvpgn/bnetd/account_get_friends(27f2e57ffe21264).(my_acc);
1587 if (flist == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
1588 return -1;
1589
1590 LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(flist, curr)
1591 {
1592 if (!(fr = (t_friendcxx . . $ pvpgn/bnetd/t_friend#*)elem_get_data(curr))) {
1593 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL entry in list");
1594 continue;
1595 }
1596 if (friend_get_mutualcxx . . $ pvpgn/bnetd/friend_get_mutual(1bd0d6ddce271d17).(fr)) {
1597 dest_c = connlist_find_connection_by_accountcxx . . $ pvpgn/bnetd/connlist_find_connection_by_account(831fe2ed2f0bd703).(friend_get_accountcxx . . $ pvpgn/bnetd/friend_get_account(9d018d83140d552c).(fr));
1598 if (!dest_c) continue;
1599 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(dest_c, message_type_whisper, c, msg);
1600 cnt++;
1601 }
1602 }
1603 if (cnt)
1604 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_friendwhisperack, c, msg);
1605 else
1606 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "All of your friends are offline."));
1607 }
1608 else if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "r" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "remove" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "del" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "delete")
1609 {
1610 int num;
1611 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
1612
1613 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
1614 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1615 return -1;
1616 }
1617 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1618
1619 switch ((num = account_remove_friend2cxx . . $ pvpgn/bnetd/account_remove_friend2(4b12bc5edcfaeac7).(my_acc, text))) {
1620 case -1: return -1;
1621 case -2:
1622 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} was not found on your friends list.", text);
1623 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1624 return -1;
1625 default:
1626 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Removed {} from your friends list.", text);
1627 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1628
1629 if ((conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(c) != conn_class_bnet) || (!(rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))))
1630 return 0;
1631
1632 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_frienddel_ackcxx . . $ pvpgn/t_server_frienddel_ack#));
1633 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_FRIENDDEL_ACKcxx . . $ `src/common/anongame_protocol.h:663:9`!);
1634
1635 bn_byte_setcxx . . $ pvpgn/bn_byte_set(9656657e14223459).(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_frienddel_ackcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_frienddel_ack..friendnumcxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_30#friendnum., num);
1636
1637 conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket);
1638 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
1639
1640 return 0;
1641 }
1642 }
1643 else if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "p" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "promote") {
1644 int num;
1645 int n;
1646 char const * dest_name;
1647 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
1648 t_listcxx . . $ pvpgn/t_list# * flist;
1649 t_friendcxx . . $ pvpgn/bnetd/t_friend# * fr;
1650 t_accountcxx . . $ pvpgn/bnetd/t_account# * dest_acc;
1651 unsigned int dest_uid;
1652
1653 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
1654 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1655 return -1;
1656 }
1657 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1658
1659 num = account_get_friendcountcxx . . $ pvpgn/bnetd/account_get_friendcount(367bfb076f70247b).(my_acc);
1660 flist = account_get_friendscxx . . $ pvpgn/bnetd/account_get_friends(27f2e57ffe21264).(my_acc);
1661 for (n = 1; n < num; n++)
1662 if ((dest_uid = account_get_friendcxx . . $ pvpgn/bnetd/account_get_friend(20c0a00602323ffe).(my_acc, n)) &&
1663 (fr = friendlist_find_uidcxx . . $ pvpgn/bnetd/friendlist_find_uid(9da8c1d9dfa566eb).(flist, dest_uid)) &&
1664 (dest_acc = friend_get_accountcxx . . $ pvpgn/bnetd/friend_get_account(9d018d83140d552c).(fr)) &&
1665 (dest_name = account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(dest_acc)) &&
1666 (strcasecmp(dest_name, text) == 0))
1667 {
1668 account_set_friendcxx . . $ pvpgn/bnetd/account_set_friend(dd9d7c881017d9c5).(my_acc, n, account_get_friendcxx . . $ pvpgn/bnetd/account_get_friend(20c0a00602323ffe).(my_acc, n - 1));
1669 account_set_friendcxx . . $ pvpgn/bnetd/account_set_friend(dd9d7c881017d9c5).(my_acc, n - 1, dest_uid);
1670 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Promoted {} in your friends list.", dest_name);
1671 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1672
1673 if ((conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(c) != conn_class_bnet) || (!(rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))))
1674 return 0;
1675
1676 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_friendmove_ackcxx . . $ pvpgn/t_server_friendmove_ack#));
1677 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_FRIENDMOVE_ACKcxx . . $ `src/common/anongame_protocol.h:671:9`!);
1678 bn_byte_setcxx . . $ pvpgn/bn_byte_set(9656657e14223459).(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_friendmove_ackcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_friendmove_ack..pos1cxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_31#pos1., n - 1);
1679 bn_byte_setcxx . . $ pvpgn/bn_byte_set(9656657e14223459).(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_friendmove_ackcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_friendmove_ack..pos2cxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_31#pos2., n);
1680
1681 conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket);
1682 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
1683 return 0;
1684 }
1685 }
1686 else if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "d" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "demote") {
1687 int num;
1688 int n;
1689 char const * dest_name;
1690 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
1691 t_listcxx . . $ pvpgn/t_list# * flist;
1692 t_friendcxx . . $ pvpgn/bnetd/t_friend# * fr;
1693 t_accountcxx . . $ pvpgn/bnetd/t_account# * dest_acc;
1694 unsigned int dest_uid;
1695
1696 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
1697 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1698 return -1;
1699 }
1700 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1701
1702 num = account_get_friendcountcxx . . $ pvpgn/bnetd/account_get_friendcount(367bfb076f70247b).(my_acc);
1703 flist = account_get_friendscxx . . $ pvpgn/bnetd/account_get_friends(27f2e57ffe21264).(my_acc);
1704 for (n = 0; n < num - 1; n++)
1705 if ((dest_uid = account_get_friendcxx . . $ pvpgn/bnetd/account_get_friend(20c0a00602323ffe).(my_acc, n)) &&
1706 (fr = friendlist_find_uidcxx . . $ pvpgn/bnetd/friendlist_find_uid(9da8c1d9dfa566eb).(flist, dest_uid)) &&
1707 (dest_acc = friend_get_accountcxx . . $ pvpgn/bnetd/friend_get_account(9d018d83140d552c).(fr)) &&
1708 (dest_name = account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(dest_acc)) &&
1709 (strcasecmp(dest_name, text) == 0))
1710 {
1711 account_set_friendcxx . . $ pvpgn/bnetd/account_set_friend(dd9d7c881017d9c5).(my_acc, n, account_get_friendcxx . . $ pvpgn/bnetd/account_get_friend(20c0a00602323ffe).(my_acc, n + 1));
1712 account_set_friendcxx . . $ pvpgn/bnetd/account_set_friend(dd9d7c881017d9c5).(my_acc, n + 1, dest_uid);
1713 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Demoted {} in your friends list.", dest_name);
1714 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1715
1716 if ((conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(c) != conn_class_bnet) || (!(rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))))
1717 return 0;
1718
1719 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_friendmove_ackcxx . . $ pvpgn/t_server_friendmove_ack#));
1720 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_FRIENDMOVE_ACKcxx . . $ `src/common/anongame_protocol.h:671:9`!);
1721 bn_byte_setcxx . . $ pvpgn/bn_byte_set(9656657e14223459).(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_friendmove_ackcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_friendmove_ack..pos1cxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_31#pos1., n);
1722 bn_byte_setcxx . . $ pvpgn/bn_byte_set(9656657e14223459).(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_friendmove_ackcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_friendmove_ack..pos2cxx . . $ pvpgn/$anonymous_type_7419cb175bf0dbad_31#pos2., n + 1);
1723
1724 conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket);
1725 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
1726 return 0;
1727 }
1728 }
1729 else if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "list" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "l" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "online" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "o") {
1730 char const * frienduid;
1731 stdcxx . . $ std/::stringcxx . . $ std/string# statuscxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391)., softwarecxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).;
1732 t_connection * dest_c;
1733 t_accountcxx . . $ pvpgn/bnetd/t_account# * friend_acc;
1734 t_game const * game;
1735 t_channelcxx . . $ pvpgn/bnetd/t_channel# const * channel;
1736 t_friendcxx . . $ pvpgn/bnetd/t_friend# * fr;
1737 t_listcxx . . $ pvpgn/t_list# * flist;
1738 int num;
1739 unsigned int uid;
1740 bool online_only = false;
1741
1742 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "online" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "o")
1743 {
1744 online_only = true;
1745 }
1746 if (!online_only)
1747 {
1748 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your {} - Friends List", prefs_get_servername());
1749 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1750 }
1751 else
1752 {
1753 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your {} - Online Friends List", prefs_get_servername());
1754 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1755 }
1756 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
1757 num = account_get_friendcountcxx . . $ pvpgn/bnetd/account_get_friendcount(367bfb076f70247b).(my_acc);
1758
1759 flist = account_get_friendscxx . . $ pvpgn/bnetd/account_get_friends(27f2e57ffe21264).(my_acc);
1760 if (flist != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
1761 for (i = 0; i < num; i++)
1762 {
1763 if ((!(uid = account_get_friendcxx . . $ pvpgn/bnetd/account_get_friend(20c0a00602323ffe).(my_acc, i))) || (!(fr = friendlist_find_uidcxx . . $ pvpgn/bnetd/friendlist_find_uid(9da8c1d9dfa566eb).(flist, uid))))
1764 {
1765 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "friend uid in list");
1766 continue;
1767 }
1768 friend_acc = friend_get_accountcxx . . $ pvpgn/bnetd/friend_get_account(9d018d83140d552c).(fr);
1769 if (!(dest_c = connlist_find_connection_by_accountcxx . . $ pvpgn/bnetd/connlist_find_connection_by_account(831fe2ed2f0bd703).(friend_acc))) {
1770 if (online_only) {
1771 continue;
1772 }
1773 status =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, ", offline");
1774 }
1775 else {
1776 software =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, " using {}", clienttag_get_title(conn_get_clienttag(dest_c)));
1777
1778 if (friend_get_mutualcxx . . $ pvpgn/bnetd/friend_get_mutual(1bd0d6ddce271d17).(fr)) {
1779 if ((game = conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(dest_c)))
1780 status =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, ", in game \"{}\"", game_get_name(game));
1781 else if ((channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(dest_c))) {
1782 if (strcasecmp(channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel), "Arranged Teams") == 0)
1783 status =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, ", in game AT Preparation");
1784 else
1785 status =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, ", in channel \"{}\",", channel_get_name(channel));
1786 }
1787 else
1788 status =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, ", is in AT Preparation");
1789 }
1790 else {
1791 if ((game = conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(dest_c)))
1792 status =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, ", is in a game");
1793 else if ((channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(dest_c)))
1794 status =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, ", is in a chat channel");
1795 else
1796 status =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, ", is in AT Preparation");
1797 }
1798 }
1799
1800 frienduid = account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(friend_acc);
1801 if (!software.emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "%d: %s%.16s%.128s, %.64s", i + 1, friend_get_mutualcxx . . $ pvpgn/bnetd/friend_get_mutual(1bd0d6ddce271d17).(fr) ? "*" : " ", frienduid, status.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), software.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1802 else stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "%d: %.16s%.128s", i + 1, frienduid, status.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1803 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
1804 }
1805 }
1806 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
1807 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "End of Friends List"));
1808 }
1809 else {
1810 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1811 return -1;
1812 }
1813
1814 return 0;
1815 }
1816
1817 static int _handle_me_commandcxx . . $ pvpgn/bnetd/_handle_me_command(2e9022cda97b266d).(t_connection * c, char const * text)
1818 {
1819 t_channelcxx . . $ pvpgn/bnetd/t_channel# const * channel;
1820
1821 if (!(channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)))
1822 {
1823 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are not in a channel."));
1824 return -1;
1825 }
1826
1827 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
1828
1829 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
1830 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1831 return -1;
1832 }
1833 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // message
1834
1835 if (!conn_quota_exceededcxx . . $ pvpgn/bnetd/conn_quota_exceeded(2e9022cda97b266d).(c, text))
1836 channel_message_sendcxx . . $ pvpgn/bnetd/channel_message_send(3c4bd88e6f433f89).(channel, message_type_emote, c, text);
1837 return 0;
1838 }
1839
1840 static int _handle_whisper_commandcxx . . $ pvpgn/bnetd/_handle_whisper_command(2e9022cda97b266d).(t_connection * c, char const *text)
1841 {
1842 char const * username; /* both include NUL, so no need to add one for middle @ or * */
1843
1844 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
1845
1846 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
1847 {
1848 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1849 return -1;
1850 }
1851 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1852 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // message
1853
1854 do_whispercxx . . $ pvpgn/bnetd/do_whisper(eaaa44a2dcaaa0e3).(c, username, text);
1855
1856 return 0;
1857 }
1858
1859 static int _handle_status_commandcxx . . $ pvpgn/bnetd/_handle_status_command(2e9022cda97b266d).(t_connection * c, char const *text)
1860 {
1861 t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag;
1862
1863 // get clienttag
1864 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
1865
1866 if (!args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() && (clienttag = tag_validate_clientcxx . . $ pvpgn/tag_validate_client(c61c63047ce273de).(args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).())))
1867 {
1868 // clienttag status
1869 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "There are currently {} user(s) in {} games of {}",
1870 conn_get_user_count_by_clienttag(clienttag),
1871 game_get_count_by_clienttag(clienttag),
1872 clienttag_get_title(clienttag));
1873 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1874 }
1875 else
1876 {
1877 // overall status
1878 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "There are currently {} users online, in {} games, and in {} channels.",
1879 connlist_login_get_length(),
1880 gamelist_get_length(),
1881 channellist_get_length());
1882 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
1883 }
1884
1885 return 0;
1886 }
1887
1888 static int _handle_who_commandcxx . . $ pvpgn/bnetd/_handle_who_command(2e9022cda97b266d).(t_connection * c, char const *text)
1889 {
1890 t_connection const * conn;
1891 t_channelcxx . . $ pvpgn/bnetd/t_channel# const * channel;
1892 unsigned int i;
1893 char const * tname;
1894
1895 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
1896
1897 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
1898 {
1899 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1900 return -1;
1901 }
1902 char const * cname = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // channel name
1903
1904
1905 if (!(channel = channellist_find_channel_by_namecxx . . $ pvpgn/bnetd/channellist_find_channel_by_name(7177a8438ab16268).(cname, conn_get_countrycxx . . $ pvpgn/bnetd/conn_get_country(c99dbccf638f5c6).(c), realm_get_namecxx . . $ pvpgn/bnetd/realm_get_name(83f045398bcf2fc5).(conn_get_realmcxx . . $ pvpgn/bnetd/conn_get_realm(c743a4e7d4d1463d).(c)))))
1906 {
1907 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That channel does not exist."));
1908 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "(If you are trying to search for a user, use the /whois command.)"));
1909 return -1;
1910 }
1911 if (channel_check_banningcxx . . $ pvpgn/bnetd/channel_check_banning(af8c4400d4e536a9).(channel, c) == 1)
1912 {
1913 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are banned from that channel."));
1914 return -1;
1915 }
1916
1917 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "%s", localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Users in channel {}:", cname).c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1918 i = stdcxx . . $ std/::strlen(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
1919 for (conn = channel_get_firstcxx . . $ pvpgn/bnetd/channel_get_first(77c4a1edc1ac6ba1).(channel); conn; conn = channel_get_nextcxx . . $ pvpgn/bnetd/channel_get_next(181375335219f0cb).())
1920 {
1921 if (i + stdcxx . . $ std/::strlen((tname = conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(conn))) + 2 > sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.)) /* " ", name, '\0' */
1922 {
1923 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
1924 i = 0;
1925 }
1926 stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(&msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.[i], " %s", tname);
1927 i += stdcxx . . $ std/::strlen(&msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.[i]);
1928 }
1929 if (i > 0)
1930 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
1931
1932 return 0;
1933 }
1934
1935 static int _handle_whois_commandcxx . . $ pvpgn/bnetd/_handle_whois_command(2e9022cda97b266d).(t_connection * c, char const * text)
1936 {
1937 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
1938
1939 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
1940 {
1941 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1942 return -1;
1943 }
1944 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
1945
1946 do_whoiscxx . . $ pvpgn/bnetd/do_whois(c8fb97a9af134824).(c, text);
1947
1948 return 0;
1949 }
1950
1951 static int _handle_whoami_commandcxx . . $ pvpgn/bnetd/_handle_whoami_command(2e9022cda97b266d).(t_connection * c, char const *text)
1952 {
1953 char const * tname;
1954
1955 if (!(tname = conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(c)))
1956 {
1957 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Unable to obtain your account name."));
1958 return -1;
1959 }
1960
1961 do_whoiscxx . . $ pvpgn/bnetd/do_whois(c8fb97a9af134824).(c, tname);
1962
1963 return 0;
1964 }
1965
1966 static int _handle_announce_commandcxx . . $ pvpgn/bnetd/_handle_announce_command(2e9022cda97b266d).(t_connection * c, char const *text)
1967 {
1968 t_message * message;
1969
1970 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
1971
1972 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
1973 {
1974 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
1975 return -1;
1976 }
1977 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // message
1978
1979 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Announcement from {}: {}", conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(c), text);
1980 if (!(message = message_createcxx . . $ pvpgn/bnetd/message_create(e95537b238ea1ff).(message_type_broadcast, c, msgtempcxx . . $ pvpgn/bnetd/msgtemp..c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).())))
1981 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Could not broadcast message."));
1982 else
1983 {
1984 if (message_send_allcxx . . $ pvpgn/bnetd/message_send_all(946070d365682f94).(message) < 0)
1985 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Could not broadcast message."));
1986 message_destroycxx . . $ pvpgn/bnetd/message_destroy(946070d365682f94).(message);
1987 }
1988
1989 return 0;
1990 }
1991
1992 static int _handle_beep_commandcxx . . $ pvpgn/bnetd/_handle_beep_command(2e9022cda97b266d).(t_connection * c, char const *text)
1993 {
1994 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Audible notification on.")); /* FIXME: actually do something */
1995 return 0; /* FIXME: these only affect CHAT clients... I think they prevent ^G from being sent */
1996 }
1997
1998 static int _handle_nobeep_commandcxx . . $ pvpgn/bnetd/_handle_nobeep_command(2e9022cda97b266d).(t_connection * c, char const *text)
1999 {
2000 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Audible notification off.")); /* FIXME: actually do something */
2001 return 0;
2002 }
2003
2004 static int _handle_version_commandcxx . . $ pvpgn/bnetd/_handle_version_command(2e9022cda97b266d).(t_connection * c, char const *text)
2005 {
2006 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, PVPGN_SOFTWAREcxx . . $ `src/common/version.h:28:9`! " " PVPGN_VERSIONcxx . . $ `src/common/version.h:23:9`!);
2007 return 0;
2008 }
2009
2010 static int _handle_copyright_commandcxx . . $ pvpgn/bnetd/_handle_copyright_command(2e9022cda97b266d).(t_connection * c, char const *text)
2011 {
2012 static char const * const info[] =
2013 {
2014 " Copyright (C) 2002 - 2014 See source for details",
2015 " ",
2016 " PvPGN is free software; you can redistribute it and/or",
2017 " modify it under the terms of the GNU General Public License",
2018 " as published by the Free Software Foundation; either version 2",
2019 " of the License, or (at your option) any later version.",
2020 " ",
2021 " This program is distributed in the hope that it will be useful,",
2022 " but WITHOUT ANY WARRANTY; without even the implied warranty of",
2023 " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
2024 " GNU General Public License for more details.",
2025 " ",
2026 " You should have received a copy of the GNU General Public License",
2027 " along with this program; if not, write to the Free Software",
2028 " Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.",
2029 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!
2030 };
2031 unsigned int i;
2032
2033 for (i = 0; info[i]; i++)
2034 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, info[i]);
2035
2036 return 0;
2037 }
2038
2039 static int _handle_uptime_commandcxx . . $ pvpgn/bnetd/_handle_uptime_command(2e9022cda97b266d).(t_connection * c, char const *text)
2040 {
2041
2042 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Uptime: {}", seconds_to_timestr(server_get_uptime()));
2043 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2044
2045 return 0;
2046 }
2047
2048 static int _handle_stats_commandcxx . . $ pvpgn/bnetd/_handle_stats_command(2e9022cda97b266d).(t_connection * c, char const *text)
2049 {
2050 char const * username;
2051 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
2052 char const * clienttag = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2053 t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag_uint;
2054 char clienttag_str[5];
2055
2056 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
2057
2058 // username
2059 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
2060 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) {
2061 account = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c);
2062 }
2063 else if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username))) {
2064 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid user."));
2065 return -1;
2066 }
2067
2068 // clienttag
2069 if (!args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() && args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).() == 4)
2070 clienttag = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
2071 else if (!(clienttag = tag_uint_to_strcxx . . $ pvpgn/tag_uint_to_str(d172961b102a89a5).(clienttag_str, conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c)))) {
2072 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Unable to determine client game."));
2073 return -1;
2074 }
2075
2076 clienttag_uint = tag_case_str_to_uintcxx . . $ pvpgn/tag_case_str_to_uint(c61c63047ce273de).(clienttag);
2077
2078 // custom stats
2079 if (prefs_get_custom_iconscxx . . $ pvpgn/bnetd/prefs_get_custom_icons(b126dc7c1de90089).() == 1 && customicons_allowed_by_clientcxx . . $ pvpgn/bnetd/customicons_allowed_by_client(dfa6e707f7696010).(clienttag_uint))
2080 {
2081 const char *text;
2082
2083 // if text is not empty
2084 if (text = customicons_get_stats_textcxx . . $ pvpgn/bnetd/customicons_get_stats_text(771ec84f6146e718).(account, clienttag_uint))
2085 {
2086 // split by lines
2087 char* output_array = strtok((char*)text, "\n");
2088 while (output_array)
2089 {
2090 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, output_array);
2091 output_array = strtok(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, "\n");
2092 }
2093 xfreecxx . . $ `src/common/xalloc.h:51:9`!((char*)text);
2094
2095 return 0;
2096 }
2097 }
2098
2099
2100 switch (clienttag_uint)
2101 {
2102 case CLIENTTAG_BNCHATBOT_UINTcxx . . $ `src/common/tag.h:85:9`!:
2103 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This game does not support win/loss records."));
2104 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must supply a user name and a valid program ID."));
2105 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Example: /stats joe STAR"));
2106 return -1;
2107 case CLIENTTAG_DIABLORTL_UINTcxx . . $ `src/common/tag.h:93:9`!:
2108 case CLIENTTAG_DIABLOSHR_UINTcxx . . $ `src/common/tag.h:95:9`!:
2109 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{}'s record:", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account));
2110 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2111 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "level: {}", account_get_normal_level(account, clienttag_uint));
2112 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2113 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "class: {}", bnclass_get_str(account_get_normal_class(account, clienttag_uint)));
2114 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2115 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "stats: {} str {} mag {} dex {} vit {} gld",
2116 account_get_normal_strength(account, clienttag_uint),
2117 account_get_normal_magic(account, clienttag_uint),
2118 account_get_normal_dexterity(account, clienttag_uint),
2119 account_get_normal_vitality(account, clienttag_uint),
2120 account_get_normal_gold(account, clienttag_uint));
2121 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2122 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Diablo kills: {}", account_get_normal_diablo_kills(account, clienttag_uint));
2123 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2124 return 0;
2125 case CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!:
2126 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{}'s record:", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account));
2127 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2128 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Normal games: {}-{}-{}",
2129 account_get_normal_wins(account, clienttag_uint),
2130 account_get_normal_losses(account, clienttag_uint),
2131 account_get_normal_disconnects(account, clienttag_uint));
2132 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2133 if (account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, clienttag_uint, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.) > 0)
2134 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Ladder games: {}-{}-{} (rating {})",
2135 account_get_ladder_wins(account, clienttag_uint, ladder_id_normal),
2136 account_get_ladder_losses(account, clienttag_uint, ladder_id_normal),
2137 account_get_ladder_disconnects(account, clienttag_uint, ladder_id_normal),
2138 account_get_ladder_rating(account, clienttag_uint, ladder_id_normal));
2139 else
2140 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Ladder games: 0-0-0");
2141 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2142 if (account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, clienttag_uint, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.) > 0)
2143 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "IronMan games: {}-{}-{} (rating {})",
2144 account_get_ladder_wins(account, clienttag_uint, ladder_id_ironman),
2145 account_get_ladder_losses(account, clienttag_uint, ladder_id_ironman),
2146 account_get_ladder_disconnects(account, clienttag_uint, ladder_id_ironman),
2147 account_get_ladder_rating(account, clienttag_uint, ladder_id_ironman));
2148 else
2149 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "IronMan games: 0-0-0");
2150 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2151 return 0;
2152 case CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!:
2153 case CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!:
2154 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{}'s Ladder Record's:", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account));
2155 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2156 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Users Solo Level: {}, Experience: {}",
2157 account_get_ladder_level(account, clienttag_uint, ladder_id_solo),
2158 account_get_ladder_xp(account, clienttag_uint, ladder_id_solo));
2159 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2160 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "SOLO Ladder Record: {}-{}-0",
2161 account_get_ladder_wins(account, clienttag_uint, ladder_id_solo),
2162 account_get_ladder_losses(account, clienttag_uint, ladder_id_solo));
2163 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2164 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "SOLO Rank: {}",
2165 account_get_ladder_rank(account, clienttag_uint, ladder_id_solo));
2166 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2167 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Users Team Level: {}, Experience: {}",
2168 account_get_ladder_level(account, clienttag_uint, ladder_id_team),
2169 account_get_ladder_xp(account, clienttag_uint, ladder_id_team));
2170 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2171 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "TEAM Ladder Record: {}-{}-0",
2172 account_get_ladder_wins(account, clienttag_uint, ladder_id_team),
2173 account_get_ladder_losses(account, clienttag_uint, ladder_id_team));
2174 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2175 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "TEAM Rank: {}",
2176 account_get_ladder_rank(account, clienttag_uint, ladder_id_team));
2177 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2178 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Users FFA Level: {}, Experience: {}",
2179 account_get_ladder_level(account, clienttag_uint, ladder_id_ffa),
2180 account_get_ladder_xp(account, clienttag_uint, ladder_id_ffa));
2181 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2182 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "FFA Ladder Record: {}-{}-0",
2183 account_get_ladder_wins(account, clienttag_uint, ladder_id_ffa),
2184 account_get_ladder_losses(account, clienttag_uint, ladder_id_ffa));
2185 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2186 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "FFA Rank: {}",
2187 account_get_ladder_rank(account, clienttag_uint, ladder_id_ffa));
2188 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2189 if (account_get_teamscxx . . $ pvpgn/bnetd/account_get_teams(27f2e57ffe21264).(account)) {
2190 t_elemcxx . . $ pvpgn/t_elem# * curr;
2191 t_listcxx . . $ pvpgn/t_list# * list;
2192 t_teamcxx . . $ pvpgn/bnetd/t_team# * team;
2193 int teamcount = 0;
2194
2195 list = account_get_teamscxx . . $ pvpgn/bnetd/account_get_teams(27f2e57ffe21264).(account);
2196
2197 LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(list, curr)
2198 {
2199 if (!(team = (t_teamcxx . . $ pvpgn/bnetd/t_team#*)elem_get_data(curr)))
2200 {
2201 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL entry in list");
2202 continue;
2203 }
2204
2205 if (team_get_clienttagcxx . . $ pvpgn/bnetd/team_get_clienttag(3d0b4ed7d37a7d35).(team) != clienttag_uint)
2206 continue;
2207
2208 teamcount++;
2209 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Users AT Team No. {}", teamcount);
2210 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2211 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Users AT TEAM Level: {}, Experience: {}",
2212 team_get_level(team), team_get_xp(team));
2213 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2214 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "AT TEAM Ladder Record: {}-{}-0",
2215 team_get_wins(team), team_get_losses(team));
2216 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2217 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "AT TEAM Rank: {}",
2218 team_get_rank(team));
2219 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2220 }
2221 }
2222 return 0;
2223 default:
2224 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{}'s record:", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account));
2225 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2226 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Normal games: {}-{}-{}",
2227 account_get_normal_wins(account, clienttag_uint),
2228 account_get_normal_losses(account, clienttag_uint),
2229 account_get_normal_disconnects(account, clienttag_uint));
2230 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2231 if (account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, clienttag_uint, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.) > 0)
2232 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Ladder games: {}-{}-{} (rating {})",
2233 account_get_ladder_wins(account, clienttag_uint, ladder_id_normal),
2234 account_get_ladder_losses(account, clienttag_uint, ladder_id_normal),
2235 account_get_ladder_disconnects(account, clienttag_uint, ladder_id_normal),
2236 account_get_ladder_rating(account, clienttag_uint, ladder_id_normal));
2237 else
2238 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Ladder games: 0-0-0");
2239 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2240 return 0;
2241 }
2242 }
2243
2244 static int _handle_time_commandcxx . . $ pvpgn/bnetd/_handle_time_command(2e9022cda97b266d).(t_connection * c, char const *text)
2245 {
2246 t_bnettimecxx . . $ pvpgn/t_bnettime# btsystem;
2247 t_bnettimecxx . . $ pvpgn/t_bnettime# btlocal;
2248 stdcxx . . $ std/::time_tcxx . . $ std/time_t# now;
2249 struct stdcxx . . $ std/::tmcxx . . $ tm# * tmnow;
2250
2251 btsystem =cxx . . $ pvpgn/$anonymous_type_c83edbf674c01669_0#`operator=`(372276d12cbccf26). bnettimecxx . . $ pvpgn/bnettime(c08f2632e82bc0c).();
2252
2253 /* Battle.net time: Wed Jun 23 15:15:29 */
2254 btlocal =cxx . . $ pvpgn/$anonymous_type_c83edbf674c01669_0#`operator=`(372276d12cbccf26). bnettime_add_tzbiascxx . . $ pvpgn/bnettime_add_tzbias(f1f1310dc900a45f).(btsystem, local_tzbiascxx . . $ pvpgn/local_tzbias(b126dc7c1de90089).());
2255 now = bnettime_to_timecxx . . $ pvpgn/bnettime_to_time(f37c7c75a9c2d829).(btlocal);
2256 if (!(tmnow = stdcxx . . $ std/::gmtimecxx . . $ std/gmtime(7d91c9e5f6bb884b).(&now)))
2257 stdcxx . . $ std/::strcpy(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "?");
2258 else
2259 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "%a %b %d %H:%M:%S", tmnow);
2260 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Server Time: {}", msgtemp0);
2261 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2262 if (conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(c) == conn_class_bnet)
2263 {
2264 btlocal =cxx . . $ pvpgn/$anonymous_type_c83edbf674c01669_0#`operator=`(372276d12cbccf26). bnettime_add_tzbiascxx . . $ pvpgn/bnettime_add_tzbias(f1f1310dc900a45f).(btsystem, conn_get_tzbiascxx . . $ pvpgn/bnetd/conn_get_tzbias(b5160de3e9803af4).(c));
2265 now = bnettime_to_timecxx . . $ pvpgn/bnettime_to_time(f37c7c75a9c2d829).(btlocal);
2266 if (!(tmnow = stdcxx . . $ std/::gmtimecxx . . $ std/gmtime(7d91c9e5f6bb884b).(&now)))
2267 stdcxx . . $ std/::strcpy(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "?");
2268 else
2269 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "%a %b %d %H:%M:%S", tmnow);
2270 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your local time: {}", msgtemp0);
2271 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2272 }
2273
2274 return 0;
2275 }
2276
2277 static int _handle_channel_commandcxx . . $ pvpgn/bnetd/_handle_channel_command(2e9022cda97b266d).(t_connection * c, char const *text)
2278 {
2279 t_channelcxx . . $ pvpgn/bnetd/t_channel# * channel;
2280
2281 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
2282
2283 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
2284 {
2285 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2286 return -1;
2287 }
2288 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // channelname
2289
2290 if (!conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(c)) {
2291 if (strcasecmp(text, "Arranged Teams") == 0)
2292 {
2293 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5). =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Channel Arranged Teams is a RESTRICTED Channel!"));
2294 return -1;
2295 }
2296
2297 if (!(stdcxx . . $ std/::strlen(text) < MAX_CHANNELNAME_LENcxx . . $ MAX_CHANNELNAME_LEN.))
2298 {
2299 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Max channel name length exceeded (max {} symbols)", MAX_CHANNELNAME_LEN - 1);
2300 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2301 return -1;
2302 }
2303
2304 if ((channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)) && (strcasecmp(channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel), text) == 0))
2305 return -1; // we don't have to do anything, we are already in this channel
2306
2307 if (conn_set_channelcxx . . $ pvpgn/bnetd/conn_set_channel(2e9022cda97b266d).(c, text) < 0)
2308 conn_set_channelcxx . . $ pvpgn/bnetd/conn_set_channel(2e9022cda97b266d).(c, CHANNEL_NAME_BANNEDcxx . . $ `src/bnetd/channel.h:125:9`!); /* should not fail */
2309 if ((conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c) == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!) || (conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c) == CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!))
2310 conn_update_w3_playerinfocxx . . $ pvpgn/bnetd/conn_update_w3_playerinfo(c4dfbc2386fe4fc3).(c);
2311 command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(c);
2312 }
2313 else
2314 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Command disabled while inside a game."));
2315
2316 return 0;
2317 }
2318
2319 static int _handle_rejoin_commandcxx . . $ pvpgn/bnetd/_handle_rejoin_command(2e9022cda97b266d).(t_connection * c, char const *text)
2320 {
2321
2322 if (channel_rejoincxx . . $ pvpgn/bnetd/channel_rejoin(c4dfbc2386fe4fc3).(c) != 0)
2323 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are not in a channel."));
2324 if ((conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c) == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!) || (conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c) == CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!))
2325 conn_update_w3_playerinfocxx . . $ pvpgn/bnetd/conn_update_w3_playerinfo(c4dfbc2386fe4fc3).(c);
2326 command_set_flagscxx . . $ pvpgn/bnetd/command_set_flags(c4dfbc2386fe4fc3).(c);
2327
2328 return 0;
2329 }
2330
2331 static int _handle_away_commandcxx . . $ pvpgn/bnetd/_handle_away_command(2e9022cda97b266d).(t_connection * c, char const *text)
2332 {
2333 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
2334 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // message
2335
2336 if (text[0] == '\0') /* toggle away mode */
2337 {
2338 if (!conn_get_awaystrcxx . . $ pvpgn/bnetd/conn_get_awaystr(c99dbccf638f5c6).(c))
2339 {
2340 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are now marked as being away."));
2341 conn_set_awaystrcxx . . $ pvpgn/bnetd/conn_set_awaystr(2e9022cda97b266d).(c, "Currently not available");
2342 }
2343 else
2344 {
2345 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are no longer marked as away."));
2346 conn_set_awaystrcxx . . $ pvpgn/bnetd/conn_set_awaystr(2e9022cda97b266d).(c, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2347 }
2348 }
2349 else
2350 {
2351 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are now marked as being away."));
2352 conn_set_awaystrcxx . . $ pvpgn/bnetd/conn_set_awaystr(2e9022cda97b266d).(c, text);
2353 }
2354
2355 return 0;
2356 }
2357
2358 static int _handle_dnd_commandcxx . . $ pvpgn/bnetd/_handle_dnd_command(2e9022cda97b266d).(t_connection * c, char const *text)
2359 {
2360 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
2361 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // message
2362
2363 if (text[0] == '\0') /* toggle dnd mode */
2364 {
2365 if (!conn_get_dndstrcxx . . $ pvpgn/bnetd/conn_get_dndstr(c99dbccf638f5c6).(c))
2366 {
2367 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Do Not Disturb mode engaged."));
2368 conn_set_dndstrcxx . . $ pvpgn/bnetd/conn_set_dndstr(2e9022cda97b266d).(c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Not available").c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2369 }
2370 else
2371 {
2372 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Do Not Disturb mode canceled."));
2373 conn_set_dndstrcxx . . $ pvpgn/bnetd/conn_set_dndstr(2e9022cda97b266d).(c, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2374 }
2375 }
2376 else
2377 {
2378 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Do Not Disturb mode engaged."));
2379 conn_set_dndstrcxx . . $ pvpgn/bnetd/conn_set_dndstr(2e9022cda97b266d).(c, text);
2380 }
2381
2382 return 0;
2383 }
2384
2385 static int _handle_squelch_commandcxx . . $ pvpgn/bnetd/_handle_squelch_command(2e9022cda97b266d).(t_connection * c, char const *text)
2386 {
2387 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
2388
2389 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
2390
2391 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
2392 {
2393 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2394 return -1;
2395 }
2396 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
2397
2398 /* D2 std::puts * before username */
2399 if (text[0] == '*')
2400 text++;
2401
2402 if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(text)))
2403 {
2404 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "No such user."));
2405 return -1;
2406 }
2407
2408 if (conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c) == account)
2409 {
2410 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You can't squelch yourself."));
2411 return -1;
2412 }
2413
2414 if (conn_add_ignorecxx . . $ pvpgn/bnetd/conn_add_ignore(992d0c708e1a1a08).(c, account) < 0)
2415 {
2416 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Could not squelch user."));
2417 return -1;
2418 }
2419 else
2420 {
2421 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been squelched.", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account));
2422 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2423 }
2424
2425 return 0;
2426 }
2427
2428 static int _handle_unsquelch_commandcxx . . $ pvpgn/bnetd/_handle_unsquelch_command(2e9022cda97b266d).(t_connection * c, char const *text)
2429 {
2430 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
2431 t_connection * dest_c;
2432
2433 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
2434
2435 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
2436 {
2437 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2438 return -1;
2439 }
2440 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
2441
2442 /* D2 std::puts * before username */
2443 if (text[0] == '*')
2444 text++;
2445
2446 if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(text)))
2447 {
2448 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "No such user."));
2449 return -1;
2450 }
2451
2452 if (conn_del_ignorecxx . . $ pvpgn/bnetd/conn_del_ignore(587a1b32e97b873a).(c, account) < 0)
2453 {
2454 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "User was not being ignored."));
2455 return -1;
2456 }
2457 else
2458 {
2459 t_message * message;
2460
2461 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "No longer ignoring."));
2462
2463 if ((dest_c = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(account)))
2464 {
2465 if (!(message = message_createcxx . . $ pvpgn/bnetd/message_create(e95537b238ea1ff).(message_type_userflags, dest_c, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!))) /* handles NULL text */
2466 return -1;
2467 message_sendcxx . . $ pvpgn/bnetd/message_send(9d5ee2468ca25dbd).(message, c);
2468 message_destroycxx . . $ pvpgn/bnetd/message_destroy(946070d365682f94).(message);
2469 }
2470 }
2471
2472 return 0;
2473 }
2474
2475 static int _handle_kick_commandcxx . . $ pvpgn/bnetd/_handle_kick_command(2e9022cda97b266d).(t_connection * c, char const *text)
2476 {
2477 char const * username;
2478 t_channelcxx . . $ pvpgn/bnetd/t_channel# const * channel;
2479 t_connection * kuc;
2480 t_accountcxx . . $ pvpgn/bnetd/t_account# * acc;
2481
2482 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
2483
2484 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
2485 {
2486 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2487 return -1;
2488 }
2489 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
2490 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // reason
2491
2492 if (!(channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)))
2493 {
2494 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
2495 return -1;
2496 }
2497
2498 acc = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c);
2499 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(acc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) != 1 && /* default to false */
2500 account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(acc, channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) != 1 && /* default to false */
2501 account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(acc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) != 1 && /* default to false */
2502 account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(acc, channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) != 1 && /* default to false */
2503 !channel_conn_is_tmpOPcxx . . $ pvpgn/bnetd/channel_conn_is_tmpOP(7159c29bb3f93f5f).(channel, account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc)))
2504 {
2505 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You have to be at least a Channel Operator or tempOP to use this command."));
2506 return -1;
2507 }
2508 if (!(kuc = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(username)))
2509 {
2510 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That user is not logged in."));
2511 return -1;
2512 }
2513 if (conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(kuc) != channel)
2514 {
2515 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That user is not in this channel."));
2516 return -1;
2517 }
2518 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(kuc), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1 ||
2519 account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(kuc), channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) == 1)
2520 {
2521 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You cannot kick administrators."));
2522 return -1;
2523 }
2524 else if (account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(kuc), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1 ||
2525 account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(kuc), channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) == 1)
2526 {
2527 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You cannot kick operators."));
2528 return -1;
2529 }
2530
2531 {
2532 char const * tname1;
2533 char const * tname2;
2534
2535 tname1 = conn_get_loggedusercxx . . $ pvpgn/bnetd/conn_get_loggeduser(c99dbccf638f5c6).(kuc);
2536 tname2 = conn_get_loggedusercxx . . $ pvpgn/bnetd/conn_get_loggeduser(c99dbccf638f5c6).(c);
2537 if (!tname1 || !tname2) {
2538 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL username");
2539 return -1;
2540 }
2541
2542 if (text[0] != '\0')
2543 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been kicked by {} ({}).", tname1, tname2, text);
2544 else
2545 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been kicked by {}.", tname1, tname2);
2546 channel_message_sendcxx . . $ pvpgn/bnetd/channel_message_send(3c4bd88e6f433f89).(channel, message_type_info, c, msgtempcxx . . $ pvpgn/bnetd/msgtemp..c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2547 }
2548 conn_kick_channelcxx . . $ pvpgn/bnetd/conn_kick_channel(2e9022cda97b266d).(kuc, "Bye");
2549 if (conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(kuc) == conn_class_bnet)
2550 conn_set_channelcxx . . $ pvpgn/bnetd/conn_set_channel(2e9022cda97b266d).(kuc, CHANNEL_NAME_KICKEDcxx . . $ `src/bnetd/channel.h:126:9`!); /* should not fail */
2551
2552 return 0;
2553 }
2554
2555 static int _handle_ban_commandcxx . . $ pvpgn/bnetd/_handle_ban_command(2e9022cda97b266d).(t_connection * c, char const *text)
2556 {
2557 char const * username;
2558 t_channelcxx . . $ pvpgn/bnetd/t_channel# * channel;
2559 t_connection * buc;
2560
2561 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
2562
2563 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
2564 {
2565 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2566 return -1;
2567 }
2568 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
2569 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // reason
2570
2571 if (!(channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)))
2572 {
2573 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
2574 return -1;
2575 }
2576 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) != 1 && /* default to false */
2577 account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) != 1 && /* default to false */
2578 account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) != 1 && /* default to false */
2579 account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) != 1) /* default to false */
2580 {
2581 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You have to be at least a Channel Operator to use this command."));
2582 return -1;
2583 }
2584 {
2585 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
2586
2587 if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username)))
2588 {
2589 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That account doesn't currently exist."));
2590 return -1;
2591 }
2592 else if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(account, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1 || account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(account, channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) == 1)
2593 {
2594 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You cannot ban administrators."));
2595 return -1;
2596 }
2597 else if (account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(account, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1 ||
2598 account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(account, channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) == 1)
2599 {
2600 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You cannot ban operators."));
2601 return -1;
2602 }
2603 }
2604
2605 if (channel_ban_usercxx . . $ pvpgn/bnetd/channel_ban_user(2cba118976651e77).(channel, username) < 0)
2606 {
2607 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Unable to ban {}.", username);
2608 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2609 }
2610 else
2611 {
2612 char const * tname;
2613
2614 tname = conn_get_loggedusercxx . . $ pvpgn/bnetd/conn_get_loggeduser(c99dbccf638f5c6).(c);
2615 if (text[0] != '\0')
2616 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been banned by {} ({}).", username, tname ? tname : "unknown", text);
2617 else
2618 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} has been banned by {}.", username, tname ? tname : "unknown");
2619 channel_message_sendcxx . . $ pvpgn/bnetd/channel_message_send(3c4bd88e6f433f89).(channel, message_type_info, c, msgtempcxx . . $ pvpgn/bnetd/msgtemp..c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2620 }
2621 if ((buc = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(username)) &&
2622 conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(buc) == channel)
2623 conn_set_channelcxx . . $ pvpgn/bnetd/conn_set_channel(2e9022cda97b266d).(buc, CHANNEL_NAME_BANNEDcxx . . $ `src/bnetd/channel.h:125:9`!);
2624
2625 return 0;
2626 }
2627
2628 static int _handle_unban_commandcxx . . $ pvpgn/bnetd/_handle_unban_command(2e9022cda97b266d).(t_connection * c, char const *text)
2629 {
2630 t_channelcxx . . $ pvpgn/bnetd/t_channel# * channel;
2631
2632 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
2633
2634 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
2635 {
2636 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2637 return -1;
2638 }
2639 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
2640
2641 if (!(channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)))
2642 {
2643 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
2644 return -1;
2645 }
2646 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) != 1 && /* default to false */
2647 account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) != 1 && /* default to false */
2648 account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) != 1 && /* default to false */
2649 account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) != 1) /* default to false */
2650 {
2651 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are not a channel operator."));
2652 return -1;
2653 }
2654
2655 if (channel_unban_usercxx . . $ pvpgn/bnetd/channel_unban_user(2cba118976651e77).(channel, text) < 0)
2656 {
2657 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That user is not banned."));
2658 return -1;
2659 }
2660 else
2661 {
2662 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} is no longer banned from this channel.", text);
2663 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2664 }
2665
2666 return 0;
2667 }
2668
2669 static int _handle_reply_commandcxx . . $ pvpgn/bnetd/_handle_reply_command(2e9022cda97b266d).(t_connection * c, char const *text)
2670 {
2671 char const * dest;
2672
2673 if (!(dest = conn_get_lastsendercxx . . $ pvpgn/bnetd/conn_get_lastsender(c99dbccf638f5c6).(c)))
2674 {
2675 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "No one messaged you, use /m instead"));
2676 return -1;
2677 }
2678
2679 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
2680
2681 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
2682 {
2683 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2684 return -1;
2685 }
2686 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // message
2687
2688 do_whispercxx . . $ pvpgn/bnetd/do_whisper(eaaa44a2dcaaa0e3).(c, dest, text);
2689 return 0;
2690 }
2691
2692 static int _handle_realmann_commandcxx . . $ pvpgn/bnetd/_handle_realmann_command(2e9022cda97b266d).(t_connection * c, char const *text)
2693 {
2694 t_realmcxx . . $ pvpgn/bnetd/t_realm# * realm;
2695 t_realmcxx . . $ pvpgn/bnetd/t_realm# * trealm;
2696 t_connection * tc;
2697 t_elemcxx . . $ pvpgn/t_elem# const * curr;
2698 t_message * message;
2699
2700 if (!(realm = conn_get_realmcxx . . $ pvpgn/bnetd/conn_get_realm(c743a4e7d4d1463d).(c))) {
2701 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must join a realm first"));
2702 return -1;
2703 }
2704
2705 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
2706
2707 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
2708 {
2709 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2710 return -1;
2711 }
2712 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // message
2713
2714 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Announcement from {}@{}: {}", conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(c), realm_get_name(realm), text);
2715 if (!(message = message_createcxx . . $ pvpgn/bnetd/message_create(e95537b238ea1ff).(message_type_broadcast, c, msgtempcxx . . $ pvpgn/bnetd/msgtemp..c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).())))
2716 {
2717 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, "Could not broadcast message.");
2718 return -1;
2719 }
2720 else
2721 {
2722 LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(connlist(), curr)
2723 {
2724 tc = (t_connection*)elem_get_data(curr);
2725 if (!tc)
2726 continue;
2727 if ((trealm = conn_get_realmcxx . . $ pvpgn/bnetd/conn_get_realm(c743a4e7d4d1463d).(tc)) && (trealm == realm))
2728 {
2729 message_sendcxx . . $ pvpgn/bnetd/message_send(9d5ee2468ca25dbd).(message, tc);
2730 }
2731 }
2732 }
2733
2734 message_destroycxx . . $ pvpgn/bnetd/message_destroy(946070d365682f94).(message);
2735
2736 return 0;
2737 }
2738
2739 static int _handle_watch_commandcxx . . $ pvpgn/bnetd/_handle_watch_command(2e9022cda97b266d).(t_connection * c, char const *text)
2740 {
2741 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
2742
2743 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
2744
2745 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
2746 {
2747 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2748 return -1;
2749 }
2750 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
2751
2752 if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(text)))
2753 {
2754 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That user does not exist."));
2755 return -1;
2756 }
2757
2758 if (conn_add_watchcxx . . $ pvpgn/bnetd/conn_add_watch(2bc9ff09b9a40602).(c, account, 0) < 0) /* FIXME: adds all events for now */
2759 {
2760 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Add to watch list failed."));
2761 return -1;
2762 }
2763 else
2764 {
2765 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "User {} added to your watch list.", text);
2766 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2767 }
2768
2769 return 0;
2770 }
2771
2772 static int _handle_unwatch_commandcxx . . $ pvpgn/bnetd/_handle_unwatch_command(2e9022cda97b266d).(t_connection * c, char const *text)
2773 {
2774 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
2775
2776 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
2777
2778 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
2779 {
2780 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2781 return -1;
2782 }
2783 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
2784 if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(text)))
2785 {
2786 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That user does not exist."));
2787 return -1;
2788 }
2789
2790 if (conn_del_watchcxx . . $ pvpgn/bnetd/conn_del_watch(2bc9ff09b9a40602).(c, account, 0) < 0) /* FIXME: deletes all events for now */
2791 {
2792 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Removal from watch list failed."));
2793 return -1;
2794 }
2795 else
2796 {
2797 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "User {} removed from your watch list.", text);
2798 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2799 }
2800
2801 return 0;
2802 }
2803
2804 static int _handle_watchall_commandcxx . . $ pvpgn/bnetd/_handle_watchall_command(2e9022cda97b266d).(t_connection * c, char const *text)
2805 {
2806 t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag = 0;
2807 char const * clienttag_str;
2808
2809 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
2810 clienttag_str = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // clienttag
2811
2812 if (clienttag_str[0] != '\0')
2813 {
2814 if ( !(clienttag = tag_validate_clientcxx . . $ pvpgn/tag_validate_client(c61c63047ce273de).(args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).())) )
2815 {
2816 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2817 return -1;
2818 }
2819 }
2820
2821 if (conn_add_watchcxx . . $ pvpgn/bnetd/conn_add_watch(2bc9ff09b9a40602).(c, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, clienttag) < 0) /* FIXME: adds all events for now */
2822 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Add to watch list failed."));
2823 else
2824 if (clienttag) {
2825 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "All {} users added to your watch list.", tag_uint_to_str((char*)clienttag_str, clienttag));
2826 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2827 }
2828 else
2829 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "All users added to your watch list."));
2830
2831 return 0;
2832 }
2833
2834 static int _handle_unwatchall_commandcxx . . $ pvpgn/bnetd/_handle_unwatchall_command(2e9022cda97b266d).(t_connection * c, char const *text)
2835 {
2836 t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag = 0;
2837 char const * clienttag_str;
2838
2839 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
2840 clienttag_str = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // clienttag
2841
2842 if (clienttag_str[0] != '\0')
2843 {
2844 if (!(clienttag = tag_validate_clientcxx . . $ pvpgn/tag_validate_client(c61c63047ce273de).(args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).())))
2845 {
2846 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2847 return -1;
2848 }
2849 }
2850
2851 if (conn_del_watchcxx . . $ pvpgn/bnetd/conn_del_watch(2bc9ff09b9a40602).(c, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, clienttag) < 0) /* FIXME: deletes all events for now */
2852 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Removal from watch list failed."));
2853 else
2854 if (clienttag) {
2855 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "All {} users removed from your watch list.", tag_uint_to_str((char*)clienttag_str, clienttag));
2856 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
2857 }
2858 else
2859 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "All users removed from your watch list."));
2860
2861 return 0;
2862 }
2863
2864 static int _handle_lusers_commandcxx . . $ pvpgn/bnetd/_handle_lusers_command(2e9022cda97b266d).(t_connection * c, char const *text)
2865 {
2866 t_channelcxx . . $ pvpgn/bnetd/t_channel# * channel;
2867 t_elemcxx . . $ pvpgn/t_elem# const * curr;
2868 char const * banned;
2869 unsigned int i;
2870
2871 if (!(channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c)))
2872 {
2873 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
2874 return -1;
2875 }
2876
2877 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "%s", localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Banned users:").c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2878 i = stdcxx . . $ std/::strlen(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
2879 LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(channel_get_banlist(channel), curr)
2880 {
2881 banned = (char*)elem_get_data(curr);
2882 if (i + stdcxx . . $ std/::strlen(banned) + 2 > sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.)) /* " ", name, '\0' */
2883 {
2884 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
2885 i = 0;
2886 }
2887 stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(&msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.[i], " %s", banned);
2888 i += stdcxx . . $ std/::strlen(&msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.[i]);
2889 }
2890 if (i > 0)
2891 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
2892
2893 return 0;
2894 }
2895
2896 static int _news_cbcxx . . $ pvpgn/bnetd/_news_cb(7fa8c71bb12462fa).(stdcxx . . $ std/::time_tcxx . . $ std/time_t# date, t_lstr *lstr, void *data)
2897 {
2898 char strdate[64];
2899 struct stdcxx . . $ std/::tmcxx . . $ tm# *tm;
2900 char save, *p, *q;
2901 t_connection *c = (t_connection*)data;
2902
2903 tm = stdcxx . . $ std/::localtimecxx . . $ std/localtime(7d91c9e5f6bb884b).(&date);
2904 if (tm)
2905 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(strdate, 64, "%B %d, %Y", tm);
2906 else
2907 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(strdate, sizeof strdate, "%s", localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "(invalid date)").c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
2908
2909 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, strdate);
2910
2911 for (p = lstr_get_str(lstr); *p;) {
2912 for (q = p; *q && *q != '\r' && *q != '\n'; q++);
2913 save = *q;
2914 *q = '\0';
2915 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, p);
2916 *q = save;
2917 p = q;
2918 for (; *p == '\n' || *p == '\r'; p++);
2919 }
2920
2921 return 0;
2922 }
2923
2924 static int _handle_news_commandcxx . . $ pvpgn/bnetd/_handle_news_command(2e9022cda97b266d).(t_connection * c, char const *text)
2925 {
2926 news_traversecxx . . $ pvpgn/bnetd/news_traverse(161353baa9c5a8aa).(_news_cbcxx . . $ pvpgn/bnetd/_news_cb(7fa8c71bb12462fa)., c);
2927 return 0;
2928 }
2929
2930 struct glist_cb_structcxx . . $ pvpgn/bnetd/glist_cb_struct# {
2931 t_game_difficulty diffcxx . . $ pvpgn/bnetd/glist_cb_struct#diff.;
2932 t_clienttagcxx . . $ pvpgn/t_clienttag# tagcxx . . $ pvpgn/bnetd/glist_cb_struct#tag.;
2933 t_connection *ccxx . . $ pvpgn/bnetd/glist_cb_struct#c.;
2934 bool lobbycxx . . $ pvpgn/bnetd/glist_cb_struct#lobby.;
2935 };
2936
2937 static int _glist_cbcxx . . $ pvpgn/bnetd/_glist_cb(7b7c187348591887).(t_game *game, void *data)
2938 {
2939 auto cbdata = reinterpret_cast<struct glist_cb_structcxx . . $ pvpgn/bnetd/glist_cb_struct#*>(data);
2940
2941 // when cbdata->tag != 0, user is requesting games of the same client tag
2942 // return early when the game's client tag does not match the user's client tag
2943 if (cbdata->tagcxx . . $ pvpgn/bnetd/glist_cb_struct#tag. != 0 && cbdata->tagcxx . . $ pvpgn/bnetd/glist_cb_struct#tag. != game_get_clienttagcxx . . $ pvpgn/bnetd/game_get_clienttag(d7b85b5cd2056731).(game))
2944 {
2945 return 0;
2946 }
2947
2948 // when cbdata->lobby == true, only display list of all games in the lobby
2949 // return early if game has started or is already finished
2950 if (cbdata->lobbycxx . . $ pvpgn/bnetd/glist_cb_struct#lobby. == true && (game_get_statuscxx . . $ pvpgn/bnetd/game_get_status(e13bf945064795ea).(game) == game_status_started || game_get_statuscxx . . $ pvpgn/bnetd/game_get_status(e13bf945064795ea).(game) == game_status_done))
2951 {
2952 return 0;
2953 }
2954
2955 // when cbdata->diff != game_difficulty_none, user is requesting a specific game difficulty
2956 // return early if user is requesting a specific game difficulty that does not match the game's difficulty
2957 if (cbdata->diffcxx . . $ pvpgn/bnetd/glist_cb_struct#diff. != game_difficulty_none && cbdata->diffcxx . . $ pvpgn/bnetd/glist_cb_struct#diff. != game_get_difficultycxx . . $ pvpgn/bnetd/game_get_difficulty(d7b85b5cd2056731).(game))
2958 {
2959 return 0;
2960 }
2961
2962 unsigned int pref = prefs_get_hide_pass_gamescxx . . $ pvpgn/bnetd/prefs_get_hide_pass_games(db52760e79bf9054).();
2963 if (pref && game_get_flagcxx . . $ pvpgn/bnetd/game_get_flag(98b2c43fe55f6682).(game) == game_flag_private)
2964 {
2965 // return early if hide_pass_games is true and the game is private
2966 if (cbdata->tagcxx . . $ pvpgn/bnetd/glist_cb_struct#tag. != 0)
2967 {
2968 return 0;
2969 }
2970 // if user used /games all and is not an admin, return early
2971 else if (cbdata->tagcxx . . $ pvpgn/bnetd/glist_cb_struct#tag. == 0 && account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(cbdata->ccxx . . $ pvpgn/bnetd/glist_cb_struct#c.), nullptr) != 1)
2972 {
2973 return 0;
2974 }
2975 }
2976
2977
2978 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), " %-16.16s %1.1s %-8.8s %-21.21s %5u ",
2979 game_get_namecxx . . $ pvpgn/bnetd/game_get_name(743fb6d1aa411c4e).(game),
2980 game_get_flagcxx . . $ pvpgn/bnetd/game_get_flag(98b2c43fe55f6682).(game) != game_flag_private ? "n" : "y",
2981 game_status_get_strcxx . . $ pvpgn/bnetd/game_status_get_str(919d871ac64ee540).(game_get_statuscxx . . $ pvpgn/bnetd/game_get_status(e13bf945064795ea).(game)),
2982 game_type_get_strcxx . . $ pvpgn/bnetd/game_type_get_str(99410026be00fa29).(game_get_typecxx . . $ pvpgn/bnetd/game_get_type(11fe09fff8b42355).(game)),
2983 game_get_refcxx . . $ pvpgn/bnetd/game_get_ref(d7b85b5cd2056731).(game));
2984
2985 if (!cbdata->tagcxx . . $ pvpgn/bnetd/glist_cb_struct#tag.)
2986 {
2987
2988 stdcxx . . $ std/::strcat(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., clienttag_uint_to_strcxx . . $ pvpgn/clienttag_uint_to_str(81a3ae90da26a711).(game_get_clienttagcxx . . $ pvpgn/bnetd/game_get_clienttag(d7b85b5cd2056731).(game)));
2989 stdcxx . . $ std/::strcat(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., " ");
2990 }
2991
2992 if ((!prefs_get_hide_addrcxx . . $ pvpgn/bnetd/prefs_get_hide_addr(db52760e79bf9054).()) || (account_get_command_groupscxx . . $ pvpgn/bnetd/account_get_command_groups(c7ab9369555c44b8).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(cbdata->ccxx . . $ pvpgn/bnetd/glist_cb_struct#c.)) & command_get_groupcxx . . $ pvpgn/bnetd/command_get_group(c61c63047ce273de).("/admin-addr"))) /* default to false */
2993 stdcxx . . $ std/::strcat(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., addr_num_to_addr_strcxx . . $ pvpgn/addr_num_to_addr_str(9313bf3c546cb16).(game_get_addrcxx . . $ pvpgn/bnetd/game_get_addr(d7b85b5cd2056731).(game), game_get_portcxx . . $ pvpgn/bnetd/game_get_port(5675c6bb4f2bafa6).(game)));
2994
2995 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(cbdata->ccxx . . $ pvpgn/bnetd/glist_cb_struct#c., message_type_info, cbdata->ccxx . . $ pvpgn/bnetd/glist_cb_struct#c., msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
2996
2997 return 0;
2998 }
2999
3000 static int _handle_games_commandcxx . . $ pvpgn/bnetd/_handle_games_command(2e9022cda97b266d).(t_connection * c, char const *text)
3001 {
3002 char clienttag_str[5];
3003 char const * dest;
3004 char const * difficulty;
3005 struct glist_cb_structcxx . . $ pvpgn/bnetd/glist_cb_struct# cbdata;
3006
3007 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
3008
3009 dest = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // clienttag
3010 difficulty = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // difficulty (only for diablo)
3011
3012 cbdata.ccxx . . $ pvpgn/bnetd/glist_cb_struct#c. = c;
3013 cbdata.lobbycxx . . $ pvpgn/bnetd/glist_cb_struct#lobby. = false;
3014
3015 if (strcasecmp(difficulty, "norm") == 0)
3016 cbdata.diffcxx . . $ pvpgn/bnetd/glist_cb_struct#diff. = game_difficulty_normal;
3017 else if (strcasecmp(difficulty, "night") == 0)
3018 cbdata.diffcxx . . $ pvpgn/bnetd/glist_cb_struct#diff. = game_difficulty_nightmare;
3019 else if (strcasecmp(difficulty, "hell") == 0)
3020 cbdata.diffcxx . . $ pvpgn/bnetd/glist_cb_struct#diff. = game_difficulty_hell;
3021 else
3022 cbdata.diffcxx . . $ pvpgn/bnetd/glist_cb_struct#diff. = game_difficulty_none;
3023
3024 if (dest[0] == '\0')
3025 {
3026 cbdata.tagcxx . . $ pvpgn/bnetd/glist_cb_struct#tag. = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c);
3027 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Currently accessible games:"));
3028 }
3029 else if (strcasecmp(dest, "all") == 0)
3030 {
3031 cbdata.tagcxx . . $ pvpgn/bnetd/glist_cb_struct#tag. = 0;
3032 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "All current games:"));
3033 }
3034 else if (strcasecmp(dest, "lobby") == 0 || strcasecmp(dest, "l") == 0)
3035 {
3036 cbdata.tagcxx . . $ pvpgn/bnetd/glist_cb_struct#tag. = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c);
3037 cbdata.lobbycxx . . $ pvpgn/bnetd/glist_cb_struct#lobby. = true;
3038 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Games in lobby:"));
3039 }
3040 else
3041 {
3042 if (!(cbdata.tagcxx . . $ pvpgn/bnetd/glist_cb_struct#tag. = tag_validate_clientcxx . . $ pvpgn/tag_validate_client(c61c63047ce273de).(dest)))
3043 {
3044 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3045 return -1;
3046 }
3047
3048 if (cbdata.diffcxx . . $ pvpgn/bnetd/glist_cb_struct#diff. == game_difficulty_none)
3049 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Current games of type {}", tag_uint_to_str(clienttag_str, cbdata.tag));
3050 else
3051 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Current games of type {} {}", tag_uint_to_str(clienttag_str, cbdata.tag), difficulty);
3052 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3053 }
3054
3055 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, " ------name------ p -status- --------type--------- count ");
3056 if (!cbdata.tagcxx . . $ pvpgn/bnetd/glist_cb_struct#tag.)
3057 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "ctag ");
3058 if ((!prefs_get_hide_addrcxx . . $ pvpgn/bnetd/prefs_get_hide_addr(db52760e79bf9054).()) || (account_get_command_groupscxx . . $ pvpgn/bnetd/account_get_command_groups(c7ab9369555c44b8).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) & command_get_groupcxx . . $ pvpgn/bnetd/command_get_group(c61c63047ce273de).("/admin-addr"))) /* default to false */
3059 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "--------addr--------");
3060 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3061 gamelist_traversecxx . . $ pvpgn/bnetd/gamelist_traverse(c7b2023d64399da8).(_glist_cbcxx . . $ pvpgn/bnetd/_glist_cb(7b7c187348591887)., &cbdata, gamelist_source_none);
3062
3063 return 0;
3064 }
3065
3066 static int _handle_channels_commandcxx . . $ pvpgn/bnetd/_handle_channels_command(2e9022cda97b266d).(t_connection * c, char const *text)
3067 {
3068 t_elemcxx . . $ pvpgn/t_elem# const * curr;
3069 t_channelcxx . . $ pvpgn/bnetd/t_channel# const * channel;
3070 t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag;
3071 t_connection const * conn;
3072 t_accountcxx . . $ pvpgn/bnetd/t_account# * acc;
3073 char const * name;
3074 int first;
3075
3076 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
3077
3078 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
3079 {
3080 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3081 return -1;
3082 }
3083 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // clienttag
3084
3085 if (text[0] == '\0')
3086 {
3087 clienttag = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c);
3088 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Currently accessible channels:"));
3089 }
3090 else if (strcasecmp(text, "all") == 0)
3091 {
3092 clienttag = 0;
3093 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "All current channels:"));
3094 }
3095 else
3096 {
3097 if (!(clienttag = tag_validate_clientcxx . . $ pvpgn/tag_validate_client(c61c63047ce273de).(text)))
3098 {
3099 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3100 return -1;
3101 }
3102 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Current channels of type {}", text);
3103 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3104 }
3105
3106 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, " -----------name----------- users ----admin/operator----");
3107 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3108 LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(channellist(), curr)
3109 {
3110 channel = (t_channelcxx . . $ pvpgn/bnetd/t_channel#*)elem_get_data(curr);
3111 if ((!(channel_get_flagscxx . . $ pvpgn/bnetd/channel_get_flags(6768ecacf43d05ec).(channel) & channel_flags_clancxx . . $ pvpgn/bnetd/channel_flags_clan.)) && (!clienttag || !prefs_get_hide_temp_channelscxx . . $ pvpgn/bnetd/prefs_get_hide_temp_channels(db52760e79bf9054).() || channel_get_permanentcxx . . $ pvpgn/bnetd/channel_get_permanent(28c764f7c20ec9b2).(channel)) &&
3112 (!clienttag || !channel_get_clienttagcxx . . $ pvpgn/bnetd/channel_get_clienttag(6768ecacf43d05ec).(channel) ||
3113 channel_get_clienttagcxx . . $ pvpgn/bnetd/channel_get_clienttag(6768ecacf43d05ec).(channel) == clienttag) &&
3114 ((channel_get_maxcxx . . $ pvpgn/bnetd/channel_get_max(28c764f7c20ec9b2).(channel) != 0) || //only show restricted channels to OPs and Admins
3115 ((channel_get_maxcxx . . $ pvpgn/bnetd/channel_get_max(28c764f7c20ec9b2).(channel) == 0 && account_is_operator_or_admincxx . . $ pvpgn/bnetd/account_is_operator_or_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)))) &&
3116 (!(channel_get_flagscxx . . $ pvpgn/bnetd/channel_get_flags(6768ecacf43d05ec).(channel) & channel_flags_thevoidcxx . . $ pvpgn/bnetd/channel_flags_thevoid.)) // don't list TheVoid
3117 )
3118 {
3119
3120 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), " %-26.26s %5d - ",
3121 channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel),
3122 channel_get_lengthcxx . . $ pvpgn/bnetd/channel_get_length(28c764f7c20ec9b2).(channel));
3123
3124 first = 1;
3125
3126 for (conn = channel_get_firstcxx . . $ pvpgn/bnetd/channel_get_first(77c4a1edc1ac6ba1).(channel); conn; conn = channel_get_nextcxx . . $ pvpgn/bnetd/channel_get_next(181375335219f0cb).())
3127 {
3128 acc = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(conn);
3129 if (account_is_operator_or_admincxx . . $ pvpgn/bnetd/account_is_operator_or_admin(4b12bc5edcfaeac7).(acc, channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) ||
3130 channel_conn_is_tmpOPcxx . . $ pvpgn/bnetd/channel_conn_is_tmpOP(7159c29bb3f93f5f).(channel, account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(acc)))
3131 {
3132 name = conn_get_loggedusercxx . . $ pvpgn/bnetd/conn_get_loggeduser(c99dbccf638f5c6).(conn);
3133 if (stdcxx . . $ std/::strlen(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.) + stdcxx . . $ std/::strlen(name) + 6 >= MAX_MESSAGE_LENcxx . . $ MAX_MESSAGE_LEN.) break;
3134 if (!first) stdcxx . . $ std/::strcat(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., " ,");
3135 stdcxx . . $ std/::strcat(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., name);
3136 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(acc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1) stdcxx . . $ std/::strcat(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "(A)");
3137 else if (account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(acc, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1) stdcxx . . $ std/::strcat(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "(O)");
3138 else if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(acc, channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) == 1) stdcxx . . $ std/::strcat(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "(a)");
3139 else if (account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(acc, channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)) == 1) stdcxx . . $ std/::strcat(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "(o)");
3140 first = 0;
3141 }
3142 }
3143
3144 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
3145 }
3146 }
3147
3148 return 0;
3149 }
3150
3151 static int _handle_addacct_commandcxx . . $ pvpgn/bnetd/_handle_addacct_command(2e9022cda97b266d).(t_connection * c, char const *text)
3152 {
3153 unsigned int i;
3154 t_accountcxx . . $ pvpgn/bnetd/t_account# * temp;
3155 t_hashcxx . . $ pvpgn/t_hash# passhash;
3156 char const * username, *pass;
3157
3158 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
3159
3160 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
3161 {
3162 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3163 return -1;
3164 }
3165 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
3166
3167 if (account_check_namecxx . . $ pvpgn/bnetd/account_check_name(5c4306d8553b3696).(username) < 0) {
3168 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Account name contains some invalid symbol!"));
3169 return -1;
3170 }
3171
3172 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).() > MAX_USERPASS_LENcxx . . $ MAX_USERPASS_LEN.)
3173 {
3174 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Maximum password length allowed is {}", MAX_USERPASS_LEN);
3175 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3176 return -1;
3177 }
3178 for (i = 0; i < args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).(); i++)
3179 args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2][cxx . . $ std/__cxx11/basic_string#`operator[]`(7b73c3179b3cb3ad).i] = safe_tolowercxx . . $ `src/common/xstring.h:41:10`!(args[2][i]);
3180 pass = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // password
3181
3182
3183 bnet_hashcxx . . $ pvpgn/bnet_hash(2a8392f275be648).(&passhash, stdcxx . . $ std/::strlen(pass), pass);
3184
3185 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Trying to add account \"{}\" with password \"{}\"", username, pass);
3186 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3187
3188 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Hash is: {}", hash_get_str(passhash));
3189 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3190
3191 temp = accountlist_create_accountcxx . . $ pvpgn/bnetd/accountlist_create_account(fdad4c38d937b650).(username, hash_get_strcxx . . $ pvpgn/hash_get_str(d917ea147d03f908).(passhash));
3192 if (!temp) {
3193 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Failed to create account!"));
3194 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_debugcxx . . $ pvpgn/eventlog_level_debug., __FUNCTION__, "[{}] account \"{}\" not created (failed)", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), username);
3195 return -1;
3196 }
3197
3198 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Account {} created.", account_get_uidcxx . . $ `src/bnetd/account.h:91:9`!(temp));
3199 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3200 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_debugcxx . . $ pvpgn/eventlog_level_debug., __FUNCTION__, "[{}] account \"{}\" created", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), username);
3201
3202 return 0;
3203 }
3204
3205 static int _handle_chpass_commandcxx . . $ pvpgn/bnetd/_handle_chpass_command(2e9022cda97b266d).(t_connection * c, char const *text)
3206 {
3207 unsigned int i;
3208 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
3209 t_accountcxx . . $ pvpgn/bnetd/t_account# * temp;
3210 t_hashcxx . . $ pvpgn/t_hash# passhash;
3211 char const * username;
3212 stdcxx . . $ std/::stringcxx . . $ std/string# passcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).;
3213
3214 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
3215
3216 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
3217 {
3218 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3219 return -1;
3220 }
3221
3222 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
3223 {
3224 username = conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(c);
3225 pass =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1];
3226 }
3227 else
3228 {
3229 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
3230 pass =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2];
3231 }
3232
3233 temp = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username);
3234
3235 account = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c);
3236
3237 if ((temp == account && account_get_auth_changepasscxx . . $ pvpgn/bnetd/account_get_auth_changepass(367bfb076f70247b).(account) == 0) || /* default to true */
3238 (temp != account && !(account_get_command_groupscxx . . $ pvpgn/bnetd/account_get_command_groups(c7ab9369555c44b8).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) & command_get_groupcxx . . $ pvpgn/bnetd/command_get_group(c61c63047ce273de).("/admin-chpass")))) /* default to false */
3239 {
3240 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "[{}] password change for \"{}\" refused (no change access)", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), username);
3241 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Only admins may change passwords for other accounts."));
3242 return -1;
3243 }
3244
3245 if (!temp)
3246 {
3247 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Account does not exist."));
3248 return -1;
3249 }
3250
3251 if (pass.lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).() > MAX_USERPASS_LENcxx . . $ MAX_USERPASS_LEN.)
3252 {
3253 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Maximum password length allowed is {}", MAX_USERPASS_LEN);
3254 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3255 return -1;
3256 }
3257
3258 for (i = 0; i < pass.lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).(); i++)
3259 pass[cxx . . $ std/__cxx11/basic_string#`operator[]`(7b73c3179b3cb3ad).i] = safe_tolowercxx . . $ `src/common/xstring.h:41:10`!(pass[i]);
3260
3261 bnet_hashcxx . . $ pvpgn/bnet_hash(2a8392f275be648).(&passhash, pass.lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).(), pass.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3262
3263 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Trying to change password for account \"{}\" to \"{}\"", username, pass.c_str());
3264 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3265
3266 if (account_set_passcxx . . $ pvpgn/bnetd/account_set_pass(4b12bc5edcfaeac7).(temp, hash_get_strcxx . . $ pvpgn/hash_get_str(d917ea147d03f908).(passhash)) < 0)
3267 {
3268 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Unable to set password."));
3269 return -1;
3270 }
3271
3272 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(account, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1 ||
3273 account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(account, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1) {
3274 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Password for account {} updated.", account_get_uidcxx . . $ `src/bnetd/account.h:91:9`!(temp));
3275 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3276
3277 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Hash is: {}", hash_get_str(passhash));
3278 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3279 }
3280 else {
3281 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Password for account {} updated.", username);
3282 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3283 }
3284
3285 return 0;
3286 }
3287
3288 static int _handle_connections_commandcxx . . $ pvpgn/bnetd/_handle_connections_command(2e9022cda97b266d).(t_connection *c, char const *text)
3289 {
3290 t_elemcxx . . $ pvpgn/t_elem# const * curr;
3291 t_connection * conn;
3292 char name[19];
3293 char const * channel_name;
3294 char clienttag_str[5];
3295
3296 if (!prefs_get_enable_conn_allcxx . . $ pvpgn/bnetd/prefs_get_enable_conn_all(db52760e79bf9054).() && !(account_get_command_groupscxx . . $ pvpgn/bnetd/account_get_command_groups(c7ab9369555c44b8).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) & command_get_groupcxx . . $ pvpgn/bnetd/command_get_group(c61c63047ce273de).("/admin-con"))) /* default to false */
3297 {
3298 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command is only enabled for admins."));
3299 return -1;
3300 }
3301
3302 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Current connections:"));
3303
3304 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
3305 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
3306
3307 if (text[0] == '\0')
3308 {
3309 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, " -class -tag -----name------ -lat(ms)- ----channel---- --game--");
3310 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3311 }
3312 else
3313 if (stdcxx . . $ std/::strcmp(text, "all") == 0) /* print extended info */
3314 {
3315 if (prefs_get_hide_addrcxx . . $ pvpgn/bnetd/prefs_get_hide_addr(db52760e79bf9054).() && !(account_get_command_groupscxx . . $ pvpgn/bnetd/account_get_command_groups(c7ab9369555c44b8).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) & command_get_groupcxx . . $ pvpgn/bnetd/command_get_group(c61c63047ce273de).("/admin-addr")))
3316 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, " -#- -class ----state--- -tag -----name------ -session-- -flag- -lat(ms)- ----channel---- --game--");
3317 else
3318 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, " -#- -class ----state--- -tag -----name------ -session-- -flag- -lat(ms)- ----channel---- --game-- ---------addr--------");
3319 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3320 }
3321 else
3322 {
3323 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Unknown option."));
3324 return -1;
3325 }
3326
3327 LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(connlist(), curr)
3328 {
3329 conn = (t_connection*)elem_get_data(curr);
3330 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(name, sizeof name, "%s", conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(conn) ? conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(conn) : "(none)");
3331
3332 if (conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(conn) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
3333 channel_name = channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(conn));
3334 else
3335 channel_name = localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "none").c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
3336
3337 stdcxx . . $ std/::stringcxx . . $ std/string# game_namecxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).;
3338 if (conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(conn) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
3339 game_name =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). game_get_namecxx . . $ pvpgn/bnetd/game_get_name(743fb6d1aa411c4e).(conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(conn));
3340 else
3341 game_name =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "none");
3342
3343 if (text[0] == '\0')
3344 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), " %-6.6s %4.4s %-15.15s %9u %-16.16s %-8.8s",
3345 conn_class_get_strcxx . . $ pvpgn/bnetd/conn_class_get_str(197fb956ae47a8f8).(conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(conn)),
3346 tag_uint_to_strcxx . . $ pvpgn/tag_uint_to_str(d172961b102a89a5).(clienttag_str, conn_get_fake_clienttagcxx . . $ pvpgn/bnetd/conn_get_fake_clienttag(8bd2285a65940781).(conn)),
3347 name,
3348 conn_get_latencycxx . . $ pvpgn/bnetd/conn_get_latency(8bd2285a65940781).(conn),
3349 channel_name,
3350 game_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3351 else
3352 if (prefs_get_hide_addrcxx . . $ pvpgn/bnetd/prefs_get_hide_addr(db52760e79bf9054).() && !(account_get_command_groupscxx . . $ pvpgn/bnetd/account_get_command_groups(c7ab9369555c44b8).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) & command_get_groupcxx . . $ pvpgn/bnetd/command_get_group(c61c63047ce273de).("/admin-addr"))) /* default to false */
3353 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), " %3d %-6.6s %-12.12s %4.4s %-15.15s 0x%08x 0x%04x %9u %-16.16s %-8.8s",
3354 conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(conn),
3355 conn_class_get_strcxx . . $ pvpgn/bnetd/conn_class_get_str(197fb956ae47a8f8).(conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(conn)),
3356 conn_state_get_strcxx . . $ pvpgn/bnetd/conn_state_get_str(8beab9044c5fcbfa).(conn_get_statecxx . . $ pvpgn/bnetd/conn_get_state(14586157a79399d4).(conn)),
3357 tag_uint_to_strcxx . . $ pvpgn/tag_uint_to_str(d172961b102a89a5).(clienttag_str, conn_get_fake_clienttagcxx . . $ pvpgn/bnetd/conn_get_fake_clienttag(8bd2285a65940781).(conn)),
3358 name,
3359 conn_get_sessionkeycxx . . $ pvpgn/bnetd/conn_get_sessionkey(8bd2285a65940781).(conn),
3360 conn_get_flagscxx . . $ pvpgn/bnetd/conn_get_flags(8bd2285a65940781).(conn),
3361 conn_get_latencycxx . . $ pvpgn/bnetd/conn_get_latency(8bd2285a65940781).(conn),
3362 channel_name,
3363 game_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3364 else
3365 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), " %3d %-6.6s %-12.12s %4.4s %-15.15s 0x%08x 0x%04x %9u %-16.16s %-8.8s %.16s",
3366 conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(conn),
3367 conn_class_get_strcxx . . $ pvpgn/bnetd/conn_class_get_str(197fb956ae47a8f8).(conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(conn)),
3368 conn_state_get_strcxx . . $ pvpgn/bnetd/conn_state_get_str(8beab9044c5fcbfa).(conn_get_statecxx . . $ pvpgn/bnetd/conn_get_state(14586157a79399d4).(conn)),
3369 tag_uint_to_strcxx . . $ pvpgn/tag_uint_to_str(d172961b102a89a5).(clienttag_str, conn_get_fake_clienttagcxx . . $ pvpgn/bnetd/conn_get_fake_clienttag(8bd2285a65940781).(conn)),
3370 name,
3371 conn_get_sessionkeycxx . . $ pvpgn/bnetd/conn_get_sessionkey(8bd2285a65940781).(conn),
3372 conn_get_flagscxx . . $ pvpgn/bnetd/conn_get_flags(8bd2285a65940781).(conn),
3373 conn_get_latencycxx . . $ pvpgn/bnetd/conn_get_latency(8bd2285a65940781).(conn),
3374 channel_name,
3375 game_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(),
3376 addr_num_to_addr_strcxx . . $ pvpgn/addr_num_to_addr_str(9313bf3c546cb16).(conn_get_addrcxx . . $ pvpgn/bnetd/conn_get_addr(8bd2285a65940781).(conn), conn_get_portcxx . . $ pvpgn/bnetd/conn_get_port(70207a9c46bcade7).(conn)));
3377
3378 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
3379 }
3380
3381 return 0;
3382 }
3383
3384 static int _handle_finger_commandcxx . . $ pvpgn/bnetd/_handle_finger_command(2e9022cda97b266d).(t_connection * c, char const *text)
3385 {
3386 char const * dest;
3387 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
3388 t_connection * conn;
3389 char * tok;
3390 t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * clanmemb;
3391 stdcxx . . $ std/::time_tcxx . . $ std/time_t# then;
3392 struct stdcxx . . $ std/::tmcxx . . $ tm# * tmthen;
3393
3394 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
3395
3396 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
3397 {
3398 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3399 return -1;
3400 }
3401 dest = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username;
3402
3403 if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(dest)))
3404 {
3405 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid user."));
3406 return -1;
3407 }
3408
3409 then = account_get_ll_ctimecxx . . $ pvpgn/bnetd/account_get_ll_ctime(c7ab9369555c44b8).(account);
3410 tmthen = stdcxx . . $ std/::localtimecxx . . $ std/localtime(7d91c9e5f6bb884b).(&then); /* FIXME: determine user's timezone */
3411
3412 // do not display sex if empty
3413 stdcxx . . $ std/::stringcxx . . $ std/string# sex = account_get_sexcxx . . $ pvpgn/bnetd/account_get_sex(d4e1318117ac9d0e).(account);
3414 stdcxx . . $ std/::stringcxx . . $ std/string# pattern = "Login: {} {} Sex: {}"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).;
3415 pattern =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). (sex.lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).() > 0)
3416 ? patterncxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).
3417 : pattern.substrcxx . . $ std/__cxx11/basic_string#substr(149c655009c9bbd2).(0, pattern.findcxx . . $ std/__cxx11/basic_string#find(b733e800f6f8fb8b).("Sex: ", 0));
3418
3419 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, pattern.c_str(),
3420 account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account),
3421 account_get_uidcxx . . $ `src/bnetd/account.h:91:9`!(account),
3422 account_get_sex(account));
3423 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3424
3425 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "%a %b %d %H:%M %Y", tmthen);
3426 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Created: {}", msgtemp0);
3427 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3428
3429 if ((clanmemb = account_get_clanmembercxx . . $ pvpgn/bnetd/account_get_clanmember(4ce48d4e65930331).(account)))
3430 {
3431 t_clancxx . . $ pvpgn/bnetd/t_clan# * clan;
3432 char status;
3433
3434 if ((clan = clanmember_get_clancxx . . $ pvpgn/bnetd/clanmember_get_clan(18fc6df730a9c54c).(clanmemb)))
3435 {
3436 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Clan: {}", clan_get_name(clan));
3437 if ((status = clanmember_get_statuscxx . . $ pvpgn/bnetd/clanmember_get_status(54878624261d8c60).(clanmemb)))
3438 {
3439 switch (status)
3440 {
3441 case CLAN_CHIEFTAINcxx . . $ `src/bnetd/clan.h:98:9`!:
3442 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, " Rank: Chieftain");
3443 break;
3444 case CLAN_SHAMANcxx . . $ `src/bnetd/clan.h:99:9`!:
3445 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, " Rank: Shaman");
3446 break;
3447 case CLAN_GRUNTcxx . . $ `src/bnetd/clan.h:100:9`!:
3448 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, " Rank: Grunt");
3449 break;
3450 case CLAN_PEONcxx . . $ `src/bnetd/clan.h:101:9`!:
3451 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, " Rank: Peon");
3452 break;
3453 default:;
3454 }
3455 }
3456 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3457
3458 }
3459 }
3460
3461 // do not display age if empty
3462 stdcxx . . $ std/::stringcxx . . $ std/string# age = account_get_agecxx . . $ pvpgn/bnetd/account_get_age(d4e1318117ac9d0e).(account);
3463 pattern =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "Location: {} Age: {}";
3464 pattern =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). (age.lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).() > 0)
3465 ? patterncxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).
3466 : pattern.substrcxx . . $ std/__cxx11/basic_string#substr(149c655009c9bbd2).(0, pattern.findcxx . . $ std/__cxx11/basic_string#find(b733e800f6f8fb8b).("Age: ", 0));
3467 stdcxx . . $ std/::stringcxx . . $ std/string# loc = account_get_loccxx . . $ pvpgn/bnetd/account_get_loc(d4e1318117ac9d0e).(account);
3468 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, pattern.c_str(),
3469 (!loc.empty()) ? loc : "unknown",
3470 account_get_age(account));
3471 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3472
3473 if ((conn = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(dest)))
3474 {
3475 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Client: {} Ver: {} Country: {}",
3476 clienttag_get_title(conn_get_clienttag(conn)),
3477 conn_get_clientver(conn),
3478 conn_get_country(conn));
3479 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3480 }
3481
3482 const char* const ip_tmp = account_get_ll_ipcxx . . $ pvpgn/bnetd/account_get_ll_ip(4b37305d4a4563d0).(account);
3483 stdcxx . . $ std/::stringcxx . . $ std/string# ipcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).(ip_tmp ? ip_tmp : "");
3484 if (ip.emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() == true ||
3485 !(account_get_command_groupscxx . . $ pvpgn/bnetd/account_get_command_groups(c7ab9369555c44b8).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) & command_get_groupcxx . . $ pvpgn/bnetd/command_get_group(c61c63047ce273de).("/admin-addr"))) /* default to false */
3486 ip =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "unknown");
3487
3488 {
3489
3490 then = account_get_ll_timecxx . . $ pvpgn/bnetd/account_get_ll_time(c7ab9369555c44b8).(account);
3491 tmthen = stdcxx . . $ std/::localtimecxx . . $ std/localtime(7d91c9e5f6bb884b).(&then); /* FIXME: determine user's timezone */
3492 if (tmthen)
3493 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "%a %b %d %H:%M %Y", tmthen);
3494 else
3495 stdcxx . . $ std/::strcpy(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "?");
3496
3497 if (!(conn))
3498 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Last login {} from ", msgtemp0);
3499 else
3500 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "On since {} from ", msgtemp0);
3501 }
3502 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). ip;
3503 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3504
3505 /* check /admin-addr for admin privileges */
3506 if ((account_get_command_groupscxx . . $ pvpgn/bnetd/account_get_command_groups(c7ab9369555c44b8).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) & command_get_groupcxx . . $ pvpgn/bnetd/command_get_group(c61c63047ce273de).("/admin-addr")))
3507 {
3508 stdcxx . . $ std/::stringcxx . . $ std/string# yes = localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Yes");
3509 stdcxx . . $ std/::stringcxx . . $ std/string# no = localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "No");
3510 /* the player who requested /finger has admin privileges
3511 give him more info about the one he queries;
3512 is_admin, is_operator, is_locked, email */
3513 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Operator: {}, Admin: {}, Locked: {}, Muted: {}",
3514 account_get_auth_operator(account, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1 ? yes : no,
3515 account_get_auth_admin(account, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1 ? yes : no,
3516 account_get_auth_lock(account) == 1 ? yes : no,
3517 account_get_auth_mute(account) == 1 ? yes : no);
3518 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3519
3520 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Email: {}", account_get_email(account));
3521 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3522
3523 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Last login Owner: {}", account_get_ll_owner(account));
3524 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3525 }
3526
3527
3528 if (conn)
3529 {
3530 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Idle {}", seconds_to_timestr(conn_get_idletime(conn)));
3531 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3532 }
3533
3534 stdcxx . . $ std/::strncpy(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., account_get_desccxx . . $ pvpgn/bnetd/account_get_desc(d4e1318117ac9d0e).(account).c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.));
3535 msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.[sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.)-1] = '\0';
3536 for (tok = stdcxx . . $ std/::strtok(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "\r\n"); tok; tok = stdcxx . . $ std/::strtok(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, "\r\n"))
3537 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, tok);
3538 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, "");
3539
3540 return 0;
3541 }
3542
3543
3544 /* FIXME: do we want to show just Server Admin or Channel Admin Also? [Omega] */
3545 static int _handle_admins_commandcxx . . $ pvpgn/bnetd/_handle_admins_command(2e9022cda97b266d).(t_connection * c, char const *text)
3546 {
3547 unsigned int i;
3548 t_elemcxx . . $ pvpgn/t_elem# const * curr;
3549 t_connection * tc;
3550 char const * nick;
3551
3552 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "%s", localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Currently logged on Administrators:").c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3553 i = stdcxx . . $ std/::strlen(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
3554 LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(connlist(), curr)
3555 {
3556 tc = (t_connection*)elem_get_data(curr);
3557 if (!tc)
3558 continue;
3559 if (!conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(tc))
3560 continue;
3561 if (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(tc), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) == 1)
3562 {
3563 if ((nick = conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(tc)))
3564 {
3565 if (i + stdcxx . . $ std/::strlen(nick) + 2 > sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.)) /* " ", name, '\0' */
3566 {
3567 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
3568 i = 0;
3569 }
3570 stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(&msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.[i], " %s", nick);
3571 i += stdcxx . . $ std/::strlen(&msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.[i]);
3572 }
3573 }
3574 }
3575 if (i > 0)
3576 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
3577
3578 return 0;
3579 }
3580
3581 static int _handle_quit_commandcxx . . $ pvpgn/bnetd/_handle_quit_command(2e9022cda97b266d).(t_connection * c, char const *text)
3582 {
3583 if (conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(c))
3584 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_warncxx . . $ pvpgn/eventlog_level_warn., __FUNCTION__, "[{}] user '{}' tried to disconnect while in game, cheat attempt ?", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), conn_get_loggedusercxx . . $ pvpgn/bnetd/conn_get_loggeduser(c99dbccf638f5c6).(c));
3585 else {
3586 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Connection closed."));
3587 conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(c, conn_state_destroy);
3588 }
3589
3590 return 0;
3591 }
3592
3593 static int _handle_kill_commandcxx . . $ pvpgn/bnetd/_handle_kill_command(2e9022cda97b266d).(t_connection * c, char const *text)
3594 {
3595 t_connection * user;
3596 char const * username, * min;
3597
3598 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
3599 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
3600 min = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // minutes of ban
3601
3602 if (username[0] == '\0' || (username[0] == '#' && (username[1] < '0' || username[1] > '9')))
3603 {
3604 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3605 return -1;
3606 }
3607
3608 if (username[0] == '#') {
3609 if (!(user = connlist_find_connection_by_socketcxx . . $ pvpgn/bnetd/connlist_find_connection_by_socket(f341f3d34aa180c2).(stdcxx . . $ std/::atoi(username + 1)))) {
3610 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That connection doesn't exist."));
3611 return -1;
3612 }
3613 }
3614 else {
3615 if (!(user = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(username))) {
3616 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That user is not logged in?"));
3617 return -1;
3618 }
3619 }
3620
3621 if (min[0] != '\0' && ipbanlist_addcxx . . $ pvpgn/bnetd/ipbanlist_add(648564aa43f2d1f5).(c, addr_num_to_ip_strcxx . . $ pvpgn/addr_num_to_ip_str(81a3ae90da26a711).(conn_get_addrcxx . . $ pvpgn/bnetd/conn_get_addr(8bd2285a65940781).(user)), ipbanlist_str_to_time_tcxx . . $ pvpgn/bnetd/ipbanlist_str_to_time_t(5248ec5b220e07bd).(c, min)) == 0)
3622 {
3623 ipbanlist_savecxx . . $ pvpgn/bnetd/ipbanlist_save(5c4306d8553b3696).(prefs_get_ipbanfilecxx . . $ pvpgn/bnetd/prefs_get_ipbanfile(33a1f659e94feb42).());
3624 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(user, message_type_info, user, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "An admin has closed your connection and banned your IP address."));
3625 }
3626 else
3627 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(user, message_type_info, user, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Connection closed by admin."));
3628 conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(user, conn_state_destroy);
3629
3630 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Operation successful."));
3631
3632 return 0;
3633 }
3634
3635 static int _handle_killsession_commandcxx . . $ pvpgn/bnetd/_handle_killsession_command(2e9022cda97b266d).(t_connection * c, char const *text)
3636 {
3637 t_connection * user;
3638 char const * session, *min;
3639
3640
3641 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
3642
3643 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
3644 {
3645 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3646 return -1;
3647 }
3648 session = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // session id
3649 min = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // minutes of ban
3650
3651 if (!stdcxx . . $ std/::isxdigitcxx . . $ std/isxdigit(a1851578aea3f541).((int)session[0]))
3652 {
3653 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That is not a valid session."));
3654 return -1;
3655 }
3656 if (!(user = connlist_find_connection_by_sessionkeycxx . . $ pvpgn/bnetd/connlist_find_connection_by_sessionkey(d9e2ca1f510d44cc).((unsigned int)stdcxx . . $ std/::strtoul(session, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 16))))
3657 {
3658 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That session does not exist."));
3659 return -1;
3660 }
3661 if (min[0] != '\0' && ipbanlist_addcxx . . $ pvpgn/bnetd/ipbanlist_add(648564aa43f2d1f5).(c, addr_num_to_ip_strcxx . . $ pvpgn/addr_num_to_ip_str(81a3ae90da26a711).(conn_get_addrcxx . . $ pvpgn/bnetd/conn_get_addr(8bd2285a65940781).(user)), ipbanlist_str_to_time_tcxx . . $ pvpgn/bnetd/ipbanlist_str_to_time_t(5248ec5b220e07bd).(c, min)) == 0)
3662 {
3663 ipbanlist_savecxx . . $ pvpgn/bnetd/ipbanlist_save(5c4306d8553b3696).(prefs_get_ipbanfilecxx . . $ pvpgn/bnetd/prefs_get_ipbanfile(33a1f659e94feb42).());
3664 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(user, message_type_info, user, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Connection closed by admin and banned your IP's."));
3665 }
3666 else
3667 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(user, message_type_info, user, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Connection closed by admin."));
3668 conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(user, conn_state_destroy);
3669 return 0;
3670 }
3671
3672 static int _handle_gameinfo_commandcxx . . $ pvpgn/bnetd/_handle_gameinfo_command(2e9022cda97b266d).(t_connection * c, char const *text)
3673 {
3674 t_game const * game;
3675 char clienttag_str[5];
3676
3677 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
3678 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
3679
3680 if (text[0] == '\0')
3681 {
3682 // current user game
3683 if (!(game = conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(c)))
3684 {
3685 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are not in a game."));
3686 return -1;
3687 }
3688 }
3689 else
3690 if (!(game = gamelist_find_game_availablecxx . . $ pvpgn/bnetd/gamelist_find_game_available(e383c2f40f0b546f).(text, conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c), game_type_all)))
3691 {
3692 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That game does not exist."));
3693 return -1;
3694 }
3695 stdcxx . . $ std/::stringcxx . . $ std/string# pub = localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "public");
3696 stdcxx . . $ std/::stringcxx . . $ std/string# prv = localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "private");
3697 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Name: {} ID: {} ({})", game_get_name(game), game_get_id(game), game_get_flag(game) != game_flag_private ? pub : prv);
3698 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3699
3700 {
3701 t_accountcxx . . $ pvpgn/bnetd/t_account# * owner;
3702 char const * tname;
3703 char const * namestr;
3704
3705 if (!(owner = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(game_get_ownercxx . . $ pvpgn/bnetd/game_get_owner(44263c0cd290cfb5).(game))))
3706 {
3707 tname = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3708 namestr = localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "none").c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
3709 }
3710 else
3711 if (!(tname = conn_get_loggedusercxx . . $ pvpgn/bnetd/conn_get_loggeduser(c99dbccf638f5c6).(game_get_ownercxx . . $ pvpgn/bnetd/game_get_owner(44263c0cd290cfb5).(game))))
3712 namestr = localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "unknown").c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
3713 else
3714 namestr = tname;
3715
3716 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Owner: {}", namestr);
3717
3718 }
3719 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3720
3721 if (!prefs_get_hide_addrcxx . . $ pvpgn/bnetd/prefs_get_hide_addr(db52760e79bf9054).() || (account_get_command_groupscxx . . $ pvpgn/bnetd/account_get_command_groups(c7ab9369555c44b8).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) & command_get_groupcxx . . $ pvpgn/bnetd/command_get_group(c61c63047ce273de).("/admin-addr"))) /* default to false */
3722 {
3723 unsigned int addr;
3724 unsigned short port;
3725 unsigned int taddr;
3726 unsigned short tport;
3727
3728 taddr = addr = game_get_addrcxx . . $ pvpgn/bnetd/game_get_addr(d7b85b5cd2056731).(game);
3729 tport = port = game_get_portcxx . . $ pvpgn/bnetd/game_get_port(5675c6bb4f2bafa6).(game);
3730 trans_netcxx . . $ pvpgn/trans_net(cf0ba8ec647fd542).(conn_get_addrcxx . . $ pvpgn/bnetd/conn_get_addr(8bd2285a65940781).(c), &taddr, &tport);
3731
3732 if (taddr == addr && tport == port)
3733 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Address: {}",
3734 addr_num_to_addr_str(addr, port));
3735 else
3736 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Address: {} (trans {})",
3737 addr_num_to_addr_str(addr, port),
3738 addr_num_to_addr_str(taddr, tport));
3739 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3740 }
3741
3742 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Client: {} (version {}, startver {})", tag_uint_to_str(clienttag_str, game_get_clienttag(game)), vernum_to_verstr(game_get_version(game)), game_get_startver(game));
3743 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3744
3745 {
3746 stdcxx . . $ std/::time_tcxx . . $ std/time_t# gametime;
3747 struct stdcxx . . $ std/::tmcxx . . $ tm# * gmgametime;
3748
3749 gametime = game_get_create_timecxx . . $ pvpgn/bnetd/game_get_create_time(57cecc7178e653af).(game);
3750 if (!(gmgametime = stdcxx . . $ std/::localtimecxx . . $ std/localtime(7d91c9e5f6bb884b).(&gametime)))
3751 stdcxx . . $ std/::strcpy(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "?");
3752 else
3753 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), GAME_TIME_FORMATcxx . . $ `src/common/setup_before.h:107:9`!, gmgametime);
3754 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Created: {}", msgtemp0);
3755 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3756
3757 gametime = game_get_start_timecxx . . $ pvpgn/bnetd/game_get_start_time(57cecc7178e653af).(game);
3758 if (gametime != (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)0)
3759 {
3760 if (!(gmgametime = stdcxx . . $ std/::localtimecxx . . $ std/localtime(7d91c9e5f6bb884b).(&gametime)))
3761 stdcxx . . $ std/::strcpy(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "?");
3762 else
3763 stdcxx . . $ std/::strftimecxx . . $ std/strftime(689617e6f2fd1a9a).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), GAME_TIME_FORMATcxx . . $ `src/common/setup_before.h:107:9`!, gmgametime);
3764 }
3765 else
3766 stdcxx . . $ std/::strcpy(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., "");
3767 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Started: {}", msgtemp0);
3768 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3769 }
3770
3771 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Status: {}", game_status_get_str(game_get_status(game)));
3772 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3773
3774 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Type: {}", game_type_get_str(game_get_type(game)));
3775 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3776
3777 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Speed: {}", game_speed_get_str(game_get_speed(game)));
3778 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3779
3780 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Difficulty: {}", game_difficulty_get_str(game_get_difficulty(game)));
3781 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3782
3783 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Option: {}", game_option_get_str(game_get_option(game)));
3784 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3785
3786 {
3787 char const * mapname;
3788
3789 if (!(mapname = game_get_mapnamecxx . . $ pvpgn/bnetd/game_get_mapname(743fb6d1aa411c4e).(game)))
3790 mapname = localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "unknown").c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
3791 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Map: {}", mapname);
3792 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3793 }
3794
3795 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Map Size: {}x{}", game_get_mapsize_x(game), game_get_mapsize_y(game));
3796 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3797 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Map Tileset: {}", game_tileset_get_str(game_get_tileset(game)));
3798 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3799 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Map Type: {}", game_maptype_get_str(game_get_maptype(game)));
3800 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3801
3802 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Players: {} current, {} total, {} max", game_get_ref(game), game_get_count(game), game_get_maxplayers(game));
3803 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3804
3805 {
3806 char const * description;
3807
3808 if (!(description = game_get_descriptioncxx . . $ pvpgn/bnetd/game_get_description(743fb6d1aa411c4e).(game)))
3809 description = "";
3810 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Description: {}", description);
3811 }
3812
3813 return 0;
3814 }
3815
3816 static int _handle_ladderactivate_commandcxx . . $ pvpgn/bnetd/_handle_ladderactivate_command(2e9022cda97b266d).(t_connection * c, char const *text)
3817 {
3818 ladderscxx . . $ pvpgn/bnetd/ladders..activatecxx . . $ pvpgn/bnetd/Ladders#activate(49f6e7a06ebc5aa8).();
3819 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Copied current scores to active scores on all ladders."));
3820 return 0;
3821 }
3822
3823 static int _handle_rehash_commandcxx . . $ pvpgn/bnetd/_handle_rehash_command(2e9022cda97b266d).(t_connection * c, char const *text)
3824 {
3825 int mode = restart_mode_allcxx . . $ pvpgn/bnetd/restart_mode_all.; // all by default
3826
3827 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
3828
3829 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
3830 {
3831 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3832 return -1;
3833 }
3834 stdcxx . . $ std/::stringcxx . . $ std/string# mode_str = argscxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1];
3835
3836 if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "all")
3837 mode = restart_mode_allcxx . . $ pvpgn/bnetd/restart_mode_all.;
3838 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "i18n")
3839 mode = restart_mode_i18ncxx . . $ pvpgn/bnetd/restart_mode_i18n.;
3840 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "channels")
3841 mode = restart_mode_channelscxx . . $ pvpgn/bnetd/restart_mode_channels.;
3842 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "realms")
3843 mode = restart_mode_realmscxx . . $ pvpgn/bnetd/restart_mode_realms.;
3844 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "autoupdate")
3845 mode = restart_mode_autoupdatecxx . . $ pvpgn/bnetd/restart_mode_autoupdate.;
3846 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "news")
3847 mode = restart_mode_newscxx . . $ pvpgn/bnetd/restart_mode_news.;
3848 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "versioncheck")
3849 mode = restart_mode_versioncheckcxx . . $ pvpgn/bnetd/restart_mode_versioncheck.;
3850 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ipbans")
3851 mode = restart_mode_ipbanscxx . . $ pvpgn/bnetd/restart_mode_ipbans.;
3852 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "helpfile")
3853 mode = restart_mode_helpfilecxx . . $ pvpgn/bnetd/restart_mode_helpfile.;
3854 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "banners")
3855 mode = restart_mode_bannerscxx . . $ pvpgn/bnetd/restart_mode_banners.;
3856 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "tracker")
3857 mode = restart_mode_trackercxx . . $ pvpgn/bnetd/restart_mode_tracker.;
3858 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "commandgroups")
3859 mode = restart_mode_commandgroupscxx . . $ pvpgn/bnetd/restart_mode_commandgroups.;
3860 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "aliasfile")
3861 mode = restart_mode_aliasfilecxx . . $ pvpgn/bnetd/restart_mode_aliasfile.;
3862 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "transfile")
3863 mode = restart_mode_transfilecxx . . $ pvpgn/bnetd/restart_mode_transfile.;
3864 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "tournament")
3865 mode = restart_mode_tournamentcxx . . $ pvpgn/bnetd/restart_mode_tournament.;
3866 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "icons")
3867 mode = restart_mode_iconscxx . . $ pvpgn/bnetd/restart_mode_icons.;
3868 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "anongame")
3869 mode = restart_mode_anongamecxx . . $ pvpgn/bnetd/restart_mode_anongame.;
3870 else if (mode_str ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "lua")
3871 mode = restart_mode_luacxx . . $ pvpgn/bnetd/restart_mode_lua.;
3872 else
3873 {
3874 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid mode."));
3875 return -1;
3876 }
3877
3878 server_restart_wrapercxx . . $ pvpgn/bnetd/server_restart_wraper(d4f767463ce0a6b3).(mode);
3879 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Rehash of \"{}\" is complete!", mode_str.c_str());
3880 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3881 return 0;
3882 }
3883
3884 /**
3885 * /find <substr to search for inside username>
3886 */
3887 static int _handle_find_commandcxx . . $ pvpgn/bnetd/_handle_find_command(2e9022cda97b266d).(t_connection * c, char const *text)
3888 {
3889 unsigned int i = 0;
3890 t_accountcxx . . $ pvpgn/bnetd/t_account# *account;
3891 char const *tname;
3892 t_entry *curr;
3893 t_hashtable *accountlist_head = accountlistcxx . . $ pvpgn/bnetd/accountlist(be8548fcc1b5d2a).();
3894
3895 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
3896 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
3897 {
3898 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3899 return -1;
3900 }
3901 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
3902
3903 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, " -- name -- similar to {}", text);
3904 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
3905
3906
3907 HASHTABLE_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/hashtable.h:107:9`!(accountlist_head, curr)
3908 {
3909 if (!curr)
3910 {
3911 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL account in list");
3912 }
3913 else
3914 {
3915 account = (t_accountcxx . . $ pvpgn/bnetd/t_account# *)entry_get_data(curr);
3916 if ((tname = accountlist_find_vague_accountcxx . . $ pvpgn/bnetd/accountlist_find_vague_account(f379082f354693e).(account, text)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
3917 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, tname);
3918 return 0;
3919 }
3920 }
3921 }
3922 return 0;
3923 }
3924
3925 /**
3926 * Save changes of accounts and clans from the cache to a storage
3927 */
3928 static int _handle_save_commandcxx . . $ pvpgn/bnetd/_handle_save_command(2e9022cda97b266d).(t_connection * c, char const *text)
3929 {
3930 clanlist_savecxx . . $ pvpgn/bnetd/clanlist_save(b126dc7c1de90089).();
3931
3932 accountlist_savecxx . . $ pvpgn/bnetd/accountlist_save(4c679297bf94b9eb).(FS_FORCEcxx . . $ `src/bnetd/attrlayer.h:27:9`! | FS_ALLcxx . . $ `src/bnetd/attrlayer.h:28:9`!);
3933 accountlist_flushcxx . . $ pvpgn/bnetd/accountlist_flush(4c679297bf94b9eb).(FS_FORCEcxx . . $ `src/bnetd/attrlayer.h:27:9`! | FS_ALLcxx . . $ `src/bnetd/attrlayer.h:28:9`!);
3934
3935 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Pending changes has been saved into the database."));
3936 return 0;
3937 }
3938
3939 static int _handle_shutdown_commandcxx . . $ pvpgn/bnetd/_handle_shutdown_command(2e9022cda97b266d).(t_connection * c, char const *text)
3940 {
3941 char const * dest;
3942 unsigned int delay;
3943
3944 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
3945 dest = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // delay
3946
3947 if (dest[0] == '\0')
3948 delay = prefs_get_shutdown_delaycxx . . $ pvpgn/bnetd/prefs_get_shutdown_delay(db52760e79bf9054).();
3949 else
3950 if (clockstr_to_secondscxx . . $ pvpgn/clockstr_to_seconds(6974107818eeb505).(dest, &delay) < 0)
3951 {
3952 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid delay."));
3953 return -1;
3954 }
3955
3956 server_quit_delaycxx . . $ pvpgn/bnetd/server_quit_delay(d4f767463ce0a6b3).(delay);
3957
3958 if (delay)
3959 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You've initialized the shutdown sequence."));
3960 else
3961 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You've canceled the shutdown sequence."));
3962
3963 return 0;
3964 }
3965
3966 static int _handle_ladderinfo_commandcxx . . $ pvpgn/bnetd/_handle_ladderinfo_command(2e9022cda97b266d).(t_connection * c, char const *text)
3967 {
3968 char const * rank_s, *tag_s;
3969 unsigned int rank;
3970 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
3971 t_teamcxx . . $ pvpgn/bnetd/t_team# * team;
3972 t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag;
3973 const LadderReferencedObjectcxx . . $ pvpgn/bnetd/LadderReferencedObject#* referencedObject;
3974 LadderListcxx . . $ pvpgn/bnetd/LadderList#* ladderList;
3975
3976 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
3977 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
3978 {
3979 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
3980 return -1;
3981 }
3982 rank_s = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // rank
3983 tag_s = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // clienttag
3984
3985 if (str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(rank_s, &rank) < 0 || rank < 1)
3986 {
3987 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_error, c, "Invalid rank.");
3988 return -1;
3989 }
3990
3991 if (!(clienttag = tag_validate_clientcxx . . $ pvpgn/tag_validate_client(c61c63047ce273de).(tag_s)))
3992 {
3993 if (!(clienttag = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c)))
3994 {
3995 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Unable to determine client game."));
3996 return -1;
3997 }
3998 }
3999
4000 if (clienttag == CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`!)
4001 {
4002 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., clienttag, ladder_sort_highestratedcxx . . $ pvpgn/bnetd/ladder_sort_highestrated., ladder_time_activecxx . . $ pvpgn/bnetd/ladder_time_active.));
4003 referencedObject = ladderList->getReferencedObjectcxx . . $ pvpgn/bnetd/LadderList#getReferencedObject(56fd0941de524e93).(rank);
4004 if ((referencedObject) && (account = referencedObject->getAccountcxx . . $ pvpgn/bnetd/LadderReferencedObject#getAccount(bd50dfe41cbbfab3).()))
4005 {
4006 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "StarCraft active %5u: %-20.20s %u/%u/%u rating %u",
4007 rank,
4008 account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account),
4009 account_get_ladder_active_winscxx . . $ pvpgn/bnetd/account_get_ladder_active_wins(44091a2c7ac3910).(account, CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4010 account_get_ladder_active_lossescxx . . $ pvpgn/bnetd/account_get_ladder_active_losses(44091a2c7ac3910).(account, CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4011 account_get_ladder_active_disconnectscxx . . $ pvpgn/bnetd/account_get_ladder_active_disconnects(44091a2c7ac3910).(account, CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4012 account_get_ladder_active_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_active_rating(44091a2c7ac3910).(account, CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.));
4013 }
4014 else
4015 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "StarCraft active %5u: <none>", rank);
4016 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4017
4018 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., clienttag, ladder_sort_highestratedcxx . . $ pvpgn/bnetd/ladder_sort_highestrated., ladder_time_currentcxx . . $ pvpgn/bnetd/ladder_time_current.));
4019 referencedObject = ladderList->getReferencedObjectcxx . . $ pvpgn/bnetd/LadderList#getReferencedObject(56fd0941de524e93).(rank);
4020 if ((referencedObject) && (account = referencedObject->getAccountcxx . . $ pvpgn/bnetd/LadderReferencedObject#getAccount(bd50dfe41cbbfab3).()))
4021 {
4022 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "StarCraft current %5u: %-20.20s %u/%u/%u rating %u",
4023 rank,
4024 account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account),
4025 account_get_ladder_winscxx . . $ pvpgn/bnetd/account_get_ladder_wins(44091a2c7ac3910).(account, CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4026 account_get_ladder_lossescxx . . $ pvpgn/bnetd/account_get_ladder_losses(44091a2c7ac3910).(account, CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4027 account_get_ladder_disconnectscxx . . $ pvpgn/bnetd/account_get_ladder_disconnects(44091a2c7ac3910).(account, CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4028 account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.));
4029 }
4030 else
4031 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "StarCraft current %5u: <none>", rank);
4032 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4033 }
4034 else if (clienttag == CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`!)
4035 {
4036 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., clienttag, ladder_sort_highestratedcxx . . $ pvpgn/bnetd/ladder_sort_highestrated., ladder_time_activecxx . . $ pvpgn/bnetd/ladder_time_active.));
4037 referencedObject = ladderList->getReferencedObjectcxx . . $ pvpgn/bnetd/LadderList#getReferencedObject(56fd0941de524e93).(rank);
4038 if ((referencedObject) && (account = referencedObject->getAccountcxx . . $ pvpgn/bnetd/LadderReferencedObject#getAccount(bd50dfe41cbbfab3).()))
4039 {
4040 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "Brood War active %5u: %-20.20s %u/%u/%u rating %u",
4041 rank,
4042 account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account),
4043 account_get_ladder_active_winscxx . . $ pvpgn/bnetd/account_get_ladder_active_wins(44091a2c7ac3910).(account, CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4044 account_get_ladder_active_lossescxx . . $ pvpgn/bnetd/account_get_ladder_active_losses(44091a2c7ac3910).(account, CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4045 account_get_ladder_active_disconnectscxx . . $ pvpgn/bnetd/account_get_ladder_active_disconnects(44091a2c7ac3910).(account, CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4046 account_get_ladder_active_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_active_rating(44091a2c7ac3910).(account, CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.));
4047 }
4048 else
4049 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "Brood War active %5u: <none>", rank);
4050 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4051
4052 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., clienttag, ladder_sort_highestratedcxx . . $ pvpgn/bnetd/ladder_sort_highestrated., ladder_time_currentcxx . . $ pvpgn/bnetd/ladder_time_current.));
4053 referencedObject = ladderList->getReferencedObjectcxx . . $ pvpgn/bnetd/LadderList#getReferencedObject(56fd0941de524e93).(rank);
4054 if ((referencedObject) && (account = referencedObject->getAccountcxx . . $ pvpgn/bnetd/LadderReferencedObject#getAccount(bd50dfe41cbbfab3).()))
4055 {
4056 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "Brood War current %5u: %-20.20s %u/%u/%u rating %u",
4057 rank,
4058 account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account),
4059 account_get_ladder_winscxx . . $ pvpgn/bnetd/account_get_ladder_wins(44091a2c7ac3910).(account, CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4060 account_get_ladder_lossescxx . . $ pvpgn/bnetd/account_get_ladder_losses(44091a2c7ac3910).(account, CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4061 account_get_ladder_disconnectscxx . . $ pvpgn/bnetd/account_get_ladder_disconnects(44091a2c7ac3910).(account, CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4062 account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.));
4063 }
4064 else
4065 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "Brood War current %5u: <none>", rank);
4066 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4067 }
4068 else if (clienttag == CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!)
4069 {
4070 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., clienttag, ladder_sort_highestratedcxx . . $ pvpgn/bnetd/ladder_sort_highestrated., ladder_time_activecxx . . $ pvpgn/bnetd/ladder_time_active.));
4071 referencedObject = ladderList->getReferencedObjectcxx . . $ pvpgn/bnetd/LadderList#getReferencedObject(56fd0941de524e93).(rank);
4072 if ((referencedObject) && (account = referencedObject->getAccountcxx . . $ pvpgn/bnetd/LadderReferencedObject#getAccount(bd50dfe41cbbfab3).()))
4073 {
4074 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft II standard active %5u: %-20.20s %u/%u/%u rating %u",
4075 rank,
4076 account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account),
4077 account_get_ladder_active_winscxx . . $ pvpgn/bnetd/account_get_ladder_active_wins(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4078 account_get_ladder_active_lossescxx . . $ pvpgn/bnetd/account_get_ladder_active_losses(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4079 account_get_ladder_active_disconnectscxx . . $ pvpgn/bnetd/account_get_ladder_active_disconnects(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4080 account_get_ladder_active_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_active_rating(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.));
4081 }
4082 else
4083 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft II standard active %5u: <none>", rank);
4084 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4085
4086 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., clienttag, ladder_sort_highestratedcxx . . $ pvpgn/bnetd/ladder_sort_highestrated., ladder_time_activecxx . . $ pvpgn/bnetd/ladder_time_active.));
4087 referencedObject = ladderList->getReferencedObjectcxx . . $ pvpgn/bnetd/LadderList#getReferencedObject(56fd0941de524e93).(rank);
4088 if ((referencedObject) && (account = referencedObject->getAccountcxx . . $ pvpgn/bnetd/LadderReferencedObject#getAccount(bd50dfe41cbbfab3).()))
4089 {
4090 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft II IronMan active %5u: %-20.20s %u/%u/%u rating %u",
4091 rank,
4092 account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account),
4093 account_get_ladder_active_winscxx . . $ pvpgn/bnetd/account_get_ladder_active_wins(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.),
4094 account_get_ladder_active_lossescxx . . $ pvpgn/bnetd/account_get_ladder_active_losses(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.),
4095 account_get_ladder_active_disconnectscxx . . $ pvpgn/bnetd/account_get_ladder_active_disconnects(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.),
4096 account_get_ladder_active_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_active_rating(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.));
4097 }
4098 else
4099 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft II IronMan active %5u: <none>", rank);
4100 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4101
4102 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., clienttag, ladder_sort_highestratedcxx . . $ pvpgn/bnetd/ladder_sort_highestrated., ladder_time_currentcxx . . $ pvpgn/bnetd/ladder_time_current.));
4103 referencedObject = ladderList->getReferencedObjectcxx . . $ pvpgn/bnetd/LadderList#getReferencedObject(56fd0941de524e93).(rank);
4104 if ((referencedObject) && (account = referencedObject->getAccountcxx . . $ pvpgn/bnetd/LadderReferencedObject#getAccount(bd50dfe41cbbfab3).()))
4105 {
4106 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft II standard current %5u: %-20.20s %u/%u/%u rating %u",
4107 rank,
4108 account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account),
4109 account_get_ladder_winscxx . . $ pvpgn/bnetd/account_get_ladder_wins(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4110 account_get_ladder_lossescxx . . $ pvpgn/bnetd/account_get_ladder_losses(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4111 account_get_ladder_disconnectscxx . . $ pvpgn/bnetd/account_get_ladder_disconnects(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.),
4112 account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.));
4113 }
4114 else
4115 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft II standard current %5u: <none>", rank);
4116 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4117
4118 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., clienttag, ladder_sort_highestratedcxx . . $ pvpgn/bnetd/ladder_sort_highestrated., ladder_time_currentcxx . . $ pvpgn/bnetd/ladder_time_current.));
4119 referencedObject = ladderList->getReferencedObjectcxx . . $ pvpgn/bnetd/LadderList#getReferencedObject(56fd0941de524e93).(rank);
4120 if ((referencedObject) && (account = referencedObject->getAccountcxx . . $ pvpgn/bnetd/LadderReferencedObject#getAccount(bd50dfe41cbbfab3).()))
4121 {
4122 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft II IronMan current %5u: %-20.20s %u/%u/%u rating %u",
4123 rank,
4124 account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account),
4125 account_get_ladder_winscxx . . $ pvpgn/bnetd/account_get_ladder_wins(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.),
4126 account_get_ladder_lossescxx . . $ pvpgn/bnetd/account_get_ladder_losses(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.),
4127 account_get_ladder_disconnectscxx . . $ pvpgn/bnetd/account_get_ladder_disconnects(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.),
4128 account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.));
4129 }
4130 else
4131 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft II IronMan current %5u: <none>", rank);
4132 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4133 }
4134 // --> aaron
4135 else if (clienttag == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`! || clienttag == CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!)
4136 {
4137 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_solocxx . . $ pvpgn/bnetd/ladder_id_solo., clienttag, ladder_sort_defaultcxx . . $ pvpgn/bnetd/ladder_sort_default., ladder_time_defaultcxx . . $ pvpgn/bnetd/ladder_time_default.));
4138 referencedObject = ladderList->getReferencedObjectcxx . . $ pvpgn/bnetd/LadderList#getReferencedObject(56fd0941de524e93).(rank);
4139 if ((referencedObject) && (account = referencedObject->getAccountcxx . . $ pvpgn/bnetd/LadderReferencedObject#getAccount(bd50dfe41cbbfab3).()))
4140 {
4141 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft3 Solo %5u: %-20.20s %u/%u/0",
4142 rank,
4143 account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account),
4144 account_get_ladder_winscxx . . $ pvpgn/bnetd/account_get_ladder_wins(44091a2c7ac3910).(account, clienttag, ladder_id_solocxx . . $ pvpgn/bnetd/ladder_id_solo.),
4145 account_get_ladder_lossescxx . . $ pvpgn/bnetd/account_get_ladder_losses(44091a2c7ac3910).(account, clienttag, ladder_id_solocxx . . $ pvpgn/bnetd/ladder_id_solo.));
4146 }
4147 else
4148 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft3 Solo %5u: <none>", rank);
4149 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4150
4151 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_teamcxx . . $ pvpgn/bnetd/ladder_id_team., clienttag, ladder_sort_defaultcxx . . $ pvpgn/bnetd/ladder_sort_default., ladder_time_defaultcxx . . $ pvpgn/bnetd/ladder_time_default.));
4152 referencedObject = ladderList->getReferencedObjectcxx . . $ pvpgn/bnetd/LadderList#getReferencedObject(56fd0941de524e93).(rank);
4153 if ((referencedObject) && (account = referencedObject->getAccountcxx . . $ pvpgn/bnetd/LadderReferencedObject#getAccount(bd50dfe41cbbfab3).()))
4154 {
4155 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft3 Team %5u: %-20.20s %u/%u/0",
4156 rank,
4157 account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account),
4158 account_get_ladder_winscxx . . $ pvpgn/bnetd/account_get_ladder_wins(44091a2c7ac3910).(account, clienttag, ladder_id_teamcxx . . $ pvpgn/bnetd/ladder_id_team.),
4159 account_get_ladder_lossescxx . . $ pvpgn/bnetd/account_get_ladder_losses(44091a2c7ac3910).(account, clienttag, ladder_id_teamcxx . . $ pvpgn/bnetd/ladder_id_team.));
4160 }
4161 else
4162 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft3 Team %5u: <none>", rank);
4163 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4164
4165 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_ffacxx . . $ pvpgn/bnetd/ladder_id_ffa., clienttag, ladder_sort_defaultcxx . . $ pvpgn/bnetd/ladder_sort_default., ladder_time_defaultcxx . . $ pvpgn/bnetd/ladder_time_default.));
4166 referencedObject = ladderList->getReferencedObjectcxx . . $ pvpgn/bnetd/LadderList#getReferencedObject(56fd0941de524e93).(rank);
4167 if ((referencedObject) && (account = referencedObject->getAccountcxx . . $ pvpgn/bnetd/LadderReferencedObject#getAccount(bd50dfe41cbbfab3).()))
4168 {
4169 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft3 FFA %5u: %-20.20s %u/%u/0",
4170 rank,
4171 account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account),
4172 account_get_ladder_winscxx . . $ pvpgn/bnetd/account_get_ladder_wins(44091a2c7ac3910).(account, clienttag, ladder_id_ffacxx . . $ pvpgn/bnetd/ladder_id_ffa.),
4173 account_get_ladder_lossescxx . . $ pvpgn/bnetd/account_get_ladder_losses(44091a2c7ac3910).(account, clienttag, ladder_id_ffacxx . . $ pvpgn/bnetd/ladder_id_ffa.));
4174 }
4175 else
4176 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft3 FFA %5u: <none>", rank);
4177 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4178
4179 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_ateamcxx . . $ pvpgn/bnetd/ladder_id_ateam., clienttag, ladder_sort_defaultcxx . . $ pvpgn/bnetd/ladder_sort_default., ladder_time_defaultcxx . . $ pvpgn/bnetd/ladder_time_default.));
4180 referencedObject = ladderList->getReferencedObjectcxx . . $ pvpgn/bnetd/LadderList#getReferencedObject(56fd0941de524e93).(rank);
4181 if ((referencedObject) && (team = referencedObject->getTeamcxx . . $ pvpgn/bnetd/LadderReferencedObject#getTeam(d86d4840e1570a5a).()))
4182 {
4183 t_xstrcxx . . $ pvpgn/t_xstr# * membernames = xstr_alloccxx . . $ pvpgn/xstr_alloc(3125114ad3ba0a87).();
4184 for (unsigned char i = 0; i < team_get_sizecxx . . $ pvpgn/bnetd/team_get_size(7a9350cb6bb6d81e).(team); i++){
4185 xstr_cat_strcxx . . $ pvpgn/xstr_cat_str(5f93d84c9cbedb2c).(membernames, account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(team_get_member(team, i)));
4186 if ((i)) xstr_cat_charcxx . . $ pvpgn/xstr_cat_char(b449f1e097feab7).(membernames, ',');
4187 }
4188 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft3 AT Team %5u: %-80.80s %d/%d/0",
4189 rank,
4190 xstr_get_strcxx . . $ pvpgn/xstr_get_str(9a9300e90646af37).(membernames),
4191 team_get_winscxx . . $ pvpgn/bnetd/team_get_wins(bfd9c5af88c00d10).(team),
4192 team_get_lossescxx . . $ pvpgn/bnetd/team_get_losses(bfd9c5af88c00d10).(team));
4193 xstr_freecxx . . $ pvpgn/xstr_free(dbb2bf3681fb2b00).(membernames);
4194 }
4195 else
4196 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "WarCraft3 AT Team %5u: <none>", rank);
4197 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4198 }
4199 //<---
4200 else
4201 {
4202 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This game does not support win/loss records."));
4203 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must supply a rank and a valid program ID."));
4204 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Example: /ladderinfo 1 STAR"));
4205 }
4206
4207 return 0;
4208 }
4209
4210 static int _handle_timer_commandcxx . . $ pvpgn/bnetd/_handle_timer_command(2e9022cda97b266d).(t_connection * c, char const *text)
4211 {
4212 unsigned int delta;
4213 t_timer_datacxx . . $ pvpgn/bnetd/t_timer_data# data;
4214
4215 char const * delta_s, *msgtext_s;
4216 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
4217 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4218 {
4219 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4220 return -1;
4221 }
4222 delta_s = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // timer delta
4223 msgtext_s = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // message text display when timer elapsed
4224
4225 if (clockstr_to_secondscxx . . $ pvpgn/clockstr_to_seconds(6974107818eeb505).(delta_s, &delta) < 0)
4226 {
4227 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid duration."));
4228 return -1;
4229 }
4230
4231 if (msgtext_s[0] == '\0')
4232 data.pcxx . . $ pvpgn/bnetd/$anonymous_type_64e82d6b10ad28f9_0#p. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your timer has expired.").c_str());
4233 else
4234 data.pcxx . . $ pvpgn/bnetd/$anonymous_type_64e82d6b10ad28f9_0#p. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(msgtext_s);
4235
4236 if (timerlist_add_timercxx . . $ pvpgn/bnetd/timerlist_add_timer(f16dcbfb825fabda).(c, stdcxx . . $ std/::timecxx . . $ std/time(a7cd306b2d326b09).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) + (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)delta, user_timer_cbcxx . . $ pvpgn/bnetd/user_timer_cb(9b6c929c3dbc4c93)., data) < 0)
4237 {
4238 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "Could not add timer");
4239 xfreecxx . . $ `src/common/xalloc.h:51:9`!(data.p);
4240 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Could not set timer."));
4241 }
4242 else
4243 {
4244 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Timer set for {} second(s)", seconds_to_timestr(delta));
4245 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4246 }
4247
4248 return 0;
4249 }
4250
4251 static int _handle_serverban_commandcxx . . $ pvpgn/bnetd/_handle_serverban_command(2e9022cda97b266d).(t_connection *c, char const *text)
4252 {
4253 char const * username;
4254 t_connection * dest_c;
4255
4256 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
4257 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4258 {
4259 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4260 return -1;
4261 }
4262 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
4263
4264 if (!(dest_c = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(username)))
4265 {
4266 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That user is not logged on."));
4267 return -1;
4268 }
4269 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Banning {} who is using IP address {}", conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(dest_c), addr_num_to_ip_str(conn_get_game_addr(dest_c)));
4270 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4271 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "User's account is also LOCKED! Only an admin can unlock it!"));
4272 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "/ipban a {}", addr_num_to_ip_str(conn_get_game_addr(dest_c)));
4273 handle_ipban_commandcxx . . $ pvpgn/bnetd/handle_ipban_command(2e9022cda97b266d).(c, msgtempcxx . . $ pvpgn/bnetd/msgtemp..c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4274 account_set_auth_lockcxx . . $ pvpgn/bnetd/account_set_auth_lock(9f6a50bf8c531a3f).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(dest_c), 1);
4275 //now kill the connection
4276 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You have been banned by Admin: {}", conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(c));
4277 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dest_c, message_type_error, dest_c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4278 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(dest_c, message_type_error, dest_c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your account is also LOCKED! Only an admin can UNLOCK it!"));
4279 conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(dest_c, conn_state_destroy);
4280 return 0;
4281 }
4282
4283 static int _handle_netinfo_commandcxx . . $ pvpgn/bnetd/_handle_netinfo_command(2e9022cda97b266d).(t_connection * c, char const *text)
4284 {
4285 char const * username;
4286 t_connection * conn;
4287 t_game const * game;
4288 unsigned int addr;
4289 unsigned short port;
4290 unsigned int taddr;
4291 unsigned short tport;
4292
4293 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
4294 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
4295
4296 if (username[0] == '\0')
4297 username = conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(c);
4298
4299 if (!(conn = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(username)))
4300 {
4301 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That user is not logged on."));
4302 return -1;
4303 }
4304
4305 if (conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(conn) != conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c) &&
4306 prefs_get_hide_addrcxx . . $ pvpgn/bnetd/prefs_get_hide_addr(db52760e79bf9054).() && !(account_get_command_groupscxx . . $ pvpgn/bnetd/account_get_command_groups(c7ab9369555c44b8).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) & command_get_groupcxx . . $ pvpgn/bnetd/command_get_group(c61c63047ce273de).("/admin-addr"))) // default to false
4307 {
4308 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Address information for other users is only available to admins."));
4309 return -1;
4310 }
4311
4312 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Server TCP: {} (bind {})", addr_num_to_addr_str(conn_get_real_local_addr(conn), conn_get_real_local_port(conn)), addr_num_to_addr_str(conn_get_local_addr(conn), conn_get_local_port(conn)));
4313 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4314
4315 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Client TCP: {}", addr_num_to_addr_str(conn_get_addr(conn), conn_get_port(conn)));
4316 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4317
4318 taddr = addr = conn_get_game_addrcxx . . $ pvpgn/bnetd/conn_get_game_addr(8bd2285a65940781).(conn);
4319 tport = port = conn_get_game_portcxx . . $ pvpgn/bnetd/conn_get_game_port(70207a9c46bcade7).(conn);
4320 trans_netcxx . . $ pvpgn/trans_net(cf0ba8ec647fd542).(conn_get_addrcxx . . $ pvpgn/bnetd/conn_get_addr(8bd2285a65940781).(c), &taddr, &tport);
4321
4322 if (taddr == addr && tport == port)
4323 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Client UDP: {}",
4324 addr_num_to_addr_str(addr, port));
4325 else
4326 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Client UDP: {} (trans {})",
4327 addr_num_to_addr_str(addr, port),
4328 addr_num_to_addr_str(taddr, tport));
4329 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4330
4331 if ((game = conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(conn)))
4332 {
4333 taddr = addr = game_get_addrcxx . . $ pvpgn/bnetd/game_get_addr(d7b85b5cd2056731).(game);
4334 tport = port = game_get_portcxx . . $ pvpgn/bnetd/game_get_port(5675c6bb4f2bafa6).(game);
4335 trans_netcxx . . $ pvpgn/trans_net(cf0ba8ec647fd542).(conn_get_addrcxx . . $ pvpgn/bnetd/conn_get_addr(8bd2285a65940781).(c), &taddr, &tport);
4336
4337 if (taddr == addr && tport == port)
4338 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Game UDP: {}",
4339 addr_num_to_addr_str(addr, port));
4340 else
4341 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Game UDP: {} (trans {})",
4342 addr_num_to_addr_str(addr, port),
4343 addr_num_to_addr_str(taddr, tport));
4344 }
4345 else
4346 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Game UDP: none");
4347 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4348
4349 return 0;
4350 }
4351
4352 static int _handle_quota_commandcxx . . $ pvpgn/bnetd/_handle_quota_command(2e9022cda97b266d).(t_connection * c, char const * text)
4353 {
4354 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your quota allows you to write {} line(s) per {} second(s).", prefs_get_quota_lines(), prefs_get_quota_time());
4355 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4356 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Long lines will be wrapped every {} characters.", prefs_get_quota_wrapline());
4357 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4358 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You are not allowed to send lines with more than {} characters.", prefs_get_quota_maxline());
4359 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4360
4361 return 0;
4362 }
4363
4364 static int _handle_lockacct_commandcxx . . $ pvpgn/bnetd/_handle_lockacct_command(2e9022cda97b266d).(t_connection * c, char const *text)
4365 {
4366 t_connection * user;
4367 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
4368 char const * username, *reason = "", *hours = "24"; // default time 24 hours
4369 unsigned int sectime;
4370
4371 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 3);
4372 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4373 {
4374 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4375 return -1;
4376 }
4377 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
4378 if (!args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4379 hours = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // hours
4380 if (!args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).3].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4381 reason = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).3].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // reason
4382
4383 if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username)))
4384 {
4385 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid user."));
4386 return -1;
4387 }
4388
4389 account_set_auth_lockcxx . . $ pvpgn/bnetd/account_set_auth_lock(9f6a50bf8c531a3f).(account, 1);
4390 sectime = (atoi(hours) == 0) ? 0 : (atoi(hours) * 60 * 60) + nowcxx . . $ pvpgn/bnetd/now.; // get unlock time in the future
4391 account_set_auth_locktimecxx . . $ pvpgn/bnetd/account_set_auth_locktime(43f7d0f5a7c4b307).(account, sectime);
4392 account_set_auth_lockreasoncxx . . $ pvpgn/bnetd/account_set_auth_lockreason(4b12bc5edcfaeac7).(account, reason);
4393 account_set_auth_lockbycxx . . $ pvpgn/bnetd/account_set_auth_lockby(4b12bc5edcfaeac7).(account, conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(c));
4394
4395
4396 // send message to author
4397 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Account {} is now locked", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account));
4398 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). account_get_locktextcxx . . $ pvpgn/bnetd/account_get_locktext(650897560b616fe8).(c, account, false);
4399 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4400
4401 // send message to locked user
4402 if ((user = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(username)))
4403 {
4404 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your account has just been locked");
4405 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). account_get_locktextcxx . . $ pvpgn/bnetd/account_get_locktext(650897560b616fe8).(c, account, true);
4406 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(user, message_type_error, user, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4407 }
4408
4409 return 0;
4410 }
4411
4412 static int _handle_unlockacct_commandcxx . . $ pvpgn/bnetd/_handle_unlockacct_command(2e9022cda97b266d).(t_connection * c, char const *text)
4413 {
4414 t_connection * user;
4415 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
4416
4417 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
4418 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4419 {
4420 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4421 return -1;
4422 }
4423 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
4424
4425 if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(text)))
4426 {
4427 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid user."));
4428 return -1;
4429 }
4430
4431 if ((user = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(text)))
4432 {
4433 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your account has just been unlocked by {}", conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(c));
4434 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(user, message_type_info, user, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4435 }
4436
4437 account_set_auth_lockcxx . . $ pvpgn/bnetd/account_set_auth_lock(9f6a50bf8c531a3f).(account, 0);
4438 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That user's account is now unlocked."));
4439 return 0;
4440 }
4441
4442
4443 static int _handle_muteacct_commandcxx . . $ pvpgn/bnetd/_handle_muteacct_command(2e9022cda97b266d).(t_connection * c, char const *text)
4444 {
4445 t_connection * user;
4446 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
4447 char const * username, *reason = "", *hours = "1"; // default time 1 hour
4448 unsigned int sectime;
4449
4450 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 3);
4451 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4452 {
4453 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4454 return -1;
4455 }
4456 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
4457 if (!args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4458 hours = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // hours
4459 if (!args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).3].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4460 reason = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).3].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // reason
4461
4462 if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username)))
4463 {
4464 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid user."));
4465 return -1;
4466 }
4467
4468 account_set_auth_mutecxx . . $ pvpgn/bnetd/account_set_auth_mute(9f6a50bf8c531a3f).(account, 1);
4469 // get unlock time in the future
4470 sectime = (atoi(hours) == 0) ? 0 : (atoi(hours) * 60 * 60) + nowcxx . . $ pvpgn/bnetd/now.;
4471 account_set_auth_mutetimecxx . . $ pvpgn/bnetd/account_set_auth_mutetime(43f7d0f5a7c4b307).(account, sectime);
4472 account_set_auth_mutereasoncxx . . $ pvpgn/bnetd/account_set_auth_mutereason(4b12bc5edcfaeac7).(account, reason);
4473 account_set_auth_mutebycxx . . $ pvpgn/bnetd/account_set_auth_muteby(4b12bc5edcfaeac7).(account, conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(c));
4474
4475 // send message to author
4476 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Account {} is now muted", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account));
4477 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). account_get_mutetextcxx . . $ pvpgn/bnetd/account_get_mutetext(47bad2ee332eabb2).(c, account, false);
4478 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4479
4480 // send message to muted user
4481 if ((user = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(username)))
4482 {
4483 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your account has just been muted");
4484 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). account_get_mutetextcxx . . $ pvpgn/bnetd/account_get_mutetext(47bad2ee332eabb2).(c, account, true);
4485 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(user, message_type_error, user, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4486 }
4487
4488 return 0;
4489 }
4490
4491 static int _handle_unmuteacct_commandcxx . . $ pvpgn/bnetd/_handle_unmuteacct_command(2e9022cda97b266d).(t_connection * c, char const *text)
4492 {
4493 t_connection * user;
4494 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
4495
4496 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
4497 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4498 {
4499 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4500 return -1;
4501 }
4502 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
4503
4504 if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(text)))
4505 {
4506 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid user."));
4507 return -1;
4508 }
4509
4510 if ((user = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(text)))
4511 {
4512 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your account has just been unmuted by {}", conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(c));
4513 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(user, message_type_info, user, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4514 }
4515
4516 account_set_auth_mutecxx . . $ pvpgn/bnetd/account_set_auth_mute(9f6a50bf8c531a3f).(account, 0);
4517 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That user's account is now unmuted."));
4518 return 0;
4519 }
4520
4521 static int _handle_flag_commandcxx . . $ pvpgn/bnetd/_handle_flag_command(2e9022cda97b266d).(t_connection * c, char const *text)
4522 {
4523 char const * flag_s;
4524 unsigned int newflag;
4525
4526 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
4527 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4528 {
4529 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4530 return -1;
4531 }
4532 flag_s = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // flag
4533
4534 newflag = stdcxx . . $ std/::strtoul(flag_s, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0);
4535 conn_set_flagscxx . . $ pvpgn/bnetd/conn_set_flags(c14bb6458e7562a).(c, newflag);
4536
4537 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), "0x%08x.", newflag);
4538
4539 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Flags set to {}.", msgtemp0);
4540 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4541 return 0;
4542 }
4543
4544 static int _handle_tag_commandcxx . . $ pvpgn/bnetd/_handle_tag_command(2e9022cda97b266d).(t_connection * c, char const *text)
4545 {
4546 char const * tag_s;
4547 t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag;
4548
4549 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
4550 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4551 {
4552 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4553 return -1;
4554 }
4555 tag_s = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // flag
4556
4557 if (clienttag = tag_validate_clientcxx . . $ pvpgn/tag_validate_client(c61c63047ce273de).(tag_s))
4558 {
4559 unsigned int oldflags = conn_get_flagscxx . . $ pvpgn/bnetd/conn_get_flags(8bd2285a65940781).(c);
4560 conn_set_clienttagcxx . . $ pvpgn/bnetd/conn_set_clienttag(d97ad1b62a895b69).(c, clienttag);
4561 if ((clienttag == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!) || (clienttag == CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!))
4562 conn_update_w3_playerinfocxx . . $ pvpgn/bnetd/conn_update_w3_playerinfo(c4dfbc2386fe4fc3).(c);
4563 channel_rejoincxx . . $ pvpgn/bnetd/channel_rejoin(c4dfbc2386fe4fc3).(c);
4564 conn_set_flagscxx . . $ pvpgn/bnetd/conn_set_flags(c14bb6458e7562a).(c, oldflags);
4565 channel_update_userflagscxx . . $ pvpgn/bnetd/channel_update_userflags(428cd989165da3c5).(c);
4566 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Client tag set to {}.", tag_s);
4567 }
4568 else
4569 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid clienttag {} specified", tag_s);
4570 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4571 return 0;
4572 }
4573
4574 static int _handle_ipscan_commandcxx . . $ pvpgn/bnetd/_handle_ipscan_command(2e9022cda97b266d).(t_connection * c, char const * text)
4575 {
4576 /*
4577 Description of _handle_ipscan_command
4578 ---------------------------------------
4579 Finds all currently logged in users with the given ip address.
4580 */
4581
4582 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
4583 t_connection * conn;
4584
4585 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
4586 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4587 {
4588 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4589 return -1;
4590 }
4591 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // ip or username
4592
4593 stdcxx . . $ std/::stringcxx . . $ std/string# ipcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).;
4594 if (account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(text))
4595 {
4596 conn = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(account);
4597 if (conn)
4598 {
4599 // conn_get_addr returns int, so there can never be a NULL string construct
4600 ip =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). addr_num_to_ip_strcxx . . $ pvpgn/addr_num_to_ip_str(81a3ae90da26a711).(conn_get_addrcxx . . $ pvpgn/bnetd/conn_get_addr(8bd2285a65940781).(conn));
4601 }
4602 else
4603 {
4604 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Warning: That user is not online, using last known address."));
4605 ip =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). account_get_ll_ipcxx . . $ pvpgn/bnetd/account_get_ll_ip(4b37305d4a4563d0).(account);
4606 if (ip.emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4607 {
4608 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Sorry, no IP address could be retrieved."));
4609 return 0;
4610 }
4611 }
4612 }
4613 else
4614 {
4615 ip =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). text;
4616 }
4617
4618 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Scanning online users for IP {}...", ip));
4619
4620 t_elemcxx . . $ pvpgn/t_elem# const * curr;
4621 int count = 0;
4622 LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(connlist(), curr) {
4623 conn = (t_connection *)elem_get_data(curr);
4624 if (!conn) {
4625 // got empty element
4626 continue;
4627 }
4628
4629 if (ip.comparecxx . . $ std/__cxx11/basic_string#compare(a291d14eafe45d05).(addr_num_to_ip_strcxx . . $ pvpgn/addr_num_to_ip_str(81a3ae90da26a711).(conn_get_addrcxx . . $ pvpgn/bnetd/conn_get_addr(8bd2285a65940781).(conn))) == 0)
4630 {
4631 stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., sizeof(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.), " %s", conn_get_loggedusercxx . . $ pvpgn/bnetd/conn_get_loggeduser(c99dbccf638f5c6).(conn));
4632 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4633 count++;
4634 }
4635 }
4636
4637 if (count == 0) {
4638 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "There are no online users with that IP address"));
4639 }
4640
4641 return 0;
4642 }
4643
4644 static int _handle_set_commandcxx . . $ pvpgn/bnetd/_handle_set_command(2e9022cda97b266d).(t_connection * c, char const *text)
4645 {
4646 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
4647 char const * username, *key, *value;
4648
4649 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 3);
4650 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4651 {
4652 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4653 return -1;
4654 }
4655 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
4656 key = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // key
4657 value = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).3].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // value
4658
4659
4660 // disallow get/set value for password hash and username (hash can be cracked easily, account name should be permanent)
4661 if (strcasecmp(key, "bnet\\acct\\passhash1") == 0 || strcasecmp(key, "bnet\\acct\\username") == 0 || strcasecmp(key, "bnet\\acct\\verifier") == 0 || strcasecmp(key, "bnet\\acct\\salt") == 0 || strcasecmp(key, "bnet\\username") == 0)
4662 {
4663 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Access denied due to security reasons."));
4664 return -1;
4665 }
4666
4667 if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username)))
4668 {
4669 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid user."));
4670 return -1;
4671 }
4672
4673 if (*value == '\0')
4674 {
4675 if (account_get_strattrcxx . . $ `src/bnetd/account.h:96:9`!(account, key))
4676 {
4677 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Current value of {} is \"{}\"", key, account_get_strattrcxx . . $ `src/bnetd/account.h:96:9`!(account, key));
4678 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4679 }
4680 else
4681 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Value currently not set"));
4682 return 0;
4683 }
4684
4685 // unset value
4686 if (strcasecmp(value, "null") == 0)
4687 value = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4688
4689 stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., " \"%.64s\" (%.128s = \"%.128s\")", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account), key, value);
4690
4691 if (account_set_strattrcxx . . $ pvpgn/bnetd/account_set_strattr(47d7ee6351fa1de3).(account, key, value) < 0)
4692 {
4693 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Unable to set key for");
4694 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(978ca1133b5f6e74). msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.;
4695 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4696 }
4697 else
4698 {
4699 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Key set successfully for");
4700 msgtempcxx . . $ pvpgn/bnetd/msgtemp. +=cxx . . $ std/__cxx11/basic_string#`operator+=`(978ca1133b5f6e74). msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.;
4701 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4702 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_warncxx . . $ pvpgn/eventlog_level_warn., __FUNCTION__, "Key set by \"{}\" for {}", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(conn_get_account(c)),msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4703 }
4704 return 0;
4705 }
4706
4707 static int _handle_motd_commandcxx . . $ pvpgn/bnetd/_handle_motd_command(2e9022cda97b266d).(t_connection * c, char const *text)
4708 {
4709 stdcxx . . $ std/::stringcxx . . $ std/string# filename = i18n_filenamecxx . . $ pvpgn/bnetd/i18n_filename(caf975da75400ef4).(prefs_get_motdfilecxx . . $ pvpgn/bnetd/prefs_get_motdfile(33a1f659e94feb42).(), conn_get_gamelang_localizedcxx . . $ pvpgn/bnetd/conn_get_gamelang_localized(c9be5e844f0af884).(c));
4710
4711 stdcxx . . $ std/::FILEcxx . . $ std/FILE#* fp = stdcxx . . $ std/::fopencxx . . $ std/fopen(82ec0787cd37e0a3).(filename.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), "r");
4712 if (fp)
4713 {
4714 message_send_filecxx . . $ pvpgn/bnetd/message_send_file(97063c28d6bb8792).(c, fp);
4715 if (stdcxx . . $ std/::fclosecxx . . $ std/fclose(89bc1efcdac0ca22).(fp) < 0)
4716 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not close motd file \"{}\" after reading (std::fopen: {})", filename, stdcxx . . $ std/::strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!));
4717 }
4718 else
4719 {
4720 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not open motd file \"{}\" for reading (std::fopen: {})", filename, stdcxx . . $ std/::strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!));
4721 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Unable to open motd."));
4722 }
4723
4724 return 0;
4725 }
4726
4727 static int _handle_tos_commandcxx . . $ pvpgn/bnetd/_handle_tos_command(2e9022cda97b266d).(t_connection * c, char const * text)
4728 {
4729 /* handle /tos - shows terms of service by user request -raistlinthewiz */
4730
4731 stdcxx . . $ std/::stringcxx . . $ std/string# filename = i18n_filenamecxx . . $ pvpgn/bnetd/i18n_filename(caf975da75400ef4).(prefs_get_tosfilecxx . . $ pvpgn/bnetd/prefs_get_tosfile(33a1f659e94feb42).(), conn_get_gamelang_localizedcxx . . $ pvpgn/bnetd/conn_get_gamelang_localized(c9be5e844f0af884).(c));
4732 /* FIXME: if user enters relative path to tos file in config,
4733 above routine will fail */
4734 stdcxx . . $ std/::FILEcxx . . $ std/FILE#* fp = stdcxx . . $ std/::fopencxx . . $ std/fopen(82ec0787cd37e0a3).(filename.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), "r");
4735 if (fp)
4736 {
4737 char * buff;
4738 unsigned len;
4739
4740 while ((buff = file_get_linecxx . . $ pvpgn/file_get_line(e31226b218f63160).(fp)))
4741 {
4742
4743 if ((len = stdcxx . . $ std/::strlen(buff)) < MAX_MESSAGE_LENcxx . . $ MAX_MESSAGE_LEN.)
4744 {
4745 i18n_convertcxx . . $ pvpgn/bnetd/i18n_convert(c30c6622e93e4e71).(c, buff);
4746 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, buff);
4747 }
4748 else {
4749 /* lines in TOS file can be > MAX_MESSAGE_LEN, so split them
4750 truncating is not an option for TOS -raistlinthewiz
4751 */
4752
4753 while (len > MAX_MESSAGE_LENcxx . . $ MAX_MESSAGE_LEN. - 1)
4754 {
4755 stdcxx . . $ std/::strncpy(msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0., buff, MAX_MESSAGE_LENcxx . . $ MAX_MESSAGE_LEN. - 1);
4756 msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.[MAX_MESSAGE_LENcxx . . $ MAX_MESSAGE_LEN.-1] = '\0';
4757 buff += MAX_MESSAGE_LENcxx . . $ MAX_MESSAGE_LEN. - 1;
4758 len -= MAX_MESSAGE_LENcxx . . $ MAX_MESSAGE_LEN. - 1;
4759 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp0cxx . . $ pvpgn/bnetd/msgtemp0.);
4760 }
4761
4762 if (len > 0) /* does it exist a small last part ? */
4763 {
4764 i18n_convertcxx . . $ pvpgn/bnetd/i18n_convert(c30c6622e93e4e71).(c, buff);
4765 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, buff);
4766 }
4767
4768 }
4769 }
4770
4771
4772 if (stdcxx . . $ std/::fclosecxx . . $ std/fclose(89bc1efcdac0ca22).(fp) < 0)
4773 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not close tos file \"{}\" after reading (std::fopen: {})", filename, stdcxx . . $ std/::strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!));
4774 }
4775 else
4776 {
4777 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not open tos file \"{}\" for reading (std::fopen: {})", filename, stdcxx . . $ std/::strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!));
4778 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Unable to send TOS (Terms of Service)."));
4779 }
4780
4781 return 0;
4782
4783 }
4784
4785
4786 static int _handle_ping_commandcxx . . $ pvpgn/bnetd/_handle_ping_command(2e9022cda97b266d).(t_connection * c, char const *text)
4787 {
4788 unsigned int i;
4789 t_connection * user;
4790 t_game * game;
4791
4792 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
4793 text = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
4794
4795 if (text[0] == '\0')
4796 {
4797 if ((game = conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(c)))
4798 {
4799 for (i = 0; i < game_get_countcxx . . $ pvpgn/bnetd/game_get_count(d7b85b5cd2056731).(game); i++)
4800 {
4801 if ((user = game_get_player_conncxx . . $ pvpgn/bnetd/game_get_player_conn(da5fb43dd1d11f74).(game, i)))
4802 {
4803 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} latency: {}", conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(user), conn_get_latency(user));
4804 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4805 }
4806 }
4807 return 0;
4808 }
4809 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your latency {}", conn_get_latency(c));
4810 }
4811 else if ((user = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(text)))
4812 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} latency ()", text, conn_get_latency(user));
4813 else
4814 {
4815 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid user.");
4816 return -1;
4817 }
4818
4819 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4820 return 0;
4821 }
4822
4823 static int _handle_commandgroups_commandcxx . . $ pvpgn/bnetd/_handle_commandgroups_command(2e9022cda97b266d).(t_connection * c, char const * text)
4824 {
4825 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
4826 char const * command, *username;
4827
4828 unsigned int usergroups; // from user account
4829 unsigned int groups = 0; // converted from arg3
4830 char tempgroups[9]; // converted from usergroups
4831
4832 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 3);
4833 // display help if [list] without [username], or not [list] without [groups]
4834 if ( ((args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "list" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "l") && args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4835 || (!(args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "list" || args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "l") && args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).3].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) )
4836 {
4837 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4838 return -1;
4839 }
4840 command = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // command
4841 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // username
4842 //args[3]; // groups
4843
4844
4845 if (!(account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username))) {
4846 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid user."));
4847 return -1;
4848 }
4849
4850 usergroups = account_get_command_groupscxx . . $ pvpgn/bnetd/account_get_command_groups(c7ab9369555c44b8).(account);
4851
4852 if (!stdcxx . . $ std/::strcmp(command, "list") || !stdcxx . . $ std/::strcmp(command, "l")) {
4853 if (usergroups & 1) tempgroups[0] = '1'; else tempgroups[0] = ' ';
4854 if (usergroups & 2) tempgroups[1] = '2'; else tempgroups[1] = ' ';
4855 if (usergroups & 4) tempgroups[2] = '3'; else tempgroups[2] = ' ';
4856 if (usergroups & 8) tempgroups[3] = '4'; else tempgroups[3] = ' ';
4857 if (usergroups & 16) tempgroups[4] = '5'; else tempgroups[4] = ' ';
4858 if (usergroups & 32) tempgroups[5] = '6'; else tempgroups[5] = ' ';
4859 if (usergroups & 64) tempgroups[6] = '7'; else tempgroups[6] = ' ';
4860 if (usergroups & 128) tempgroups[7] = '8'; else tempgroups[7] = ' ';
4861 tempgroups[8] = '\0';
4862 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{}'s command group(s): {}", username, tempgroups);
4863 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4864 return 0;
4865 }
4866
4867 // iterate chars in string
4868 for (stdcxx . . $ std/::stringcxx . . $ std/string#::iteratorcxx . . $ std/__cxx11/basic_string#iterator# g = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).3].begincxx . . $ std/__cxx11/basic_string#begin(417acd00ce8503f4).(); g !=cxx . . $ __gnu_cxx/`operator!=`(30ee64f2df4eef8b). args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).3].endcxx . . $ std/__cxx11/basic_string#end(417acd00ce8503f4).(); ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(1613faa01bc3d014).g) {
4869 if (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).g == '1') groups |= 1;
4870 else if (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).g == '2') groups |= 2;
4871 else if (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).g == '3') groups |= 4;
4872 else if (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).g == '4') groups |= 8;
4873 else if (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).g == '5') groups |= 16;
4874 else if (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).g == '6') groups |= 32;
4875 else if (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).g == '7') groups |= 64;
4876 else if (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).g == '8') groups |= 128;
4877 else {
4878 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Got bad group: {}", *g);
4879 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4880 return -1;
4881 }
4882 }
4883
4884 if (!stdcxx . . $ std/::strcmp(command, "add") || !stdcxx . . $ std/::strcmp(command, "a")) {
4885 account_set_command_groupscxx . . $ pvpgn/bnetd/account_set_command_groups(43f7d0f5a7c4b307).(account, usergroups | groups);
4886 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Groups {} has been added to {}", args[3].c_str(), username);
4887 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4888 return 0;
4889 }
4890
4891 if (!stdcxx . . $ std/::strcmp(command, "del") || !stdcxx . . $ std/::strcmp(command, "d")) {
4892 account_set_command_groupscxx . . $ pvpgn/bnetd/account_set_command_groups(43f7d0f5a7c4b307).(account, usergroups & (255 - groups));
4893 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Groups {} has been deleted from {}", args[3].c_str(), username);
4894 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4895 return 0;
4896 }
4897
4898 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Got unknown command: {}", command);
4899 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4900 return -1;
4901 }
4902
4903 static int _handle_topic_commandcxx . . $ pvpgn/bnetd/_handle_topic_command(2e9022cda97b266d).(t_connection * c, char const * text)
4904 {
4905 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
4906 stdcxx . . $ std/::stringcxx . . $ std/string# topicstr = argscxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1];
4907
4908
4909 t_channelcxx . . $ pvpgn/bnetd/t_channel# * channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c);
4910 if (channel == nullptr)
4911 {
4912 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
4913 return -1;
4914 }
4915
4916 class_topiccxx . . $ pvpgn/bnetd/class_topic# Topiccxx . . $ pvpgn/bnetd/class_topic#class_topic(49f6e7a06ebc5aa8).;
4917 char const * channel_name = channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel);
4918
4919 // set channel topic
4920 if (!topicstr.emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
4921 {
4922 if ((topicstr.sizecxx . . $ std/__cxx11/basic_string#size(6f8bd5c0ea8fb29a).() + 1) > MAX_TOPIC_LENcxx . . $ MAX_TOPIC_LEN.)
4923 {
4924 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Max topic length exceeded (max {} symbols)", MAX_TOPIC_LEN);
4925 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4926 return -1;
4927 }
4928
4929 if (!(account_is_operator_or_admincxx . . $ pvpgn/bnetd/account_is_operator_or_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel_name)))
4930 {
4931 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must be at least a Channel Operator of {} to set the topic", channel_name);
4932 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4933 return -1;
4934 }
4935
4936 bool do_save;
4937 if (channel_get_permanentcxx . . $ pvpgn/bnetd/channel_get_permanent(28c764f7c20ec9b2).(channel))
4938 do_save = true;
4939 else
4940 do_save = false;
4941
4942 Topic.setcxx . . $ pvpgn/bnetd/class_topic#set(68710a89f2bd51b).(stdcxx . . $ std/::stringcxx . . $ std/string#(channel_name), stdcxx . . $ std/::stringcxx . . $ std/string#(topicstr), do_save);
4943 }
4944
4945 // display channel topic
4946 if (Topic.displaycxx . . $ pvpgn/bnetd/class_topic#display(4ecd64a16013f99d).(c, stdcxx . . $ std/::stringcxx . . $ std/string#(channel_name)) == false)
4947 {
4948 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "{} topic: no topic", channel_name);
4949 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4950 }
4951
4952 return 0;
4953 }
4954
4955 static int _handle_moderate_commandcxx . . $ pvpgn/bnetd/_handle_moderate_command(2e9022cda97b266d).(t_connection * c, char const * text)
4956 {
4957 unsigned oldflags;
4958 t_channelcxx . . $ pvpgn/bnetd/t_channel# * channel;
4959
4960 if (!(channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c))) {
4961 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This command can only be used inside a channel."));
4962 return -1;
4963 }
4964
4965 if (!(account_is_operator_or_admincxx . . $ pvpgn/bnetd/account_is_operator_or_admin(4b12bc5edcfaeac7).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel)))) {
4966 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "You must be at least a Channel Operator to use this command."));
4967 return -1;
4968 }
4969
4970 oldflags = channel_get_flagscxx . . $ pvpgn/bnetd/channel_get_flags(6768ecacf43d05ec).(channel);
4971
4972 if (channel_set_flagscxx . . $ pvpgn/bnetd/channel_set_flags(2ef76a208426d92b).(channel, oldflags ^ channel_flags_moderatedcxx . . $ pvpgn/bnetd/channel_flags_moderated.)) {
4973 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not set channel {} flags", channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel));
4974 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Unable to change channel flags."));
4975 return -1;
4976 }
4977 else {
4978 if (oldflags & channel_flags_moderatedcxx . . $ pvpgn/bnetd/channel_flags_moderated.)
4979 channel_message_sendcxx . . $ pvpgn/bnetd/channel_message_send(3c4bd88e6f433f89).(channel, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Channel is now unmoderated.").c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4980 else
4981 channel_message_sendcxx . . $ pvpgn/bnetd/channel_message_send(3c4bd88e6f433f89).(channel, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Channel is now moderated.").c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
4982 }
4983
4984 return 0;
4985 }
4986
4987 static void _reset_d1_statscxx . . $ pvpgn/bnetd/_reset_d1_stats(bc4fdadb3417eae0).(t_accountcxx . . $ pvpgn/bnetd/t_account# *account, t_clienttagcxx . . $ pvpgn/t_clienttag# ctag, t_connection *c)
4988 {
4989 account_set_normal_levelcxx . . $ pvpgn/bnetd/account_set_normal_level(d1a42c0f2badce10).(account, ctag, 0);
4990 account_set_normal_strengthcxx . . $ pvpgn/bnetd/account_set_normal_strength(d1a42c0f2badce10).(account, ctag, 0),
4991 account_set_normal_magiccxx . . $ pvpgn/bnetd/account_set_normal_magic(d1a42c0f2badce10).(account, ctag, 0),
4992 account_set_normal_dexteritycxx . . $ pvpgn/bnetd/account_set_normal_dexterity(d1a42c0f2badce10).(account, ctag, 0),
4993 account_set_normal_vitalitycxx . . $ pvpgn/bnetd/account_set_normal_vitality(d1a42c0f2badce10).(account, ctag, 0),
4994 account_set_normal_goldcxx . . $ pvpgn/bnetd/account_set_normal_gold(d1a42c0f2badce10).(account, ctag, 0);
4995
4996 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Reset {}'s {} stats", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account), clienttag_get_title(ctag));
4997 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
4998 }
4999
5000 static void _reset_scw2_statscxx . . $ pvpgn/bnetd/_reset_scw2_stats(bc4fdadb3417eae0).(t_accountcxx . . $ pvpgn/bnetd/t_account# *account, t_clienttagcxx . . $ pvpgn/t_clienttag# ctag, t_connection *c)
5001 {
5002 LadderListcxx . . $ pvpgn/bnetd/LadderList#* ladderList;
5003 unsigned int uid = account_get_uidcxx . . $ `src/bnetd/account.h:91:9`!(account);
5004
5005 account_set_normal_winscxx . . $ pvpgn/bnetd/account_set_normal_wins(d1a42c0f2badce10).(account, ctag, 0);
5006 account_set_normal_lossescxx . . $ pvpgn/bnetd/account_set_normal_losses(d1a42c0f2badce10).(account, ctag, 0);
5007 account_set_normal_drawscxx . . $ pvpgn/bnetd/account_set_normal_draws(d1a42c0f2badce10).(account, ctag, 0);
5008 account_set_normal_disconnectscxx . . $ pvpgn/bnetd/account_set_normal_disconnects(d1a42c0f2badce10).(account, ctag, 0);
5009
5010 // normal, current
5011 if (account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, ctag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.) > 0) {
5012 account_set_ladder_winscxx . . $ pvpgn/bnetd/account_set_ladder_wins(8c7f1be2c24befe).(account, ctag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., 0);
5013 account_set_ladder_lossescxx . . $ pvpgn/bnetd/account_set_ladder_losses(8c7f1be2c24befe).(account, ctag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., 0);
5014 account_set_ladder_drawscxx . . $ pvpgn/bnetd/account_set_ladder_draws(8c7f1be2c24befe).(account, ctag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., 0);
5015 account_set_ladder_disconnectscxx . . $ pvpgn/bnetd/account_set_ladder_disconnects(8c7f1be2c24befe).(account, ctag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., 0);
5016 account_set_ladder_ratingcxx . . $ pvpgn/bnetd/account_set_ladder_rating(8c7f1be2c24befe).(account, ctag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., 0);
5017 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., ctag, ladder_sort_highestratedcxx . . $ pvpgn/bnetd/ladder_sort_highestrated., ladder_time_currentcxx . . $ pvpgn/bnetd/ladder_time_current.));
5018 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5019 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5020 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., ctag, ladder_sort_mostwinscxx . . $ pvpgn/bnetd/ladder_sort_mostwins., ladder_time_currentcxx . . $ pvpgn/bnetd/ladder_time_current.));
5021 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5022 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5023 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., ctag, ladder_sort_mostgamescxx . . $ pvpgn/bnetd/ladder_sort_mostgames., ladder_time_currentcxx . . $ pvpgn/bnetd/ladder_time_current.));
5024 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5025 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5026 }
5027
5028 // ironman, current
5029 if (account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, ctag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.) > 0) {
5030 account_set_ladder_winscxx . . $ pvpgn/bnetd/account_set_ladder_wins(8c7f1be2c24befe).(account, ctag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., 0);
5031 account_set_ladder_lossescxx . . $ pvpgn/bnetd/account_set_ladder_losses(8c7f1be2c24befe).(account, ctag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., 0);
5032 account_set_ladder_drawscxx . . $ pvpgn/bnetd/account_set_ladder_draws(8c7f1be2c24befe).(account, ctag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., 0);
5033 account_set_ladder_disconnectscxx . . $ pvpgn/bnetd/account_set_ladder_disconnects(8c7f1be2c24befe).(account, ctag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., 0);
5034 account_set_ladder_ratingcxx . . $ pvpgn/bnetd/account_set_ladder_rating(8c7f1be2c24befe).(account, ctag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., 0);
5035 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., ctag, ladder_sort_highestratedcxx . . $ pvpgn/bnetd/ladder_sort_highestrated., ladder_time_currentcxx . . $ pvpgn/bnetd/ladder_time_current.));
5036 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5037 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5038 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., ctag, ladder_sort_mostwinscxx . . $ pvpgn/bnetd/ladder_sort_mostwins., ladder_time_currentcxx . . $ pvpgn/bnetd/ladder_time_current.));
5039 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5040 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5041 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., ctag, ladder_sort_mostgamescxx . . $ pvpgn/bnetd/ladder_sort_mostgames., ladder_time_currentcxx . . $ pvpgn/bnetd/ladder_time_current.));
5042 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5043 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5044 }
5045
5046 // normal, active
5047 if (account_get_ladder_active_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_active_rating(44091a2c7ac3910).(account, ctag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.) > 0) {
5048 account_set_ladder_active_winscxx . . $ pvpgn/bnetd/account_set_ladder_active_wins(8c7f1be2c24befe).(account, ctag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., 0);
5049 account_set_ladder_active_lossescxx . . $ pvpgn/bnetd/account_set_ladder_active_losses(8c7f1be2c24befe).(account, ctag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., 0);
5050 account_set_ladder_active_drawscxx . . $ pvpgn/bnetd/account_set_ladder_active_draws(8c7f1be2c24befe).(account, ctag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., 0);
5051 account_set_ladder_active_disconnectscxx . . $ pvpgn/bnetd/account_set_ladder_active_disconnects(8c7f1be2c24befe).(account, ctag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., 0);
5052 account_set_ladder_active_ratingcxx . . $ pvpgn/bnetd/account_set_ladder_active_rating(8c7f1be2c24befe).(account, ctag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., 0);
5053 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., ctag, ladder_sort_highestratedcxx . . $ pvpgn/bnetd/ladder_sort_highestrated., ladder_time_activecxx . . $ pvpgn/bnetd/ladder_time_active.));
5054 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5055 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5056 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., ctag, ladder_sort_mostwinscxx . . $ pvpgn/bnetd/ladder_sort_mostwins., ladder_time_activecxx . . $ pvpgn/bnetd/ladder_time_active.));
5057 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5058 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5059 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal., ctag, ladder_sort_mostgamescxx . . $ pvpgn/bnetd/ladder_sort_mostgames., ladder_time_activecxx . . $ pvpgn/bnetd/ladder_time_active.));
5060 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5061 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5062 }
5063
5064 // ironman, active
5065 if (account_get_ladder_active_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_active_rating(44091a2c7ac3910).(account, ctag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.) > 0) {
5066 account_set_ladder_active_winscxx . . $ pvpgn/bnetd/account_set_ladder_active_wins(8c7f1be2c24befe).(account, ctag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., 0);
5067 account_set_ladder_active_lossescxx . . $ pvpgn/bnetd/account_set_ladder_active_losses(8c7f1be2c24befe).(account, ctag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., 0);
5068 account_set_ladder_active_drawscxx . . $ pvpgn/bnetd/account_set_ladder_active_draws(8c7f1be2c24befe).(account, ctag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., 0);
5069 account_set_ladder_active_disconnectscxx . . $ pvpgn/bnetd/account_set_ladder_active_disconnects(8c7f1be2c24befe).(account, ctag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., 0);
5070 account_set_ladder_active_ratingcxx . . $ pvpgn/bnetd/account_set_ladder_active_rating(8c7f1be2c24befe).(account, ctag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., 0);
5071 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., ctag, ladder_sort_highestratedcxx . . $ pvpgn/bnetd/ladder_sort_highestrated., ladder_time_activecxx . . $ pvpgn/bnetd/ladder_time_active.));
5072 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5073 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5074 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., ctag, ladder_sort_mostwinscxx . . $ pvpgn/bnetd/ladder_sort_mostwins., ladder_time_activecxx . . $ pvpgn/bnetd/ladder_time_active.));
5075 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5076 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5077 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman., ctag, ladder_sort_mostgamescxx . . $ pvpgn/bnetd/ladder_sort_mostgames., ladder_time_activecxx . . $ pvpgn/bnetd/ladder_time_active.));
5078 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5079 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5080 }
5081
5082 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Reset {}'s {} stats", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account), clienttag_get_title(ctag));
5083 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
5084 }
5085
5086 static void _reset_w3_statscxx . . $ pvpgn/bnetd/_reset_w3_stats(bc4fdadb3417eae0).(t_accountcxx . . $ pvpgn/bnetd/t_account# *account, t_clienttagcxx . . $ pvpgn/t_clienttag# ctag, t_connection *c)
5087 {
5088 LadderListcxx . . $ pvpgn/bnetd/LadderList#* ladderList;
5089 unsigned int uid = account_get_uidcxx . . $ `src/bnetd/account.h:91:9`!(account);
5090
5091 account_set_ladder_levelcxx . . $ pvpgn/bnetd/account_set_ladder_level(8c7f1be2c24befe).(account, ctag, ladder_id_solocxx . . $ pvpgn/bnetd/ladder_id_solo., 0);
5092 account_set_ladder_xpcxx . . $ pvpgn/bnetd/account_set_ladder_xp(8c7f1be2c24befe).(account, ctag, ladder_id_solocxx . . $ pvpgn/bnetd/ladder_id_solo., 0);
5093 account_set_ladder_winscxx . . $ pvpgn/bnetd/account_set_ladder_wins(8c7f1be2c24befe).(account, ctag, ladder_id_solocxx . . $ pvpgn/bnetd/ladder_id_solo., 0);
5094 account_set_ladder_lossescxx . . $ pvpgn/bnetd/account_set_ladder_losses(8c7f1be2c24befe).(account, ctag, ladder_id_solocxx . . $ pvpgn/bnetd/ladder_id_solo., 0);
5095 account_set_ladder_rankcxx . . $ pvpgn/bnetd/account_set_ladder_rank(8c7f1be2c24befe).(account, ctag, ladder_id_solocxx . . $ pvpgn/bnetd/ladder_id_solo., 0);
5096 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_solocxx . . $ pvpgn/bnetd/ladder_id_solo., ctag, ladder_sort_defaultcxx . . $ pvpgn/bnetd/ladder_sort_default., ladder_time_defaultcxx . . $ pvpgn/bnetd/ladder_time_default.));
5097 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5098 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5099
5100 account_set_ladder_levelcxx . . $ pvpgn/bnetd/account_set_ladder_level(8c7f1be2c24befe).(account, ctag, ladder_id_teamcxx . . $ pvpgn/bnetd/ladder_id_team., 0);
5101 account_set_ladder_xpcxx . . $ pvpgn/bnetd/account_set_ladder_xp(8c7f1be2c24befe).(account, ctag, ladder_id_teamcxx . . $ pvpgn/bnetd/ladder_id_team., 0);
5102 account_set_ladder_winscxx . . $ pvpgn/bnetd/account_set_ladder_wins(8c7f1be2c24befe).(account, ctag, ladder_id_teamcxx . . $ pvpgn/bnetd/ladder_id_team., 0);
5103 account_set_ladder_lossescxx . . $ pvpgn/bnetd/account_set_ladder_losses(8c7f1be2c24befe).(account, ctag, ladder_id_teamcxx . . $ pvpgn/bnetd/ladder_id_team., 0);
5104 account_set_ladder_rankcxx . . $ pvpgn/bnetd/account_set_ladder_rank(8c7f1be2c24befe).(account, ctag, ladder_id_teamcxx . . $ pvpgn/bnetd/ladder_id_team., 0);
5105 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_teamcxx . . $ pvpgn/bnetd/ladder_id_team., ctag, ladder_sort_defaultcxx . . $ pvpgn/bnetd/ladder_sort_default., ladder_time_defaultcxx . . $ pvpgn/bnetd/ladder_time_default.));
5106 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5107 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5108
5109 account_set_ladder_levelcxx . . $ pvpgn/bnetd/account_set_ladder_level(8c7f1be2c24befe).(account, ctag, ladder_id_ffacxx . . $ pvpgn/bnetd/ladder_id_ffa., 0);
5110 account_set_ladder_xpcxx . . $ pvpgn/bnetd/account_set_ladder_xp(8c7f1be2c24befe).(account, ctag, ladder_id_ffacxx . . $ pvpgn/bnetd/ladder_id_ffa., 0);
5111 account_set_ladder_winscxx . . $ pvpgn/bnetd/account_set_ladder_wins(8c7f1be2c24befe).(account, ctag, ladder_id_ffacxx . . $ pvpgn/bnetd/ladder_id_ffa., 0);
5112 account_set_ladder_lossescxx . . $ pvpgn/bnetd/account_set_ladder_losses(8c7f1be2c24befe).(account, ctag, ladder_id_ffacxx . . $ pvpgn/bnetd/ladder_id_ffa., 0);
5113 account_set_ladder_rankcxx . . $ pvpgn/bnetd/account_set_ladder_rank(8c7f1be2c24befe).(account, ctag, ladder_id_ffacxx . . $ pvpgn/bnetd/ladder_id_ffa., 0);
5114 ladderList = ladderscxx . . $ pvpgn/bnetd/ladders..getLadderListcxx . . $ pvpgn/bnetd/Ladders#getLadderList(2c0c64fbd1351270).(LadderKeycxx . . $ pvpgn/bnetd/LadderKey#LadderKey(f0da15e05d48c065).(ladder_id_ffacxx . . $ pvpgn/bnetd/ladder_id_ffa., ctag, ladder_sort_defaultcxx . . $ pvpgn/bnetd/ladder_sort_default., ladder_time_defaultcxx . . $ pvpgn/bnetd/ladder_time_default.));
5115 if (ladderList != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
5116 ladderList->delEntrycxx . . $ pvpgn/bnetd/LadderList#delEntry(dfa6e707f7696010).(uid);
5117 // this would now need a way to delete the team for all members now
5118 //account_set_atteamcount(account,ctag,0);
5119
5120 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Reset {}'s {} stats", account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account), clienttag_get_title(ctag));
5121 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, msgtempcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).);
5122 }
5123
5124 static int _handle_clearstats_commandcxx . . $ pvpgn/bnetd/_handle_clearstats_command(2e9022cda97b266d).(t_connection *c, char const *text)
5125 {
5126 char const * username, * tag;
5127 unsigned int all;
5128 t_accountcxx . . $ pvpgn/bnetd/t_account# * account;
5129 t_clienttagcxx . . $ pvpgn/t_clienttag# ctag = 0;
5130
5131 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 2);
5132 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
5133 {
5134 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
5135 return -1;
5136 }
5137 username = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).();
5138 tag = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).2].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(); // clienttag
5139
5140 account = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(username);
5141 if (!account) {
5142 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Invalid user."));
5143 return -1;
5144 }
5145
5146 if (strcasecmp(tag, "all") != 0)
5147 {
5148 ctag = tag_validate_clientcxx . . $ pvpgn/tag_validate_client(c61c63047ce273de).(tag);
5149 all = 0;
5150 }
5151 else all = 1;
5152
5153 if (all || ctag == CLIENTTAG_DIABLORTL_UINTcxx . . $ `src/common/tag.h:93:9`!)
5154 _reset_d1_statscxx . . $ pvpgn/bnetd/_reset_d1_stats(bc4fdadb3417eae0).(account, CLIENTTAG_DIABLORTL_UINTcxx . . $ `src/common/tag.h:93:9`!, c);
5155
5156 if (all || ctag == CLIENTTAG_DIABLOSHR_UINTcxx . . $ `src/common/tag.h:95:9`!)
5157 _reset_d1_statscxx . . $ pvpgn/bnetd/_reset_d1_stats(bc4fdadb3417eae0).(account, CLIENTTAG_DIABLOSHR_UINTcxx . . $ `src/common/tag.h:95:9`!, c);
5158
5159 if (all || ctag == CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!)
5160 _reset_scw2_statscxx . . $ pvpgn/bnetd/_reset_scw2_stats(bc4fdadb3417eae0).(account, CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`!, c);
5161
5162 if (all || ctag == CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`!)
5163 _reset_scw2_statscxx . . $ pvpgn/bnetd/_reset_scw2_stats(bc4fdadb3417eae0).(account, CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`!, c);
5164
5165 if (all || ctag == CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`!)
5166 _reset_scw2_statscxx . . $ pvpgn/bnetd/_reset_scw2_stats(bc4fdadb3417eae0).(account, CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`!, c);
5167
5168 if (all || ctag == CLIENTTAG_SHAREWARE_UINTcxx . . $ `src/common/tag.h:91:9`!)
5169 _reset_scw2_statscxx . . $ pvpgn/bnetd/_reset_scw2_stats(bc4fdadb3417eae0).(account, CLIENTTAG_SHAREWARE_UINTcxx . . $ `src/common/tag.h:91:9`!, c);
5170
5171 if (all || ctag == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!)
5172 _reset_w3_statscxx . . $ pvpgn/bnetd/_reset_w3_stats(bc4fdadb3417eae0).(account, CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!, c);
5173
5174 if (all || ctag == CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!)
5175 _reset_w3_statscxx . . $ pvpgn/bnetd/_reset_w3_stats(bc4fdadb3417eae0).(account, CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!, c);
5176
5177 ladderscxx . . $ pvpgn/bnetd/ladders..updatecxx . . $ pvpgn/bnetd/Ladders#update(49f6e7a06ebc5aa8).();
5178
5179 return 0;
5180 }
5181
5182 /* Send message to all clients (similar to announce, but in messagebox) */
5183 static int _handle_alert_commandcxx . . $ pvpgn/bnetd/_handle_alert_command(2e9022cda97b266d).(t_connection * c, char const * text)
5184 {
5185 t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag;
5186 t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag_dest;
5187
5188 clienttag = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c);
5189 // disallow clients that doesn't support SID_MESSAGEBOX
5190 if (clienttag != CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`! && clienttag != CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`! && clienttag != CLIENTTAG_STARJAPAN_UINTcxx . . $ `src/common/tag.h:101:9`! && clienttag != CLIENTTAG_SHAREWARE_UINTcxx . . $ `src/common/tag.h:91:9`! &&
5191 clienttag != CLIENTTAG_DIABLORTL_UINTcxx . . $ `src/common/tag.h:93:9`! && clienttag != CLIENTTAG_DIABLOSHR_UINTcxx . . $ `src/common/tag.h:95:9`! &&
5192 clienttag != CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`! && clienttag != CLIENTTAG_BNCHATBOT_UINTcxx . . $ `src/common/tag.h:85:9`!)
5193 {
5194 message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Your game client doesn't support MessageBox."));
5195 return -1;
5196 }
5197
5198 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> args = split_commandcxx . . $ pvpgn/bnetd/split_command(36641c1b5e9c088b).(text, 1);
5199 if (args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1].emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).())
5200 {
5201 describe_commandcxx . . $ pvpgn/bnetd/describe_command(2e9022cda97b266d).(c, args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
5202 return -1;
5203 }
5204
5205 // reduntant line - it adds a caption to message box
5206 stdcxx . . $ std/::stringcxx . . $ std/string# goodtext = args[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] +cxx . . $ std/operator+(ee59693d670ab61e). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "\n\n***************************\nBy {}", conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(c));
5207
5208 // caption
5209 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Information from {}", prefs_get_servername());
5210 msgtempcxx . . $ pvpgn/bnetd/msgtemp. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, " for {}", prefs_get_servername());
5211
5212 t_connection * conn;
5213 t_elemcxx . . $ pvpgn/t_elem# const * curr;
5214 // send to online users
5215 LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(connlist(), curr)
5216 {
5217 if (conn = (t_connection*)elem_get_data(curr))
5218 {
5219 clienttag_dest = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(conn);
5220
5221 if (clienttag_dest != CLIENTTAG_STARCRAFT_UINTcxx . . $ `src/common/tag.h:87:9`! && clienttag_dest != CLIENTTAG_BROODWARS_UINTcxx . . $ `src/common/tag.h:89:9`! && clienttag_dest != CLIENTTAG_STARJAPAN_UINTcxx . . $ `src/common/tag.h:101:9`! && clienttag_dest != CLIENTTAG_SHAREWARE_UINTcxx . . $ `src/common/tag.h:91:9`! &&
5222 clienttag_dest != CLIENTTAG_DIABLORTL_UINTcxx . . $ `src/common/tag.h:93:9`! && clienttag_dest != CLIENTTAG_DIABLOSHR_UINTcxx . . $ `src/common/tag.h:95:9`! &&
5223 clienttag_dest != CLIENTTAG_WARCIIBNE_UINTcxx . . $ `src/common/tag.h:97:9`! && clienttag_dest != CLIENTTAG_BNCHATBOT_UINTcxx . . $ `src/common/tag.h:85:9`!) {
5224 continue;
5225 }
5226 messagebox_showcxx . . $ pvpgn/bnetd/messagebox_show(fd732d9674eb4b7c).(conn, goodtext.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), msgtempcxx . . $ pvpgn/bnetd/msgtemp..c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).());
5227 }
5228 }
5229
5230 return 0;
5231 }
5232
5233 }
5234 }