| 1 | /* |
| 2 | * Copyright (C) 1998 Mark Baysinger ([email protected]) |
| 3 | * Copyright (C) 1998,1999,2000,2001 Ross Combs ([email protected]) |
| 4 | * Copyright (C) 2000,2001 Marco Ziech ([email protected]) |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version 2 |
| 9 | * of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 19 | */ |
| 20 | #define CONNECTION_INTERNAL_ACCESScxx . . $ `src/bnetd/connection.cpp:20:9`! |
| 21 | #include "common/setup_before.h"cxx . . $ `<file>/src/common/setup_before.h`/ |
| 22 | #include "connection.h"cxx . . $ `<file>/src/bnetd/connection.h`/ |
| 23 | |
| 24 | #include <cerrno> |
| 25 | #include <cstring> |
| 26 | #include <cassert> |
| 27 | |
| 28 | #ifdef WIN32_GUI |
| 29 | #include <win32/winmain.h> |
| 30 | #endif |
| 31 | #include "compat/strcasecmp.h"cxx . . $ `<file>/src/compat/strcasecmp.h`/ |
| 32 | #include "compat/strncasecmp.h"cxx . . $ `<file>/src/compat/strncasecmp.h`/ |
| 33 | #include "compat/socket.h"cxx . . $ `<file>/src/compat/socket.h`/ |
| 34 | #include "compat/psock.h"cxx . . $ `<file>/src/compat/psock.h`/ |
| 35 | #include "common/eventlog.h"cxx . . $ `<file>/src/common/eventlog.h`/ |
| 36 | #include "common/addr.h"cxx . . $ `<file>/src/common/addr.h`/ |
| 37 | #include "common/queue.h"cxx . . $ `<file>/src/common/queue.h`/ |
| 38 | #include "common/packet.h"cxx . . $ `<file>/src/common/packet.h`/ |
| 39 | #include "common/tag.h"cxx . . $ `<file>/src/common/tag.h`/ |
| 40 | #include "common/bn_type.h"cxx . . $ `<file>/src/common/bn_type.h`/ |
| 41 | #include "common/version.h"cxx . . $ `<file>/src/common/version.h`/ |
| 42 | #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/ |
| 43 | #include "common/list.h"cxx . . $ `<file>/src/common/list.h`/ |
| 44 | #include "common/bnet_protocol.h"cxx . . $ `<file>/src/common/bnet_protocol.h`/ |
| 45 | #include "common/field_sizes.h"cxx . . $ `<file>/src/common/field_sizes.h`/ |
| 46 | #include "common/rcm.h"cxx . . $ `<file>/src/common/rcm.h`/ |
| 47 | #include "common/fdwatch.h"cxx . . $ `<file>/src/common/fdwatch.h`/ |
| 48 | #include "common/elist.h"cxx . . $ `<file>/src/common/elist.h`/ |
| 49 | #include "common/xalloc.h"cxx . . $ `<file>/src/common/xalloc.h`/ |
| 50 | |
| 51 | #include "account.h"cxx . . $ `<file>/src/bnetd/account.h`/ |
| 52 | #include "account_wrap.h"cxx . . $ `<file>/src/bnetd/account_wrap.h`/ |
| 53 | #include "realm.h"cxx . . $ `<file>/src/bnetd/realm.h`/ |
| 54 | #include "channel.h"cxx . . $ `<file>/src/bnetd/channel.h`/ |
| 55 | #include "game.h"cxx . . $ `<file>/src/bnetd/game.h`/ |
| 56 | #include "tick.h"cxx . . $ `<file>/src/bnetd/tick.h`/ |
| 57 | #include "message.h"cxx . . $ `<file>/src/bnetd/message.h`/ |
| 58 | #include "prefs.h"cxx . . $ `<file>/src/bnetd/prefs.h`/ |
| 59 | #include "watch.h"cxx . . $ `<file>/src/bnetd/watch.h`/ |
| 60 | #include "timer.h"cxx . . $ `<file>/src/bnetd/timer.h`/ |
| 61 | #include "irc.h"cxx . . $ `<file>/src/bnetd/irc.h`/ |
| 62 | #include "ipban.h"cxx . . $ `<file>/src/bnetd/ipban.h`/ |
| 63 | #include "game_conv.h"cxx . . $ `<file>/src/bnetd/game_conv.h`/ |
| 64 | #include "udptest_send.h"cxx . . $ `<file>/src/bnetd/udptest_send.h`/ |
| 65 | #include "character.h"cxx . . $ `<file>/src/bnetd/character.h`/ |
| 66 | #include "versioncheck.h"cxx . . $ `<file>/src/bnetd/versioncheck.h`/ |
| 67 | #include "anongame.h"cxx . . $ `<file>/src/bnetd/anongame.h`/ |
| 68 | #include "clan.h"cxx . . $ `<file>/src/bnetd/clan.h`/ |
| 69 | #include "topic.h"cxx . . $ `<file>/src/bnetd/topic.h`/ |
| 70 | #include "server.h"cxx . . $ `<file>/src/bnetd/server.h`/ |
| 71 | #include "handle_d2cs.h"cxx . . $ `<file>/src/bnetd/handle_d2cs.h`/ |
| 72 | #include "command_groups.h"cxx . . $ `<file>/src/bnetd/command_groups.h`/ |
| 73 | #include "attrlayer.h"cxx . . $ `<file>/src/bnetd/attrlayer.h`/ |
| 74 | #include "anongame_wol.h"cxx . . $ `<file>/src/bnetd/anongame_wol.h`/ |
| 75 | #include "icons.h"cxx . . $ `<file>/src/bnetd/icons.h`/ |
| 76 | #include "i18n.h"cxx . . $ `<file>/src/bnetd/i18n.h`/ |
| 77 | #include "common/setup_after.h"cxx . . $ `<file>/src/common/setup_after.h`/ |
| 78 | #include "prefs.h"cxx . . $ `<file>/src/bnetd/prefs.h`/ |
| 79 | |
| 80 | #ifdef WITH_LUA |
| 81 | #include "luainterface.h" |
| 82 | #endif |
| 83 | |
| 84 | namespace pvpgncxx . . $ pvpgn/ |
| 85 | { |
| 86 | |
| 87 | namespace bnetdcxx . . $ pvpgn/bnetd/ |
| 88 | { |
| 89 | |
| 90 | /* types and data structures used for the connlist array */ |
| 91 | typedef structcxx . . $ pvpgn/bnetd/$anonymous_type_7688b6786bdcb7f2_0# { |
| 92 | t_connectioncxx . . $ pvpgn/bnetd/t_connection# *ccxx . . $ pvpgn/bnetd/$anonymous_type_7688b6786bdcb7f2_0#c.; |
| 93 | t_elistcxx . . $ pvpgn/t_elist# freelistcxx . . $ pvpgn/bnetd/$anonymous_type_7688b6786bdcb7f2_0#freelist.; |
| 94 | } t_conn_entrycxx . . $ pvpgn/bnetd/t_conn_entry#; |
| 95 | |
| 96 | t_conn_entrycxx . . $ pvpgn/bnetd/t_conn_entry# *connarraycxx . . $ pvpgn/bnetd/connarray. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 97 | t_elistcxx . . $ pvpgn/t_elist# arrayflistcxx . . $ pvpgn/bnetd/arrayflist.; |
| 98 | |
| 99 | static int totalcountcxx . . $ pvpgn/bnetd/totalcount. = 0; |
| 100 | static t_list * conn_headcxx . . $ pvpgn/bnetd/conn_head. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 101 | static t_list * conn_deadcxx . . $ pvpgn/bnetd/conn_dead. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 102 | |
| 103 | static void conn_send_welcomecxx . . $ pvpgn/bnetd/conn_send_welcome(428cd989165da3c5).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c); |
| 104 | static void conn_send_issuecxx . . $ pvpgn/bnetd/conn_send_issue(428cd989165da3c5).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c); |
| 105 | |
| 106 | static int connarray_createcxx . . $ pvpgn/bnetd/connarray_create(b126dc7c1de90089).(void); |
| 107 | static void connarray_destroycxx . . $ pvpgn/bnetd/connarray_destroy(49f6e7a06ebc5aa8).(void); |
| 108 | static t_connectioncxx . . $ pvpgn/bnetd/t_connection# *connarray_get_conncxx . . $ pvpgn/bnetd/connarray_get_conn(d9e2ca1f510d44cc).(unsigned index); |
| 109 | static unsigned connarray_add_conncxx . . $ pvpgn/bnetd/connarray_add_conn(c9be5e844f0af884).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c); |
| 110 | static void connarray_del_conncxx . . $ pvpgn/bnetd/connarray_del_conn(cb2f890c2fdad230).(unsigned index); |
| 111 | |
| 112 | static void conn_send_welcomecxx . . $ pvpgn/bnetd/conn_send_welcome(428cd989165da3c5).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 113 | { |
| 114 | char const * filename; |
| 115 | stdcxx . . $ std/::FILEcxx . . $ std/FILE# * fp; |
| 116 | |
| 117 | if (!c) |
| 118 | { |
| 119 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 120 | return; |
| 121 | } |
| 122 | |
| 123 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. & conn_flags_welcomedcxx . . $ pvpgn/bnetd/conn_flags_welcomed.) |
| 124 | return; |
| 125 | |
| 126 | if ((conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(c) == conn_class_irccxx . . $ pvpgn/bnetd/conn_class_irc.) || (conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(c) == conn_class_wolcxx . . $ pvpgn/bnetd/conn_class_wol.)) |
| 127 | { |
| 128 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. |= conn_flags_welcomedcxx . . $ pvpgn/bnetd/conn_flags_welcomed.; |
| 129 | return; |
| 130 | } |
| 131 | |
| 132 | if (filename = prefs_get_motdfilecxx . . $ pvpgn/bnetd/prefs_get_motdfile(33a1f659e94feb42).()) |
| 133 | { |
| 134 | stdcxx . . $ std/::stringcxx . . $ std/string# lang_filename = i18n_filenamecxx . . $ pvpgn/bnetd/i18n_filename(caf975da75400ef4).(filename, conn_get_gamelang_localizedcxx . . $ pvpgn/bnetd/conn_get_gamelang_localized(c9be5e844f0af884).(c)); |
| 135 | if (fp = stdcxx . . $ std/::fopencxx . . $ std/fopen(82ec0787cd37e0a3).(lang_filename.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), "r")) |
| 136 | { |
| 137 | message_send_filecxx . . $ pvpgn/bnetd/message_send_file(97063c28d6bb8792).(c, fp); |
| 138 | if (stdcxx . . $ std/::fclosecxx . . $ std/fclose(89bc1efcdac0ca22).(fp) < 0) |
| 139 | { |
| 140 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not close MOTD file \"{}\" after reading (std::fopen: {})", lang_filename, stdcxx . . $ std/::strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 141 | } |
| 142 | } |
| 143 | else |
| 144 | { |
| 145 | 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`!)); |
| 146 | } |
| 147 | } |
| 148 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. |= conn_flags_welcomedcxx . . $ pvpgn/bnetd/conn_flags_welcomed.; |
| 149 | } |
| 150 | |
| 151 | |
| 152 | static void conn_send_issuecxx . . $ pvpgn/bnetd/conn_send_issue(428cd989165da3c5).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 153 | { |
| 154 | char const * filename; |
| 155 | stdcxx . . $ std/::FILEcxx . . $ std/FILE# * fp; |
| 156 | |
| 157 | if (!c) |
| 158 | { |
| 159 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 160 | return; |
| 161 | } |
| 162 | |
| 163 | if ((filename = prefs_get_issuefilecxx . . $ pvpgn/bnetd/prefs_get_issuefile(33a1f659e94feb42).())) |
| 164 | if ((fp = stdcxx . . $ std/::fopencxx . . $ std/fopen(82ec0787cd37e0a3).(filename, "r"))) |
| 165 | { |
| 166 | message_send_filecxx . . $ pvpgn/bnetd/message_send_file(97063c28d6bb8792).(c, fp); |
| 167 | if (stdcxx . . $ std/::fclosecxx . . $ std/fclose(89bc1efcdac0ca22).(fp) < 0) |
| 168 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not close issue file \"{}\" after reading (std::fopen: {})", filename, stdcxx . . $ std/::strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 169 | } |
| 170 | else |
| 171 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not open issue file \"{}\" for reading (std::fopen: {})", filename, stdcxx . . $ std/::strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 172 | else |
| 173 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_debugcxx . . $ pvpgn/eventlog_level_debug., __FUNCTION__, "no issue file"); |
| 174 | } |
| 175 | |
| 176 | // [zap-zero] 20020629 |
| 177 | extern void conn_shutdowncxx . . $ pvpgn/bnetd/conn_shutdown(9b6c929c3dbc4c93).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, stdcxx . . $ std/::time_tcxx . . $ std/time_t# now, t_timer_datacxx . . $ pvpgn/bnetd/t_timer_data# foo) |
| 178 | { |
| 179 | if (!c) |
| 180 | { |
| 181 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 182 | return; |
| 183 | } |
| 184 | |
| 185 | if (now == (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)0) /* zero means user logged out before expiration */ |
| 186 | { |
| 187 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_tracecxx . . $ pvpgn/eventlog_level_trace., __FUNCTION__, "[{}] connection already closed", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c)); |
| 188 | return; |
| 189 | } |
| 190 | |
| 191 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_tracecxx . . $ pvpgn/eventlog_level_trace., __FUNCTION__, "[{}] closing connection", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c)); |
| 192 | |
| 193 | conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(c, conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.); |
| 194 | } |
| 195 | |
| 196 | extern void conn_test_latencycxx . . $ pvpgn/bnetd/conn_test_latency(9b6c929c3dbc4c93).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, stdcxx . . $ std/::time_tcxx . . $ std/time_t# now, t_timer_datacxx . . $ pvpgn/bnetd/t_timer_data# delta) |
| 197 | { |
| 198 | t_packetcxx . . $ pvpgn/t_packet# * packet; |
| 199 | |
| 200 | if (!c) |
| 201 | { |
| 202 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 203 | return; |
| 204 | } |
| 205 | |
| 206 | |
| 207 | if (now == (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)0) /* zero means user logged out before expiration */ |
| 208 | return; |
| 209 | |
| 210 | if (conn_get_statecxx . . $ pvpgn/bnetd/conn_get_state(14586157a79399d4).(c) == conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.) // [zap-zero] 20020910 |
| 211 | return; // state_destroy: do nothing |
| 212 | |
| 213 | |
| 214 | if ((conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(c) == conn_class_irccxx . . $ pvpgn/bnetd/conn_class_irc.) || (conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(c) == conn_class_wolcxx . . $ pvpgn/bnetd/conn_class_wol.)) { |
| 215 | /* We should start pinging the client after we received the first line ... */ |
| 216 | /* NOTE: RFC2812 only suggests that PINGs are being sent |
| 217 | * if no other activity is detected. However it explecitly |
| 218 | * allows PINGs to be sent if there is activity on this |
| 219 | * connection. In other words we just don't care :) |
| 220 | */ |
| 221 | if (conn_get_ircpingcxx . . $ pvpgn/bnetd/conn_get_ircping(8bd2285a65940781).(c) != 0) { |
| 222 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_warncxx . . $ pvpgn/eventlog_level_warn., __FUNCTION__, "[{}] ping timeout (closing connection)", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c)); |
| 223 | conn_set_latencycxx . . $ pvpgn/bnetd/conn_set_latency(d97ad1b62a895b69).(c, 0); |
| 224 | conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(c, conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.); |
| 225 | } |
| 226 | irc_send_pingcxx . . $ pvpgn/bnetd/irc_send_ping(c4dfbc2386fe4fc3).(c); |
| 227 | } |
| 228 | else if (conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(c) == conn_class_w3routecxx . . $ pvpgn/bnetd/conn_class_w3route.) { |
| 229 | if (!(packet = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_w3routecxx . . $ pvpgn/packet_class_w3route.))) { |
| 230 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "[{}] packet_create failed", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c)); |
| 231 | } |
| 232 | else { |
| 233 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(packet, sizeof(t_server_w3route_echoreqcxx . . $ pvpgn/t_server_w3route_echoreq#)); |
| 234 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(packet, SERVER_W3ROUTE_ECHOREQcxx . . $ `src/common/bnet_protocol.h:166:9`!); |
| 235 | bn_int_setcxx . . $ pvpgn/bn_int_set(e97e500db3ec3c79).(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_w3route_echoreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_w3route_echoreq..tickscxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_10#ticks., get_tickscxx . . $ pvpgn/bnetd/get_ticks(db52760e79bf9054).()); |
| 236 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, packet); |
| 237 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(packet); |
| 238 | } |
| 239 | } |
| 240 | else { |
| 241 | |
| 242 | /* FIXME: I think real Battle.net sends these even before login */ |
| 243 | if (!conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(c)) |
| 244 | { |
| 245 | if ((packet = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 246 | { |
| 247 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(packet, sizeof(t_server_echoreqcxx . . $ pvpgn/t_server_echoreq#)); |
| 248 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(packet, SERVER_ECHOREQcxx . . $ `src/common/bnet_protocol.h:3444:9`!); |
| 249 | bn_int_setcxx . . $ pvpgn/bn_int_set(e97e500db3ec3c79).(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_echoreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_echoreq..tickscxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_130#ticks., get_tickscxx . . $ pvpgn/bnetd/get_ticks(db52760e79bf9054).()); |
| 250 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, packet); |
| 251 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(packet); |
| 252 | } |
| 253 | else |
| 254 | { |
| 255 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not create packet"); |
| 256 | } |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | if (timerlist_add_timercxx . . $ pvpgn/bnetd/timerlist_add_timer(f16dcbfb825fabda).(c, now + (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)delta.ncxx . . $ pvpgn/bnetd/$anonymous_type_64e82d6b10ad28f9_0#n., conn_test_latencycxx . . $ pvpgn/bnetd/conn_test_latency(9b6c929c3dbc4c93)., delta) < 0) |
| 261 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not add timer"); |
| 262 | } |
| 263 | |
| 264 | |
| 265 | static void conn_send_nullmsgcxx . . $ pvpgn/bnetd/conn_send_nullmsg(9b6c929c3dbc4c93).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, stdcxx . . $ std/::time_tcxx . . $ std/time_t# now, t_timer_datacxx . . $ pvpgn/bnetd/t_timer_data# delta) |
| 266 | { |
| 267 | if (!c) |
| 268 | { |
| 269 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 270 | return; |
| 271 | } |
| 272 | |
| 273 | if (now == (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)0) /* zero means user logged out before expiration */ |
| 274 | return; |
| 275 | |
| 276 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_null, c, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 277 | |
| 278 | if (timerlist_add_timercxx . . $ pvpgn/bnetd/timerlist_add_timer(f16dcbfb825fabda).(c, now + (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)delta.ncxx . . $ pvpgn/bnetd/$anonymous_type_64e82d6b10ad28f9_0#n., conn_send_nullmsgcxx . . $ pvpgn/bnetd/conn_send_nullmsg(9b6c929c3dbc4c93)., delta) < 0) |
| 279 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not add timer"); |
| 280 | } |
| 281 | |
| 282 | |
| 283 | extern char const * conn_class_get_strcxx . . $ pvpgn/bnetd/conn_class_get_str(197fb956ae47a8f8).(t_conn_classcxx . . $ pvpgn/bnetd/t_conn_class# cclass) |
| 284 | { |
| 285 | switch (cclass) |
| 286 | { |
| 287 | case conn_class_initcxx . . $ pvpgn/bnetd/conn_class_init.: |
| 288 | return "init"; |
| 289 | case conn_class_bnetcxx . . $ pvpgn/bnetd/conn_class_bnet.: |
| 290 | return "bnet"; |
| 291 | case conn_class_filecxx . . $ pvpgn/bnetd/conn_class_file.: |
| 292 | return "file"; |
| 293 | case conn_class_botcxx . . $ pvpgn/bnetd/conn_class_bot.: |
| 294 | return "bot"; |
| 295 | case conn_class_d2cs_bnetdcxx . . $ pvpgn/bnetd/conn_class_d2cs_bnetd.: |
| 296 | return "d2cs_bnetd"; |
| 297 | case conn_class_telnetcxx . . $ pvpgn/bnetd/conn_class_telnet.: |
| 298 | return "telnet"; |
| 299 | case conn_class_irccxx . . $ pvpgn/bnetd/conn_class_irc.: |
| 300 | return "irc"; |
| 301 | case conn_class_wolcxx . . $ pvpgn/bnetd/conn_class_wol.: |
| 302 | return "wol"; |
| 303 | case conn_class_wservcxx . . $ pvpgn/bnetd/conn_class_wserv.: |
| 304 | return "wserv"; |
| 305 | case conn_class_apiregcxx . . $ pvpgn/bnetd/conn_class_apireg.: |
| 306 | return "apireg"; |
| 307 | case conn_class_wgamerescxx . . $ pvpgn/bnetd/conn_class_wgameres.: |
| 308 | return "wgameres"; |
| 309 | case conn_class_wladdercxx . . $ pvpgn/bnetd/conn_class_wladder.: |
| 310 | return "wladder"; |
| 311 | case conn_class_nonecxx . . $ pvpgn/bnetd/conn_class_none.: |
| 312 | return "none"; |
| 313 | case conn_class_w3routecxx . . $ pvpgn/bnetd/conn_class_w3route.: |
| 314 | return "w3route"; |
| 315 | default: |
| 316 | return "UNKNOWN"; |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | |
| 321 | extern char const * conn_state_get_strcxx . . $ pvpgn/bnetd/conn_state_get_str(8beab9044c5fcbfa).(t_conn_statecxx . . $ pvpgn/bnetd/t_conn_state# state) |
| 322 | { |
| 323 | switch (state) |
| 324 | { |
| 325 | case conn_state_emptycxx . . $ pvpgn/bnetd/conn_state_empty.: |
| 326 | return "empty"; |
| 327 | case conn_state_initialcxx . . $ pvpgn/bnetd/conn_state_initial.: |
| 328 | return "initial"; |
| 329 | case conn_state_connectedcxx . . $ pvpgn/bnetd/conn_state_connected.: |
| 330 | return "connected"; |
| 331 | case conn_state_bot_usernamecxx . . $ pvpgn/bnetd/conn_state_bot_username.: |
| 332 | return "bot_username"; |
| 333 | case conn_state_bot_passwordcxx . . $ pvpgn/bnetd/conn_state_bot_password.: |
| 334 | return "bot_password"; |
| 335 | case conn_state_loggedincxx . . $ pvpgn/bnetd/conn_state_loggedin.: |
| 336 | return "loggedin"; |
| 337 | case conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.: |
| 338 | return "destroy"; |
| 339 | case conn_state_untrustedcxx . . $ pvpgn/bnetd/conn_state_untrusted.: |
| 340 | return "untrusted"; |
| 341 | case conn_state_pending_rawcxx . . $ pvpgn/bnetd/conn_state_pending_raw.: |
| 342 | return "pending_raw"; |
| 343 | default: |
| 344 | return "UNKNOWN"; |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | extern int conn_set_realm_cbcxx . . $ pvpgn/bnetd/conn_set_realm_cb(361d5d7064a2a85d).(void *data, void *newref); |
| 349 | |
| 350 | extern t_connectioncxx . . $ pvpgn/bnetd/t_connection# * conn_createcxx . . $ pvpgn/bnetd/conn_create(7c33ab42ebdb8351).(int tsock, int usock, unsigned int real_local_addr, unsigned short real_local_port, unsigned int local_addr, unsigned short local_port, unsigned int addr, unsigned short port) |
| 351 | { |
| 352 | t_connectioncxx . . $ pvpgn/bnetd/t_connection# * temp; |
| 353 | |
| 354 | |
| 355 | if (tsock < 0) |
| 356 | { |
| 357 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got bad TCP socket {}", tsock); |
| 358 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 359 | } |
| 360 | if (usock < -1) /* -1 is allowed for some connection classes like bot, irc, and telnet */ |
| 361 | { |
| 362 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got bad UDP socket {}", usock); |
| 363 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 364 | } |
| 365 | |
| 366 | temp = (t_connectioncxx . . $ pvpgn/bnetd/t_connection#*)xmalloccxx . . $ `src/common/xalloc.h:43:9`!(sizeof(t_connection)); |
| 367 | temp->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_sockcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_sock. = tsock; |
| 368 | temp->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_addrcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_addr. = addr; |
| 369 | temp->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_portcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_port. = port; |
| 370 | temp->socketcxx . . $ pvpgn/bnetd/connection#socket..udp_sockcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#udp_sock. = usock; |
| 371 | temp->socketcxx . . $ pvpgn/bnetd/connection#socket..udp_addrcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#udp_addr. = addr; /* same for now but client can request it to be different */ |
| 372 | temp->socketcxx . . $ pvpgn/bnetd/connection#socket..local_addrcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#local_addr. = local_addr; |
| 373 | temp->socketcxx . . $ pvpgn/bnetd/connection#socket..local_portcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#local_port. = local_port; |
| 374 | temp->socketcxx . . $ pvpgn/bnetd/connection#socket..real_local_addrcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#real_local_addr. = real_local_addr; |
| 375 | temp->socketcxx . . $ pvpgn/bnetd/connection#socket..real_local_portcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#real_local_port. = real_local_port; |
| 376 | temp->socketcxx . . $ pvpgn/bnetd/connection#socket..udp_portcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#udp_port. = port; |
| 377 | temp->socketcxx . . $ pvpgn/bnetd/connection#socket..fdw_idxcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#fdw_idx. = -1; |
| 378 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. = conn_class_initcxx . . $ pvpgn/bnetd/conn_class_init.; |
| 379 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..statecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#state. = conn_state_initialcxx . . $ pvpgn/bnetd/conn_state_initial.; |
| 380 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..sessionkeycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#sessionkey. = ((unsigned int)stdcxx . . $ std/::rand()) ^ ((unsigned int)nowcxx . . $ pvpgn/bnetd/now. + (unsigned int)real_local_port); |
| 381 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..sessionnumcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#sessionnum. = connarray_add_conncxx . . $ pvpgn/bnetd/connarray_add_conn(c9be5e844f0af884).(temp); |
| 382 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..secretcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#secret. = ((unsigned int)stdcxx . . $ std/::rand()) ^ (totalcountcxx . . $ pvpgn/bnetd/totalcount. + ((unsigned int)nowcxx . . $ pvpgn/bnetd/now.)); |
| 383 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..flagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#flags. = MF_PLUGcxx . . $ `src/common/bnet_protocol.h:2578:9`!; |
| 384 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..latencycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#latency. = 0; |
| 385 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..dndcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#dnd. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 386 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..awaycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#away. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 387 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_listcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 388 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_count. = 0; |
| 389 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..quotacxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#quota..totcountcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_1#totcount. = 0; |
| 390 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..quotacxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#quota..listcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_1#list. = list_create(); |
| 391 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..versionidcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#versionid. = 0; |
| 392 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..gameversioncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#gameversion. = 0; |
| 393 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..checksumcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#checksum. = 0; |
| 394 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..archtagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#archtag. = 0; |
| 395 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag. = 0; |
| 396 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientvercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientver. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 397 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..gamelangcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#gamelang. = 0; |
| 398 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..countrycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#country. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 399 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..tzbiascxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#tzbias. = 0; |
| 400 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..hostcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#host. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 401 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..usercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#user. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 402 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientexecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientexe. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 403 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..ownercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#owner. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 404 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..cdkeycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#cdkey. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 405 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..versioncheckcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#versioncheck. = nullptr; |
| 406 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 407 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 408 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..last_messagecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#last_message. = nowcxx . . $ pvpgn/bnetd/now.; |
| 409 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..lastsendercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#lastsender. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 410 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..irclinecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircline. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 411 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..ircpingcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircping. = 0; |
| 412 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..ircpasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircpass. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 413 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..tmpOP_channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#tmpOP_channel. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 414 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..tmpVOICE_channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#tmpVOICE_channel. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 415 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 416 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outqueue. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 417 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outsizecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outsize. = 0; |
| 418 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outsizepcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outsizep. = 0; |
| 419 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..inqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#inqueue. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 420 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..insizecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#insize. = 0; |
| 421 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..loggedusercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#loggeduser. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 422 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 423 | rcm_regref_initcxx . . $ pvpgn/rcm_regref_init(93d760c169d7201f).(&temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realm_regrefcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm_regref., &conn_set_realm_cbcxx . . $ pvpgn/bnetd/conn_set_realm_cb(361d5d7064a2a85d)., temp); |
| 424 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charactercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#character. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 425 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realminfocxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realminfo. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 426 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charnamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#charname. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 427 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..w3_playerinfocxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#w3_playerinfo. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 428 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..routeconncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#routeconn. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 429 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..anongamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#anongame. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 430 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..anongame_search_starttimecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#anongame_search_starttime. = 0; |
| 431 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..client_proofcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#client_proof. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 432 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..server_proofcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#server_proof. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 433 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..boundcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#bound. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 434 | elist_initcxx . . $ `src/common/elist.h:193:9`!(&temp->protocol.timers); |
| 435 | |
| 436 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..ingamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#ingame. = 0; |
| 437 | |
| 438 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..codepagecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#codepage. = 0; |
| 439 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..pagemecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#pageme. = true; |
| 440 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..findmecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#findme. = true; |
| 441 | |
| 442 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..apgarcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#apgar. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 443 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..anongame_playercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#anongame_player. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 444 | |
| 445 | |
| 446 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cr_timecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cr_time. = nowcxx . . $ pvpgn/bnetd/now.; |
| 447 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..passfail_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#passfail_count. = 0; |
| 448 | |
| 449 | |
| 450 | temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. = 0; |
| 451 | |
| 452 | list_prepend_data(conn_headcxx . . $ pvpgn/bnetd/conn_head., temp); |
| 453 | |
| 454 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_debugcxx . . $ pvpgn/eventlog_level_debug., __FUNCTION__, "[{}][{}] sessionkey=0x{:08} sessionnum=0x{:08}", temp->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_sockcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_sock., temp->socketcxx . . $ pvpgn/bnetd/connection#socket..udp_sockcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#udp_sock., temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..sessionkeycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#sessionkey., temp->protocolcxx . . $ pvpgn/bnetd/connection#protocol..sessionnumcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#sessionnum.); |
| 455 | |
| 456 | return temp; |
| 457 | } |
| 458 | |
| 459 | |
| 460 | extern t_anongamecxx . . $ pvpgn/bnetd/t_anongame# * conn_create_anongamecxx . . $ pvpgn/bnetd/conn_create_anongame(28581bdaae3fd375).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c) |
| 461 | { |
| 462 | t_anongamecxx . . $ pvpgn/bnetd/t_anongame# * temp; |
| 463 | int i; |
| 464 | |
| 465 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..anongamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#anongame.) { |
| 466 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "anongame already allocated"); |
| 467 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..anongamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#anongame.; |
| 468 | } |
| 469 | |
| 470 | temp = (t_anongamecxx . . $ pvpgn/bnetd/t_anongame#*)xmalloccxx . . $ `src/common/xalloc.h:43:9`!(sizeof(t_anongame)); |
| 471 | temp->countcxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#count. = 0; |
| 472 | temp->idcxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#id. = 0; |
| 473 | temp->tidcxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#tid. = 0; |
| 474 | |
| 475 | for (i = 0; i < ANONGAME_MAX_GAMECOUNTcxx . . $ ANONGAME_MAX_GAMECOUNT. / 2; i++) |
| 476 | temp->tccxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#tc.[i] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 477 | |
| 478 | temp->racecxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#race. = 0; |
| 479 | temp->playernumcxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#playernum. = 0; |
| 480 | temp->handlecxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#handle. = 0; |
| 481 | temp->addrcxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#addr. = 0; |
| 482 | temp->loadedcxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#loaded. = 0; |
| 483 | temp->joinedcxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#joined. = 0; |
| 484 | temp->map_prefscxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#map_prefs. = 0xffffffff; |
| 485 | temp->typecxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#type. = 0; |
| 486 | temp->gametypecxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#gametype. = 0; |
| 487 | temp->queuecxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#queue. = 0; |
| 488 | temp->infocxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#info. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 489 | |
| 490 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..anongamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#anongame. = temp; |
| 491 | |
| 492 | return temp; |
| 493 | } |
| 494 | |
| 495 | extern t_anongamecxx . . $ pvpgn/bnetd/t_anongame# * conn_get_anongamecxx . . $ pvpgn/bnetd/conn_get_anongame(28581bdaae3fd375).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c) |
| 496 | { |
| 497 | if (!c) { |
| 498 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 499 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 500 | } |
| 501 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..anongamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#anongame.; |
| 502 | } |
| 503 | |
| 504 | extern void conn_destroy_anongamecxx . . $ pvpgn/bnetd/conn_destroy_anongame(428cd989165da3c5).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c) |
| 505 | { |
| 506 | t_anongamecxx . . $ pvpgn/bnetd/t_anongame# * a; |
| 507 | |
| 508 | if (!c) |
| 509 | { |
| 510 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 511 | return; |
| 512 | } |
| 513 | |
| 514 | if (!(a = c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..anongamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#anongame.)) |
| 515 | { |
| 516 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "NULL anongame"); |
| 517 | return; |
| 518 | } |
| 519 | |
| 520 | // delete reference to this connection |
| 521 | if (a->infocxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#info.) { |
| 522 | a->infocxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#info.->playercxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_0#player.[a->playernumcxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#playernum. - 1] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 523 | if (--(a->infocxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#info.->currentplayerscxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_0#currentplayers.) == 0) |
| 524 | anongameinfo_destroycxx . . $ pvpgn/bnetd/anongameinfo_destroy(2779310e7a7a5560).(a->infocxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#info.); |
| 525 | } |
| 526 | |
| 527 | // [quetzal] 20020824 |
| 528 | // unqueue from anongame search list, |
| 529 | // if we got AT game, unqueue entire team. |
| 530 | if (anongame_arrangedcxx . . $ pvpgn/bnetd/anongame_arranged(266ca1ce69549011).(a->queuecxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#queue.)) { |
| 531 | anongame_unqueuecxx . . $ pvpgn/bnetd/anongame_unqueue(fa505503af8860d0).(a->tccxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#tc.[0], a->queuecxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#queue.); |
| 532 | } |
| 533 | else { |
| 534 | anongame_unqueuecxx . . $ pvpgn/bnetd/anongame_unqueue(fa505503af8860d0).(c, a->queuecxx . . $ pvpgn/bnetd/$anonymous_type_f87250fcf39fce72_1#queue.); |
| 535 | } |
| 536 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(c->protocol.w3.anongame); |
| 537 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..anongamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#anongame. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 538 | } |
| 539 | |
| 540 | extern void conn_destroycxx . . $ pvpgn/bnetd/conn_destroy(5ca99be69f7b035).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_elem ** elem, int conn_or_dead_list) |
| 541 | { |
| 542 | char const * classstr; |
| 543 | t_elem * curr; |
| 544 | |
| 545 | |
| 546 | if (c == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 547 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., "conn_destroy", "got NULL connection"); |
| 548 | return; |
| 549 | } |
| 550 | |
| 551 | classstr = conn_class_get_strcxx . . $ pvpgn/bnetd/conn_class_get_str(197fb956ae47a8f8).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass.); |
| 552 | |
| 553 | if (list_remove_data(conn_headcxx . . $ pvpgn/bnetd/conn_head., c, (conn_or_dead_list) ? &curr : elem) < 0) |
| 554 | { |
| 555 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not remove item from list"); |
| 556 | return; |
| 557 | } |
| 558 | |
| 559 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_d2cs_bnetdcxx . . $ pvpgn/bnetd/conn_class_d2cs_bnetd.) |
| 560 | { |
| 561 | t_realmcxx . . $ pvpgn/bnetd/t_realm# * realm; |
| 562 | |
| 563 | realm = conn_get_realmcxx . . $ pvpgn/bnetd/conn_get_realm(c743a4e7d4d1463d).(c); |
| 564 | if (realm) |
| 565 | realm_deactivecxx . . $ pvpgn/bnetd/realm_deactive(6a6afb432ed40419).(realm); |
| 566 | else |
| 567 | { |
| 568 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not find realm for d2cs connection"); |
| 569 | } |
| 570 | } |
| 571 | else if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_w3routecxx . . $ pvpgn/bnetd/conn_class_w3route. && c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..routeconncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#routeconn. && c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..routeconncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#routeconn.->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..anongamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#anongame.) |
| 572 | { |
| 573 | anongame_statscxx . . $ pvpgn/bnetd/anongame_stats(c4dfbc2386fe4fc3).(c); |
| 574 | conn_destroy_anongamecxx . . $ pvpgn/bnetd/conn_destroy_anongame(428cd989165da3c5).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..routeconncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#routeconn.); // [zap-zero] destroy anongame too when game connection is invalid |
| 575 | } |
| 576 | |
| 577 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm.) { |
| 578 | realm_add_player_numbercxx . . $ pvpgn/bnetd/realm_add_player_number(776df6f6ee711b79).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm., -1); |
| 579 | realm_putcxx . . $ pvpgn/bnetd/realm_put(b4ea8bd8f86a51c).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm., &c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realm_regrefcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm_regref.); |
| 580 | } |
| 581 | |
| 582 | |
| 583 | /* free the memory with user quota */ |
| 584 | { |
| 585 | t_qlinecxx . . $ pvpgn/bnetd/t_qline# * qline; |
| 586 | |
| 587 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(c->protocol.chat.quota.list, curr) |
| 588 | { |
| 589 | qline = (t_qlinecxx . . $ pvpgn/bnetd/t_qline#*)elem_get_data(curr); |
| 590 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(qline); |
| 591 | list_remove_elem(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..quotacxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#quota..listcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_1#list., &curr); |
| 592 | } |
| 593 | list_destroy(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..quotacxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#quota..listcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_1#list.); |
| 594 | } |
| 595 | |
| 596 | /* if this user in a channel, notify everyone that the user has left */ |
| 597 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) |
| 598 | channel_del_connectioncxx . . $ pvpgn/bnetd/channel_del_connection(11eacf26fb1585ff).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel., c, message_type_quit, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 599 | |
| 600 | if ((c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game.) && (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account.)) |
| 601 | { |
| 602 | if (game_get_statuscxx . . $ pvpgn/bnetd/game_get_status(e13bf945064795ea).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game.) == game_status_started) |
| 603 | { |
| 604 | game_set_self_reportcxx . . $ pvpgn/bnetd/game_set_self_report(6888f7d335a1cb84).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game., c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account., game_result_disconnect); |
| 605 | game_set_reportcxx . . $ pvpgn/bnetd/game_set_report(656ae8b4ac453ef4).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game., c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account., "disconnect", "disconnect"); |
| 606 | } |
| 607 | } |
| 608 | |
| 609 | conn_set_gamecxx . . $ pvpgn/bnetd/conn_set_game(6346b62fdc8e3894).(c, 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`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, game_type_none, 0); |
| 610 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..statecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#state. = conn_state_emptycxx . . $ pvpgn/bnetd/conn_state_empty.; |
| 611 | |
| 612 | watchlistcxx . . $ pvpgn/bnetd/watchlist.->cxx . . $ pvpgn/scoped_ptr#`operator->`(155dc7f103cdb9db).delcxx . . $ pvpgn/bnetd/WatchComponent#del(428cd989165da3c5).(c); |
| 613 | timerlist_del_all_timerscxx . . $ pvpgn/bnetd/timerlist_del_all_timers(c4dfbc2386fe4fc3).(c); |
| 614 | |
| 615 | clanmember_set_offlinecxx . . $ pvpgn/bnetd/clanmember_set_offline(c4dfbc2386fe4fc3).(c); |
| 616 | |
| 617 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account.) |
| 618 | watchlistcxx . . $ pvpgn/bnetd/watchlist.->cxx . . $ pvpgn/scoped_ptr#`operator->`(155dc7f103cdb9db).dispatchcxx . . $ pvpgn/bnetd/WatchComponent#dispatch(5f92e2dc3f12ba14).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag., Watchcxx . . $ pvpgn/bnetd/Watch#::ET_logoutcxx . . $ pvpgn/bnetd/Watch#ET_logout.); |
| 619 | |
| 620 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..lastsendercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#lastsender.) |
| 621 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.lastsender); /* avoid warning */ |
| 622 | |
| 623 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..awaycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#away.) |
| 624 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.away); /* avoid warning */ |
| 625 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..dndcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#dnd.) |
| 626 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.dnd); /* avoid warning */ |
| 627 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..tmpOP_channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#tmpOP_channel.) |
| 628 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.tmpOP_channel); /* avoid warning */ |
| 629 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..tmpVOICE_channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#tmpVOICE_channel.) |
| 630 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.tmpVOICE_channel); /* avoid warning */ |
| 631 | |
| 632 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientvercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientver.) |
| 633 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.clientver); /* avoid warning */ |
| 634 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..countrycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#country.) |
| 635 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.country); /* avoid warning */ |
| 636 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..hostcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#host.) |
| 637 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.host); /* avoid warning */ |
| 638 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..usercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#user.) |
| 639 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.user); /* avoid warning */ |
| 640 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientexecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientexe.) |
| 641 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.clientexe); /* avoid warning */ |
| 642 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..ownercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#owner.) |
| 643 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.owner); /* avoid warning */ |
| 644 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..cdkeycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#cdkey.) |
| 645 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.cdkey); /* avoid warning */ |
| 646 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realminfocxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realminfo.) |
| 647 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.d2.realminfo); /* avoid warning */ |
| 648 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charnamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#charname.) |
| 649 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.d2.charname); /* avoid warning */ |
| 650 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..irclinecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircline.) |
| 651 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.irc.ircline); /* avoid warning */ |
| 652 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..ircpasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircpass.) |
| 653 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.irc.ircpass); /* avoid warning */ |
| 654 | |
| 655 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..apgarcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#apgar.) |
| 656 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.wol.apgar); /* avoid warning */ |
| 657 | |
| 658 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..anongame_playercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#anongame_player.) |
| 659 | anongame_wol_destroycxx . . $ pvpgn/bnetd/anongame_wol_destroy(c4dfbc2386fe4fc3).(c); |
| 660 | |
| 661 | /* ADDED BY UNDYING SOULZZ 4/8/02 */ |
| 662 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..w3_playerinfocxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#w3_playerinfo.) |
| 663 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.w3.w3_playerinfo); /* avoid warning */ |
| 664 | |
| 665 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..client_proofcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#client_proof.) |
| 666 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.w3.client_proof); /* avoid warning */ |
| 667 | |
| 668 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..server_proofcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#server_proof.) |
| 669 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.w3.server_proof); /* avoid warning */ |
| 670 | |
| 671 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..boundcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#bound.) |
| 672 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..boundcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#bound.->protocolcxx . . $ pvpgn/bnetd/connection#protocol..boundcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#bound. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 673 | |
| 674 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_count. > 0) |
| 675 | { |
| 676 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_listcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_list.) |
| 677 | { |
| 678 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL ignore_list with ignore_count={}", c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_count.); |
| 679 | } |
| 680 | else |
| 681 | { |
| 682 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(c->protocol.chat.ignore_list); |
| 683 | } |
| 684 | } |
| 685 | |
| 686 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account.) |
| 687 | { |
| 688 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "[{}] \"{}\" logged out", c->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_sockcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_sock., conn_get_loggedusercxx . . $ pvpgn/bnetd/conn_get_loggeduser(c99dbccf638f5c6).(c)); |
| 689 | //amadeo |
| 690 | #ifdef WIN32_GUI |
| 691 | guiOnUpdateUserList(); |
| 692 | #endif |
| 693 | if (prefs_get_sync_on_logoffcxx . . $ pvpgn/bnetd/prefs_get_sync_on_logoff(db52760e79bf9054).()) { |
| 694 | if (account_savecxx . . $ pvpgn/bnetd/account_save(43f7d0f5a7c4b307).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), FS_FORCEcxx . . $ `src/bnetd/attrlayer.h:27:9`!) < 0) |
| 695 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "cannot sync account (sync_on_logoff)"); |
| 696 | } |
| 697 | |
| 698 | #ifdef WITH_LUA |
| 699 | lua_handle_user(c, NULL, NULL, luaevent_user_disconnect); |
| 700 | #endif |
| 701 | |
| 702 | if (account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account.) == c) /* make sure you don't set this when already on new conn (relogin with same account) */ |
| 703 | account_set_conncxx . . $ pvpgn/bnetd/account_set_conn(dd21e8ef2296c4e9).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 704 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; /* the account code will free the memory later */ |
| 705 | } |
| 706 | |
| 707 | /* logged user is no longer only for logged in users */ |
| 708 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..loggedusercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#loggeduser.) xfreecxx . . $ `src/common/xalloc.h:51:9`!((void*)c->protocol.loggeduser); |
| 709 | |
| 710 | /* make sure the connection is closed */ |
| 711 | if (c->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_sockcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_sock. != -1) { /* -1 means that the socket was already closed by conn_close() */ |
| 712 | fdwatch_del_fdcxx . . $ pvpgn/fdwatch_del_fd(7864480464b09eea).(c->socketcxx . . $ pvpgn/bnetd/connection#socket..fdw_idxcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#fdw_idx.); |
| 713 | psock_shutdowncxx . . $ `src/compat/psock.h:299:9`!(c->socket.tcp_sock, PSOCK_SHUT_RDWRcxx . . $ `src/compat/psock.h:263:10`!); |
| 714 | psock_closecxx . . $ `src/compat/psock.h:300:9`!(c->socket.tcp_sock); |
| 715 | } |
| 716 | /* clear out the packet queues */ |
| 717 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..inqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#inqueue.) packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..inqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#inqueue.); |
| 718 | queue_clearcxx . . $ pvpgn/queue_clear(e7fc052edc0a6819).(&c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outqueue.); |
| 719 | |
| 720 | // [zap-zero] 20020601 |
| 721 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..routeconncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#routeconn.) { |
| 722 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..routeconncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#routeconn.->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..routeconncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#routeconn. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 723 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..routeconncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#routeconn.->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_w3routecxx . . $ pvpgn/bnetd/conn_class_w3route.) |
| 724 | conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..routeconncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#routeconn., conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.); |
| 725 | } |
| 726 | |
| 727 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..anongamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#anongame.) |
| 728 | conn_destroy_anongamecxx . . $ pvpgn/bnetd/conn_destroy_anongame(428cd989165da3c5).(c); |
| 729 | |
| 730 | /* delete the conn from the dead list if its there, we dont check for error |
| 731 | * because connections may be destroyed without first setting state to destroy */ |
| 732 | if (conn_deadcxx . . $ pvpgn/bnetd/conn_dead.) list_remove_data(conn_deadcxx . . $ pvpgn/bnetd/conn_dead., c, (conn_or_dead_list) ? elem : &curr); |
| 733 | connarray_del_conncxx . . $ pvpgn/bnetd/connarray_del_conn(cb2f890c2fdad230).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..sessionnumcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#sessionnum.); |
| 734 | |
| 735 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "[{}] closed {} connection", c->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_sockcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_sock., classstr); |
| 736 | |
| 737 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(c); |
| 738 | } |
| 739 | |
| 740 | |
| 741 | extern int conn_matchcxx . . $ pvpgn/bnetd/conn_match(6b2655da947c846f).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c, char const * username) |
| 742 | { |
| 743 | if (!c) |
| 744 | { |
| 745 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 746 | return -1; |
| 747 | } |
| 748 | if (!username) |
| 749 | { |
| 750 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL username"); |
| 751 | return -1; |
| 752 | } |
| 753 | |
| 754 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account.) |
| 755 | return 0; |
| 756 | |
| 757 | return account_matchcxx . . $ pvpgn/bnetd/account_match(4b12bc5edcfaeac7).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account., username); |
| 758 | } |
| 759 | |
| 760 | |
| 761 | extern t_conn_classcxx . . $ pvpgn/bnetd/t_conn_class# conn_get_classcxx . . $ pvpgn/bnetd/conn_get_class(1f98a8b9c19f47bc).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 762 | { |
| 763 | if (!c) |
| 764 | { |
| 765 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 766 | return conn_class_nonecxx . . $ pvpgn/bnetd/conn_class_none.; |
| 767 | } |
| 768 | |
| 769 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass.; |
| 770 | } |
| 771 | |
| 772 | |
| 773 | extern void conn_set_classcxx . . $ pvpgn/bnetd/conn_set_class(a3757502d22a5f05).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_conn_classcxx . . $ pvpgn/bnetd/t_conn_class# cclass) |
| 774 | { |
| 775 | t_timer_datacxx . . $ pvpgn/bnetd/t_timer_data# data; |
| 776 | unsigned long delta; |
| 777 | t_conn_classcxx . . $ pvpgn/bnetd/t_conn_class# oldclass; |
| 778 | |
| 779 | if (!c) |
| 780 | { |
| 781 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 782 | return; |
| 783 | } |
| 784 | |
| 785 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == cclass) |
| 786 | return; |
| 787 | |
| 788 | oldclass = c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass.; |
| 789 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. = cclass; |
| 790 | |
| 791 | switch (cclass) { |
| 792 | case conn_class_bnetcxx . . $ pvpgn/bnetd/conn_class_bnet.: |
| 793 | if (prefs_get_udptest_portcxx . . $ pvpgn/bnetd/prefs_get_udptest_port(db52760e79bf9054).() != 0) |
| 794 | conn_set_game_portcxx . . $ pvpgn/bnetd/conn_set_game_port(45a47db2bc2ee415).(c, (unsigned short)prefs_get_udptest_portcxx . . $ pvpgn/bnetd/prefs_get_udptest_port(db52760e79bf9054).()); |
| 795 | udptest_sendcxx . . $ pvpgn/bnetd/udptest_send(b5160de3e9803af4).(c); |
| 796 | |
| 797 | /* remove any init timers */ |
| 798 | if (oldclass == conn_class_initcxx . . $ pvpgn/bnetd/conn_class_init.) timerlist_del_all_timerscxx . . $ pvpgn/bnetd/timerlist_del_all_timers(c4dfbc2386fe4fc3).(c); |
| 799 | delta = prefs_get_latencycxx . . $ pvpgn/bnetd/prefs_get_latency(db52760e79bf9054).(); |
| 800 | data.ncxx . . $ pvpgn/bnetd/$anonymous_type_64e82d6b10ad28f9_0#n. = delta; |
| 801 | if (timerlist_add_timercxx . . $ pvpgn/bnetd/timerlist_add_timer(f16dcbfb825fabda).(c, nowcxx . . $ pvpgn/bnetd/now. + (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)delta, conn_test_latencycxx . . $ pvpgn/bnetd/conn_test_latency(9b6c929c3dbc4c93)., data) < 0) |
| 802 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not add timer"); |
| 803 | |
| 804 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_debugcxx . . $ pvpgn/eventlog_level_debug., __FUNCTION__, "added latency check timer"); |
| 805 | break; |
| 806 | |
| 807 | case conn_class_w3routecxx . . $ pvpgn/bnetd/conn_class_w3route.: |
| 808 | delta = prefs_get_latencycxx . . $ pvpgn/bnetd/prefs_get_latency(db52760e79bf9054).(); |
| 809 | data.ncxx . . $ pvpgn/bnetd/$anonymous_type_64e82d6b10ad28f9_0#n. = delta; |
| 810 | if (timerlist_add_timercxx . . $ pvpgn/bnetd/timerlist_add_timer(f16dcbfb825fabda).(c, nowcxx . . $ pvpgn/bnetd/now. + (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)delta, conn_test_latencycxx . . $ pvpgn/bnetd/conn_test_latency(9b6c929c3dbc4c93)., data)<0) |
| 811 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not add timer"); |
| 812 | break; |
| 813 | |
| 814 | case conn_class_botcxx . . $ pvpgn/bnetd/conn_class_bot.: |
| 815 | case conn_class_telnetcxx . . $ pvpgn/bnetd/conn_class_telnet.: |
| 816 | { |
| 817 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 818 | if (cclass == conn_class_botcxx . . $ pvpgn/bnetd/conn_class_bot.) { |
| 819 | if ((delta = prefs_get_nullmsgcxx . . $ pvpgn/bnetd/prefs_get_nullmsg(db52760e79bf9054).())>0) { |
| 820 | data.ncxx . . $ pvpgn/bnetd/$anonymous_type_64e82d6b10ad28f9_0#n. = delta; |
| 821 | if (timerlist_add_timercxx . . $ pvpgn/bnetd/timerlist_add_timer(f16dcbfb825fabda).(c, nowcxx . . $ pvpgn/bnetd/now. + (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)delta, conn_send_nullmsgcxx . . $ pvpgn/bnetd/conn_send_nullmsg(9b6c929c3dbc4c93)., data) < 0) |
| 822 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not add timer"); |
| 823 | } |
| 824 | } |
| 825 | |
| 826 | /* remove any init timers */ |
| 827 | if (oldclass == conn_class_initcxx . . $ pvpgn/bnetd/conn_class_init.) timerlist_del_all_timerscxx . . $ pvpgn/bnetd/timerlist_del_all_timers(c4dfbc2386fe4fc3).(c); |
| 828 | conn_send_issuecxx . . $ pvpgn/bnetd/conn_send_issue(428cd989165da3c5).(c); |
| 829 | |
| 830 | if (!(rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_rawcxx . . $ pvpgn/packet_class_raw.))) |
| 831 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not create rpacket"); |
| 832 | else { |
| 833 | packet_append_ntstringcxx . . $ pvpgn/packet_append_ntstring(41801851180b7cbb).(rpacket, "Username: "); |
| 834 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket); |
| 835 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 836 | } |
| 837 | |
| 838 | break; |
| 839 | } |
| 840 | |
| 841 | default: |
| 842 | /* remove any init timers */ |
| 843 | if (oldclass == conn_class_initcxx . . $ pvpgn/bnetd/conn_class_init.) |
| 844 | timerlist_del_all_timerscxx . . $ pvpgn/bnetd/timerlist_del_all_timers(c4dfbc2386fe4fc3).(c); |
| 845 | break; |
| 846 | } |
| 847 | |
| 848 | } |
| 849 | |
| 850 | |
| 851 | extern t_conn_statecxx . . $ pvpgn/bnetd/t_conn_state# conn_get_statecxx . . $ pvpgn/bnetd/conn_get_state(14586157a79399d4).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 852 | { |
| 853 | if (!c) |
| 854 | { |
| 855 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 856 | return conn_state_emptycxx . . $ pvpgn/bnetd/conn_state_empty.; |
| 857 | } |
| 858 | |
| 859 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..statecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#state.; |
| 860 | } |
| 861 | |
| 862 | |
| 863 | extern void conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_conn_statecxx . . $ pvpgn/bnetd/t_conn_state# state) |
| 864 | { |
| 865 | t_elem * elem; |
| 866 | |
| 867 | if (!c) |
| 868 | { |
| 869 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 870 | return; |
| 871 | } |
| 872 | |
| 873 | /* special case for destroying connections, add them to conn_dead list */ |
| 874 | if (state == conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy. && c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..statecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#state. != conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.) { |
| 875 | if (!conn_deadcxx . . $ pvpgn/bnetd/conn_dead.) |
| 876 | conn_deadcxx . . $ pvpgn/bnetd/conn_dead. = list_create(); |
| 877 | list_append_data(conn_deadcxx . . $ pvpgn/bnetd/conn_dead., c); |
| 878 | } |
| 879 | else if (state != conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy. && c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..statecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#state. == conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.) |
| 880 | if (list_remove_data(conn_deadcxx . . $ pvpgn/bnetd/conn_dead., c, &elem)) { |
| 881 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not remove dead connection"); |
| 882 | return; |
| 883 | } |
| 884 | |
| 885 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..statecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#state. = state; |
| 886 | } |
| 887 | |
| 888 | extern unsigned int conn_get_sessionkeycxx . . $ pvpgn/bnetd/conn_get_sessionkey(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 889 | { |
| 890 | if (!c) |
| 891 | { |
| 892 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 893 | return 0; |
| 894 | } |
| 895 | |
| 896 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..sessionkeycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#sessionkey.; |
| 897 | } |
| 898 | |
| 899 | |
| 900 | extern unsigned int conn_get_sessionnumcxx . . $ pvpgn/bnetd/conn_get_sessionnum(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 901 | { |
| 902 | if (!c) |
| 903 | { |
| 904 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 905 | return 0; |
| 906 | } |
| 907 | |
| 908 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..sessionnumcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#sessionnum.; |
| 909 | } |
| 910 | |
| 911 | |
| 912 | extern unsigned int conn_get_secretcxx . . $ pvpgn/bnetd/conn_get_secret(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 913 | { |
| 914 | if (!c) |
| 915 | { |
| 916 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 917 | return 0; |
| 918 | } |
| 919 | |
| 920 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..secretcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#secret.; |
| 921 | } |
| 922 | |
| 923 | |
| 924 | extern unsigned int conn_get_addrcxx . . $ pvpgn/bnetd/conn_get_addr(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 925 | { |
| 926 | if (!c) |
| 927 | { |
| 928 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 929 | return 0; |
| 930 | } |
| 931 | |
| 932 | return c->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_addrcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_addr.; |
| 933 | } |
| 934 | |
| 935 | |
| 936 | extern unsigned short conn_get_portcxx . . $ pvpgn/bnetd/conn_get_port(70207a9c46bcade7).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 937 | { |
| 938 | if (!c) |
| 939 | { |
| 940 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 941 | return 0; |
| 942 | } |
| 943 | |
| 944 | return c->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_portcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_port.; |
| 945 | } |
| 946 | |
| 947 | |
| 948 | extern unsigned int conn_get_local_addrcxx . . $ pvpgn/bnetd/conn_get_local_addr(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 949 | { |
| 950 | if (!c) |
| 951 | { |
| 952 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 953 | return 0; |
| 954 | } |
| 955 | |
| 956 | return c->socketcxx . . $ pvpgn/bnetd/connection#socket..local_addrcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#local_addr.; |
| 957 | } |
| 958 | |
| 959 | |
| 960 | extern unsigned short conn_get_local_portcxx . . $ pvpgn/bnetd/conn_get_local_port(70207a9c46bcade7).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 961 | { |
| 962 | if (!c) |
| 963 | { |
| 964 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 965 | return 0; |
| 966 | } |
| 967 | |
| 968 | return c->socketcxx . . $ pvpgn/bnetd/connection#socket..local_portcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#local_port.; |
| 969 | } |
| 970 | |
| 971 | |
| 972 | extern unsigned int conn_get_real_local_addrcxx . . $ pvpgn/bnetd/conn_get_real_local_addr(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 973 | { |
| 974 | if (!c) |
| 975 | { |
| 976 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 977 | return 0; |
| 978 | } |
| 979 | |
| 980 | return c->socketcxx . . $ pvpgn/bnetd/connection#socket..real_local_addrcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#real_local_addr.; |
| 981 | } |
| 982 | |
| 983 | |
| 984 | extern unsigned short conn_get_real_local_portcxx . . $ pvpgn/bnetd/conn_get_real_local_port(70207a9c46bcade7).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 985 | { |
| 986 | if (!c) |
| 987 | { |
| 988 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 989 | return 0; |
| 990 | } |
| 991 | |
| 992 | return c->socketcxx . . $ pvpgn/bnetd/connection#socket..real_local_portcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#real_local_port.; |
| 993 | } |
| 994 | |
| 995 | |
| 996 | extern unsigned int conn_get_game_addrcxx . . $ pvpgn/bnetd/conn_get_game_addr(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 997 | { |
| 998 | if (!c) |
| 999 | { |
| 1000 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1001 | return 0; |
| 1002 | } |
| 1003 | |
| 1004 | return c->socketcxx . . $ pvpgn/bnetd/connection#socket..udp_addrcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#udp_addr.; |
| 1005 | } |
| 1006 | |
| 1007 | |
| 1008 | extern int conn_set_game_addrcxx . . $ pvpgn/bnetd/conn_set_game_addr(c14bb6458e7562a).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned int game_addr) |
| 1009 | { |
| 1010 | if (!c) |
| 1011 | { |
| 1012 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1013 | return -1; |
| 1014 | } |
| 1015 | |
| 1016 | c->socketcxx . . $ pvpgn/bnetd/connection#socket..udp_addrcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#udp_addr. = game_addr; |
| 1017 | return 0; |
| 1018 | } |
| 1019 | |
| 1020 | |
| 1021 | extern unsigned short conn_get_game_portcxx . . $ pvpgn/bnetd/conn_get_game_port(70207a9c46bcade7).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1022 | { |
| 1023 | if (!c) |
| 1024 | { |
| 1025 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1026 | return 0; |
| 1027 | } |
| 1028 | |
| 1029 | return c->socketcxx . . $ pvpgn/bnetd/connection#socket..udp_portcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#udp_port.; |
| 1030 | } |
| 1031 | |
| 1032 | |
| 1033 | extern int conn_set_game_portcxx . . $ pvpgn/bnetd/conn_set_game_port(45a47db2bc2ee415).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned short game_port) |
| 1034 | { |
| 1035 | if (!c) |
| 1036 | { |
| 1037 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1038 | return -1; |
| 1039 | } |
| 1040 | |
| 1041 | c->socketcxx . . $ pvpgn/bnetd/connection#socket..udp_portcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#udp_port. = game_port; |
| 1042 | return 0; |
| 1043 | } |
| 1044 | |
| 1045 | |
| 1046 | extern void conn_set_hostcxx . . $ pvpgn/bnetd/conn_set_host(c8fb97a9af134824).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * host) |
| 1047 | { |
| 1048 | if (!c) |
| 1049 | { |
| 1050 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1051 | return; |
| 1052 | } |
| 1053 | if (!host) |
| 1054 | { |
| 1055 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL host"); |
| 1056 | return; |
| 1057 | } |
| 1058 | |
| 1059 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..hostcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#host.) |
| 1060 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.host); /* avoid warning */ |
| 1061 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..hostcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#host. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(host); |
| 1062 | } |
| 1063 | |
| 1064 | |
| 1065 | extern void conn_set_usercxx . . $ pvpgn/bnetd/conn_set_user(c8fb97a9af134824).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * user) |
| 1066 | { |
| 1067 | if (!c) |
| 1068 | { |
| 1069 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1070 | return; |
| 1071 | } |
| 1072 | if (!user) |
| 1073 | { |
| 1074 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL user"); |
| 1075 | return; |
| 1076 | } |
| 1077 | |
| 1078 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..usercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#user.) |
| 1079 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.user); /* avoid warning */ |
| 1080 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..usercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#user. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(user); |
| 1081 | } |
| 1082 | |
| 1083 | |
| 1084 | extern void conn_set_ownercxx . . $ pvpgn/bnetd/conn_set_owner(c8fb97a9af134824).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * owner) |
| 1085 | { |
| 1086 | if (!c) |
| 1087 | { |
| 1088 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1089 | return; |
| 1090 | } |
| 1091 | if (!owner) |
| 1092 | { |
| 1093 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL owner"); |
| 1094 | return; |
| 1095 | } |
| 1096 | |
| 1097 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..ownercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#owner.) |
| 1098 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.owner); /* avoid warning */ |
| 1099 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..ownercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#owner. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(owner); |
| 1100 | } |
| 1101 | |
| 1102 | extern const char * conn_get_usercxx . . $ pvpgn/bnetd/conn_get_user(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1103 | { |
| 1104 | if (!c) { |
| 1105 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1106 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1107 | } |
| 1108 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..usercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#user.; |
| 1109 | } |
| 1110 | |
| 1111 | extern const char * conn_get_ownercxx . . $ pvpgn/bnetd/conn_get_owner(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1112 | { |
| 1113 | if (!c) { |
| 1114 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1115 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1116 | } |
| 1117 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..ownercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#owner.; |
| 1118 | } |
| 1119 | |
| 1120 | extern void conn_set_cdkeycxx . . $ pvpgn/bnetd/conn_set_cdkey(c8fb97a9af134824).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * cdkey) |
| 1121 | { |
| 1122 | if (!c) |
| 1123 | { |
| 1124 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1125 | return; |
| 1126 | } |
| 1127 | if (!cdkey) |
| 1128 | { |
| 1129 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL cdkey"); |
| 1130 | return; |
| 1131 | } |
| 1132 | |
| 1133 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..cdkeycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#cdkey.) |
| 1134 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.cdkey); /* avoid warning */ |
| 1135 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..cdkeycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#cdkey. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(cdkey); |
| 1136 | } |
| 1137 | |
| 1138 | |
| 1139 | extern char const * conn_get_clientexecxx . . $ pvpgn/bnetd/conn_get_clientexe(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1140 | { |
| 1141 | if (!c) |
| 1142 | { |
| 1143 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1144 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1145 | } |
| 1146 | |
| 1147 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientexecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientexe.) |
| 1148 | return ""; |
| 1149 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientexecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientexe.; |
| 1150 | } |
| 1151 | |
| 1152 | |
| 1153 | extern void conn_set_clientexecxx . . $ pvpgn/bnetd/conn_set_clientexe(c8fb97a9af134824).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * clientexe) |
| 1154 | { |
| 1155 | char const * temp; |
| 1156 | |
| 1157 | if (!c) |
| 1158 | { |
| 1159 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1160 | return; |
| 1161 | } |
| 1162 | if (!clientexe) |
| 1163 | { |
| 1164 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clientexe"); |
| 1165 | return; |
| 1166 | } |
| 1167 | |
| 1168 | temp = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(clientexe); |
| 1169 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientexecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientexe.) |
| 1170 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.clientexe); /* avoid warning */ |
| 1171 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientexecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientexe. = temp; |
| 1172 | } |
| 1173 | |
| 1174 | |
| 1175 | extern char const * conn_get_clientvercxx . . $ pvpgn/bnetd/conn_get_clientver(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1176 | { |
| 1177 | if (!c) |
| 1178 | { |
| 1179 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1180 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1181 | } |
| 1182 | |
| 1183 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientvercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientver.) |
| 1184 | return ""; |
| 1185 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientvercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientver.; |
| 1186 | } |
| 1187 | |
| 1188 | |
| 1189 | extern void conn_set_clientvercxx . . $ pvpgn/bnetd/conn_set_clientver(c8fb97a9af134824).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * clientver) |
| 1190 | { |
| 1191 | char const * temp; |
| 1192 | |
| 1193 | if (!c) |
| 1194 | { |
| 1195 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1196 | return; |
| 1197 | } |
| 1198 | if (!clientver) |
| 1199 | { |
| 1200 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clientver"); |
| 1201 | return; |
| 1202 | } |
| 1203 | |
| 1204 | temp = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(clientver); |
| 1205 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientvercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientver.) |
| 1206 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.clientver); /* avoid warning */ |
| 1207 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientvercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientver. = temp; |
| 1208 | } |
| 1209 | |
| 1210 | |
| 1211 | extern t_tagcxx . . $ pvpgn/t_tag# conn_get_archtagcxx . . $ pvpgn/bnetd/conn_get_archtag(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1212 | { |
| 1213 | if (!c) { |
| 1214 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1215 | return 0; /* unknown */ |
| 1216 | } |
| 1217 | |
| 1218 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..archtagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#archtag.; |
| 1219 | } |
| 1220 | |
| 1221 | |
| 1222 | extern void conn_set_archtagcxx . . $ pvpgn/bnetd/conn_set_archtag(d97ad1b62a895b69).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_tagcxx . . $ pvpgn/t_tag# archtag) |
| 1223 | { |
| 1224 | if (!c) { |
| 1225 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1226 | return; |
| 1227 | } |
| 1228 | if (!tag_check_arch(archtag)) { |
| 1229 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got UNKNOWN archtag"); |
| 1230 | return; |
| 1231 | } |
| 1232 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..archtagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#archtag. != archtag) |
| 1233 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..archtagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#archtag. = archtag; |
| 1234 | } |
| 1235 | |
| 1236 | |
| 1237 | extern t_tagcxx . . $ pvpgn/t_tag# conn_get_gamelangcxx . . $ pvpgn/bnetd/conn_get_gamelang(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1238 | { |
| 1239 | if (!c) |
| 1240 | { |
| 1241 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1242 | return 0; |
| 1243 | } |
| 1244 | |
| 1245 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..gamelangcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#gamelang.; |
| 1246 | } |
| 1247 | |
| 1248 | |
| 1249 | extern void conn_set_gamelangcxx . . $ pvpgn/bnetd/conn_set_gamelang(d97ad1b62a895b69).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_tagcxx . . $ pvpgn/t_tag# gamelang) |
| 1250 | { |
| 1251 | char gamelang_str[5]; |
| 1252 | |
| 1253 | if (!c) { |
| 1254 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1255 | return; |
| 1256 | } |
| 1257 | if (!gamelang) |
| 1258 | return; /* only war3 & w3xp have gamelang */ |
| 1259 | |
| 1260 | bool found; |
| 1261 | language_find_by_tagcxx . . $ pvpgn/bnetd/language_find_by_tag(4ad94360b135822).(gamelang, found); |
| 1262 | if (!found) |
| 1263 | { |
| 1264 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_warncxx . . $ pvpgn/eventlog_level_warn., __FUNCTION__, "got UNKNOWN gamelang"); |
| 1265 | return; |
| 1266 | } |
| 1267 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..gamelangcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#gamelang. != gamelang) |
| 1268 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "[{}] setting client gamelang to \"{}\"", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), tag_uint_to_str(gamelang_str, gamelang)); |
| 1269 | |
| 1270 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..gamelangcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#gamelang. = gamelang; |
| 1271 | } |
| 1272 | |
| 1273 | |
| 1274 | extern t_clienttagcxx . . $ pvpgn/t_clienttag# conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1275 | { |
| 1276 | if (!c) |
| 1277 | { |
| 1278 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1279 | return CLIENTTAG_UNKNOWN_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:152:9`!; |
| 1280 | } |
| 1281 | |
| 1282 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag.) |
| 1283 | return CLIENTTAG_UNKNOWN_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:152:9`!; |
| 1284 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag.; |
| 1285 | } |
| 1286 | |
| 1287 | |
| 1288 | extern t_clienttagcxx . . $ pvpgn/t_clienttag# conn_get_fake_clienttagcxx . . $ pvpgn/bnetd/conn_get_fake_clienttag(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1289 | { |
| 1290 | char const * clienttag; |
| 1291 | t_accountcxx . . $ pvpgn/bnetd/t_account# * account; |
| 1292 | |
| 1293 | if (!c) |
| 1294 | { |
| 1295 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1296 | return 0; /* unknown */ |
| 1297 | } |
| 1298 | |
| 1299 | account = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c); |
| 1300 | if (account) /* BITS remote connections don't need to have an account */ |
| 1301 | if ((clienttag = account_get_strattrcxx . . $ `src/bnetd/account.h:96:9`!(account, "BNET\\fakeclienttag"))) |
| 1302 | return tag_str_to_uint(clienttag); |
| 1303 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag.; |
| 1304 | } |
| 1305 | |
| 1306 | |
| 1307 | extern void conn_set_clienttagcxx . . $ pvpgn/bnetd/conn_set_clienttag(d97ad1b62a895b69).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag) |
| 1308 | { |
| 1309 | char clienttag_str[5]; |
| 1310 | |
| 1311 | if (!c) { |
| 1312 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1313 | return; |
| 1314 | } |
| 1315 | if (!tag_check_client(clienttag)) { |
| 1316 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got UNKNOWN clienttag \"{}\"", tag_uint_to_str(clienttag_str, clienttag)); |
| 1317 | return; |
| 1318 | } |
| 1319 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag. != clienttag) |
| 1320 | { |
| 1321 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag. = clienttag; |
| 1322 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) |
| 1323 | channel_update_userflagscxx . . $ pvpgn/bnetd/channel_update_userflags(428cd989165da3c5).(c); |
| 1324 | } |
| 1325 | |
| 1326 | } |
| 1327 | |
| 1328 | |
| 1329 | extern unsigned long conn_get_gameversioncxx . . $ pvpgn/bnetd/conn_get_gameversion(3fda5c23f1f5e239).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1330 | { |
| 1331 | if (!c) |
| 1332 | { |
| 1333 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1334 | return 0; |
| 1335 | } |
| 1336 | |
| 1337 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..gameversioncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#gameversion.; |
| 1338 | } |
| 1339 | |
| 1340 | |
| 1341 | extern int conn_set_gameversioncxx . . $ pvpgn/bnetd/conn_set_gameversion(31721b9a6fcb2436).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned long gameversion) |
| 1342 | { |
| 1343 | if (!c) |
| 1344 | { |
| 1345 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1346 | return -1; |
| 1347 | } |
| 1348 | |
| 1349 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..gameversioncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#gameversion. = gameversion; |
| 1350 | return 0; |
| 1351 | } |
| 1352 | |
| 1353 | |
| 1354 | extern unsigned long conn_get_checksumcxx . . $ pvpgn/bnetd/conn_get_checksum(3fda5c23f1f5e239).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1355 | { |
| 1356 | if (!c) |
| 1357 | { |
| 1358 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1359 | return 0; |
| 1360 | } |
| 1361 | |
| 1362 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..checksumcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#checksum.; |
| 1363 | } |
| 1364 | |
| 1365 | |
| 1366 | extern int conn_set_checksumcxx . . $ pvpgn/bnetd/conn_set_checksum(31721b9a6fcb2436).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned long checksum) |
| 1367 | { |
| 1368 | if (!c) |
| 1369 | { |
| 1370 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1371 | return -1; |
| 1372 | } |
| 1373 | |
| 1374 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..checksumcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#checksum. = checksum; |
| 1375 | return 0; |
| 1376 | } |
| 1377 | |
| 1378 | |
| 1379 | extern unsigned long conn_get_versionidcxx . . $ pvpgn/bnetd/conn_get_versionid(3fda5c23f1f5e239).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1380 | { |
| 1381 | if (!c) |
| 1382 | { |
| 1383 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1384 | return 0; |
| 1385 | } |
| 1386 | |
| 1387 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..versionidcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#versionid.; |
| 1388 | } |
| 1389 | |
| 1390 | |
| 1391 | extern int conn_set_versionidcxx . . $ pvpgn/bnetd/conn_set_versionid(31721b9a6fcb2436).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned long versionid) |
| 1392 | { |
| 1393 | if (!c) |
| 1394 | { |
| 1395 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1396 | return -1; |
| 1397 | } |
| 1398 | |
| 1399 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..versionidcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#versionid. = versionid; |
| 1400 | return 0; |
| 1401 | } |
| 1402 | |
| 1403 | |
| 1404 | extern int conn_get_tzbiascxx . . $ pvpgn/bnetd/conn_get_tzbias(b5160de3e9803af4).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1405 | { |
| 1406 | if (!c) |
| 1407 | { |
| 1408 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1409 | return 0; |
| 1410 | } |
| 1411 | |
| 1412 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..tzbiascxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#tzbias.; |
| 1413 | } |
| 1414 | |
| 1415 | |
| 1416 | extern void conn_set_tzbiascxx . . $ pvpgn/bnetd/conn_set_tzbias(5b9d37d9dd0897d2).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, int tzbias) |
| 1417 | { |
| 1418 | if (!c) |
| 1419 | { |
| 1420 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1421 | return; |
| 1422 | } |
| 1423 | |
| 1424 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..tzbiascxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#tzbias. = tzbias; |
| 1425 | } |
| 1426 | |
| 1427 | |
| 1428 | static void conn_set_accountcxx . . $ pvpgn/bnetd/conn_set_account(c3edbca9dfe59b8a).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_accountcxx . . $ pvpgn/bnetd/t_account# * account) |
| 1429 | { |
| 1430 | t_connectioncxx . . $ pvpgn/bnetd/t_connection# * other; |
| 1431 | char const * tname; |
| 1432 | |
| 1433 | if (!c) |
| 1434 | { |
| 1435 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1436 | return; |
| 1437 | } |
| 1438 | if (!account) |
| 1439 | { |
| 1440 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL account"); |
| 1441 | return; |
| 1442 | } |
| 1443 | |
| 1444 | if ((other = connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).((tname = account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account))))) |
| 1445 | { |
| 1446 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "[{}] forcing logout of previous login for \"{}\"", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), tname); |
| 1447 | conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(other, conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.); |
| 1448 | } |
| 1449 | |
| 1450 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account. = account; |
| 1451 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..statecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#state. = conn_state_loggedincxx . . $ pvpgn/bnetd/conn_state_loggedin.; |
| 1452 | account_set_conncxx . . $ pvpgn/bnetd/account_set_conn(dd21e8ef2296c4e9).(account, c); |
| 1453 | { |
| 1454 | char const * flagstr; |
| 1455 | |
| 1456 | if ((flagstr = account_get_strattrcxx . . $ `src/bnetd/account.h:96:9`!(account, "BNET\\flags\\initial"))) |
| 1457 | conn_add_flagscxx . . $ pvpgn/bnetd/conn_add_flags(d97ad1b62a895b69).(c, stdcxx . . $ std/::strtoul(flagstr, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0)); |
| 1458 | } |
| 1459 | |
| 1460 | account_set_ll_timecxx . . $ pvpgn/bnetd/account_set_ll_time(43f7d0f5a7c4b307).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account., (unsigned int)nowcxx . . $ pvpgn/bnetd/now.); |
| 1461 | account_set_ll_ownercxx . . $ pvpgn/bnetd/account_set_ll_owner(4b12bc5edcfaeac7).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account., c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..ownercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#owner.); |
| 1462 | account_set_ll_clienttagcxx . . $ pvpgn/bnetd/account_set_ll_clienttag(43f7d0f5a7c4b307).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account., c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag.); |
| 1463 | account_set_ll_ipcxx . . $ pvpgn/bnetd/account_set_ll_ip(4b12bc5edcfaeac7).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account., addr_num_to_ip_strcxx . . $ pvpgn/addr_num_to_ip_str(81a3ae90da26a711).(c->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_addrcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_addr.)); |
| 1464 | |
| 1465 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..hostcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#host.) |
| 1466 | { |
| 1467 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.host); /* avoid warning */ |
| 1468 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..hostcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#host. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1469 | } |
| 1470 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..usercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#user.) |
| 1471 | { |
| 1472 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.user); /* avoid warning */ |
| 1473 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..usercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#user. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1474 | } |
| 1475 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientexecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientexe.) |
| 1476 | { |
| 1477 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.clientexe); /* avoid warning */ |
| 1478 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clientexecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clientexe. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1479 | } |
| 1480 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..ownercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#owner.) |
| 1481 | { |
| 1482 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.owner); /* avoid warning */ |
| 1483 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..ownercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#owner. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1484 | } |
| 1485 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..cdkeycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#cdkey.) |
| 1486 | { |
| 1487 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.cdkey); /* avoid warning */ |
| 1488 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..cdkeycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#cdkey. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1489 | } |
| 1490 | |
| 1491 | clanmember_set_onlinecxx . . $ pvpgn/bnetd/clanmember_set_online(c4dfbc2386fe4fc3).(c); |
| 1492 | |
| 1493 | totalcountcxx . . $ pvpgn/bnetd/totalcount.++; |
| 1494 | |
| 1495 | watchlistcxx . . $ pvpgn/bnetd/watchlist.->cxx . . $ pvpgn/scoped_ptr#`operator->`(155dc7f103cdb9db).dispatchcxx . . $ pvpgn/bnetd/WatchComponent#dispatch(5f92e2dc3f12ba14).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag., Watchcxx . . $ pvpgn/bnetd/Watch#::ET_logincxx . . $ pvpgn/bnetd/Watch#ET_login.); |
| 1496 | |
| 1497 | return; |
| 1498 | } |
| 1499 | |
| 1500 | |
| 1501 | extern void conn_logincxx . . $ pvpgn/bnetd/conn_login(37ada50ef2b0abe1).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c, t_accountcxx . . $ pvpgn/bnetd/t_account# *a, const char *loggeduser) |
| 1502 | { |
| 1503 | assertcxx . . $ `/usr/include/assert.h:102:11`!(c != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 1504 | assertcxx . . $ `/usr/include/assert.h:102:11`!(a != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 1505 | assertcxx . . $ `/usr/include/assert.h:102:11`!(loggeduser != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 1506 | |
| 1507 | conn_set_accountcxx . . $ pvpgn/bnetd/conn_set_account(c3edbca9dfe59b8a).(c, a); |
| 1508 | if (stdcxx . . $ std/::strcmp(conn_get_loggedusercxx . . $ pvpgn/bnetd/conn_get_loggeduser(c99dbccf638f5c6).(c), loggeduser)) |
| 1509 | conn_set_loggedusercxx . . $ pvpgn/bnetd/conn_set_loggeduser(2e9022cda97b266d).(c, loggeduser); |
| 1510 | } |
| 1511 | |
| 1512 | |
| 1513 | extern t_accountcxx . . $ pvpgn/bnetd/t_account# * conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1514 | { |
| 1515 | if (!c) |
| 1516 | { |
| 1517 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1518 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1519 | } |
| 1520 | |
| 1521 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account.; |
| 1522 | } |
| 1523 | |
| 1524 | |
| 1525 | extern int conn_set_loggedusercxx . . $ pvpgn/bnetd/conn_set_loggeduser(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * username) |
| 1526 | { |
| 1527 | const char * temp; |
| 1528 | |
| 1529 | assertcxx . . $ `/usr/include/assert.h:102:11`!(c != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 1530 | assertcxx . . $ `/usr/include/assert.h:102:11`!(username != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 1531 | |
| 1532 | if (username[0] != '#') |
| 1533 | temp = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(username); |
| 1534 | else { |
| 1535 | unsigned int userid = 0; |
| 1536 | str_to_uintcxx . . $ pvpgn/str_to_uint(6974107818eeb505).(&username[1], &userid); |
| 1537 | if (userid != 0) |
| 1538 | { |
| 1539 | if (prefs_get_account_force_usernamecxx . . $ pvpgn/bnetd/prefs_get_account_force_username(db52760e79bf9054).()) |
| 1540 | { |
| 1541 | t_accountcxx . . $ pvpgn/bnetd/t_account#* account = accountlist_find_account_by_uidcxx . . $ pvpgn/bnetd/accountlist_find_account_by_uid(c4505e327c9ccd36).(userid); |
| 1542 | temp = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(account)); |
| 1543 | } |
| 1544 | else |
| 1545 | temp = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(std::string("#" + userid).c_str()); |
| 1546 | } |
| 1547 | else |
| 1548 | { //theoretically this should never happen... |
| 1549 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got invalid numeric uid \"{}\"", username); |
| 1550 | // set value that would have been set prior to this bugfix... |
| 1551 | temp = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(username); |
| 1552 | } |
| 1553 | } |
| 1554 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..loggedusercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#loggeduser.) xfreecxx . . $ `src/common/xalloc.h:51:9`!((void*)c->protocol.loggeduser); |
| 1555 | |
| 1556 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..loggedusercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#loggeduser. = temp; |
| 1557 | |
| 1558 | return 0; |
| 1559 | } |
| 1560 | |
| 1561 | |
| 1562 | extern char const * conn_get_loggedusercxx . . $ pvpgn/bnetd/conn_get_loggeduser(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1563 | { |
| 1564 | assertcxx . . $ `/usr/include/assert.h:102:11`!(c != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 1565 | |
| 1566 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..loggedusercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#loggeduser. && c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account.) |
| 1567 | return account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(c->protocol.account); |
| 1568 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..loggedusercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#loggeduser.; |
| 1569 | } |
| 1570 | |
| 1571 | |
| 1572 | extern unsigned int conn_get_flagscxx . . $ pvpgn/bnetd/conn_get_flags(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1573 | { |
| 1574 | if (!c) |
| 1575 | { |
| 1576 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1577 | return 0; |
| 1578 | } |
| 1579 | |
| 1580 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..flagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#flags.; |
| 1581 | } |
| 1582 | |
| 1583 | |
| 1584 | extern int conn_set_flagscxx . . $ pvpgn/bnetd/conn_set_flags(c14bb6458e7562a).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned int flags) |
| 1585 | { |
| 1586 | if (!c) { |
| 1587 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1588 | return -1; |
| 1589 | } |
| 1590 | |
| 1591 | if (flags != c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..flagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#flags.) { |
| 1592 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..flagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#flags. = flags; |
| 1593 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) channel_update_userflagscxx . . $ pvpgn/bnetd/channel_update_userflags(428cd989165da3c5).(c); |
| 1594 | } |
| 1595 | |
| 1596 | return 0; |
| 1597 | } |
| 1598 | |
| 1599 | |
| 1600 | extern void conn_add_flagscxx . . $ pvpgn/bnetd/conn_add_flags(d97ad1b62a895b69).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned int flags) |
| 1601 | { |
| 1602 | unsigned int oldflags; |
| 1603 | |
| 1604 | if (!c) |
| 1605 | { |
| 1606 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1607 | return; |
| 1608 | } |
| 1609 | oldflags = c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..flagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#flags.; |
| 1610 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..flagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#flags. |= flags; |
| 1611 | |
| 1612 | if (oldflags != c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..flagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#flags. && c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) |
| 1613 | channel_update_userflagscxx . . $ pvpgn/bnetd/channel_update_userflags(428cd989165da3c5).(c); |
| 1614 | } |
| 1615 | |
| 1616 | |
| 1617 | extern void conn_del_flagscxx . . $ pvpgn/bnetd/conn_del_flags(d97ad1b62a895b69).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned int flags) |
| 1618 | { |
| 1619 | unsigned int oldflags; |
| 1620 | |
| 1621 | if (!c) |
| 1622 | { |
| 1623 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1624 | return; |
| 1625 | } |
| 1626 | oldflags = c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..flagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#flags.; |
| 1627 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..flagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#flags. &= ~flags; |
| 1628 | |
| 1629 | if (oldflags != c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..flagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#flags. && c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) |
| 1630 | channel_update_userflagscxx . . $ pvpgn/bnetd/channel_update_userflags(428cd989165da3c5).(c); |
| 1631 | } |
| 1632 | |
| 1633 | |
| 1634 | extern unsigned int conn_get_latencycxx . . $ pvpgn/bnetd/conn_get_latency(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1635 | { |
| 1636 | if (!c) |
| 1637 | { |
| 1638 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1639 | return 0; |
| 1640 | } |
| 1641 | |
| 1642 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..latencycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#latency.; |
| 1643 | } |
| 1644 | |
| 1645 | |
| 1646 | extern void conn_set_latencycxx . . $ pvpgn/bnetd/conn_set_latency(d97ad1b62a895b69).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned int ms) |
| 1647 | { |
| 1648 | if (!c) |
| 1649 | { |
| 1650 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1651 | return; |
| 1652 | } |
| 1653 | |
| 1654 | |
| 1655 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..latencycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#latency. != ms) |
| 1656 | { |
| 1657 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..latencycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#latency. = ms; |
| 1658 | |
| 1659 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) |
| 1660 | channel_update_latencycxx . . $ pvpgn/bnetd/channel_update_latency(428cd989165da3c5).(c); |
| 1661 | } |
| 1662 | } |
| 1663 | |
| 1664 | |
| 1665 | extern char const * conn_get_awaystrcxx . . $ pvpgn/bnetd/conn_get_awaystr(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1666 | { |
| 1667 | if (!c) |
| 1668 | { |
| 1669 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1670 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1671 | } |
| 1672 | |
| 1673 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..awaycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#away.; |
| 1674 | } |
| 1675 | |
| 1676 | |
| 1677 | extern int conn_set_awaystrcxx . . $ pvpgn/bnetd/conn_set_awaystr(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * away) |
| 1678 | { |
| 1679 | if (!c) |
| 1680 | { |
| 1681 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1682 | return -1; |
| 1683 | } |
| 1684 | |
| 1685 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..awaycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#away.) |
| 1686 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.away); /* avoid warning */ |
| 1687 | if (!away) |
| 1688 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..awaycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#away. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1689 | else |
| 1690 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..awaycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#away. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(away); |
| 1691 | |
| 1692 | return 0; |
| 1693 | } |
| 1694 | |
| 1695 | |
| 1696 | extern char const * conn_get_dndstrcxx . . $ pvpgn/bnetd/conn_get_dndstr(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1697 | { |
| 1698 | if (!c) |
| 1699 | { |
| 1700 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1701 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1702 | } |
| 1703 | |
| 1704 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..dndcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#dnd.; |
| 1705 | } |
| 1706 | |
| 1707 | |
| 1708 | extern int conn_set_dndstrcxx . . $ pvpgn/bnetd/conn_set_dndstr(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * dnd) |
| 1709 | { |
| 1710 | if (!c) |
| 1711 | { |
| 1712 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1713 | return -1; |
| 1714 | } |
| 1715 | |
| 1716 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..dndcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#dnd.) |
| 1717 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.dnd); /* avoid warning */ |
| 1718 | if (!dnd) |
| 1719 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..dndcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#dnd. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1720 | else |
| 1721 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..dndcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#dnd. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(dnd); |
| 1722 | |
| 1723 | return 0; |
| 1724 | } |
| 1725 | |
| 1726 | |
| 1727 | extern int conn_add_ignorecxx . . $ pvpgn/bnetd/conn_add_ignore(992d0c708e1a1a08).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_accountcxx . . $ pvpgn/bnetd/t_account# * account) |
| 1728 | { |
| 1729 | t_accountcxx . . $ pvpgn/bnetd/t_account# * * newlist; |
| 1730 | t_connectioncxx . . $ pvpgn/bnetd/t_connection# *dest_c; |
| 1731 | |
| 1732 | if (!c) { |
| 1733 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1734 | return -1; |
| 1735 | } |
| 1736 | |
| 1737 | if (!account) { |
| 1738 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL account"); |
| 1739 | return -1; |
| 1740 | } |
| 1741 | |
| 1742 | newlist = (t_accountcxx . . $ pvpgn/bnetd/t_account#**)xrealloccxx . . $ `src/common/xalloc.h:47:9`!(c->protocol.chat.ignore_list, sizeof(t_account const *)*(c->protocol.chat.ignore_count + 1)); |
| 1743 | newlist[c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_count.++] = account; |
| 1744 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_listcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_list. = newlist; |
| 1745 | |
| 1746 | dest_c = account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(account); |
| 1747 | if (dest_c) { |
| 1748 | t_message *message; |
| 1749 | |
| 1750 | 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`!); |
| 1751 | if (!message) return 0; |
| 1752 | message_sendcxx . . $ pvpgn/bnetd/message_send(9d5ee2468ca25dbd).(message, c); |
| 1753 | message_destroycxx . . $ pvpgn/bnetd/message_destroy(946070d365682f94).(message); |
| 1754 | } |
| 1755 | |
| 1756 | return 0; |
| 1757 | } |
| 1758 | |
| 1759 | |
| 1760 | extern int conn_del_ignorecxx . . $ pvpgn/bnetd/conn_del_ignore(587a1b32e97b873a).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_accountcxx . . $ pvpgn/bnetd/t_account# const * account) |
| 1761 | { |
| 1762 | t_accountcxx . . $ pvpgn/bnetd/t_account# * * newlist; |
| 1763 | t_accountcxx . . $ pvpgn/bnetd/t_account# * temp; |
| 1764 | unsigned int i; |
| 1765 | |
| 1766 | if (!c) |
| 1767 | { |
| 1768 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1769 | return -1; |
| 1770 | } |
| 1771 | if (!account) |
| 1772 | { |
| 1773 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL account"); |
| 1774 | return -1; |
| 1775 | } |
| 1776 | |
| 1777 | for (i = 0; i < c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_count.; i++) |
| 1778 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_listcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_list.[i] == account) |
| 1779 | break; |
| 1780 | if (i == c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_count.) |
| 1781 | return -1; /* not in list */ |
| 1782 | |
| 1783 | /* swap entry to be deleted with last entry */ |
| 1784 | temp = c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_listcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_list.[c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_count. - 1]; |
| 1785 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_listcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_list.[c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_count. - 1] = c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_listcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_list.[i]; |
| 1786 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_listcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_list.[i] = temp; |
| 1787 | |
| 1788 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_count. == 1) /* some realloc()s are buggy */ |
| 1789 | { |
| 1790 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(c->protocol.chat.ignore_list); |
| 1791 | newlist = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1792 | } |
| 1793 | else |
| 1794 | newlist = (t_accountcxx . . $ pvpgn/bnetd/t_account#**)xrealloccxx . . $ `src/common/xalloc.h:47:9`!(c->protocol.chat.ignore_list, sizeof(t_account const *)*(c->protocol.chat.ignore_count - 1)); |
| 1795 | |
| 1796 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_count.--; |
| 1797 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_listcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_list. = newlist; |
| 1798 | |
| 1799 | return 0; |
| 1800 | } |
| 1801 | |
| 1802 | |
| 1803 | extern int conn_add_watchcxx . . $ pvpgn/bnetd/conn_add_watch(2bc9ff09b9a40602).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_accountcxx . . $ pvpgn/bnetd/t_account# * account, t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag) |
| 1804 | { |
| 1805 | if (!c) |
| 1806 | { |
| 1807 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1808 | return -1; |
| 1809 | } |
| 1810 | |
| 1811 | watchlistcxx . . $ pvpgn/bnetd/watchlist.->cxx . . $ pvpgn/scoped_ptr#`operator->`(155dc7f103cdb9db).addcxx . . $ pvpgn/bnetd/WatchComponent#add(3ec15225d867d3da).(c, account, clienttag, Watchcxx . . $ pvpgn/bnetd/Watch#::ET_logincxx . . $ pvpgn/bnetd/Watch#ET_login. | Watchcxx . . $ pvpgn/bnetd/Watch#::ET_logoutcxx . . $ pvpgn/bnetd/Watch#ET_logout. | Watchcxx . . $ pvpgn/bnetd/Watch#::ET_joingamecxx . . $ pvpgn/bnetd/Watch#ET_joingame. | Watchcxx . . $ pvpgn/bnetd/Watch#::ET_leavegamecxx . . $ pvpgn/bnetd/Watch#ET_leavegame.); |
| 1812 | return 0; |
| 1813 | } |
| 1814 | |
| 1815 | |
| 1816 | extern int conn_del_watchcxx . . $ pvpgn/bnetd/conn_del_watch(2bc9ff09b9a40602).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_accountcxx . . $ pvpgn/bnetd/t_account# * account, t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag) |
| 1817 | { |
| 1818 | if (!c) |
| 1819 | { |
| 1820 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1821 | return -1; |
| 1822 | } |
| 1823 | |
| 1824 | if (watchlistcxx . . $ pvpgn/bnetd/watchlist.->cxx . . $ pvpgn/scoped_ptr#`operator->`(155dc7f103cdb9db).delcxx . . $ pvpgn/bnetd/WatchComponent#del(4da098f4e89597b2).(c, account, clienttag, Watchcxx . . $ pvpgn/bnetd/Watch#::ET_logincxx . . $ pvpgn/bnetd/Watch#ET_login. | Watchcxx . . $ pvpgn/bnetd/Watch#::ET_logoutcxx . . $ pvpgn/bnetd/Watch#ET_logout. | Watchcxx . . $ pvpgn/bnetd/Watch#::ET_joingamecxx . . $ pvpgn/bnetd/Watch#ET_joingame. | Watchcxx . . $ pvpgn/bnetd/Watch#::ET_leavegamecxx . . $ pvpgn/bnetd/Watch#ET_leavegame.) < 0) |
| 1825 | return -1; |
| 1826 | return 0; |
| 1827 | } |
| 1828 | |
| 1829 | |
| 1830 | extern int conn_check_ignoringcxx . . $ pvpgn/bnetd/conn_check_ignoring(6b2655da947c846f).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c, char const * me) |
| 1831 | { |
| 1832 | unsigned int i; |
| 1833 | t_accountcxx . . $ pvpgn/bnetd/t_account# * temp; |
| 1834 | |
| 1835 | if (!c) |
| 1836 | { |
| 1837 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1838 | return -1; |
| 1839 | } |
| 1840 | |
| 1841 | if (!me || !(temp = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(me))) |
| 1842 | return -1; |
| 1843 | |
| 1844 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_listcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_list.) |
| 1845 | for (i = 0; i < c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_count.; i++) |
| 1846 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..ignore_listcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#ignore_list.[i] == temp) |
| 1847 | return 1; |
| 1848 | |
| 1849 | return 0; |
| 1850 | } |
| 1851 | |
| 1852 | |
| 1853 | extern t_channelcxx . . $ pvpgn/bnetd/t_channel# * conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 1854 | { |
| 1855 | if (!c) |
| 1856 | { |
| 1857 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1858 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1859 | } |
| 1860 | |
| 1861 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.; |
| 1862 | } |
| 1863 | |
| 1864 | |
| 1865 | extern int conn_set_channel_varcxx . . $ pvpgn/bnetd/conn_set_channel_var(681c2fcf151532c2).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_channelcxx . . $ pvpgn/bnetd/t_channel# * channel) |
| 1866 | { |
| 1867 | if (!c) |
| 1868 | { |
| 1869 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1870 | return -1; |
| 1871 | } |
| 1872 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel. = channel; |
| 1873 | return 0; |
| 1874 | } |
| 1875 | |
| 1876 | |
| 1877 | extern int conn_set_channelcxx . . $ pvpgn/bnetd/conn_set_channel(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * channelname) |
| 1878 | { |
| 1879 | t_channelcxx . . $ pvpgn/bnetd/t_channel# * channel; |
| 1880 | t_channelcxx . . $ pvpgn/bnetd/t_channel# * oldchannel; |
| 1881 | t_accountcxx . . $ pvpgn/bnetd/t_account# * acc; |
| 1882 | t_elem * curr; |
| 1883 | int clantag = 0; |
| 1884 | t_clancxx . . $ pvpgn/bnetd/t_clan# * clan = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1885 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1886 | unsigned int created; |
| 1887 | |
| 1888 | if (!c) |
| 1889 | { |
| 1890 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1891 | return -1; |
| 1892 | } |
| 1893 | |
| 1894 | acc = c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account.; |
| 1895 | |
| 1896 | if (!acc) |
| 1897 | { |
| 1898 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL account"); |
| 1899 | return -1; |
| 1900 | } |
| 1901 | |
| 1902 | if (!channelname) |
| 1903 | { |
| 1904 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL channelname"); |
| 1905 | return -1; |
| 1906 | } |
| 1907 | |
| 1908 | oldchannel = c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.; |
| 1909 | |
| 1910 | channel = channellist_find_channel_by_namecxx . . $ pvpgn/bnetd/channellist_find_channel_by_name(7177a8438ab16268).(channelname, 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))); |
| 1911 | |
| 1912 | if (channel && (channel == oldchannel)) |
| 1913 | return 0; |
| 1914 | |
| 1915 | if ((strncasecmp(channelname, "clan ", 5) == 0) && (stdcxx . . $ std/::strlen(channelname) < 10)) |
| 1916 | clantag = str_to_clantagcxx . . $ pvpgn/bnetd/str_to_clantag(c61c63047ce273de).(&channelname[5]); |
| 1917 | |
| 1918 | if ((clantag) && !((account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(acc, channelname) == 1) || (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))) { |
| 1919 | /* PELISH: Admins should be able to join any channel */ |
| 1920 | clan = account_get_clancxx . . $ pvpgn/bnetd/account_get_clan(b1e25e267411fd2e).(acc); |
| 1921 | if ((!clan) || (clan_get_clantagcxx . . $ pvpgn/bnetd/clan_get_clantag(1e16ca1cec114489).(clan) != clantag)) { |
| 1922 | if (!channel) |
| 1923 | { |
| 1924 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_error, c, stdcxx . . $ std/::stringcxx . . $ std/string#("Unable to join channel " +cxx . . $ std/operator+(39ed2c165380f78e). stdcxx . . $ std/::stringcxx . . $ std/string#(channelname) +cxx . . $ std/operator+(900ec9581c410ad9). ", there is no member of that clan in the channel!").c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).()); |
| 1925 | |
| 1926 | if (conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(c) || c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1927 | { |
| 1928 | // FIXME: This is not tested to be according to battle.net!! |
| 1929 | // This is fix for empty clan channels with preventing to join CHANNEL_NAME_BANNED when is used _handle_join_command |
| 1930 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_error, c, stdcxx . . $ std/::stringcxx . . $ std/string#("You have been redirected to " +cxx . . $ std/operator+(39ed2c165380f78e). stdcxx . . $ std/::stringcxx . . $ std/string#(CHANNEL_NAME_BANNEDcxx . . $ `src/bnetd/channel.h:125:9`!)).c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).()); |
| 1931 | channel = channellist_find_channel_by_namecxx . . $ pvpgn/bnetd/channellist_find_channel_by_name(7177a8438ab16268).(CHANNEL_NAME_BANNEDcxx . . $ `src/bnetd/channel.h:125:9`!, 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))); |
| 1932 | } |
| 1933 | else |
| 1934 | return 0; |
| 1935 | } |
| 1936 | else |
| 1937 | { |
| 1938 | t_clancxx . . $ pvpgn/bnetd/t_clan# * ch_clan; |
| 1939 | if ((ch_clan = clanlist_find_clan_by_clantagcxx . . $ pvpgn/bnetd/clanlist_find_clan_by_clantag(8e7bfb2a07f0508e).(clantag)) && (clan_get_channel_typecxx . . $ pvpgn/bnetd/clan_get_channel_type(3931364155ee2c56).(ch_clan) == 1)) |
| 1940 | { |
| 1941 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This is a private clan channel, unable to join!")); |
| 1942 | return 0; |
| 1943 | } |
| 1944 | } |
| 1945 | } |
| 1946 | else { |
| 1947 | if ((clan) && (clan_get_clantagcxx . . $ pvpgn/bnetd/clan_get_clantag(1e16ca1cec114489).(clan) == clantag) && (member = account_get_clanmembercxx . . $ pvpgn/bnetd/account_get_clanmember(4ce48d4e65930331).(acc))) { |
| 1948 | if (clanmember_get_statuscxx . . $ pvpgn/bnetd/clanmember_get_status(54878624261d8c60).(member) >= CLAN_SHAMANcxx . . $ `src/bnetd/clan.h:99:9`!) |
| 1949 | /* PELISH: Giving tmpOP to SHAMAN and CHIEFTAIN on clanchannel */ |
| 1950 | conn_set_tmpOP_channelcxx . . $ pvpgn/bnetd/conn_set_tmpOP_channel(2e9022cda97b266d).(c, channelname); |
| 1951 | } |
| 1952 | } |
| 1953 | } |
| 1954 | |
| 1955 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) |
| 1956 | conn_part_channelcxx . . $ pvpgn/bnetd/conn_part_channel(c4dfbc2386fe4fc3).(c); |
| 1957 | |
| 1958 | if (channel) |
| 1959 | { |
| 1960 | if (channel_check_banningcxx . . $ pvpgn/bnetd/channel_check_banning(af8c4400d4e536a9).(channel, c)) |
| 1961 | { |
| 1962 | 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.")); |
| 1963 | return -1; |
| 1964 | } |
| 1965 | |
| 1966 | 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) && (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(acc, channelname) != 1) && |
| 1967 | (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) && (account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(acc, channelname) != 1) && |
| 1968 | (channel_get_maxcxx . . $ pvpgn/bnetd/channel_get_max(28c764f7c20ec9b2).(channel) == 0)) |
| 1969 | { |
| 1970 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "That channel is for Admins/Operators only.")); |
| 1971 | return -1; |
| 1972 | } |
| 1973 | |
| 1974 | 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) && (account_get_auth_admincxx . . $ pvpgn/bnetd/account_get_auth_admin(4b12bc5edcfaeac7).(acc, channelname) != 1) && |
| 1975 | (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) && (account_get_auth_operatorcxx . . $ pvpgn/bnetd/account_get_auth_operator(4b12bc5edcfaeac7).(acc, channelname) != 1) && |
| 1976 | (channel_get_maxcxx . . $ pvpgn/bnetd/channel_get_max(28c764f7c20ec9b2).(channel) != -1) && (channel_get_currcxx . . $ pvpgn/bnetd/channel_get_curr(28c764f7c20ec9b2).(channel) >= channel_get_maxcxx . . $ pvpgn/bnetd/channel_get_max(28c764f7c20ec9b2).(channel))) |
| 1977 | { |
| 1978 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "The channel is currently full.")); |
| 1979 | return -1; |
| 1980 | } |
| 1981 | } |
| 1982 | |
| 1983 | if (conn_set_joingamewhisper_ackcxx . . $ pvpgn/bnetd/conn_set_joingamewhisper_ack(c14bb6458e7562a).(c, 0) < 0) |
| 1984 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "Unable to reset conn_set_joingamewhisper_ack flag"); |
| 1985 | |
| 1986 | if (conn_set_leavegamewhisper_ackcxx . . $ pvpgn/bnetd/conn_set_leavegamewhisper_ack(c14bb6458e7562a).(c, 0) < 0) |
| 1987 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "Unable to reset conn_set_leavegamewhisper_ack flag"); |
| 1988 | |
| 1989 | /* if you're entering a channel, make sure they didn't exit a game without telling us */ |
| 1990 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game.) |
| 1991 | { |
| 1992 | game_del_playercxx . . $ pvpgn/bnetd/game_del_player(28b000dc6317d503).(conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(c), c); |
| 1993 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1994 | } |
| 1995 | |
| 1996 | created = 0; |
| 1997 | |
| 1998 | if (!channel) |
| 1999 | { |
| 2000 | if (clantag) |
| 2001 | channel = channel_createcxx . . $ pvpgn/bnetd/channel_create(4ddcb5bef4c114f7).(channelname, channelname, 0, 0, 1, 1, prefs_get_chanlogcxx . . $ pvpgn/bnetd/prefs_get_chanlog(db52760e79bf9054).(), 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`!, (prefs_get_maxusers_per_channelcxx . . $ pvpgn/bnetd/prefs_get_maxusers_per_channel(db52760e79bf9054).() > 0) ? prefs_get_maxusers_per_channelcxx . . $ pvpgn/bnetd/prefs_get_maxusers_per_channel(db52760e79bf9054).() : -1, 0, 1, 0); |
| 2002 | else |
| 2003 | channel = channel_createcxx . . $ pvpgn/bnetd/channel_create(4ddcb5bef4c114f7).(channelname, channelname, 0, 0, 1, 1, prefs_get_chanlogcxx . . $ pvpgn/bnetd/prefs_get_chanlog(db52760e79bf9054).(), 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`!, (prefs_get_maxusers_per_channelcxx . . $ pvpgn/bnetd/prefs_get_maxusers_per_channel(db52760e79bf9054).() > 0) ? prefs_get_maxusers_per_channelcxx . . $ pvpgn/bnetd/prefs_get_maxusers_per_channel(db52760e79bf9054).() : -1, 0, 0, 0); |
| 2004 | if (!channel) |
| 2005 | { |
| 2006 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "[{}] could not create channel on join \"{}\"", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), channelname); |
| 2007 | return -1; |
| 2008 | } |
| 2009 | created = 1; |
| 2010 | } |
| 2011 | |
| 2012 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel. = channel; |
| 2013 | |
| 2014 | if (channel_add_connectioncxx . . $ pvpgn/bnetd/channel_add_connection(cf5fcfcfa3727e22).(channel, c) < 0) |
| 2015 | { |
| 2016 | if (created) |
| 2017 | channel_destroycxx . . $ pvpgn/bnetd/channel_destroy(aa13f85fad4de15c).(channel, &curr); |
| 2018 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2019 | return -1; |
| 2020 | } |
| 2021 | |
| 2022 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "[{}] joined channel \"{}\"", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.)); |
| 2023 | conn_send_welcomecxx . . $ pvpgn/bnetd/conn_send_welcome(428cd989165da3c5).(c); |
| 2024 | |
| 2025 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel. && (channel_get_flagscxx . . $ pvpgn/bnetd/channel_get_flags(6768ecacf43d05ec).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) & channel_flags_thevoidcxx . . $ pvpgn/bnetd/channel_flags_thevoid.)) |
| 2026 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This channel does not have chat privileges.")); |
| 2027 | if (clantag && clan && (clan_get_clantagcxx . . $ pvpgn/bnetd/clan_get_clantag(1e16ca1cec114489).(clan) == clantag)) |
| 2028 | { |
| 2029 | char msgtemp[MAX_MESSAGE_LENcxx . . $ MAX_MESSAGE_LEN.]; |
| 2030 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(msgtemp, "%s", clan_get_motdcxx . . $ pvpgn/bnetd/clan_get_motd(49ae76a143b2b3).(clan)); |
| 2031 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(c, message_type_info, c, msgtemp); |
| 2032 | } |
| 2033 | |
| 2034 | |
| 2035 | if (conn_is_irc_variantcxx . . $ pvpgn/bnetd/conn_is_irc_variant(c4dfbc2386fe4fc3).(c) == 0) |
| 2036 | { |
| 2037 | class_topiccxx . . $ pvpgn/bnetd/class_topic# Topiccxx . . $ pvpgn/bnetd/class_topic#class_topic(49f6e7a06ebc5aa8).; |
| 2038 | Topic.displaycxx . . $ pvpgn/bnetd/class_topic#display(4ecd64a16013f99d).(c, stdcxx . . $ std/::stringcxx . . $ std/string#(channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.))); |
| 2039 | } |
| 2040 | |
| 2041 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel. && (channel_get_flagscxx . . $ pvpgn/bnetd/channel_get_flags(6768ecacf43d05ec).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) & channel_flags_moderatedcxx . . $ pvpgn/bnetd/channel_flags_moderated.)) |
| 2042 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_error, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "This channel is moderated.")); |
| 2043 | |
| 2044 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel. != oldchannel) |
| 2045 | clanmember_on_change_status_by_connectioncxx . . $ pvpgn/bnetd/clanmember_on_change_status_by_connection(c4dfbc2386fe4fc3).(c); |
| 2046 | |
| 2047 | return 0; |
| 2048 | } |
| 2049 | |
| 2050 | extern int conn_part_channelcxx . . $ pvpgn/bnetd/conn_part_channel(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 2051 | { |
| 2052 | if (!c) { |
| 2053 | ERROR0cxx . . $ `src/common/eventlog.h:73:9`!("got NULL connection"); |
| 2054 | return -1; |
| 2055 | } |
| 2056 | |
| 2057 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) { |
| 2058 | ERROR0cxx . . $ `src/common/eventlog.h:73:9`!("client want to PART channel but is not in channel! c->protocol.chat.channel == NULL"); |
| 2059 | return -1; |
| 2060 | } |
| 2061 | |
| 2062 | channel_del_connectioncxx . . $ pvpgn/bnetd/channel_del_connection(11eacf26fb1585ff).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel., c, message_type_part, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 2063 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2064 | |
| 2065 | return 0; |
| 2066 | } |
| 2067 | |
| 2068 | extern int conn_kick_channelcxx . . $ pvpgn/bnetd/conn_kick_channel(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * text) |
| 2069 | { |
| 2070 | /* According to RFC2812 in *text is reason, wol sends by text op nickname */ |
| 2071 | |
| 2072 | if (!c) { |
| 2073 | ERROR0cxx . . $ `src/common/eventlog.h:73:9`!("got NULL connection"); |
| 2074 | return -1; |
| 2075 | } |
| 2076 | |
| 2077 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) { |
| 2078 | ERROR0cxx . . $ `src/common/eventlog.h:73:9`!("client want to KICK channel but is not in channel! c->protocol.chat.channel == NULL"); |
| 2079 | return -1; |
| 2080 | } |
| 2081 | |
| 2082 | channel_del_connectioncxx . . $ pvpgn/bnetd/channel_del_connection(11eacf26fb1585ff).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel., c, message_type_kick, text); |
| 2083 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2084 | |
| 2085 | return 0; |
| 2086 | } |
| 2087 | |
| 2088 | extern int conn_quit_channelcxx . . $ pvpgn/bnetd/conn_quit_channel(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * text) |
| 2089 | { |
| 2090 | /* According to RFC2812 in *text is user difinable QUIT message i.e.: Gone to have lunch */ |
| 2091 | |
| 2092 | if (!c) { |
| 2093 | ERROR0cxx . . $ `src/common/eventlog.h:73:9`!("got NULL connection"); |
| 2094 | return -1; |
| 2095 | } |
| 2096 | |
| 2097 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) { |
| 2098 | ERROR0cxx . . $ `src/common/eventlog.h:73:9`!("client want to QUIT channel but is not in channel! c->protocol.chat.channel == NULL"); |
| 2099 | return -1; |
| 2100 | } |
| 2101 | |
| 2102 | channel_del_connectioncxx . . $ pvpgn/bnetd/channel_del_connection(11eacf26fb1585ff).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel., c, message_type_quit, text); |
| 2103 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2104 | |
| 2105 | return 0; |
| 2106 | } |
| 2107 | |
| 2108 | extern t_game * conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2109 | { |
| 2110 | if (!c) |
| 2111 | { |
| 2112 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2113 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2114 | } |
| 2115 | |
| 2116 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game.; |
| 2117 | } |
| 2118 | |
| 2119 | |
| 2120 | extern int conn_set_gamecxx . . $ pvpgn/bnetd/conn_set_game(6346b62fdc8e3894).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * gamename, char const * gamepass, char const * gameinfo, t_game_type type, int version) |
| 2121 | /* |
| 2122 | * If game not exists (create) version != 0 (called in handle_bnet.c, function _client_startgameX()) |
| 2123 | * If game exists (join) version == 0 always (called in handle_bnet.c, function _client_joingame()) |
| 2124 | * If game exists (join) gameinfo == "" (called in handle_bnet.c, function _client_joingame()) |
| 2125 | * [KWS] |
| 2126 | */ |
| 2127 | { |
| 2128 | if (!c) { |
| 2129 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2130 | return 0; |
| 2131 | } |
| 2132 | |
| 2133 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game.) { |
| 2134 | if (gamename) { |
| 2135 | if (strcasecmp(gamename, game_get_namecxx . . $ pvpgn/bnetd/game_get_name(743fb6d1aa411c4e).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game.))) |
| 2136 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "[{}] tried to join a new game \"{}\" while already in a game \"{}\"!", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), gamename, game_get_namecxx . . $ pvpgn/bnetd/game_get_name(743fb6d1aa411c4e).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game.)); |
| 2137 | else return 0; |
| 2138 | } |
| 2139 | game_del_playercxx . . $ pvpgn/bnetd/game_del_player(28b000dc6317d503).(conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(c), c); |
| 2140 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2141 | } |
| 2142 | |
| 2143 | if (gamename) { |
| 2144 | if (!(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game. = gamelist_find_game_availablecxx . . $ pvpgn/bnetd/gamelist_find_game_available(e383c2f40f0b546f).(gamename, c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag., type)) |
| 2145 | && !gamelist_find_game_availablecxx . . $ pvpgn/bnetd/gamelist_find_game_available(e383c2f40f0b546f).(gamename, c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag., game_type_all)) { |
| 2146 | /* do not allow creation of games with same name of same clienttag when game is not started or done */ |
| 2147 | // create game with initial values |
| 2148 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game. = game_createcxx . . $ pvpgn/bnetd/game_create(75b438a61efed074).(gamename, gamepass, gameinfo, type, version, c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag., conn_get_gameversioncxx . . $ pvpgn/bnetd/conn_get_gameversion(3fda5c23f1f5e239).(c)); |
| 2149 | |
| 2150 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game. && conn_get_realmcxx . . $ pvpgn/bnetd/conn_get_realm(c743a4e7d4d1463d).(c) && conn_get_charnamecxx . . $ pvpgn/bnetd/conn_get_charname(c99dbccf638f5c6).(c)) { |
| 2151 | game_set_realmnamecxx . . $ pvpgn/bnetd/game_set_realmname(bfbe5c8efad5152b).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game., realm_get_namecxx . . $ pvpgn/bnetd/realm_get_name(83f045398bcf2fc5).(conn_get_realmcxx . . $ pvpgn/bnetd/conn_get_realm(c743a4e7d4d1463d).(c))); |
| 2152 | realm_add_game_numbercxx . . $ pvpgn/bnetd/realm_add_game_number(776df6f6ee711b79).(conn_get_realmcxx . . $ pvpgn/bnetd/conn_get_realm(c743a4e7d4d1463d).(c), 1); |
| 2153 | send_d2cs_gameinforeqcxx . . $ pvpgn/bnetd/send_d2cs_gameinforeq(c4dfbc2386fe4fc3).(c); |
| 2154 | } |
| 2155 | } |
| 2156 | |
| 2157 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game.) { |
| 2158 | // add new player to the game |
| 2159 | if (game_add_playercxx . . $ pvpgn/bnetd/game_add_player(e78f07273e1755ea).(conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(c), gamepass, version, c) < 0) { |
| 2160 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; // bad password or version # |
| 2161 | return -1; |
| 2162 | } |
| 2163 | |
| 2164 | #ifdef WITH_LUA |
| 2165 | // handle game create when it's owner joins the game |
| 2166 | if (c == game_get_owner(c->protocol.game)) |
| 2167 | lua_handle_game(c->protocol.game, NULL, luaevent_game_create); |
| 2168 | #endif |
| 2169 | |
| 2170 | if (game_is_laddercxx . . $ pvpgn/bnetd/game_is_ladder(7ab38d5cc74e6b21).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game.)) { |
| 2171 | if (c == game_get_ownercxx . . $ pvpgn/bnetd/game_get_owner(44263c0cd290cfb5).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game.)) |
| 2172 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Created ladder game")); |
| 2173 | else |
| 2174 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(c, message_type_info, c, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(c, "Joined ladder game")); |
| 2175 | } |
| 2176 | } |
| 2177 | } |
| 2178 | else c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..gamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#game. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2179 | |
| 2180 | return 0; |
| 2181 | } |
| 2182 | |
| 2183 | extern unsigned int conn_get_tcpaddrcxx . . $ pvpgn/bnetd/conn_get_tcpaddr(c9be5e844f0af884).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 2184 | { |
| 2185 | if (!c) |
| 2186 | { |
| 2187 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2188 | return 0; |
| 2189 | } |
| 2190 | |
| 2191 | return c->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_addrcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_addr.; |
| 2192 | } |
| 2193 | |
| 2194 | |
| 2195 | extern t_packetcxx . . $ pvpgn/t_packet# * conn_get_in_queuecxx . . $ pvpgn/bnetd/conn_get_in_queue(13d5bf83aec8b080).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 2196 | { |
| 2197 | assertcxx . . $ `/usr/include/assert.h:102:11`!(c); |
| 2198 | |
| 2199 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..inqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#inqueue.; |
| 2200 | } |
| 2201 | |
| 2202 | |
| 2203 | extern void conn_put_in_queuecxx . . $ pvpgn/bnetd/conn_put_in_queue(41a43a32104f7da6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet) |
| 2204 | { |
| 2205 | assertcxx . . $ `/usr/include/assert.h:102:11`!(c); |
| 2206 | |
| 2207 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..inqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#inqueue. = packet; |
| 2208 | } |
| 2209 | |
| 2210 | |
| 2211 | extern unsigned int conn_get_in_sizecxx . . $ pvpgn/bnetd/conn_get_in_size(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2212 | { |
| 2213 | if (!c) |
| 2214 | { |
| 2215 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2216 | return 0; |
| 2217 | } |
| 2218 | |
| 2219 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..insizecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#insize.; |
| 2220 | } |
| 2221 | |
| 2222 | |
| 2223 | extern void conn_set_in_sizecxx . . $ pvpgn/bnetd/conn_set_in_size(d97ad1b62a895b69).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned int size) |
| 2224 | { |
| 2225 | if (!c) |
| 2226 | { |
| 2227 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2228 | return; |
| 2229 | } |
| 2230 | |
| 2231 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..insizecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#insize. = size; |
| 2232 | } |
| 2233 | |
| 2234 | |
| 2235 | extern unsigned int conn_get_out_sizecxx . . $ pvpgn/bnetd/conn_get_out_size(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2236 | { |
| 2237 | if (!c) |
| 2238 | { |
| 2239 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2240 | return 0; |
| 2241 | } |
| 2242 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outsizecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outsize.; |
| 2243 | } |
| 2244 | |
| 2245 | |
| 2246 | extern void conn_set_out_sizecxx . . $ pvpgn/bnetd/conn_set_out_size(d97ad1b62a895b69).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned int size) |
| 2247 | { |
| 2248 | if (!c) |
| 2249 | { |
| 2250 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2251 | return; |
| 2252 | } |
| 2253 | |
| 2254 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outsizecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outsize. = size; |
| 2255 | } |
| 2256 | |
| 2257 | extern int conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet) |
| 2258 | { |
| 2259 | if (!c) |
| 2260 | { |
| 2261 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2262 | return -1; |
| 2263 | } |
| 2264 | |
| 2265 | if (!packet) |
| 2266 | { |
| 2267 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL packet"); |
| 2268 | return -1; |
| 2269 | } |
| 2270 | |
| 2271 | // Protection from hack attempt |
| 2272 | // Limit out queue packets due to it may cause memory leak with not enough memory program crash on a server machine |
| 2273 | t_queue ** q = &c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outqueue.; |
| 2274 | if (prefs_get_packet_limitcxx . . $ pvpgn/bnetd/prefs_get_packet_limit(db52760e79bf9054).() && queue_get_lengthcxx . . $ pvpgn/queue_get_length(ae563c2b543beeaa).((t_queue const * const *)q) > prefs_get_packet_limitcxx . . $ pvpgn/bnetd/prefs_get_packet_limit(db52760e79bf9054).()) |
| 2275 | { |
| 2276 | queue_clearcxx . . $ pvpgn/queue_clear(e7fc052edc0a6819).(q); |
| 2277 | conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(c, conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.); |
| 2278 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "outqueue reached limit of {} packets (hack attempt?)", prefs_get_packet_limitcxx . . $ pvpgn/bnetd/prefs_get_packet_limit(db52760e79bf9054).()); |
| 2279 | return 0; |
| 2280 | } |
| 2281 | |
| 2282 | queue_push_packetcxx . . $ pvpgn/queue_push_packet(dcf0852b5319de36).((t_queue * *)&c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outqueue., packet); |
| 2283 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outsizepcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outsizep.++) fdwatch_update_fdcxx . . $ pvpgn/fdwatch_update_fd(b223e862534b1804).(c->socketcxx . . $ pvpgn/bnetd/connection#socket..fdw_idxcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#fdw_idx., fdwatch_type_readcxx . . $ pvpgn/fdwatch_type_read. | fdwatch_type_writecxx . . $ pvpgn/fdwatch_type_write.); |
| 2284 | |
| 2285 | return 0; |
| 2286 | } |
| 2287 | |
| 2288 | extern int conn_clear_outqueuecxx . . $ pvpgn/bnetd/conn_clear_outqueue(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 2289 | { |
| 2290 | if (!c) |
| 2291 | { |
| 2292 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2293 | return -1; |
| 2294 | } |
| 2295 | |
| 2296 | queue_clearcxx . . $ pvpgn/queue_clear(e7fc052edc0a6819).(&c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outqueue.); |
| 2297 | return 0; |
| 2298 | } |
| 2299 | |
| 2300 | extern t_packetcxx . . $ pvpgn/t_packet# * conn_peek_outqueuecxx . . $ pvpgn/bnetd/conn_peek_outqueue(13d5bf83aec8b080).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 2301 | { |
| 2302 | if (!c) |
| 2303 | { |
| 2304 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2305 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2306 | } |
| 2307 | |
| 2308 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outqueue.) |
| 2309 | return queue_peek_packetcxx . . $ pvpgn/queue_peek_packet(7fa79213a3522fc5).((t_queue const * const *)&c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outqueue.); |
| 2310 | else return 0; |
| 2311 | } |
| 2312 | |
| 2313 | extern t_packetcxx . . $ pvpgn/t_packet# * conn_pull_outqueuecxx . . $ pvpgn/bnetd/conn_pull_outqueue(13d5bf83aec8b080).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 2314 | { |
| 2315 | if (!c) |
| 2316 | { |
| 2317 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2318 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2319 | } |
| 2320 | |
| 2321 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outsizepcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outsizep.) { |
| 2322 | if (!(--c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outsizepcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outsizep.)) fdwatch_update_fdcxx . . $ pvpgn/fdwatch_update_fd(b223e862534b1804).(c->socketcxx . . $ pvpgn/bnetd/connection#socket..fdw_idxcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#fdw_idx., fdwatch_type_readcxx . . $ pvpgn/fdwatch_type_read.); |
| 2323 | return queue_pull_packetcxx . . $ pvpgn/queue_pull_packet(fc21e149db949db4).((t_queue * *)&c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..queuescxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#queues..outqueuecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_6#outqueue.); |
| 2324 | } |
| 2325 | |
| 2326 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2327 | } |
| 2328 | |
| 2329 | extern char const * conn_get_username_realcxx . . $ pvpgn/bnetd/conn_get_username_real(186ab7be98daf447).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c, char const * fn, unsigned int ln) |
| 2330 | { |
| 2331 | char const * result; |
| 2332 | |
| 2333 | if (!c) |
| 2334 | { |
| 2335 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection (from {}:{})", fn, ln); |
| 2336 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2337 | } |
| 2338 | |
| 2339 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account.) |
| 2340 | { |
| 2341 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL account (from {}:{})", fn, ln); |
| 2342 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2343 | } |
| 2344 | result = account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(c->protocol.account); |
| 2345 | if (result == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 2346 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "returned previous error after being called by {}:{}", fn, ln); |
| 2347 | |
| 2348 | return result; |
| 2349 | } |
| 2350 | |
| 2351 | |
| 2352 | extern char const * conn_get_chatnamecxx . . $ pvpgn/bnetd/conn_get_chatname(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2353 | { |
| 2354 | if (!c) |
| 2355 | { |
| 2356 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2357 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2358 | } |
| 2359 | |
| 2360 | if ((c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_bnetcxx . . $ pvpgn/bnetd/conn_class_bnet.) && c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..boundcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#bound.) |
| 2361 | { |
| 2362 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charactercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#character.) |
| 2363 | return character_get_namecxx . . $ pvpgn/bnetd/character_get_name(4383355f43ab5a1b).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charactercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#character.); |
| 2364 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..boundcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#bound.->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charactercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#character.) |
| 2365 | return character_get_namecxx . . $ pvpgn/bnetd/character_get_name(4383355f43ab5a1b).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..boundcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#bound.->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charactercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#character.); |
| 2366 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "[{}] got connection class {} bound to class {} without a character", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), conn_class_get_strcxx . . $ pvpgn/bnetd/conn_class_get_str(197fb956ae47a8f8).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass.), c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..boundcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#bound.->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass.); |
| 2367 | } |
| 2368 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account.) |
| 2369 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; /* no name yet */ |
| 2370 | return conn_get_loggedusercxx . . $ pvpgn/bnetd/conn_get_loggeduser(c99dbccf638f5c6).(c); |
| 2371 | } |
| 2372 | |
| 2373 | |
| 2374 | extern int conn_unget_chatnamecxx . . $ pvpgn/bnetd/conn_unget_chatname(6b2655da947c846f).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c, char const * name) |
| 2375 | { |
| 2376 | if (!c) |
| 2377 | { |
| 2378 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2379 | return -1; |
| 2380 | } |
| 2381 | |
| 2382 | if ((c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_bnetcxx . . $ pvpgn/bnetd/conn_class_bnet.) && c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..boundcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#bound.) |
| 2383 | return 0; |
| 2384 | return 0; |
| 2385 | } |
| 2386 | |
| 2387 | |
| 2388 | extern char const * conn_get_chatcharnamecxx . . $ pvpgn/bnetd/conn_get_chatcharname(f9b74edfe4109401).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c, t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * dst) |
| 2389 | { |
| 2390 | char const * accname; |
| 2391 | char * chatcharname; |
| 2392 | |
| 2393 | if (!c) |
| 2394 | { |
| 2395 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2396 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2397 | } |
| 2398 | |
| 2399 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account.) |
| 2400 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; /* no name yet */ |
| 2401 | |
| 2402 | /* for D2 Users */ |
| 2403 | accname = conn_get_loggedusercxx . . $ pvpgn/bnetd/conn_get_loggeduser(c99dbccf638f5c6).(c); |
| 2404 | if (!accname) |
| 2405 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2406 | |
| 2407 | if (dst && dst->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charnamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#charname.) |
| 2408 | { |
| 2409 | const char *mychar; |
| 2410 | |
| 2411 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charnamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#charname.) mychar = c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charnamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#charname.; |
| 2412 | else mychar = ""; |
| 2413 | chatcharname = (char*)xmalloccxx . . $ `src/common/xalloc.h:43:9`!(std::strlen(accname) + 2 + std::strlen(mychar)); |
| 2414 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(chatcharname, "%s*%s", mychar, accname); |
| 2415 | } |
| 2416 | else chatcharname = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(accname); |
| 2417 | |
| 2418 | return chatcharname; |
| 2419 | } |
| 2420 | |
| 2421 | |
| 2422 | extern int conn_unget_chatcharnamecxx . . $ pvpgn/bnetd/conn_unget_chatcharname(6b2655da947c846f).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c, char const * name) |
| 2423 | { |
| 2424 | if (!c) |
| 2425 | { |
| 2426 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2427 | return -1; |
| 2428 | } |
| 2429 | if (!name) |
| 2430 | { |
| 2431 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL name"); |
| 2432 | return -1; |
| 2433 | } |
| 2434 | |
| 2435 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)name); /* avoid warning */ |
| 2436 | return 0; |
| 2437 | } |
| 2438 | |
| 2439 | |
| 2440 | extern t_message_class conn_get_message_classcxx . . $ pvpgn/bnetd/conn_get_message_class(fcbdb1738f905700).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c, t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * dst) |
| 2441 | { |
| 2442 | if (dst && dst->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charnamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#charname.) /* message to D2 user must be char*account */ |
| 2443 | return message_class_charjoin; |
| 2444 | |
| 2445 | return message_class_normal; |
| 2446 | } |
| 2447 | |
| 2448 | |
| 2449 | extern unsigned int conn_get_useridcxx . . $ pvpgn/bnetd/conn_get_userid(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2450 | { |
| 2451 | if (!c) |
| 2452 | { |
| 2453 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2454 | return 0; |
| 2455 | } |
| 2456 | |
| 2457 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..accountcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#account.) |
| 2458 | { |
| 2459 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL account"); |
| 2460 | return 0; |
| 2461 | } |
| 2462 | |
| 2463 | return account_get_uidcxx . . $ `src/bnetd/account.h:91:9`!(c->protocol.account); |
| 2464 | } |
| 2465 | |
| 2466 | |
| 2467 | extern int conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2468 | { |
| 2469 | if (!c) |
| 2470 | { |
| 2471 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2472 | return -1; |
| 2473 | } |
| 2474 | |
| 2475 | return c->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_sockcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_sock.; |
| 2476 | } |
| 2477 | |
| 2478 | |
| 2479 | extern int conn_get_game_socketcxx . . $ pvpgn/bnetd/conn_get_game_socket(b5160de3e9803af4).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2480 | { |
| 2481 | if (!c) |
| 2482 | { |
| 2483 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2484 | return -1; |
| 2485 | } |
| 2486 | |
| 2487 | return c->socketcxx . . $ pvpgn/bnetd/connection#socket..udp_sockcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#udp_sock.; |
| 2488 | } |
| 2489 | |
| 2490 | |
| 2491 | extern int conn_set_game_socketcxx . . $ pvpgn/bnetd/conn_set_game_socket(fa505503af8860d0).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, int usock) |
| 2492 | { |
| 2493 | if (!c) |
| 2494 | { |
| 2495 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2496 | return -1; |
| 2497 | } |
| 2498 | |
| 2499 | c->socketcxx . . $ pvpgn/bnetd/connection#socket..udp_sockcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#udp_sock. = usock; |
| 2500 | return 0; |
| 2501 | } |
| 2502 | |
| 2503 | /* Player icon that displayed in a channel in all games (except Warcraft 3) */ |
| 2504 | extern char const * conn_get_playerinfocxx . . $ pvpgn/bnetd/conn_get_playerinfo(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2505 | { |
| 2506 | t_accountcxx . . $ pvpgn/bnetd/t_account# * account; |
| 2507 | static char playerinfo[MAX_PLAYERINFO_STRcxx . . $ MAX_PLAYERINFO_STR.]; |
| 2508 | t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag; |
| 2509 | char revtag[5]; |
| 2510 | char const * usericon; |
| 2511 | |
| 2512 | if (!c) |
| 2513 | { |
| 2514 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2515 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2516 | } |
| 2517 | if (!(account = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c))) |
| 2518 | { |
| 2519 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "connection has no account"); |
| 2520 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2521 | } |
| 2522 | |
| 2523 | if (!(clienttag = conn_get_fake_clienttagcxx . . $ pvpgn/bnetd/conn_get_fake_clienttag(8bd2285a65940781).(c))) |
| 2524 | { |
| 2525 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "connection has NULL fakeclienttag"); |
| 2526 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2527 | } |
| 2528 | tag_uint_to_revstr(revtag, clienttag); |
| 2529 | |
| 2530 | // allow set icon to a user directly from the database (override default tag always if not null) |
| 2531 | if (usericon = account_get_user_iconcxx . . $ pvpgn/bnetd/account_get_user_icon(771ec84f6146e718).(account, clienttag)) |
| 2532 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(revtag, "%s", usericon); |
| 2533 | else if (clienttag == CLIENTTAG_BNCHATBOT_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:85:9`!) |
| 2534 | { |
| 2535 | stdcxx . . $ std/::strcpy(playerinfo, revtag); /* FIXME: what to return here? */ |
| 2536 | } |
| 2537 | else if ((clienttag == CLIENTTAG_STARCRAFT_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:87:9`!) || (clienttag == CLIENTTAG_BROODWARS_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:89:9`!)) |
| 2538 | { |
| 2539 | if (conn_get_versionidcxx . . $ pvpgn/bnetd/conn_get_versionid(3fda5c23f1f5e239).(c) <= 0x000000c7) |
| 2540 | { |
| 2541 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(playerinfo, "%s %u %d %u %u %u", |
| 2542 | revtag, |
| 2543 | account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, clienttag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.), |
| 2544 | account_get_ladder_rankcxx . . $ pvpgn/bnetd/account_get_ladder_rank(829aa05f631ee398).(account, clienttag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.), |
| 2545 | account_get_normal_winscxx . . $ pvpgn/bnetd/account_get_normal_wins(93d29eefa17aed6d).(account, clienttag), |
| 2546 | 0, 0); |
| 2547 | } |
| 2548 | else |
| 2549 | { |
| 2550 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(playerinfo, "%s %u %d %u %u %u %u %u %u %s", |
| 2551 | revtag, |
| 2552 | account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, clienttag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.), |
| 2553 | account_get_ladder_rankcxx . . $ pvpgn/bnetd/account_get_ladder_rank(829aa05f631ee398).(account, clienttag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.), |
| 2554 | account_get_normal_winscxx . . $ pvpgn/bnetd/account_get_normal_wins(93d29eefa17aed6d).(account, clienttag), |
| 2555 | 0, 0, |
| 2556 | account_get_ladder_high_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_high_rating(44091a2c7ac3910).(account, clienttag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.), |
| 2557 | 0, 0, |
| 2558 | revtag); |
| 2559 | } |
| 2560 | } |
| 2561 | else if (clienttag == CLIENTTAG_SHAREWARE_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:91:9`!) |
| 2562 | { |
| 2563 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(playerinfo, "%s %u %d %u %u %u", |
| 2564 | revtag, |
| 2565 | account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, clienttag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.), |
| 2566 | account_get_ladder_rankcxx . . $ pvpgn/bnetd/account_get_ladder_rank(829aa05f631ee398).(account, clienttag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.), |
| 2567 | account_get_normal_winscxx . . $ pvpgn/bnetd/account_get_normal_wins(93d29eefa17aed6d).(account, clienttag), |
| 2568 | 0, 0); |
| 2569 | } |
| 2570 | else if (clienttag == CLIENTTAG_DIABLORTL_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:93:9`!) |
| 2571 | { |
| 2572 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(playerinfo, "%s %u %u %u %u %u %u %u %u %u", |
| 2573 | revtag, |
| 2574 | account_get_normal_levelcxx . . $ pvpgn/bnetd/account_get_normal_level(93d29eefa17aed6d).(account, clienttag), |
| 2575 | account_get_normal_classcxx . . $ pvpgn/bnetd/account_get_normal_class(93d29eefa17aed6d).(account, clienttag), |
| 2576 | account_get_normal_diablo_killscxx . . $ pvpgn/bnetd/account_get_normal_diablo_kills(93d29eefa17aed6d).(account, clienttag), |
| 2577 | account_get_normal_strengthcxx . . $ pvpgn/bnetd/account_get_normal_strength(93d29eefa17aed6d).(account, clienttag), |
| 2578 | account_get_normal_magiccxx . . $ pvpgn/bnetd/account_get_normal_magic(93d29eefa17aed6d).(account, clienttag), |
| 2579 | account_get_normal_dexteritycxx . . $ pvpgn/bnetd/account_get_normal_dexterity(93d29eefa17aed6d).(account, clienttag), |
| 2580 | account_get_normal_vitalitycxx . . $ pvpgn/bnetd/account_get_normal_vitality(93d29eefa17aed6d).(account, clienttag), |
| 2581 | account_get_normal_goldcxx . . $ pvpgn/bnetd/account_get_normal_gold(93d29eefa17aed6d).(account, clienttag), |
| 2582 | 0); |
| 2583 | } |
| 2584 | else if (clienttag == CLIENTTAG_DIABLOSHR_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:95:9`!) |
| 2585 | { |
| 2586 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(playerinfo, "%s %u %u %u %u %u %u %u %u %u", |
| 2587 | revtag, |
| 2588 | account_get_normal_levelcxx . . $ pvpgn/bnetd/account_get_normal_level(93d29eefa17aed6d).(account, clienttag), |
| 2589 | account_get_normal_classcxx . . $ pvpgn/bnetd/account_get_normal_class(93d29eefa17aed6d).(account, clienttag), |
| 2590 | account_get_normal_diablo_killscxx . . $ pvpgn/bnetd/account_get_normal_diablo_kills(93d29eefa17aed6d).(account, clienttag), |
| 2591 | account_get_normal_strengthcxx . . $ pvpgn/bnetd/account_get_normal_strength(93d29eefa17aed6d).(account, clienttag), |
| 2592 | account_get_normal_magiccxx . . $ pvpgn/bnetd/account_get_normal_magic(93d29eefa17aed6d).(account, clienttag), |
| 2593 | account_get_normal_dexteritycxx . . $ pvpgn/bnetd/account_get_normal_dexterity(93d29eefa17aed6d).(account, clienttag), |
| 2594 | account_get_normal_vitalitycxx . . $ pvpgn/bnetd/account_get_normal_vitality(93d29eefa17aed6d).(account, clienttag), |
| 2595 | account_get_normal_goldcxx . . $ pvpgn/bnetd/account_get_normal_gold(93d29eefa17aed6d).(account, clienttag), |
| 2596 | 0); |
| 2597 | } |
| 2598 | else if (clienttag == CLIENTTAG_WARCIIBNE_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:97:9`!) |
| 2599 | { |
| 2600 | unsigned int a, b; |
| 2601 | |
| 2602 | a = account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, clienttag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.); |
| 2603 | b = account_get_ladder_ratingcxx . . $ pvpgn/bnetd/account_get_ladder_rating(44091a2c7ac3910).(account, clienttag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.); |
| 2604 | |
| 2605 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(playerinfo, "%s %u %d %u %u %u %u %u %d", |
| 2606 | revtag, |
| 2607 | a, |
| 2608 | account_get_ladder_rankcxx . . $ pvpgn/bnetd/account_get_ladder_rank(829aa05f631ee398).(account, clienttag, ladder_id_normalcxx . . $ pvpgn/bnetd/ladder_id_normal.), |
| 2609 | account_get_normal_winscxx . . $ pvpgn/bnetd/account_get_normal_wins(93d29eefa17aed6d).(account, clienttag), |
| 2610 | 0, |
| 2611 | 0, |
| 2612 | (a > b) ? a : b, |
| 2613 | b, |
| 2614 | account_get_ladder_rankcxx . . $ pvpgn/bnetd/account_get_ladder_rank(829aa05f631ee398).(account, clienttag, ladder_id_ironmancxx . . $ pvpgn/bnetd/ladder_id_ironman.)); |
| 2615 | } |
| 2616 | else if (clienttag == CLIENTTAG_DIABLO2DV_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:99:9`! || clienttag == CLIENTTAG_DIABLO2XP_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:105:9`!) |
| 2617 | { |
| 2618 | /* This sets portrait of character */ |
| 2619 | if (!conn_get_realmcxx . . $ pvpgn/bnetd/conn_get_realm(c743a4e7d4d1463d).(c) || !conn_get_realminfocxx . . $ pvpgn/bnetd/conn_get_realminfo(c99dbccf638f5c6).(c)) |
| 2620 | { |
| 2621 | stdcxx . . $ std/::strcpy(playerinfo, revtag); |
| 2622 | } |
| 2623 | else |
| 2624 | { |
| 2625 | stdcxx . . $ std/::strcpy(playerinfo, conn_get_realminfocxx . . $ pvpgn/bnetd/conn_get_realminfo(c99dbccf638f5c6).(c)); |
| 2626 | } |
| 2627 | } |
| 2628 | else |
| 2629 | stdcxx . . $ std/::strcpy(playerinfo, revtag); /* open char */ |
| 2630 | |
| 2631 | // if custom_icons is enabled then set a custom client tag by player rating |
| 2632 | // do not override user selected icon if it's not null |
| 2633 | if (!usericon && prefs_get_custom_iconscxx . . $ pvpgn/bnetd/prefs_get_custom_icons(b126dc7c1de90089).() == 1 && customicons_allowed_by_clientcxx . . $ pvpgn/bnetd/customicons_allowed_by_client(dfa6e707f7696010).(clienttag)) |
| 2634 | { |
| 2635 | if (t_icon_infocxx . . $ pvpgn/bnetd/t_icon_info# * icon = customicons_get_icon_by_accountcxx . . $ pvpgn/bnetd/customicons_get_icon_by_account(6aa4f522a41892c1).(account, clienttag)) |
| 2636 | stdcxx . . $ std/::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(playerinfo, sizeof playerinfo, "%s", icon->icon_codecxx . . $ pvpgn/bnetd/$anonymous_type_e36c06d23f785114_0#icon_code.); |
| 2637 | } |
| 2638 | |
| 2639 | #ifdef WITH_LUA |
| 2640 | // change icon info from Lua |
| 2641 | if (const char * iconinfo = lua_handle_user_icon((t_connection*)c, playerinfo)) |
| 2642 | return iconinfo; |
| 2643 | #endif |
| 2644 | |
| 2645 | return playerinfo; |
| 2646 | } |
| 2647 | |
| 2648 | |
| 2649 | extern int conn_set_playerinfocxx . . $ pvpgn/bnetd/conn_set_playerinfo(6b2655da947c846f).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c, char const * playerinfo) |
| 2650 | { |
| 2651 | t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag; |
| 2652 | char clienttag_str[5]; |
| 2653 | |
| 2654 | if (!c) |
| 2655 | { |
| 2656 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2657 | return -1; |
| 2658 | } |
| 2659 | if (!playerinfo) |
| 2660 | { |
| 2661 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL playerinfo"); |
| 2662 | return -1; |
| 2663 | } |
| 2664 | clienttag = c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag.; |
| 2665 | |
| 2666 | if (clienttag == CLIENTTAG_DIABLORTL_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:93:9`!) |
| 2667 | { |
| 2668 | unsigned int level; |
| 2669 | unsigned int chclass; |
| 2670 | unsigned int diablo_kills; |
| 2671 | unsigned int strength; |
| 2672 | unsigned int magic; |
| 2673 | unsigned int dexterity; |
| 2674 | unsigned int vitality; |
| 2675 | unsigned int gold; |
| 2676 | |
| 2677 | if (stdcxx . . $ std/::sscanfcxx . . $ std/sscanf(6246fabbf6b5312d).(playerinfo, "LTRD %u %u %u %u %u %u %u %u %*u", |
| 2678 | &level, |
| 2679 | &chclass, |
| 2680 | &diablo_kills, |
| 2681 | &strength, |
| 2682 | &magic, |
| 2683 | &dexterity, |
| 2684 | &vitality, |
| 2685 | &gold) != 8) |
| 2686 | { |
| 2687 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got bad playerinfo"); |
| 2688 | return -1; |
| 2689 | } |
| 2690 | |
| 2691 | account_set_normal_levelcxx . . $ pvpgn/bnetd/account_set_normal_level(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, level); |
| 2692 | account_set_normal_classcxx . . $ pvpgn/bnetd/account_set_normal_class(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, chclass); |
| 2693 | account_set_normal_diablo_killscxx . . $ pvpgn/bnetd/account_set_normal_diablo_kills(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, diablo_kills); |
| 2694 | account_set_normal_strengthcxx . . $ pvpgn/bnetd/account_set_normal_strength(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, strength); |
| 2695 | account_set_normal_magiccxx . . $ pvpgn/bnetd/account_set_normal_magic(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, magic); |
| 2696 | account_set_normal_dexteritycxx . . $ pvpgn/bnetd/account_set_normal_dexterity(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, dexterity); |
| 2697 | account_set_normal_vitalitycxx . . $ pvpgn/bnetd/account_set_normal_vitality(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, vitality); |
| 2698 | account_set_normal_goldcxx . . $ pvpgn/bnetd/account_set_normal_gold(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, gold); |
| 2699 | } |
| 2700 | else if (clienttag == CLIENTTAG_DIABLOSHR_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:95:9`!) |
| 2701 | { |
| 2702 | unsigned int level; |
| 2703 | unsigned int chclass; |
| 2704 | unsigned int diablo_kills; |
| 2705 | unsigned int strength; |
| 2706 | unsigned int magic; |
| 2707 | unsigned int dexterity; |
| 2708 | unsigned int vitality; |
| 2709 | unsigned int gold; |
| 2710 | |
| 2711 | if (stdcxx . . $ std/::sscanfcxx . . $ std/sscanf(6246fabbf6b5312d).(playerinfo, "RHSD %u %u %u %u %u %u %u %u %*u", |
| 2712 | &level, |
| 2713 | &chclass, |
| 2714 | &diablo_kills, |
| 2715 | &strength, |
| 2716 | &magic, |
| 2717 | &dexterity, |
| 2718 | &vitality, |
| 2719 | &gold) != 8) |
| 2720 | { |
| 2721 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got bad playerinfo"); |
| 2722 | return -1; |
| 2723 | } |
| 2724 | |
| 2725 | account_set_normal_levelcxx . . $ pvpgn/bnetd/account_set_normal_level(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, level); |
| 2726 | account_set_normal_classcxx . . $ pvpgn/bnetd/account_set_normal_class(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, chclass); |
| 2727 | account_set_normal_diablo_killscxx . . $ pvpgn/bnetd/account_set_normal_diablo_kills(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, diablo_kills); |
| 2728 | account_set_normal_strengthcxx . . $ pvpgn/bnetd/account_set_normal_strength(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, strength); |
| 2729 | account_set_normal_magiccxx . . $ pvpgn/bnetd/account_set_normal_magic(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, magic); |
| 2730 | account_set_normal_dexteritycxx . . $ pvpgn/bnetd/account_set_normal_dexterity(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, dexterity); |
| 2731 | account_set_normal_vitalitycxx . . $ pvpgn/bnetd/account_set_normal_vitality(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, vitality); |
| 2732 | account_set_normal_goldcxx . . $ pvpgn/bnetd/account_set_normal_gold(d1a42c0f2badce10).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c), clienttag, gold); |
| 2733 | } |
| 2734 | else if (clienttag == CLIENTTAG_DIABLO2DV_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:99:9`!) |
| 2735 | { |
| 2736 | /* not much to do */ /* FIXME: get char name here? */ |
| 2737 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_tracecxx . . $ pvpgn/eventlog_level_trace., __FUNCTION__, "[{}] playerinfo request for client \"{}\" playerinfo=\"{}\"", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), tag_uint_to_str(clienttag_str, clienttag), playerinfo); |
| 2738 | } |
| 2739 | else if (clienttag == CLIENTTAG_DIABLO2XP_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:105:9`!) |
| 2740 | { |
| 2741 | /* in playerinfo we get strings of the form "Realmname,charname" */ |
| 2742 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_tracecxx . . $ pvpgn/eventlog_level_trace., __FUNCTION__, "[{}] playerinfo request for client \"{}\" playerinfo=\"{}\"", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), tag_uint_to_str(clienttag_str, clienttag), playerinfo); |
| 2743 | } |
| 2744 | else |
| 2745 | { |
| 2746 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_warncxx . . $ pvpgn/eventlog_level_warn., __FUNCTION__, "setting playerinfo for client \"{}\" not supported (playerinfo=\"{}\")", tag_uint_to_str(clienttag_str, clienttag), playerinfo); |
| 2747 | return -1; |
| 2748 | } |
| 2749 | |
| 2750 | return 0; |
| 2751 | } |
| 2752 | |
| 2753 | |
| 2754 | extern char const * conn_get_realminfocxx . . $ pvpgn/bnetd/conn_get_realminfo(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2755 | { |
| 2756 | if (!c) |
| 2757 | { |
| 2758 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2759 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2760 | } |
| 2761 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realminfocxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realminfo.; |
| 2762 | } |
| 2763 | |
| 2764 | |
| 2765 | extern int conn_set_realminfocxx . . $ pvpgn/bnetd/conn_set_realminfo(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * realminfo) |
| 2766 | { |
| 2767 | char const * temp; |
| 2768 | |
| 2769 | if (!c) |
| 2770 | { |
| 2771 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2772 | return -1; |
| 2773 | } |
| 2774 | |
| 2775 | if (realminfo) |
| 2776 | temp = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(realminfo); |
| 2777 | else |
| 2778 | temp = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2779 | |
| 2780 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realminfocxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realminfo.) /* if it was set before, free it now */ |
| 2781 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.d2.realminfo); /* avoid warning */ |
| 2782 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realminfocxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realminfo. = temp; |
| 2783 | return 0; |
| 2784 | } |
| 2785 | |
| 2786 | |
| 2787 | extern char const * conn_get_charnamecxx . . $ pvpgn/bnetd/conn_get_charname(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2788 | { |
| 2789 | if (!c) |
| 2790 | { |
| 2791 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2792 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2793 | } |
| 2794 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charnamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#charname.; |
| 2795 | } |
| 2796 | |
| 2797 | |
| 2798 | extern int conn_set_charnamecxx . . $ pvpgn/bnetd/conn_set_charname(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * charname) |
| 2799 | { |
| 2800 | char const * temp; |
| 2801 | |
| 2802 | if (!c) |
| 2803 | { |
| 2804 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2805 | return -1; |
| 2806 | } |
| 2807 | |
| 2808 | if (charname) |
| 2809 | temp = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(charname); |
| 2810 | else |
| 2811 | temp = charname; |
| 2812 | |
| 2813 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charnamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#charname.) /* free it, if it was previously set */ |
| 2814 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.d2.charname); /* avoid warning */ |
| 2815 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charnamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#charname. = temp; |
| 2816 | return 0; |
| 2817 | } |
| 2818 | |
| 2819 | |
| 2820 | extern int conn_set_idletimecxx . . $ pvpgn/bnetd/conn_set_idletime(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 2821 | { |
| 2822 | if (!c) |
| 2823 | { |
| 2824 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2825 | return -1; |
| 2826 | } |
| 2827 | |
| 2828 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..last_messagecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#last_message. = nowcxx . . $ pvpgn/bnetd/now.; |
| 2829 | return 0; |
| 2830 | } |
| 2831 | |
| 2832 | |
| 2833 | extern unsigned int conn_get_idletimecxx . . $ pvpgn/bnetd/conn_get_idletime(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2834 | { |
| 2835 | if (!c) |
| 2836 | { |
| 2837 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2838 | return 0; |
| 2839 | } |
| 2840 | |
| 2841 | return (unsigned int)stdcxx . . $ std/::difftimecxx . . $ std/difftime(f630275aa3e30a1e).(nowcxx . . $ pvpgn/bnetd/now., c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..last_messagecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#last_message.); |
| 2842 | } |
| 2843 | |
| 2844 | |
| 2845 | extern t_realmcxx . . $ pvpgn/bnetd/t_realm# * conn_get_realmcxx . . $ pvpgn/bnetd/conn_get_realm(c743a4e7d4d1463d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2846 | { |
| 2847 | if (!c) |
| 2848 | { |
| 2849 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2850 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2851 | } |
| 2852 | |
| 2853 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm.; |
| 2854 | } |
| 2855 | |
| 2856 | |
| 2857 | extern int conn_set_realmcxx . . $ pvpgn/bnetd/conn_set_realm(1e8eed0f1b1019dc).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_realmcxx . . $ pvpgn/bnetd/t_realm# * realm) |
| 2858 | { |
| 2859 | if (!c) |
| 2860 | { |
| 2861 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2862 | return -1; |
| 2863 | } |
| 2864 | |
| 2865 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm.) |
| 2866 | realm_putcxx . . $ pvpgn/bnetd/realm_put(b4ea8bd8f86a51c).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm., &c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realm_regrefcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm_regref.); |
| 2867 | |
| 2868 | if (!realm) |
| 2869 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2870 | else |
| 2871 | { |
| 2872 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm. = realm_getcxx . . $ pvpgn/bnetd/realm_get(220795a468a8851a).(realm, &c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realm_regrefcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm_regref.); |
| 2873 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_debugcxx . . $ pvpgn/eventlog_level_debug., __FUNCTION__, "[{}] set to \"{}\"", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), realm_get_namecxx . . $ pvpgn/bnetd/realm_get_name(83f045398bcf2fc5).(realm)); |
| 2874 | } |
| 2875 | |
| 2876 | return 0; |
| 2877 | } |
| 2878 | |
| 2879 | extern int conn_set_realm_cbcxx . . $ pvpgn/bnetd/conn_set_realm_cb(361d5d7064a2a85d).(void *data, void *newref) |
| 2880 | { |
| 2881 | t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c = (t_connectioncxx . . $ pvpgn/bnetd/t_connection#*)data; |
| 2882 | t_realmcxx . . $ pvpgn/bnetd/t_realm# *newrealm = (t_realmcxx . . $ pvpgn/bnetd/t_realm#*)newref; |
| 2883 | |
| 2884 | assertcxx . . $ `/usr/include/assert.h:102:11`!(c->protocol.d2.realm); /* this should never be NULL here */ |
| 2885 | |
| 2886 | /* we are removing a reference */ |
| 2887 | realm_putcxx . . $ pvpgn/bnetd/realm_put(b4ea8bd8f86a51c).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm., &c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realm_regrefcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm_regref.); |
| 2888 | |
| 2889 | if (newrealm) |
| 2890 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm. = realm_getcxx . . $ pvpgn/bnetd/realm_get(220795a468a8851a).(newrealm, &c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realm_regrefcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm_regref.); |
| 2891 | else { |
| 2892 | /* close the connection for players on unconfigured realms */ |
| 2893 | conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(c, conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.); |
| 2894 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2895 | } |
| 2896 | |
| 2897 | return 0; |
| 2898 | } |
| 2899 | |
| 2900 | |
| 2901 | extern int conn_set_charactercxx . . $ pvpgn/bnetd/conn_set_character(71b7a0fdde31bcde).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_character * character) |
| 2902 | { |
| 2903 | if (!c) |
| 2904 | { |
| 2905 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2906 | return -1; |
| 2907 | } |
| 2908 | if (!character) |
| 2909 | { |
| 2910 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL character"); |
| 2911 | return -1; |
| 2912 | } |
| 2913 | |
| 2914 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charactercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#character. = character; |
| 2915 | |
| 2916 | return 0; |
| 2917 | } |
| 2918 | |
| 2919 | |
| 2920 | extern void conn_set_countrycxx . . $ pvpgn/bnetd/conn_set_country(c8fb97a9af134824).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * country) |
| 2921 | { |
| 2922 | if (!c) |
| 2923 | { |
| 2924 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2925 | return; |
| 2926 | } |
| 2927 | if (!country) |
| 2928 | { |
| 2929 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL country"); |
| 2930 | return; |
| 2931 | } |
| 2932 | |
| 2933 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..countrycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#country.) |
| 2934 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.client.country); /* avoid warning */ |
| 2935 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..countrycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#country. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(country); |
| 2936 | } |
| 2937 | |
| 2938 | |
| 2939 | extern char const * conn_get_countrycxx . . $ pvpgn/bnetd/conn_get_country(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2940 | { |
| 2941 | if (!c) |
| 2942 | { |
| 2943 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2944 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2945 | } |
| 2946 | |
| 2947 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..countrycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#country.; |
| 2948 | } |
| 2949 | |
| 2950 | |
| 2951 | extern int conn_bindcxx . . $ pvpgn/bnetd/conn_bind(91f93fcc9edcb042).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c1, t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c2) |
| 2952 | { |
| 2953 | if (!c1) |
| 2954 | { |
| 2955 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2956 | return -1; |
| 2957 | } |
| 2958 | if (!c2) |
| 2959 | { |
| 2960 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2961 | return -1; |
| 2962 | } |
| 2963 | |
| 2964 | c1->protocolcxx . . $ pvpgn/bnetd/connection#protocol..boundcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#bound. = c2; |
| 2965 | c2->protocolcxx . . $ pvpgn/bnetd/connection#protocol..boundcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#bound. = c1; |
| 2966 | |
| 2967 | return 0; |
| 2968 | } |
| 2969 | |
| 2970 | |
| 2971 | extern int conn_set_irclinecxx . . $ pvpgn/bnetd/conn_set_ircline(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * line) |
| 2972 | { |
| 2973 | if (!c) { |
| 2974 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2975 | return -1; |
| 2976 | } |
| 2977 | if (!line) { |
| 2978 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL line"); |
| 2979 | return -1; |
| 2980 | } |
| 2981 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..irclinecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircline.) |
| 2982 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.irc.ircline); /* avoid warning */ |
| 2983 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..irclinecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircline. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(line); |
| 2984 | return 0; |
| 2985 | } |
| 2986 | |
| 2987 | |
| 2988 | extern char const * conn_get_irclinecxx . . $ pvpgn/bnetd/conn_get_ircline(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 2989 | { |
| 2990 | if (!c) { |
| 2991 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 2992 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2993 | } |
| 2994 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..irclinecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircline.; |
| 2995 | } |
| 2996 | |
| 2997 | |
| 2998 | extern int conn_set_ircpasscxx . . $ pvpgn/bnetd/conn_set_ircpass(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * pass) |
| 2999 | { |
| 3000 | if (!c) { |
| 3001 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3002 | return -1; |
| 3003 | } |
| 3004 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..ircpasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircpass.) |
| 3005 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.irc.ircpass); /* avoid warning */ |
| 3006 | if (!pass) |
| 3007 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..ircpasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircpass. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3008 | else |
| 3009 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..ircpasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircpass. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(pass); |
| 3010 | |
| 3011 | return 0; |
| 3012 | } |
| 3013 | |
| 3014 | |
| 3015 | extern char const * conn_get_ircpasscxx . . $ pvpgn/bnetd/conn_get_ircpass(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 3016 | { |
| 3017 | if (!c) { |
| 3018 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3019 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3020 | } |
| 3021 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..ircpasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircpass.; |
| 3022 | } |
| 3023 | |
| 3024 | |
| 3025 | extern int conn_set_ircpingcxx . . $ pvpgn/bnetd/conn_set_ircping(c14bb6458e7562a).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned int ping) |
| 3026 | { |
| 3027 | if (!c) { |
| 3028 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3029 | return -1; |
| 3030 | } |
| 3031 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..ircpingcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircping. = ping; |
| 3032 | return 0; |
| 3033 | } |
| 3034 | |
| 3035 | |
| 3036 | extern unsigned int conn_get_ircpingcxx . . $ pvpgn/bnetd/conn_get_ircping(8bd2285a65940781).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 3037 | { |
| 3038 | if (!c) { |
| 3039 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3040 | return 0; |
| 3041 | } |
| 3042 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..irccxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#irc..ircpingcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#$anonymous_type_8#ircping.; |
| 3043 | } |
| 3044 | |
| 3045 | // NonReal |
| 3046 | extern int conn_get_welcomedcxx . . $ pvpgn/bnetd/conn_get_welcomed(b5160de3e9803af4).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 3047 | { |
| 3048 | if (!c) |
| 3049 | { |
| 3050 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3051 | return 0; |
| 3052 | } |
| 3053 | |
| 3054 | return (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. & conn_flags_welcomedcxx . . $ pvpgn/bnetd/conn_flags_welcomed.); |
| 3055 | } |
| 3056 | |
| 3057 | // NonReal |
| 3058 | extern void conn_set_welcomedcxx . . $ pvpgn/bnetd/conn_set_welcomed(5b9d37d9dd0897d2).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, int welcomed) |
| 3059 | { |
| 3060 | |
| 3061 | if (!c) |
| 3062 | { |
| 3063 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3064 | return; |
| 3065 | } |
| 3066 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. |= conn_flags_welcomedcxx . . $ pvpgn/bnetd/conn_flags_welcomed.; |
| 3067 | } |
| 3068 | |
| 3069 | /* ADDED BY UNDYING SOULZZ 4/7/02 */ |
| 3070 | extern int conn_set_w3_playerinfocxx . . $ pvpgn/bnetd/conn_set_w3_playerinfo(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, const char * w3_playerinfo) |
| 3071 | { |
| 3072 | const char * temp; |
| 3073 | |
| 3074 | if (!c) |
| 3075 | { |
| 3076 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3077 | return -1; |
| 3078 | } |
| 3079 | |
| 3080 | temp = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(w3_playerinfo); |
| 3081 | |
| 3082 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..w3_playerinfocxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#w3_playerinfo.) |
| 3083 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.w3.w3_playerinfo); |
| 3084 | |
| 3085 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..w3_playerinfocxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#w3_playerinfo. = temp; |
| 3086 | |
| 3087 | return 1; |
| 3088 | } |
| 3089 | |
| 3090 | extern const char * conn_get_w3_playerinfocxx . . $ pvpgn/bnetd/conn_get_w3_playerinfo(5104e66f1dd67144).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3091 | { |
| 3092 | if (!c) |
| 3093 | { |
| 3094 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3095 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3096 | } |
| 3097 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..w3_playerinfocxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#w3_playerinfo.; |
| 3098 | } |
| 3099 | |
| 3100 | |
| 3101 | extern int conn_quota_exceededcxx . . $ pvpgn/bnetd/conn_quota_exceeded(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * con, char const * text) |
| 3102 | { |
| 3103 | t_qlinecxx . . $ pvpgn/bnetd/t_qline# * qline; |
| 3104 | t_elem * curr; |
| 3105 | |
| 3106 | if (!prefs_get_quotacxx . . $ pvpgn/bnetd/prefs_get_quota(db52760e79bf9054).() || |
| 3107 | !conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(con) |
| 3108 | // FIXME: (HarpyWar) do not allow flood for admins due to possible abuse with quick command sending that high load a server processor |
| 3109 | // If we really need to ignore flood protection, it can be allowed in Lua config for special users |
| 3110 | /* || (account_get_command_groups(conn_get_account(con)) & command_get_group("/admin-con"))*/ |
| 3111 | ) return 0; |
| 3112 | |
| 3113 | if (stdcxx . . $ std/::strlen(text) > prefs_get_quota_maxlinecxx . . $ pvpgn/bnetd/prefs_get_quota_maxline(db52760e79bf9054).()) |
| 3114 | { |
| 3115 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(con, message_type_error, con, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(con, "Your line length quota has been exceeded!")); |
| 3116 | return 1; |
| 3117 | } |
| 3118 | |
| 3119 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(con->protocol.chat.quota.list, curr) |
| 3120 | { |
| 3121 | qline = (t_qlinecxx . . $ pvpgn/bnetd/t_qline#*)elem_get_data(curr); |
| 3122 | if (nowcxx . . $ pvpgn/bnetd/now. >= qline->infcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_0#inf. + (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)prefs_get_quota_timecxx . . $ pvpgn/bnetd/prefs_get_quota_time(db52760e79bf9054).()) |
| 3123 | { |
| 3124 | /* these lines are at least quota_time old */ |
| 3125 | list_remove_elem(con->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..quotacxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#quota..listcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_1#list., &curr); |
| 3126 | if (qline->countcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_0#count. > con->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..quotacxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#quota..totcountcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_1#totcount.) |
| 3127 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "qline->count={} but con->protocol.chat.quota.totcount={}", qline->countcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_0#count., con->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..quotacxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#quota..totcountcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_1#totcount.); |
| 3128 | con->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..quotacxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#quota..totcountcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_1#totcount. -= qline->countcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_0#count.; |
| 3129 | xfreecxx . . $ `src/common/xalloc.h:51:9`!(qline); |
| 3130 | } |
| 3131 | else |
| 3132 | break; /* old items are first, so we know nothing else will match */ |
| 3133 | } |
| 3134 | |
| 3135 | qline = (t_qlinecxx . . $ pvpgn/bnetd/t_qline#*)xmalloccxx . . $ `src/common/xalloc.h:43:9`!(sizeof(t_qline)); |
| 3136 | qline->infcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_0#inf. = nowcxx . . $ pvpgn/bnetd/now.; /* set the moment */ |
| 3137 | if (stdcxx . . $ std/::strlen(text) > prefs_get_quota_wraplinecxx . . $ pvpgn/bnetd/prefs_get_quota_wrapline(db52760e79bf9054).()) /* round up on the divide */ |
| 3138 | qline->countcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_0#count. = (stdcxx . . $ std/::strlen(text) + prefs_get_quota_wraplinecxx . . $ pvpgn/bnetd/prefs_get_quota_wrapline(db52760e79bf9054).() - 1) / prefs_get_quota_wraplinecxx . . $ pvpgn/bnetd/prefs_get_quota_wrapline(db52760e79bf9054).(); |
| 3139 | else |
| 3140 | qline->countcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_0#count. = 1; |
| 3141 | |
| 3142 | list_append_data(con->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..quotacxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#quota..listcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_1#list., qline); |
| 3143 | |
| 3144 | con->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..quotacxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#quota..totcountcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_1#totcount. += qline->countcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_0#count.; |
| 3145 | |
| 3146 | if (con->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..quotacxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#quota..totcountcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_1#totcount. >= prefs_get_quota_linescxx . . $ pvpgn/bnetd/prefs_get_quota_lines(db52760e79bf9054).()) |
| 3147 | { |
| 3148 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(6288036871507e5c).(con, message_type_error, con, localizecxx . . $ `src/bnetd/i18n.h:73:11`!(con, "Your message quota has been exceeded!")); |
| 3149 | if (con->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..quotacxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#quota..totcountcxx . . $ pvpgn/bnetd/$anonymous_type_38cb70b370b44191_1#totcount. >= prefs_get_quota_dobaecxx . . $ pvpgn/bnetd/prefs_get_quota_dobae(db52760e79bf9054).()) |
| 3150 | { |
| 3151 | /* kick out the dobae user for violation of the quota rule */ |
| 3152 | conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(con, conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.); |
| 3153 | if (con->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel.) |
| 3154 | channel_message_logcxx . . $ pvpgn/bnetd/channel_message_log(3119144774c93d10).(con->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#channel., con, 0, "DISCONNECTED FOR DOBAE ABUSE"); |
| 3155 | return 2; |
| 3156 | } |
| 3157 | return 1; |
| 3158 | } |
| 3159 | |
| 3160 | return 0; |
| 3161 | } |
| 3162 | |
| 3163 | |
| 3164 | extern int conn_set_lastsendercxx . . $ pvpgn/bnetd/conn_set_lastsender(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * sender) |
| 3165 | { |
| 3166 | if (!c) |
| 3167 | { |
| 3168 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conection"); |
| 3169 | return -1; |
| 3170 | } |
| 3171 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..lastsendercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#lastsender.) |
| 3172 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.lastsender); /* avoid warning */ |
| 3173 | if (!sender) |
| 3174 | { |
| 3175 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..lastsendercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#lastsender. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3176 | return 0; |
| 3177 | } |
| 3178 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..lastsendercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#lastsender. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(sender); |
| 3179 | |
| 3180 | return 0; |
| 3181 | } |
| 3182 | |
| 3183 | |
| 3184 | extern char const * conn_get_lastsendercxx . . $ pvpgn/bnetd/conn_get_lastsender(c99dbccf638f5c6).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 3185 | { |
| 3186 | if (!c) |
| 3187 | { |
| 3188 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3189 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3190 | } |
| 3191 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..lastsendercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#lastsender.; |
| 3192 | } |
| 3193 | |
| 3194 | |
| 3195 | const VersionCheckcxx . . $ pvpgn/bnetd/VersionCheck# *conn_get_versioncheckcxx . . $ pvpgn/bnetd/conn_get_versioncheck(314c35d933cb7240).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c) |
| 3196 | { |
| 3197 | if (!c) |
| 3198 | { |
| 3199 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3200 | return nullptr; |
| 3201 | } |
| 3202 | |
| 3203 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..versioncheckcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#versioncheck.; |
| 3204 | } |
| 3205 | |
| 3206 | |
| 3207 | bool conn_set_versioncheckcxx . . $ pvpgn/bnetd/conn_set_versioncheck(2086118ca186da4).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c, const VersionCheckcxx . . $ pvpgn/bnetd/VersionCheck#* versioncheck) |
| 3208 | { |
| 3209 | if (!c) |
| 3210 | { |
| 3211 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3212 | return false; |
| 3213 | } |
| 3214 | |
| 3215 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..versioncheckcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#versioncheck. = versioncheck; |
| 3216 | |
| 3217 | return true; |
| 3218 | } |
| 3219 | |
| 3220 | extern int conn_get_echobackcxx . . $ pvpgn/bnetd/conn_get_echoback(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3221 | { |
| 3222 | if (!c) |
| 3223 | { |
| 3224 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3225 | return 0; |
| 3226 | } |
| 3227 | |
| 3228 | return (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. & conn_flags_echobackcxx . . $ pvpgn/bnetd/conn_flags_echoback.); |
| 3229 | } |
| 3230 | |
| 3231 | extern void conn_set_echobackcxx . . $ pvpgn/bnetd/conn_set_echoback(5b9d37d9dd0897d2).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, int echoback) |
| 3232 | { |
| 3233 | if (!c) |
| 3234 | { |
| 3235 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3236 | return; |
| 3237 | } |
| 3238 | if (echoback) |
| 3239 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. |= conn_flags_echobackcxx . . $ pvpgn/bnetd/conn_flags_echoback.; |
| 3240 | else |
| 3241 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. &= ~conn_flags_echobackcxx . . $ pvpgn/bnetd/conn_flags_echoback.; |
| 3242 | } |
| 3243 | |
| 3244 | extern int conn_set_udpokcxx . . $ pvpgn/bnetd/conn_set_udpok(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3245 | { |
| 3246 | if (!c) |
| 3247 | { |
| 3248 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3249 | return -1; |
| 3250 | } |
| 3251 | |
| 3252 | if (!(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. & conn_flags_udpokcxx . . $ pvpgn/bnetd/conn_flags_udpok.)) |
| 3253 | { |
| 3254 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. |= conn_flags_udpokcxx . . $ pvpgn/bnetd/conn_flags_udpok.; |
| 3255 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..flagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#flags. &= ~MF_PLUGcxx . . $ `src/common/bnet_protocol.h:2578:9`!; |
| 3256 | } |
| 3257 | |
| 3258 | return 0; |
| 3259 | } |
| 3260 | |
| 3261 | |
| 3262 | extern t_connectioncxx . . $ pvpgn/bnetd/t_connection# * conn_get_routeconncxx . . $ pvpgn/bnetd/conn_get_routeconn(30bd672f85ddc689).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c) |
| 3263 | { |
| 3264 | if (!c) |
| 3265 | { |
| 3266 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3267 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3268 | } |
| 3269 | |
| 3270 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..routeconncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#routeconn.; |
| 3271 | } |
| 3272 | |
| 3273 | |
| 3274 | extern int conn_set_routeconncxx . . $ pvpgn/bnetd/conn_set_routeconn(91f93fcc9edcb042).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_connectioncxx . . $ pvpgn/bnetd/t_connection# * rc) |
| 3275 | { |
| 3276 | if (!c) { |
| 3277 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conection"); |
| 3278 | return -1; |
| 3279 | } |
| 3280 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..routeconncxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#routeconn. = rc; |
| 3281 | |
| 3282 | return 0; |
| 3283 | } |
| 3284 | |
| 3285 | extern int conn_get_crtimecxx . . $ pvpgn/bnetd/conn_get_crtime(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c) |
| 3286 | { |
| 3287 | if (!c) |
| 3288 | { |
| 3289 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., "conn_get_crtime", "got NULL connection"); |
| 3290 | return -1; |
| 3291 | } |
| 3292 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cr_timecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cr_time.; |
| 3293 | } |
| 3294 | |
| 3295 | extern int conn_set_joingamewhisper_ackcxx . . $ pvpgn/bnetd/conn_set_joingamewhisper_ack(c14bb6458e7562a).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned int value) |
| 3296 | { |
| 3297 | if (!c) |
| 3298 | { |
| 3299 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3300 | return -1; |
| 3301 | } |
| 3302 | if (value) |
| 3303 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. |= conn_flags_joingamewhispercxx . . $ pvpgn/bnetd/conn_flags_joingamewhisper.; |
| 3304 | else |
| 3305 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. &= ~conn_flags_joingamewhispercxx . . $ pvpgn/bnetd/conn_flags_joingamewhisper.; |
| 3306 | return 0; |
| 3307 | } |
| 3308 | extern int conn_get_joingamewhisper_ackcxx . . $ pvpgn/bnetd/conn_get_joingamewhisper_ack(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3309 | { |
| 3310 | if (!c) |
| 3311 | { |
| 3312 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3313 | return -1; |
| 3314 | } |
| 3315 | return (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. & conn_flags_joingamewhispercxx . . $ pvpgn/bnetd/conn_flags_joingamewhisper.); |
| 3316 | } |
| 3317 | |
| 3318 | extern int conn_set_leavegamewhisper_ackcxx . . $ pvpgn/bnetd/conn_set_leavegamewhisper_ack(c14bb6458e7562a).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned int value) |
| 3319 | { |
| 3320 | if (!c) |
| 3321 | { |
| 3322 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3323 | return -1; |
| 3324 | } |
| 3325 | if (value) |
| 3326 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. |= conn_flags_leavegamewhispercxx . . $ pvpgn/bnetd/conn_flags_leavegamewhisper.; |
| 3327 | else |
| 3328 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. &= ~conn_flags_leavegamewhispercxx . . $ pvpgn/bnetd/conn_flags_leavegamewhisper.; |
| 3329 | return 0; |
| 3330 | } |
| 3331 | extern int conn_get_leavegamewhisper_ackcxx . . $ pvpgn/bnetd/conn_get_leavegamewhisper_ack(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3332 | { |
| 3333 | if (!c) |
| 3334 | { |
| 3335 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3336 | return -1; |
| 3337 | } |
| 3338 | return (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cflagscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cflags. & conn_flags_leavegamewhispercxx . . $ pvpgn/bnetd/conn_flags_leavegamewhisper.); |
| 3339 | } |
| 3340 | |
| 3341 | extern int conn_set_anongame_search_starttimecxx . . $ pvpgn/bnetd/conn_set_anongame_search_starttime(2bc578cf1171360f).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, stdcxx . . $ std/::time_tcxx . . $ std/time_t# t) |
| 3342 | { |
| 3343 | if (c == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 3344 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., "conn_set_anongame_search_starttime", "got NULL connection"); |
| 3345 | return -1; |
| 3346 | } |
| 3347 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..anongame_search_starttimecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#anongame_search_starttime. = t; |
| 3348 | return 0; |
| 3349 | } |
| 3350 | |
| 3351 | extern stdcxx . . $ std/::time_tcxx . . $ std/time_t# conn_get_anongame_search_starttimecxx . . $ pvpgn/bnetd/conn_get_anongame_search_starttime(c2cdf9dfb46ed026).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3352 | { |
| 3353 | if (c == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 3354 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., "conn_set_anongame_search_starttime", "got NULL connection"); |
| 3355 | return ((stdcxx . . $ std/::time_tcxx . . $ std/time_t#) 0); |
| 3356 | } |
| 3357 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..anongame_search_starttimecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#anongame_search_starttime.; |
| 3358 | } |
| 3359 | |
| 3360 | |
| 3361 | extern t_elistcxx . . $ pvpgn/t_elist# * conn_get_timercxx . . $ pvpgn/bnetd/conn_get_timer(cb0e979634baad06).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c) |
| 3362 | { |
| 3363 | if (!c) { |
| 3364 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3365 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3366 | } |
| 3367 | |
| 3368 | return &c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..timerscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#timers.; |
| 3369 | } |
| 3370 | |
| 3371 | |
| 3372 | extern int conn_add_fdwatchcxx . . $ pvpgn/bnetd/conn_add_fdwatch(c70e2a13caa7e91e).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c, fdwatch_handlercxx . . $ pvpgn/fdwatch_handler# handle) |
| 3373 | { |
| 3374 | assertcxx . . $ `/usr/include/assert.h:102:11`!(c); |
| 3375 | c->socketcxx . . $ pvpgn/bnetd/connection#socket..fdw_idxcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#fdw_idx. = fdwatch_add_fdcxx . . $ pvpgn/fdwatch_add_fd(559ef48a7724bde6).(c->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_sockcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_sock., fdwatch_type_readcxx . . $ pvpgn/fdwatch_type_read., handle, c); |
| 3376 | return c->socketcxx . . $ pvpgn/bnetd/connection#socket..fdw_idxcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#fdw_idx.; |
| 3377 | } |
| 3378 | |
| 3379 | |
| 3380 | extern void conn_close_readcxx . . $ pvpgn/bnetd/conn_close_read(428cd989165da3c5).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c) |
| 3381 | { |
| 3382 | assertcxx . . $ `/usr/include/assert.h:102:11`!(c); |
| 3383 | conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(c, conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.); |
| 3384 | |
| 3385 | /* only if we still got output packets remove the read availability |
| 3386 | * from fdwatch, we are NOT allowed to remove all availability or |
| 3387 | * remove it completely from fdwatch while handling read, also |
| 3388 | * if the connection has no output packets is ok to leave it |
| 3389 | * in read availability check cause it will be closed immediately |
| 3390 | * in connlist_reap() anyway |
| 3391 | */ |
| 3392 | if (conn_peek_outqueuecxx . . $ pvpgn/bnetd/conn_peek_outqueue(13d5bf83aec8b080).(c)) |
| 3393 | fdwatch_update_fdcxx . . $ pvpgn/fdwatch_update_fd(b223e862534b1804).(c->socketcxx . . $ pvpgn/bnetd/connection#socket..fdw_idxcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#fdw_idx., fdwatch_type_writecxx . . $ pvpgn/fdwatch_type_write.); |
| 3394 | } |
| 3395 | |
| 3396 | |
| 3397 | extern int conn_get_user_count_by_clienttagcxx . . $ pvpgn/bnetd/conn_get_user_count_by_clienttag(4c679297bf94b9eb).(t_clienttagcxx . . $ pvpgn/t_clienttag# ct) |
| 3398 | { |
| 3399 | t_connectioncxx . . $ pvpgn/bnetd/t_connection# * conn; |
| 3400 | t_elem const * curr; |
| 3401 | int clienttagusers = 0; |
| 3402 | |
| 3403 | /* Get Number of Users for client tag specific */ |
| 3404 | LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(connlist(), curr) |
| 3405 | { |
| 3406 | conn = (t_connectioncxx . . $ pvpgn/bnetd/t_connection#*)elem_get_data(curr); |
| 3407 | if ((ct == conn->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag.) |
| 3408 | && (conn->protocolcxx . . $ pvpgn/bnetd/connection#protocol..statecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#state. == conn_state_loggedincxx . . $ pvpgn/bnetd/conn_state_loggedin.)) clienttagusers++; |
| 3409 | } |
| 3410 | |
| 3411 | return clienttagusers; |
| 3412 | } |
| 3413 | |
| 3414 | extern int connlist_createcxx . . $ pvpgn/bnetd/connlist_create(b126dc7c1de90089).(void) |
| 3415 | { |
| 3416 | conn_headcxx . . $ pvpgn/bnetd/conn_head. = list_create(); |
| 3417 | connarray_createcxx . . $ pvpgn/bnetd/connarray_create(b126dc7c1de90089).(); |
| 3418 | return 0; |
| 3419 | } |
| 3420 | |
| 3421 | extern int connlist_destroycxx . . $ pvpgn/bnetd/connlist_destroy(b126dc7c1de90089).(void) |
| 3422 | { |
| 3423 | if (conn_deadcxx . . $ pvpgn/bnetd/conn_dead.) list_destroy(conn_deadcxx . . $ pvpgn/bnetd/conn_dead.); |
| 3424 | conn_deadcxx . . $ pvpgn/bnetd/conn_dead. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3425 | connarray_destroycxx . . $ pvpgn/bnetd/connarray_destroy(49f6e7a06ebc5aa8).(); |
| 3426 | /* FIXME: if called with active connection, connection are not freed */ |
| 3427 | if (list_destroy(conn_headcxx . . $ pvpgn/bnetd/conn_head.) < 0) |
| 3428 | return -1; |
| 3429 | conn_headcxx . . $ pvpgn/bnetd/conn_head. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3430 | return 0; |
| 3431 | } |
| 3432 | |
| 3433 | extern void connlist_reapcxx . . $ pvpgn/bnetd/connlist_reap(49f6e7a06ebc5aa8).(void) |
| 3434 | { |
| 3435 | t_elem *curr; |
| 3436 | t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c; |
| 3437 | |
| 3438 | if (!conn_deadcxx . . $ pvpgn/bnetd/conn_dead. || !conn_headcxx . . $ pvpgn/bnetd/conn_head.) return; |
| 3439 | |
| 3440 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(conn_dead, curr) |
| 3441 | { |
| 3442 | c = (t_connectioncxx . . $ pvpgn/bnetd/t_connection# *)elem_get_data(curr); |
| 3443 | |
| 3444 | if (!c) |
| 3445 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL entry in conn_dead list"); |
| 3446 | else if (!conn_peek_outqueuecxx . . $ pvpgn/bnetd/conn_peek_outqueue(13d5bf83aec8b080).(c)) { |
| 3447 | conn_destroycxx . . $ pvpgn/bnetd/conn_destroy(5ca99be69f7b035).(c, &curr, DESTROY_FROM_DEADLISTcxx . . $ `src/bnetd/connection.h:254:9`!); /* also removes from conn_dead list and fdwatch */ |
| 3448 | } |
| 3449 | } |
| 3450 | } |
| 3451 | |
| 3452 | extern t_list * connlistcxx . . $ pvpgn/bnetd/connlist(7a6cb11de248e2c9).(void) |
| 3453 | { |
| 3454 | return conn_headcxx . . $ pvpgn/bnetd/conn_head.; |
| 3455 | } |
| 3456 | |
| 3457 | |
| 3458 | extern t_connectioncxx . . $ pvpgn/bnetd/t_connection# * connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(char const * accountname) |
| 3459 | { |
| 3460 | t_accountcxx . . $ pvpgn/bnetd/t_account# * temp; |
| 3461 | |
| 3462 | if (!accountname) |
| 3463 | { |
| 3464 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL accountname"); |
| 3465 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3466 | } |
| 3467 | |
| 3468 | if (!(temp = accountlist_find_accountcxx . . $ pvpgn/bnetd/accountlist_find_account(db6f5ebdea1fa12b).(accountname))) |
| 3469 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3470 | |
| 3471 | return account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(temp); |
| 3472 | } |
| 3473 | |
| 3474 | extern t_connectioncxx . . $ pvpgn/bnetd/t_connection# * connlist_find_connection_by_accountcxx . . $ pvpgn/bnetd/connlist_find_connection_by_account(831fe2ed2f0bd703).(t_accountcxx . . $ pvpgn/bnetd/t_account# * account) |
| 3475 | { |
| 3476 | if (!account) { |
| 3477 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL account"); |
| 3478 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3479 | } |
| 3480 | return account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(account); |
| 3481 | } |
| 3482 | |
| 3483 | |
| 3484 | extern t_connectioncxx . . $ pvpgn/bnetd/t_connection# * connlist_find_connection_by_sessionkeycxx . . $ pvpgn/bnetd/connlist_find_connection_by_sessionkey(d9e2ca1f510d44cc).(unsigned int sessionkey) |
| 3485 | { |
| 3486 | t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c; |
| 3487 | t_elem const * curr; |
| 3488 | |
| 3489 | LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(conn_head, curr) |
| 3490 | { |
| 3491 | c = (t_connectioncxx . . $ pvpgn/bnetd/t_connection#*)elem_get_data(curr); |
| 3492 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..sessionkeycxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#sessionkey. == sessionkey) |
| 3493 | return c; |
| 3494 | } |
| 3495 | |
| 3496 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3497 | } |
| 3498 | |
| 3499 | |
| 3500 | extern t_connectioncxx . . $ pvpgn/bnetd/t_connection# * connlist_find_connection_by_sessionnumcxx . . $ pvpgn/bnetd/connlist_find_connection_by_sessionnum(d9e2ca1f510d44cc).(unsigned int sessionnum) |
| 3501 | { |
| 3502 | return connarray_get_conncxx . . $ pvpgn/bnetd/connarray_get_conn(d9e2ca1f510d44cc).(sessionnum); |
| 3503 | } |
| 3504 | |
| 3505 | |
| 3506 | extern t_connectioncxx . . $ pvpgn/bnetd/t_connection# * connlist_find_connection_by_socketcxx . . $ pvpgn/bnetd/connlist_find_connection_by_socket(f341f3d34aa180c2).(int socket) |
| 3507 | { |
| 3508 | t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c; |
| 3509 | t_elem const * curr; |
| 3510 | |
| 3511 | LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(conn_head, curr) |
| 3512 | { |
| 3513 | c = (t_connectioncxx . . $ pvpgn/bnetd/t_connection#*)elem_get_data(curr); |
| 3514 | if (c->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_sockcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_sock. == socket) |
| 3515 | return c; |
| 3516 | } |
| 3517 | |
| 3518 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3519 | } |
| 3520 | |
| 3521 | |
| 3522 | extern t_connectioncxx . . $ pvpgn/bnetd/t_connection# * connlist_find_connection_by_namecxx . . $ pvpgn/bnetd/connlist_find_connection_by_name(5be23fbfec631fd6).(char const * name, t_realmcxx . . $ pvpgn/bnetd/t_realm# * realm) |
| 3523 | { |
| 3524 | char charname[MAX_CHARNAME_LENcxx . . $ MAX_CHARNAME_LEN.]; |
| 3525 | char const * temp; |
| 3526 | |
| 3527 | if (!name) |
| 3528 | { |
| 3529 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL name"); |
| 3530 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3531 | } |
| 3532 | if (name[0] == '\0') |
| 3533 | { |
| 3534 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got empty name"); |
| 3535 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3536 | } |
| 3537 | |
| 3538 | /* format: *username */ |
| 3539 | if (name[0] == '*') |
| 3540 | { |
| 3541 | name++; |
| 3542 | return connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(name); |
| 3543 | } |
| 3544 | |
| 3545 | /* If is charname@otherrealm or ch@rname@realm */ |
| 3546 | if ((temp = stdcxx . . $ std/::strrchr(name, '@'))) /* search from the right */ |
| 3547 | { |
| 3548 | unsigned int n; |
| 3549 | |
| 3550 | n = temp - name; |
| 3551 | if (n >= MAX_CHARNAME_LENcxx . . $ MAX_CHARNAME_LEN.) |
| 3552 | { |
| 3553 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "character name too long in \"{}\" (charname@otherrealm format)", name); |
| 3554 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3555 | } |
| 3556 | stdcxx . . $ std/::strncpy(charname, name, n); |
| 3557 | charname[n] = '\0'; |
| 3558 | return connlist_find_connection_by_charnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_charname(5dfbbc8378eb231b).(name, temp + 1); |
| 3559 | } |
| 3560 | |
| 3561 | /* format: charname*username */ |
| 3562 | if ((temp = stdcxx . . $ std/::strchr(name, '*'))) |
| 3563 | { |
| 3564 | unsigned int n; |
| 3565 | |
| 3566 | n = temp - name; |
| 3567 | if (n >= MAX_CHARNAME_LENcxx . . $ MAX_CHARNAME_LEN.) |
| 3568 | { |
| 3569 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "character name too long in \"{}\" (charname*username format)", name); |
| 3570 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3571 | } |
| 3572 | name = temp + 1; |
| 3573 | return connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(name); |
| 3574 | } |
| 3575 | |
| 3576 | /* format: charname (realm must be not NULL) */ |
| 3577 | if (realm) |
| 3578 | return connlist_find_connection_by_charnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_charname(5dfbbc8378eb231b).(name, realm_get_namecxx . . $ pvpgn/bnetd/realm_get_name(83f045398bcf2fc5).(realm)); |
| 3579 | |
| 3580 | /* format: Simple username, clients with no realm, like starcraft or d2 open, |
| 3581 | * the format is the same of charname but is matched if realmname is NULL */ |
| 3582 | return connlist_find_connection_by_accountnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_accountname(2f6d5fbe0174f787).(name); |
| 3583 | } |
| 3584 | |
| 3585 | |
| 3586 | extern t_connectioncxx . . $ pvpgn/bnetd/t_connection# * connlist_find_connection_by_charnamecxx . . $ pvpgn/bnetd/connlist_find_connection_by_charname(5dfbbc8378eb231b).(char const * charname, char const * realmname) |
| 3587 | { |
| 3588 | t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c; |
| 3589 | t_elem const * curr; |
| 3590 | |
| 3591 | if (!realmname) { |
| 3592 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL realmname"); |
| 3593 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3594 | } |
| 3595 | LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(conn_head, curr) |
| 3596 | { |
| 3597 | c = (t_connectioncxx . . $ pvpgn/bnetd/t_connection#*)elem_get_data(curr); |
| 3598 | if (!c) |
| 3599 | continue; |
| 3600 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charnamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#charname.) |
| 3601 | continue; |
| 3602 | if (!c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm.) |
| 3603 | continue; |
| 3604 | if ((strcasecmp(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..charnamecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#charname., charname) == 0) && (strcasecmp(realm_get_namecxx . . $ pvpgn/bnetd/realm_get_name(83f045398bcf2fc5).(c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..d2cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#d2..realmcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_9#realm.), realmname) == 0)) |
| 3605 | return c; |
| 3606 | } |
| 3607 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3608 | } |
| 3609 | |
| 3610 | |
| 3611 | extern t_connectioncxx . . $ pvpgn/bnetd/t_connection# * connlist_find_connection_by_uidcxx . . $ pvpgn/bnetd/connlist_find_connection_by_uid(d9e2ca1f510d44cc).(unsigned int uid) |
| 3612 | { |
| 3613 | t_accountcxx . . $ pvpgn/bnetd/t_account# * temp; |
| 3614 | |
| 3615 | if (!(temp = accountlist_find_account_by_uidcxx . . $ pvpgn/bnetd/accountlist_find_account_by_uid(c4505e327c9ccd36).(uid))) |
| 3616 | { |
| 3617 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3618 | } |
| 3619 | return account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(temp); |
| 3620 | } |
| 3621 | |
| 3622 | extern int connlist_get_lengthcxx . . $ pvpgn/bnetd/connlist_get_length(b126dc7c1de90089).(void) |
| 3623 | { |
| 3624 | return list_get_length(conn_headcxx . . $ pvpgn/bnetd/conn_head.); |
| 3625 | } |
| 3626 | |
| 3627 | |
| 3628 | extern unsigned int connlist_login_get_lengthcxx . . $ pvpgn/bnetd/connlist_login_get_length(db52760e79bf9054).(void) |
| 3629 | { |
| 3630 | t_connectioncxx . . $ pvpgn/bnetd/t_connection# const * c; |
| 3631 | unsigned int count; |
| 3632 | t_elem const * curr; |
| 3633 | |
| 3634 | count = 0; |
| 3635 | LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(conn_head, curr) |
| 3636 | { |
| 3637 | c = (const t_connectioncxx . . $ pvpgn/bnetd/t_connection#*)elem_get_data(curr); |
| 3638 | if ((c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..statecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#state. == conn_state_loggedincxx . . $ pvpgn/bnetd/conn_state_loggedin.) && |
| 3639 | ((c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_bnetcxx . . $ pvpgn/bnetd/conn_class_bnet.) || (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_botcxx . . $ pvpgn/bnetd/conn_class_bot.) || (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_telnetcxx . . $ pvpgn/bnetd/conn_class_telnet.) |
| 3640 | || (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_irccxx . . $ pvpgn/bnetd/conn_class_irc.) || (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_wolcxx . . $ pvpgn/bnetd/conn_class_wol.))) |
| 3641 | count++; |
| 3642 | } |
| 3643 | |
| 3644 | return count; |
| 3645 | } |
| 3646 | |
| 3647 | |
| 3648 | extern int connlist_total_loginscxx . . $ pvpgn/bnetd/connlist_total_logins(b126dc7c1de90089).(void) |
| 3649 | { |
| 3650 | return totalcountcxx . . $ pvpgn/bnetd/totalcount.; |
| 3651 | } |
| 3652 | |
| 3653 | |
| 3654 | extern unsigned int connlist_count_connectionscxx . . $ pvpgn/bnetd/connlist_count_connections(2141b656ce2cc063).(unsigned int addr) |
| 3655 | { |
| 3656 | t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c; |
| 3657 | t_elem const * curr; |
| 3658 | unsigned int count; |
| 3659 | |
| 3660 | count = 0; |
| 3661 | |
| 3662 | LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(conn_head, curr) |
| 3663 | { |
| 3664 | c = (t_connectioncxx . . $ pvpgn/bnetd/t_connection# *)elem_get_data(curr); |
| 3665 | if (c->socketcxx . . $ pvpgn/bnetd/connection#socket..tcp_addrcxx . . $ pvpgn/bnetd/connection#$anonymous_type_3#tcp_addr. == addr) |
| 3666 | count++; |
| 3667 | } |
| 3668 | |
| 3669 | return count; |
| 3670 | } |
| 3671 | |
| 3672 | /* Warcraft 3 icon that displayed in a channel */ |
| 3673 | extern int conn_update_w3_playerinfocxx . . $ pvpgn/bnetd/conn_update_w3_playerinfo(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3674 | { |
| 3675 | t_accountcxx . . $ pvpgn/bnetd/t_account# * account; |
| 3676 | t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag; |
| 3677 | t_clancxx . . $ pvpgn/bnetd/t_clan# * user_clan; |
| 3678 | int clantag = 0; |
| 3679 | unsigned int acctlevel; |
| 3680 | char tempplayerinfo[40]; |
| 3681 | char raceicon; /* appeared in 1.03 */ |
| 3682 | unsigned int raceiconnumber; |
| 3683 | unsigned int wins; |
| 3684 | char clantag_str_tmp[5]; |
| 3685 | const char * clantag_str = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3686 | char revtag[5]; |
| 3687 | char clienttag_str[5]; |
| 3688 | |
| 3689 | if (c == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 3690 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 3691 | return -1; |
| 3692 | } |
| 3693 | |
| 3694 | account = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c); |
| 3695 | |
| 3696 | if (account == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 3697 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL account"); |
| 3698 | return -1; |
| 3699 | } |
| 3700 | |
| 3701 | clienttag = c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..clientcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#client..clienttagcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_5#clienttag.; |
| 3702 | |
| 3703 | if (!((clienttag == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:111:9`!) || |
| 3704 | (clienttag == CLIENTTAG_WAR3XP_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:113:9`!))){ |
| 3705 | return 0; |
| 3706 | } |
| 3707 | |
| 3708 | stdcxx . . $ std/::strncpy(revtag, tag_uint_to_str(clienttag_str, conn_get_fake_clienttagcxx . . $ pvpgn/bnetd/conn_get_fake_clienttag(8bd2285a65940781).(c)), 5); revtag[4] = '\0'; |
| 3709 | strreversecxx . . $ pvpgn/strreverse(7a9722d75b371431).(revtag); |
| 3710 | |
| 3711 | acctlevel = account_get_highestladderlevelcxx . . $ pvpgn/bnetd/account_get_highestladderlevel(43f7d0f5a7c4b307).(account, clienttag); |
| 3712 | account_get_raceiconcxx . . $ pvpgn/bnetd/account_get_raceicon(8a7aa5669e7c8318).(account, &raceicon, &raceiconnumber, &wins, clienttag); |
| 3713 | |
| 3714 | if ((user_clan = account_get_clancxx . . $ pvpgn/bnetd/account_get_clan(b1e25e267411fd2e).(account)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 3715 | clantag = clan_get_clantagcxx . . $ pvpgn/bnetd/clan_get_clantag(1e16ca1cec114489).(user_clan); |
| 3716 | |
| 3717 | if (clantag) { |
| 3718 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(clantag_str_tmp, "%c%c%c%c", clantag & 0xff, (clantag >> 8) & 0xff, (clantag >> 16) & 0xff, clantag >> 24); |
| 3719 | clantag_str = clantag_str_tmp; |
| 3720 | while ((*clantag_str) == 0) clantag_str++; |
| 3721 | } |
| 3722 | |
| 3723 | const char* usericon = account_get_user_iconcxx . . $ pvpgn/bnetd/account_get_user_icon(771ec84f6146e718).(account, clienttag); |
| 3724 | // allow set icon to a user directly from the database (override default icon always if not null) |
| 3725 | if (usericon) |
| 3726 | { |
| 3727 | if (clantag) |
| 3728 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(tempplayerinfo, "%s %s %u %s", revtag, usericon, acctlevel, clantag_str); |
| 3729 | else |
| 3730 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(tempplayerinfo, "%s %s %u", revtag, usericon, acctlevel); |
| 3731 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "[{}] {} using user-selected icon [{}]", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), revtag, usericon); |
| 3732 | } |
| 3733 | // default icon "WAR3" or "W3XP" |
| 3734 | else if (acctlevel == 0) |
| 3735 | { |
| 3736 | if (clantag) |
| 3737 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(tempplayerinfo, "%s %s 0 %s", revtag, revtag, clantag_str); |
| 3738 | else |
| 3739 | stdcxx . . $ std/::strcpy(tempplayerinfo, revtag); |
| 3740 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "[{}] {}", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), revtag); |
| 3741 | } |
| 3742 | // display race icon with a level number |
| 3743 | else |
| 3744 | { |
| 3745 | if (clantag) |
| 3746 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(tempplayerinfo, "%s %1u%c3W %u %s", revtag, raceiconnumber, raceicon, acctlevel, clantag_str); |
| 3747 | else |
| 3748 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(tempplayerinfo, "%s %1u%c3W %u", revtag, raceiconnumber, raceicon, acctlevel); |
| 3749 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "[{}] {} using generated icon [{}{}3W]", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), revtag, raceiconnumber, raceicon); |
| 3750 | } |
| 3751 | |
| 3752 | // if custom stats is enabled then set a custom client icon by player rating |
| 3753 | // do not override user selected icon if any |
| 3754 | if (!usericon && prefs_get_custom_iconscxx . . $ pvpgn/bnetd/prefs_get_custom_icons(b126dc7c1de90089).() == 1 && customicons_allowed_by_clientcxx . . $ pvpgn/bnetd/customicons_allowed_by_client(dfa6e707f7696010).(clienttag)) |
| 3755 | { |
| 3756 | if (t_icon_infocxx . . $ pvpgn/bnetd/t_icon_info#* icon = customicons_get_icon_by_accountcxx . . $ pvpgn/bnetd/customicons_get_icon_by_account(6aa4f522a41892c1).(account, clienttag)) |
| 3757 | { |
| 3758 | if (clantag) |
| 3759 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(tempplayerinfo, "%s %s %u %s", revtag, icon->icon_codecxx . . $ pvpgn/bnetd/$anonymous_type_e36c06d23f785114_0#icon_code., 0, clantag_str); |
| 3760 | else |
| 3761 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(tempplayerinfo, "%s %s %u", revtag, icon->icon_codecxx . . $ pvpgn/bnetd/$anonymous_type_e36c06d23f785114_0#icon_code., 0); |
| 3762 | } |
| 3763 | } |
| 3764 | |
| 3765 | #ifdef WITH_LUA |
| 3766 | // change icon info from Lua |
| 3767 | if (const char * iconinfo = lua_handle_user_icon(c, tempplayerinfo)) |
| 3768 | { |
| 3769 | conn_set_w3_playerinfo(c, iconinfo); |
| 3770 | return 0; |
| 3771 | } |
| 3772 | #endif |
| 3773 | conn_set_w3_playerinfocxx . . $ pvpgn/bnetd/conn_set_w3_playerinfo(2e9022cda97b266d).(c, tempplayerinfo); |
| 3774 | return 0; |
| 3775 | } |
| 3776 | |
| 3777 | |
| 3778 | extern int conn_get_passfail_countcxx . . $ pvpgn/bnetd/conn_get_passfail_count(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3779 | { |
| 3780 | if (!c) |
| 3781 | { |
| 3782 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., "conn_get_passfail_count", "got NULL connection"); |
| 3783 | return -1; |
| 3784 | } |
| 3785 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..passfail_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#passfail_count.; |
| 3786 | } |
| 3787 | |
| 3788 | |
| 3789 | extern int conn_set_passfail_countcxx . . $ pvpgn/bnetd/conn_set_passfail_count(c14bb6458e7562a).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned int n) |
| 3790 | { |
| 3791 | if (c == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 3792 | { |
| 3793 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., "conn_set_passfail_count", "got NULL connection"); |
| 3794 | return -1; |
| 3795 | } |
| 3796 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..passfail_countcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#passfail_count. = n; |
| 3797 | return 0; |
| 3798 | } |
| 3799 | |
| 3800 | |
| 3801 | extern int conn_increment_passfail_countcxx . . $ pvpgn/bnetd/conn_increment_passfail_count(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3802 | { |
| 3803 | unsigned int count; |
| 3804 | |
| 3805 | if (prefs_get_passfail_countcxx . . $ pvpgn/bnetd/prefs_get_passfail_count(db52760e79bf9054).() > 0) |
| 3806 | { |
| 3807 | count = conn_get_passfail_countcxx . . $ pvpgn/bnetd/conn_get_passfail_count(c4dfbc2386fe4fc3).(c) + 1; |
| 3808 | if (count == prefs_get_passfail_countcxx . . $ pvpgn/bnetd/prefs_get_passfail_count(db52760e79bf9054).()) |
| 3809 | { |
| 3810 | ipbanlist_addcxx . . $ pvpgn/bnetd/ipbanlist_add(648564aa43f2d1f5).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, addr_num_to_ip_strcxx . . $ pvpgn/addr_num_to_ip_str(81a3ae90da26a711).(conn_get_addrcxx . . $ pvpgn/bnetd/conn_get_addr(8bd2285a65940781).(c)), nowcxx . . $ pvpgn/bnetd/now. + (stdcxx . . $ std/::time_tcxx . . $ std/time_t#)prefs_get_passfail_bantimecxx . . $ pvpgn/bnetd/prefs_get_passfail_bantime(db52760e79bf9054).()); |
| 3811 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info., __FUNCTION__, "[{}] failed password tries: {} (banned ip)", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), count); |
| 3812 | conn_set_statecxx . . $ pvpgn/bnetd/conn_set_state(7b556497952c81aa).(c, conn_state_destroycxx . . $ pvpgn/bnetd/conn_state_destroy.); |
| 3813 | return -1; |
| 3814 | } |
| 3815 | else conn_set_passfail_countcxx . . $ pvpgn/bnetd/conn_set_passfail_count(c14bb6458e7562a).(c, count); |
| 3816 | } |
| 3817 | return 0; |
| 3818 | } |
| 3819 | |
| 3820 | |
| 3821 | extern char const * conn_get_client_proofcxx . . $ pvpgn/bnetd/conn_get_client_proof(5104e66f1dd67144).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3822 | { |
| 3823 | if (!c) |
| 3824 | { |
| 3825 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 3826 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3827 | } |
| 3828 | |
| 3829 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..client_proofcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#client_proof.; |
| 3830 | } |
| 3831 | |
| 3832 | extern int conn_set_client_proofcxx . . $ pvpgn/bnetd/conn_set_client_proof(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * client_proof) |
| 3833 | { |
| 3834 | if (!c) |
| 3835 | { |
| 3836 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 3837 | return -1; |
| 3838 | } |
| 3839 | |
| 3840 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..client_proofcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#client_proof.){ |
| 3841 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void*)c->protocol.w3.client_proof); |
| 3842 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..client_proofcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#client_proof. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3843 | } |
| 3844 | |
| 3845 | if (client_proof != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 3846 | char * proof = (char *)xmalloccxx . . $ `src/common/xalloc.h:43:9`!(20); |
| 3847 | stdcxx . . $ std/::memcpy(proof, client_proof, 20); |
| 3848 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..client_proofcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#client_proof. = proof; |
| 3849 | } |
| 3850 | return 0; |
| 3851 | } |
| 3852 | |
| 3853 | |
| 3854 | extern char const * conn_get_server_proofcxx . . $ pvpgn/bnetd/conn_get_server_proof(5104e66f1dd67144).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3855 | { |
| 3856 | if (!c) |
| 3857 | { |
| 3858 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 3859 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3860 | } |
| 3861 | |
| 3862 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..server_proofcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#server_proof.; |
| 3863 | } |
| 3864 | |
| 3865 | extern int conn_set_server_proofcxx . . $ pvpgn/bnetd/conn_set_server_proof(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * server_proof) |
| 3866 | { |
| 3867 | if (!c) |
| 3868 | { |
| 3869 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 3870 | return -1; |
| 3871 | } |
| 3872 | |
| 3873 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..server_proofcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#server_proof.){ |
| 3874 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void*)c->protocol.w3.server_proof); |
| 3875 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..server_proofcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#server_proof. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3876 | } |
| 3877 | |
| 3878 | if (server_proof != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 3879 | char * proof = (char *)xmalloccxx . . $ `src/common/xalloc.h:43:9`!(20); |
| 3880 | stdcxx . . $ std/::memcpy(proof, server_proof, 20); |
| 3881 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..w3cxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#w3..server_proofcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_10#server_proof. = proof; |
| 3882 | } |
| 3883 | return 0; |
| 3884 | } |
| 3885 | |
| 3886 | |
| 3887 | extern int conn_set_tmpOP_channelcxx . . $ pvpgn/bnetd/conn_set_tmpOP_channel(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * tmpOP_channel) |
| 3888 | { |
| 3889 | if (!c) |
| 3890 | { |
| 3891 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 3892 | return -1; |
| 3893 | } |
| 3894 | |
| 3895 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..tmpOP_channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#tmpOP_channel.) |
| 3896 | { |
| 3897 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.tmpOP_channel); |
| 3898 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..tmpOP_channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#tmpOP_channel. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3899 | } |
| 3900 | |
| 3901 | if (tmpOP_channel) |
| 3902 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..tmpOP_channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#tmpOP_channel. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(tmpOP_channel); |
| 3903 | |
| 3904 | return 0; |
| 3905 | } |
| 3906 | |
| 3907 | extern char const * conn_get_tmpOP_channelcxx . . $ pvpgn/bnetd/conn_get_tmpOP_channel(5104e66f1dd67144).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3908 | { |
| 3909 | if (!c) |
| 3910 | { |
| 3911 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 3912 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3913 | } |
| 3914 | |
| 3915 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..tmpOP_channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#tmpOP_channel.; |
| 3916 | } |
| 3917 | |
| 3918 | extern int conn_set_tmpVOICE_channelcxx . . $ pvpgn/bnetd/conn_set_tmpVOICE_channel(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * tmpVOICE_channel) |
| 3919 | { |
| 3920 | if (!c) |
| 3921 | { |
| 3922 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 3923 | return -1; |
| 3924 | } |
| 3925 | |
| 3926 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..tmpVOICE_channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#tmpVOICE_channel.) |
| 3927 | { |
| 3928 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.chat.tmpVOICE_channel); |
| 3929 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..tmpVOICE_channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#tmpVOICE_channel. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3930 | } |
| 3931 | |
| 3932 | if (tmpVOICE_channel) |
| 3933 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..tmpVOICE_channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#tmpVOICE_channel. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(tmpVOICE_channel); |
| 3934 | |
| 3935 | return 0; |
| 3936 | } |
| 3937 | |
| 3938 | extern char const * conn_get_tmpVOICE_channelcxx . . $ pvpgn/bnetd/conn_get_tmpVOICE_channel(5104e66f1dd67144).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 3939 | { |
| 3940 | if (!c) |
| 3941 | { |
| 3942 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 3943 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3944 | } |
| 3945 | |
| 3946 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..chatcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#chat..tmpVOICE_channelcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_7#tmpVOICE_channel.; |
| 3947 | } |
| 3948 | |
| 3949 | static int connarray_createcxx . . $ pvpgn/bnetd/connarray_create(b126dc7c1de90089).(void) |
| 3950 | { |
| 3951 | unsigned i; |
| 3952 | t_conn_entrycxx . . $ pvpgn/bnetd/t_conn_entry# *curr; |
| 3953 | |
| 3954 | if (connarraycxx . . $ pvpgn/bnetd/connarray.) connarray_destroycxx . . $ pvpgn/bnetd/connarray_destroy(49f6e7a06ebc5aa8).(); |
| 3955 | connarraycxx . . $ pvpgn/bnetd/connarray. = (t_conn_entrycxx . . $ pvpgn/bnetd/t_conn_entry#*)xmalloccxx . . $ `src/common/xalloc.h:43:9`!(sizeof(t_conn_entry)* fdw_maxcons); |
| 3956 | |
| 3957 | elist_initcxx . . $ `src/common/elist.h:193:9`!(&arrayflist); |
| 3958 | /* put all elements as free */ |
| 3959 | for (i = 0, curr = connarraycxx . . $ pvpgn/bnetd/connarray.; i < fdw_maxconscxx . . $ pvpgn/fdw_maxcons.; i++, curr++) { |
| 3960 | elist_add_tailcxx . . $ pvpgn/elist_add_tail(3e860e19053b2cfa).(&arrayflistcxx . . $ pvpgn/bnetd/arrayflist., &curr->freelistcxx . . $ pvpgn/bnetd/$anonymous_type_7688b6786bdcb7f2_0#freelist.); |
| 3961 | curr->ccxx . . $ pvpgn/bnetd/$anonymous_type_7688b6786bdcb7f2_0#c. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3962 | } |
| 3963 | |
| 3964 | return 0; |
| 3965 | } |
| 3966 | |
| 3967 | |
| 3968 | static void connarray_destroycxx . . $ pvpgn/bnetd/connarray_destroy(49f6e7a06ebc5aa8).(void) |
| 3969 | { |
| 3970 | if (connarraycxx . . $ pvpgn/bnetd/connarray.) xfreecxx . . $ `src/common/xalloc.h:51:9`!((void*)connarray); |
| 3971 | connarraycxx . . $ pvpgn/bnetd/connarray. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3972 | } |
| 3973 | |
| 3974 | static t_connectioncxx . . $ pvpgn/bnetd/t_connection# *connarray_get_conncxx . . $ pvpgn/bnetd/connarray_get_conn(d9e2ca1f510d44cc).(unsigned index) |
| 3975 | { |
| 3976 | if (index >= fdw_maxconscxx . . $ pvpgn/fdw_maxcons.) return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 3977 | return connarraycxx . . $ pvpgn/bnetd/connarray.[index].ccxx . . $ pvpgn/bnetd/$anonymous_type_7688b6786bdcb7f2_0#c.; |
| 3978 | } |
| 3979 | |
| 3980 | static unsigned connarray_add_conncxx . . $ pvpgn/bnetd/connarray_add_conn(c9be5e844f0af884).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# *c) |
| 3981 | { |
| 3982 | t_conn_entrycxx . . $ pvpgn/bnetd/t_conn_entry# *curr; |
| 3983 | |
| 3984 | assertcxx . . $ `/usr/include/assert.h:102:11`!(c); |
| 3985 | assertcxx . . $ `/usr/include/assert.h:102:11`!(!elist_emptycxx . . $ `src/common/elist.h:246:9`!(&arrayflist)); |
| 3986 | |
| 3987 | curr = elist_entrycxx . . $ `src/common/elist.h:228:9`!(elist_nextcxx . . $ `src/common/elist.h:189:9`!(&arrayflist), t_conn_entry, freelist); |
| 3988 | assertcxx . . $ `/usr/include/assert.h:102:11`!(curr->c == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); /* it should never be free and != NULL */ |
| 3989 | curr->ccxx . . $ pvpgn/bnetd/$anonymous_type_7688b6786bdcb7f2_0#c. = c; |
| 3990 | elist_delcxx . . $ pvpgn/elist_del(c14d3311d3358512).(&curr->freelistcxx . . $ pvpgn/bnetd/$anonymous_type_7688b6786bdcb7f2_0#freelist.); |
| 3991 | return (curr - connarraycxx . . $ pvpgn/bnetd/connarray.); /* return the array index */ |
| 3992 | } |
| 3993 | |
| 3994 | static void connarray_del_conncxx . . $ pvpgn/bnetd/connarray_del_conn(cb2f890c2fdad230).(unsigned index) |
| 3995 | { |
| 3996 | t_conn_entrycxx . . $ pvpgn/bnetd/t_conn_entry# *curr; |
| 3997 | |
| 3998 | if (index >= fdw_maxconscxx . . $ pvpgn/fdw_maxcons.) return; |
| 3999 | curr = connarraycxx . . $ pvpgn/bnetd/connarray. + index; |
| 4000 | curr->ccxx . . $ pvpgn/bnetd/$anonymous_type_7688b6786bdcb7f2_0#c. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 4001 | elist_add_tailcxx . . $ pvpgn/elist_add_tail(3e860e19053b2cfa).(&arrayflistcxx . . $ pvpgn/bnetd/arrayflist., &curr->freelistcxx . . $ pvpgn/bnetd/$anonymous_type_7688b6786bdcb7f2_0#freelist.); |
| 4002 | } |
| 4003 | |
| 4004 | extern int conn_is_irc_variantcxx . . $ pvpgn/bnetd/conn_is_irc_variant(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 4005 | { |
| 4006 | if (!c) |
| 4007 | { |
| 4008 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "get NULL conn"); |
| 4009 | return -1; |
| 4010 | } |
| 4011 | |
| 4012 | if ((c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_irccxx . . $ pvpgn/bnetd/conn_class_irc.) || |
| 4013 | (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_wolcxx . . $ pvpgn/bnetd/conn_class_wol.) || |
| 4014 | (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_wservcxx . . $ pvpgn/bnetd/conn_class_wserv.) || |
| 4015 | (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_wladdercxx . . $ pvpgn/bnetd/conn_class_wladder.) |
| 4016 | ) |
| 4017 | return 1; |
| 4018 | |
| 4019 | return 0; |
| 4020 | } |
| 4021 | |
| 4022 | /** |
| 4023 | * Westwood Online Extensions |
| 4024 | */ |
| 4025 | extern int conn_get_wolcxx . . $ pvpgn/bnetd/conn_get_wol(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 4026 | { |
| 4027 | if (!c) |
| 4028 | { |
| 4029 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "get NULL conn"); |
| 4030 | return -1; |
| 4031 | } |
| 4032 | |
| 4033 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..cclasscxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#cclass. == conn_class_wolcxx . . $ pvpgn/bnetd/conn_class_wol.) |
| 4034 | return 1; |
| 4035 | |
| 4036 | return 0; |
| 4037 | } |
| 4038 | |
| 4039 | extern void conn_wol_set_apgarcxx . . $ pvpgn/bnetd/conn_wol_set_apgar(c8fb97a9af134824).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, char const * apgar) |
| 4040 | { |
| 4041 | if (!c) |
| 4042 | { |
| 4043 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 4044 | return; |
| 4045 | } |
| 4046 | if (!apgar) |
| 4047 | { |
| 4048 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL WOL apgar"); |
| 4049 | return; |
| 4050 | } |
| 4051 | |
| 4052 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..apgarcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#apgar.) |
| 4053 | xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)c->protocol.wol.apgar); /* avoid warning */ |
| 4054 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..apgarcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#apgar. = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(apgar); |
| 4055 | } |
| 4056 | |
| 4057 | extern char const * conn_wol_get_apgarcxx . . $ pvpgn/bnetd/conn_wol_get_apgar(5104e66f1dd67144).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 4058 | { |
| 4059 | if (!c) |
| 4060 | { |
| 4061 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 4062 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 4063 | } |
| 4064 | |
| 4065 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..apgarcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#apgar.; |
| 4066 | } |
| 4067 | |
| 4068 | extern void conn_wol_set_codepagecxx . . $ pvpgn/bnetd/conn_wol_set_codepage(5b9d37d9dd0897d2).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, int codepage) |
| 4069 | { |
| 4070 | if (!c) |
| 4071 | { |
| 4072 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 4073 | return; |
| 4074 | } |
| 4075 | |
| 4076 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..codepagecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#codepage. = codepage; |
| 4077 | } |
| 4078 | |
| 4079 | extern int conn_wol_get_codepagecxx . . $ pvpgn/bnetd/conn_wol_get_codepage(c4dfbc2386fe4fc3).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 4080 | { |
| 4081 | if (!c) |
| 4082 | { |
| 4083 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 4084 | return -1; |
| 4085 | } |
| 4086 | |
| 4087 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..codepagecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#codepage.; |
| 4088 | } |
| 4089 | |
| 4090 | extern void conn_wol_set_findmecxx . . $ pvpgn/bnetd/conn_wol_set_findme(6a76ece71ede8144).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, bool findme) |
| 4091 | { |
| 4092 | if (!c) |
| 4093 | { |
| 4094 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 4095 | return; |
| 4096 | } |
| 4097 | |
| 4098 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..findmecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#findme. = findme; |
| 4099 | } |
| 4100 | |
| 4101 | extern bool conn_wol_get_findmecxx . . $ pvpgn/bnetd/conn_wol_get_findme(5a60a6624233dc9b).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 4102 | { |
| 4103 | if (!c) |
| 4104 | { |
| 4105 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 4106 | return false; |
| 4107 | } |
| 4108 | |
| 4109 | bool bRet; |
| 4110 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..findmecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#findme. == 0) |
| 4111 | bRet = false; |
| 4112 | else |
| 4113 | bRet = true; |
| 4114 | |
| 4115 | return bRet; |
| 4116 | } |
| 4117 | |
| 4118 | extern void conn_wol_set_pagemecxx . . $ pvpgn/bnetd/conn_wol_set_pageme(6a76ece71ede8144).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, bool pageme) |
| 4119 | { |
| 4120 | if (!c) |
| 4121 | { |
| 4122 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 4123 | return; |
| 4124 | } |
| 4125 | |
| 4126 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..pagemecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#pageme. = pageme; |
| 4127 | } |
| 4128 | |
| 4129 | extern bool conn_wol_get_pagemecxx . . $ pvpgn/bnetd/conn_wol_get_pageme(5a60a6624233dc9b).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 4130 | { |
| 4131 | if (!c) |
| 4132 | { |
| 4133 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 4134 | return false; |
| 4135 | } |
| 4136 | |
| 4137 | bool bRet; |
| 4138 | if (c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..pagemecxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#pageme. == 0) |
| 4139 | bRet = false; |
| 4140 | else |
| 4141 | bRet = true; |
| 4142 | |
| 4143 | return bRet; |
| 4144 | } |
| 4145 | |
| 4146 | extern void conn_wol_set_anongame_playercxx . . $ pvpgn/bnetd/conn_wol_set_anongame_player(2bb94d995f9d33).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, t_anongame_wol_playercxx . . $ pvpgn/bnetd/t_anongame_wol_player# * anongame_player) |
| 4147 | { |
| 4148 | if (!c) |
| 4149 | { |
| 4150 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 4151 | return; |
| 4152 | } |
| 4153 | |
| 4154 | if (!anongame_player) |
| 4155 | { |
| 4156 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL anongame_player"); |
| 4157 | return; |
| 4158 | } |
| 4159 | |
| 4160 | c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..anongame_playercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#anongame_player. = anongame_player; |
| 4161 | } |
| 4162 | |
| 4163 | extern t_anongame_wol_playercxx . . $ pvpgn/bnetd/t_anongame_wol_player# * conn_wol_get_anongame_playercxx . . $ pvpgn/bnetd/conn_wol_get_anongame_player(52b288ba16d756a0).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c) |
| 4164 | { |
| 4165 | if (!c) |
| 4166 | { |
| 4167 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 4168 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 4169 | } |
| 4170 | |
| 4171 | return c->protocolcxx . . $ pvpgn/bnetd/connection#protocol..wolcxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#wol..anongame_playercxx . . $ pvpgn/bnetd/connection#$anonymous_type_4#$anonymous_type_11#anongame_player.; |
| 4172 | } |
| 4173 | |
| 4174 | |
| 4175 | |
| 4176 | extern int conn_client_readmemorycxx . . $ pvpgn/bnetd/conn_client_readmemory(8c66d77427566fb0).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, unsigned int request_id, unsigned int offset, unsigned int length) |
| 4177 | { |
| 4178 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 4179 | t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag; |
| 4180 | |
| 4181 | if (!c) |
| 4182 | { |
| 4183 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 4184 | return -1; |
| 4185 | } |
| 4186 | clienttag = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c); |
| 4187 | |
| 4188 | // disallow clients that doesn't support SID_READMEMORY |
| 4189 | if (clienttag != CLIENTTAG_STARCRAFT_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:87:9`! && clienttag != CLIENTTAG_BROODWARS_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:89:9`! && clienttag != CLIENTTAG_STARJAPAN_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:101:9`! && clienttag != CLIENTTAG_SHAREWARE_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:91:9`! && |
| 4190 | clienttag != CLIENTTAG_DIABLORTL_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:93:9`! && clienttag != CLIENTTAG_DIABLOSHR_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:95:9`! && clienttag != CLIENTTAG_WARCIIBNE_UINTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/tag.h:97:9`!) |
| 4191 | { |
| 4192 | return -1; |
| 4193 | } |
| 4194 | if (!(rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 4195 | return -1; |
| 4196 | |
| 4197 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_readmemorycxx . . $ pvpgn/t_server_readmemory#)); |
| 4198 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_READMEMORYcxx . . $ `src/common/bnet_protocol.h:3285:9`!); |
| 4199 | |
| 4200 | bn_int_setcxx . . $ pvpgn/bn_int_set(e97e500db3ec3c79).(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_readmemorycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_readmemory..request_idcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_123#request_id., request_id); |
| 4201 | bn_int_setcxx . . $ pvpgn/bn_int_set(e97e500db3ec3c79).(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_readmemorycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_readmemory..addresscxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_123#address., offset); |
| 4202 | bn_int_setcxx . . $ pvpgn/bn_int_set(e97e500db3ec3c79).(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_readmemorycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_readmemory..lengthcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_123#length., length); |
| 4203 | |
| 4204 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket); |
| 4205 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 4206 | |
| 4207 | return 0; |
| 4208 | } |
| 4209 | |
| 4210 | extern int conn_client_requiredworkcxx . . $ pvpgn/bnetd/conn_client_requiredwork(2e9022cda97b266d).(t_connectioncxx . . $ pvpgn/bnetd/t_connection# * c, const char * filename) |
| 4211 | { |
| 4212 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 4213 | |
| 4214 | if (!c) |
| 4215 | { |
| 4216 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 4217 | return -1; |
| 4218 | } |
| 4219 | if (!(rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 4220 | return -1; |
| 4221 | |
| 4222 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_requiredworkcxx . . $ pvpgn/t_server_requiredwork#)); |
| 4223 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_REQUIREDWORKcxx . . $ `src/common/bnet_protocol.h:4082:9`!); |
| 4224 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, filename); // filename should be "IX86ExtraWork.mpq" |
| 4225 | |
| 4226 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket); |
| 4227 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 4228 | |
| 4229 | return 0; |
| 4230 | } |
| 4231 | } |
| 4232 | |
| 4233 | } |