| 1 | /* |
| 2 | * This program is free software; you can redistribute it and/or |
| 3 | * modify it under the terms of the GNU General Public License |
| 4 | * as published by the Free Software Foundation; either version 2 |
| 5 | * of the License, or (at your option) any later version. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | * You should have received a copy of the GNU General Public License |
| 13 | * along with this program; if not, write to the Free Software |
| 14 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 15 | */ |
| 16 | #define CLAN_INTERNAL_ACCESScxx . . $ `src/bnetd/clan.cpp:16:9`! |
| 17 | #include "common/setup_before.h"cxx . . $ `<file>/src/common/setup_before.h`/ |
| 18 | #include "clan.h"cxx . . $ `<file>/src/bnetd/clan.h`/ |
| 19 | |
| 20 | #include <cstdint> |
| 21 | |
| 22 | #include "compat/strcasecmp.h"cxx . . $ `<file>/src/compat/strcasecmp.h`/ |
| 23 | #include "compat/strncasecmp.h"cxx . . $ `<file>/src/compat/strncasecmp.h`/ |
| 24 | #include "compat/pdir.h"cxx . . $ `<file>/src/compat/pdir.h`/ |
| 25 | |
| 26 | #ifdef HAVE_SYS_TYPES_Hcxx . . $ `build/config.h:16:9`! |
| 27 | # include <sys/types.h> |
| 28 | #endif |
| 29 | |
| 30 | #include "common/packet.h"cxx . . $ `<file>/src/common/packet.h`/ |
| 31 | #include "common/bnet_protocol.h"cxx . . $ `<file>/src/common/bnet_protocol.h`/ |
| 32 | #include "common/util.h"cxx . . $ `<file>/src/common/util.h`/ |
| 33 | #include "common/bnettime.h"cxx . . $ `<file>/src/common/bnettime.h`/ |
| 34 | #include "common/eventlog.h"cxx . . $ `<file>/src/common/eventlog.h`/ |
| 35 | #include "common/list.h"cxx . . $ `<file>/src/common/list.h`/ |
| 36 | #include "common/proginfo.h"cxx . . $ `<file>/src/common/proginfo.h`/ |
| 37 | #include "common/bn_type.h"cxx . . $ `<file>/src/common/bn_type.h`/ |
| 38 | #include "common/xalloc.h"cxx . . $ `<file>/src/common/xalloc.h`/ |
| 39 | |
| 40 | #include "connection.h"cxx . . $ `<file>/src/bnetd/connection.h`/ |
| 41 | #include "anongame.h"cxx . . $ `<file>/src/bnetd/anongame.h`/ |
| 42 | #include "prefs.h"cxx . . $ `<file>/src/bnetd/prefs.h`/ |
| 43 | #include "friends.h"cxx . . $ `<file>/src/bnetd/friends.h`/ |
| 44 | #include "game.h"cxx . . $ `<file>/src/bnetd/game.h`/ |
| 45 | #include "message.h"cxx . . $ `<file>/src/bnetd/message.h`/ |
| 46 | #include "account.h"cxx . . $ `<file>/src/bnetd/account.h`/ |
| 47 | #include "channel.h"cxx . . $ `<file>/src/bnetd/channel.h`/ |
| 48 | #include "anongame.h"cxx . . $ `<file>/src/bnetd/anongame.h`/ |
| 49 | #include "storage.h"cxx . . $ `<file>/src/bnetd/storage.h`/ |
| 50 | #include "server.h"cxx . . $ `<file>/src/bnetd/server.h`/ |
| 51 | |
| 52 | #include "common/setup_after.h"cxx . . $ `<file>/src/common/setup_after.h`/ |
| 53 | |
| 54 | namespace pvpgncxx . . $ pvpgn/ |
| 55 | { |
| 56 | |
| 57 | namespace bnetdcxx . . $ pvpgn/bnetd/ |
| 58 | { |
| 59 | |
| 60 | static t_list *clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 61 | unsigned max_clanidcxx . . $ pvpgn/bnetd/max_clanid. = 0; |
| 62 | |
| 63 | /* callback function for storage use */ |
| 64 | |
| 65 | static int _cb_load_clanscxx . . $ pvpgn/bnetd/_cb_load_clans(dedf1e9b1c614a07).(void *clan) |
| 66 | { |
| 67 | if (clanlist_add_clancxx . . $ pvpgn/bnetd/clanlist_add_clan(6091e08b3a5a3db6).((t_clancxx . . $ pvpgn/bnetd/t_clan#*)clan) < 0) |
| 68 | { |
| 69 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "failed to add clan to clanlist"); |
| 70 | return -1; |
| 71 | } |
| 72 | |
| 73 | if (((t_clancxx . . $ pvpgn/bnetd/t_clan# *)clan)->clanidcxx . . $ pvpgn/bnetd/clan#clanid. > max_clanidcxx . . $ pvpgn/bnetd/max_clanid.) |
| 74 | max_clanidcxx . . $ pvpgn/bnetd/max_clanid. = ((t_clancxx . . $ pvpgn/bnetd/t_clan# *)clan)->clanidcxx . . $ pvpgn/bnetd/clan#clanid.; |
| 75 | return 0; |
| 76 | } |
| 77 | |
| 78 | /* |
| 79 | ** Message functions |
| 80 | */ |
| 81 | |
| 82 | extern int clan_send_message_to_online_memberscxx . . $ pvpgn/bnetd/clan_send_message_to_online_members(5b3f105ee82e5d9c).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan, t_message_type type, t_connection * me, char const * text) |
| 83 | { |
| 84 | /* PELISH: Send message to online clan_members |
| 85 | returns: an error == -1, done but no one heard == 0, done with message sended == 1 */ |
| 86 | t_list * cl_member_list; |
| 87 | t_elem * curr; |
| 88 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * dest_member; |
| 89 | t_connection * dest_conn; |
| 90 | bool heard = false; |
| 91 | |
| 92 | if (!clan) { |
| 93 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 94 | return -1; |
| 95 | } |
| 96 | |
| 97 | if (!me) { |
| 98 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connecion"); |
| 99 | return -1; |
| 100 | } |
| 101 | |
| 102 | cl_member_list = clan_get_memberscxx . . $ pvpgn/bnetd/clan_get_members(26783f42c3b86af0).(clan); |
| 103 | |
| 104 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(cl_member_list, curr) { |
| 105 | if (!(dest_member = (t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember#*)elem_get_data(curr))) { |
| 106 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL entry in list"); |
| 107 | continue; |
| 108 | } |
| 109 | |
| 110 | if ((dest_conn = clanmember_get_conncxx . . $ pvpgn/bnetd/clanmember_get_conn(6d9762d7066c7746).(dest_member)) && (dest_conn != me) && |
| 111 | (clanmember_get_fullmembercxx . . $ pvpgn/bnetd/clanmember_get_fullmember(d12aaa857ef4d493).(dest_member) == 1)) { |
| 112 | message_send_textcxx . . $ pvpgn/bnetd/message_send_text(61daf7e3ba1862c4).(dest_conn, type, me, text); |
| 113 | heard = true; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | if (heard) |
| 118 | return 1; |
| 119 | else |
| 120 | return 0; |
| 121 | } |
| 122 | |
| 123 | /* |
| 124 | ** Packet Management |
| 125 | */ |
| 126 | |
| 127 | extern int clan_send_packet_to_online_memberscxx . . $ pvpgn/bnetd/clan_send_packet_to_online_members(3930e223f0c15736).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan, t_packetcxx . . $ pvpgn/t_packet# * packet) |
| 128 | { |
| 129 | t_elem *curr; |
| 130 | |
| 131 | if (!clan) |
| 132 | { |
| 133 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 134 | return -1; |
| 135 | } |
| 136 | |
| 137 | if (!packet) |
| 138 | { |
| 139 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL packet"); |
| 140 | return -1; |
| 141 | } |
| 142 | |
| 143 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clan->members, curr) |
| 144 | { |
| 145 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member; |
| 146 | t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag; |
| 147 | t_connection * conn; |
| 148 | |
| 149 | if (!(member = (t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember#*)elem_get_data(curr))) |
| 150 | { |
| 151 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL elem in list"); |
| 152 | continue; |
| 153 | } |
| 154 | if (!(conn = clanmember_get_conncxx . . $ pvpgn/bnetd/clanmember_get_conn(6d9762d7066c7746).(member))) |
| 155 | continue; // not online |
| 156 | |
| 157 | if (!(clienttag = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(conn))) |
| 158 | { |
| 159 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "conn has NULL clienttag"); |
| 160 | continue; |
| 161 | } |
| 162 | |
| 163 | if ((clienttag != CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!) && (clienttag != CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!)) |
| 164 | continue; // online but wrong client |
| 165 | |
| 166 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(conn, packet); |
| 167 | } |
| 168 | |
| 169 | return 0; |
| 170 | } |
| 171 | |
| 172 | extern int clan_send_status_window_on_createcxx . . $ pvpgn/bnetd/clan_send_status_window_on_create(6091e08b3a5a3db6).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 173 | { |
| 174 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 175 | t_elem *curr; |
| 176 | |
| 177 | if (!(clan)) |
| 178 | { |
| 179 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 180 | return -1; |
| 181 | } |
| 182 | |
| 183 | if ((rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 184 | { |
| 185 | char channelname[10]; |
| 186 | if (clan->tagcxx . . $ pvpgn/bnetd/clan#tag.) |
| 187 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(channelname, "Clan %s", clantag_to_strcxx . . $ pvpgn/bnetd/clantag_to_str(81a3ae90da26a711).(clan->tagcxx . . $ pvpgn/bnetd/clan#tag.)); |
| 188 | else |
| 189 | { |
| 190 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(channelname, "Clans"); |
| 191 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "clan has NULL clantag"); |
| 192 | } |
| 193 | |
| 194 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_clan_clanackcxx . . $ pvpgn/t_server_clan_clanack#)); |
| 195 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_CLAN_CLANACKcxx . . $ `src/common/bnet_protocol.h:3867:9`!); |
| 196 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_clanackcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_clanack..unknow1cxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_160#unknow1., 0); |
| 197 | bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_clanackcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_clanack..clantagcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_160#clantag., clan->tagcxx . . $ pvpgn/bnetd/clan#tag.); |
| 198 | |
| 199 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clan->members, curr) |
| 200 | { |
| 201 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member; |
| 202 | t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag; |
| 203 | t_connection * conn; |
| 204 | |
| 205 | if (!(member = (t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember#*)elem_get_data(curr))) |
| 206 | { |
| 207 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL elem in list"); |
| 208 | continue; |
| 209 | } |
| 210 | if (!(conn = clanmember_get_conncxx . . $ pvpgn/bnetd/clanmember_get_conn(6d9762d7066c7746).(member))) |
| 211 | continue; // not online; |
| 212 | |
| 213 | if (!(clienttag = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(conn))) |
| 214 | { |
| 215 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "conn has NULL clienttag"); |
| 216 | continue; |
| 217 | } |
| 218 | if ((clienttag != CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!) && (clienttag != CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!)) |
| 219 | continue; // online but wrong client |
| 220 | |
| 221 | if (conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(conn)) |
| 222 | { |
| 223 | conn_update_w3_playerinfocxx . . $ pvpgn/bnetd/conn_update_w3_playerinfo(c4dfbc2386fe4fc3).(conn); |
| 224 | channel_set_userflagscxx . . $ pvpgn/bnetd/channel_set_userflags(c4dfbc2386fe4fc3).(conn); |
| 225 | if (conn_set_channelcxx . . $ pvpgn/bnetd/conn_set_channel(2e9022cda97b266d).(conn, channelname) < 0) |
| 226 | conn_set_channelcxx . . $ pvpgn/bnetd/conn_set_channel(2e9022cda97b266d).(conn, CHANNEL_NAME_BANNEDcxx . . $ `src/bnetd/channel.h:125:9`!); /* should not fail */ |
| 227 | } |
| 228 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_clanackcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_clanack..statuscxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_160#status., member->statuscxx . . $ pvpgn/bnetd/_clanmember#status.); |
| 229 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(conn, rpacket); |
| 230 | } |
| 231 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 232 | } |
| 233 | return 0; |
| 234 | } |
| 235 | |
| 236 | extern int clan_close_status_window_on_disbandcxx . . $ pvpgn/bnetd/clan_close_status_window_on_disband(6091e08b3a5a3db6).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 237 | { |
| 238 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 239 | t_elem *curr; |
| 240 | |
| 241 | if (!(clan)) |
| 242 | { |
| 243 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 244 | return -1; |
| 245 | } |
| 246 | |
| 247 | if ((rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 248 | { |
| 249 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_clanquitnotifycxx . . $ pvpgn/t_server_clanquitnotify#)); |
| 250 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_CLANQUITNOTIFYcxx . . $ `src/common/bnet_protocol.h:3875:9`!); |
| 251 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_clanackcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_clanack..statuscxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_160#status., SERVER_CLANQUITNOTIFY_STATUS_REMOVED_FROM_CLANcxx . . $ `src/common/bnet_protocol.h:3880:9`!); |
| 252 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clan->members, curr) |
| 253 | { |
| 254 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member; |
| 255 | t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag; |
| 256 | t_connection * conn; |
| 257 | |
| 258 | if (!(member = (t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember#*)elem_get_data(curr))) |
| 259 | { |
| 260 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL elem in list"); |
| 261 | continue; |
| 262 | } |
| 263 | if (!(conn = clanmember_get_conncxx . . $ pvpgn/bnetd/clanmember_get_conn(6d9762d7066c7746).(member))) |
| 264 | continue; // not online; |
| 265 | |
| 266 | if (!(clienttag = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(conn))) |
| 267 | { |
| 268 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "conn has NULL clienttag"); |
| 269 | continue; |
| 270 | } |
| 271 | |
| 272 | if ((clienttag != CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!) && (clienttag != CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!)) |
| 273 | continue; // online but wrong client |
| 274 | |
| 275 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(conn, rpacket); |
| 276 | conn_update_w3_playerinfocxx . . $ pvpgn/bnetd/conn_update_w3_playerinfo(c4dfbc2386fe4fc3).(conn); |
| 277 | } |
| 278 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 279 | } |
| 280 | |
| 281 | |
| 282 | return 0; |
| 283 | } |
| 284 | |
| 285 | extern int clan_send_status_windowcxx . . $ pvpgn/bnetd/clan_send_status_window(c4dfbc2386fe4fc3).(t_connection * c) |
| 286 | { |
| 287 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 288 | t_accountcxx . . $ pvpgn/bnetd/t_account# *acc; |
| 289 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *member; |
| 290 | t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag; |
| 291 | t_clancxx . . $ pvpgn/bnetd/t_clan# * clan; |
| 292 | |
| 293 | if (!(acc = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c))) |
| 294 | return 0; |
| 295 | |
| 296 | if (!(member = account_get_clanmembercxx . . $ pvpgn/bnetd/account_get_clanmember(4ce48d4e65930331).(acc))) |
| 297 | return 0; |
| 298 | |
| 299 | if (!(clan = member->clancxx . . $ pvpgn/bnetd/_clanmember#clan.)) |
| 300 | { |
| 301 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "member has NULL clan"); |
| 302 | return -1; |
| 303 | } |
| 304 | |
| 305 | if (!(clan->tagcxx . . $ pvpgn/bnetd/clan#tag.)) |
| 306 | { |
| 307 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "clan has NULL clantag"); |
| 308 | return -1; |
| 309 | } |
| 310 | |
| 311 | if (!(clienttag = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c))) |
| 312 | { |
| 313 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "conn has NULL clienttag"); |
| 314 | return -1; |
| 315 | } |
| 316 | |
| 317 | if ((clienttag != CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!) && (clienttag != CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!)) |
| 318 | return 0; |
| 319 | |
| 320 | if ((rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 321 | { |
| 322 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_clan_clanackcxx . . $ pvpgn/t_server_clan_clanack#)); |
| 323 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_CLAN_CLANACKcxx . . $ `src/common/bnet_protocol.h:3867:9`!); |
| 324 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_clanackcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_clanack..unknow1cxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_160#unknow1., 0); |
| 325 | bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_clanackcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_clanack..clantagcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_160#clantag., member->clancxx . . $ pvpgn/bnetd/_clanmember#clan.->tagcxx . . $ pvpgn/bnetd/clan#tag.); |
| 326 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_clanackcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_clanack..statuscxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_160#status., member->statuscxx . . $ pvpgn/bnetd/_clanmember#status.); |
| 327 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket); |
| 328 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 329 | } |
| 330 | return 0; |
| 331 | } |
| 332 | |
| 333 | extern int clan_close_status_windowcxx . . $ pvpgn/bnetd/clan_close_status_window(c4dfbc2386fe4fc3).(t_connection * c) |
| 334 | { |
| 335 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 336 | t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag; |
| 337 | |
| 338 | if (!(clienttag = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(c))) |
| 339 | { |
| 340 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "conn has NULL clienttag"); |
| 341 | return -1; |
| 342 | } |
| 343 | |
| 344 | if ((clienttag != CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!) && (clienttag != CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!)) |
| 345 | return 0; |
| 346 | |
| 347 | if ((rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 348 | { |
| 349 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_clanquitnotifycxx . . $ pvpgn/t_server_clanquitnotify#)); |
| 350 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_CLANQUITNOTIFYcxx . . $ `src/common/bnet_protocol.h:3875:9`!); |
| 351 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clanquitnotifycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clanquitnotify..statuscxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_161#status., SERVER_CLANQUITNOTIFY_STATUS_REMOVED_FROM_CLANcxx . . $ `src/common/bnet_protocol.h:3880:9`!); |
| 352 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket); |
| 353 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 354 | } |
| 355 | return 0; |
| 356 | } |
| 357 | |
| 358 | extern int clan_send_memberlistcxx . . $ pvpgn/bnetd/clan_send_memberlist(8d07eb83d60bed1d).(t_connection * c, t_packetcxx . . $ pvpgn/t_packet# const *const packet) |
| 359 | { |
| 360 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 361 | t_elem *curr; |
| 362 | char const *username; |
| 363 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *member; |
| 364 | t_clancxx . . $ pvpgn/bnetd/t_clan# *clan; |
| 365 | t_accountcxx . . $ pvpgn/bnetd/t_account# *account; |
| 366 | int count = 0; |
| 367 | char tmpstr[2]; |
| 368 | const char *append_str; |
| 369 | |
| 370 | if (!(account = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c))) |
| 371 | return -1; |
| 372 | |
| 373 | if (!(clan = account_get_clancxx . . $ pvpgn/bnetd/account_get_clan(b1e25e267411fd2e).(account))) |
| 374 | return -1; |
| 375 | |
| 376 | if ((rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 377 | { |
| 378 | t_accountcxx . . $ pvpgn/bnetd/t_account# * memberacc; |
| 379 | |
| 380 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_clanmemberlist_replycxx . . $ pvpgn/t_server_clanmemberlist_reply#)); |
| 381 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_CLANMEMBERLIST_REPLYcxx . . $ `src/common/bnet_protocol.h:4024:9`!); |
| 382 | bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clanmemberlist_replycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clanmemberlist_reply..countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_173#count., |
| 383 | bn_int_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_clanmemberlist_reqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_clanmemberlist_req..countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_174#count.)); |
| 384 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clan->members, curr) |
| 385 | { |
| 386 | if (!(member = (t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember#*)elem_get_data(curr))) |
| 387 | { |
| 388 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL element in list"); |
| 389 | continue; |
| 390 | } |
| 391 | |
| 392 | if (!(memberacc = (t_accountcxx . . $ pvpgn/bnetd/t_account#*)member->memberacccxx . . $ pvpgn/bnetd/_clanmember#memberacc.)) |
| 393 | { |
| 394 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "member has NULL account"); |
| 395 | continue; |
| 396 | } |
| 397 | |
| 398 | username = account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(memberacc); |
| 399 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, username); |
| 400 | tmpstr[0] = member->statuscxx . . $ pvpgn/bnetd/_clanmember#status.; |
| 401 | append_str = clanmember_get_online_statuscxx . . $ pvpgn/bnetd/clanmember_get_online_status(87b0b518d0f7733d).(member, &tmpstr[1]); |
| 402 | packet_append_datacxx . . $ pvpgn/packet_append_data(d82347a7305550af).(rpacket, tmpstr, 2); |
| 403 | if (append_str) |
| 404 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, append_str); |
| 405 | else |
| 406 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, ""); |
| 407 | count++; |
| 408 | } |
| 409 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clanmemberlist_replycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clanmemberlist_reply..member_countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_173#member_count., count); |
| 410 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket); |
| 411 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 412 | return 0; |
| 413 | } |
| 414 | |
| 415 | return -1; |
| 416 | } |
| 417 | |
| 418 | extern int clan_save_motd_chgcxx . . $ pvpgn/bnetd/clan_save_motd_chg(8d07eb83d60bed1d).(t_connection * c, t_packetcxx . . $ pvpgn/t_packet# const *const packet) |
| 419 | { |
| 420 | t_accountcxx . . $ pvpgn/bnetd/t_account# *account; |
| 421 | char const *motd; |
| 422 | int offset; |
| 423 | t_clancxx . . $ pvpgn/bnetd/t_clan# *clan; |
| 424 | |
| 425 | if ((account = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 426 | return -1; |
| 427 | if ((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`!) |
| 428 | return -1; |
| 429 | offset = sizeof(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_clan_motdchgcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_clan_motdchg.); |
| 430 | motd = packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet, offset, CLAN_MOTD_MAXcxx . . $ CLAN_MOTD_MAX.); |
| 431 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_tracecxx . . $ pvpgn/eventlog_level_trace., __FUNCTION__, "[{}] got W3XP_CLAN_MOTDCHG packet : {}", conn_get_socketcxx . . $ pvpgn/bnetd/conn_get_socket(b5160de3e9803af4).(c), motd); |
| 432 | if (clan_set_motdcxx . . $ pvpgn/bnetd/clan_set_motd(aba9c10be9ace918).(clan, motd) != 0) |
| 433 | { |
| 434 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "Failed to set clan motd."); |
| 435 | return -1; |
| 436 | } |
| 437 | clan->modifiedcxx . . $ pvpgn/bnetd/clan#modified. = 1; |
| 438 | return 0; |
| 439 | } |
| 440 | |
| 441 | |
| 442 | extern int clan_send_motd_replycxx . . $ pvpgn/bnetd/clan_send_motd_reply(8d07eb83d60bed1d).(t_connection * c, t_packetcxx . . $ pvpgn/t_packet# const *const packet) |
| 443 | { |
| 444 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 445 | t_accountcxx . . $ pvpgn/bnetd/t_account# *account; |
| 446 | t_clancxx . . $ pvpgn/bnetd/t_clan# *clan; |
| 447 | |
| 448 | if ((account = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 449 | return -1; |
| 450 | if ((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`!) |
| 451 | return -1; |
| 452 | if (clan->clan_motdcxx . . $ pvpgn/bnetd/clan#clan_motd. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 453 | { |
| 454 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "Failed to get clan motd."); |
| 455 | return -1; |
| 456 | } |
| 457 | if ((rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.))) |
| 458 | { |
| 459 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_clan_motdreplycxx . . $ pvpgn/t_server_clan_motdreply#)); |
| 460 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_CLAN_MOTDREPLYcxx . . $ `src/common/bnet_protocol.h:3990:9`!); |
| 461 | bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_motdreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_motdreply..countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_171#count., bn_int_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_clan_motdreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_clan_motdreq..countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_172#count.)); |
| 462 | bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_motdreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_motdreply..unknow1cxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_171#unknow1., SERVER_CLAN_MOTDREPLY_UNKNOW1cxx . . $ `src/common/bnet_protocol.h:3988:9`!); |
| 463 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, clan->clan_motdcxx . . $ pvpgn/bnetd/clan#clan_motd.); |
| 464 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket); |
| 465 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 466 | } |
| 467 | |
| 468 | return 0; |
| 469 | } |
| 470 | |
| 471 | /* |
| 472 | ** String / Function Management |
| 473 | */ |
| 474 | |
| 475 | extern int clan_get_possible_membercxx . . $ pvpgn/bnetd/clan_get_possible_member(8d07eb83d60bed1d).(t_connection * c, t_packetcxx . . $ pvpgn/t_packet# const *const packet) |
| 476 | { |
| 477 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 478 | t_channelcxx . . $ pvpgn/bnetd/t_channel# *channel; |
| 479 | t_connection *conn; |
| 480 | char const *username; |
| 481 | t_accountcxx . . $ pvpgn/bnetd/t_account# * account; |
| 482 | |
| 483 | int friend_count = 0; |
| 484 | t_clantagcxx . . $ pvpgn/bnetd/t_clantag# clantag; |
| 485 | clantag = bn_int_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_clan_createreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_clan_createreq..clantagcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_150#clantag.); |
| 486 | if ((rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 487 | { |
| 488 | return -1; |
| 489 | } |
| 490 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_clan_createreplycxx . . $ pvpgn/t_server_clan_createreply#)); |
| 491 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_CLAN_CREATEREPLYcxx . . $ `src/common/bnet_protocol.h:3763:9`!); |
| 492 | bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_createreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_createreply..countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_151#count., bn_int_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_clan_createreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_clan_createreq..countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_150#count.)); |
| 493 | if (clanlist_find_clan_by_clantagcxx . . $ pvpgn/bnetd/clanlist_find_clan_by_clantag(8e7bfb2a07f0508e).(clantag) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 494 | { |
| 495 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_createreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_createreply..check_resultcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_151#check_result., SERVER_CLAN_CREATEREPLY_CHECK_ALLREADY_IN_USEcxx . . $ `src/common/bnet_protocol.h:3773:9`!); |
| 496 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_createreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_createreply..friend_countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_151#friend_count., 0); |
| 497 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket); |
| 498 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 499 | return 0; |
| 500 | } |
| 501 | if ((account = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) && (account_get_clancxx . . $ pvpgn/bnetd/account_get_clan(b1e25e267411fd2e).(account) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! || account_get_creating_clancxx . . $ pvpgn/bnetd/account_get_creating_clan(b1e25e267411fd2e).(account) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)) |
| 502 | { |
| 503 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_createreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_createreply..check_resultcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_151#check_result., SERVER_CLAN_CREATEREPLY_CHECK_EXCEPTIONcxx . . $ `src/common/bnet_protocol.h:3775:9`!); |
| 504 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_createreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_createreply..friend_countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_151#friend_count., 0); |
| 505 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket); |
| 506 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 507 | return 0; |
| 508 | } |
| 509 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_createreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_createreply..check_resultcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_151#check_result., SERVER_CLAN_CREATEREPLY_CHECK_OKcxx . . $ `src/common/bnet_protocol.h:3772:9`!); |
| 510 | channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(c); |
| 511 | if (channel_get_permanentcxx . . $ pvpgn/bnetd/channel_get_permanent(28c764f7c20ec9b2).(channel)) |
| 512 | { |
| 513 | /* If not in a private channel, retreive number of mutual friend connected */ |
| 514 | t_list *flist = account_get_friendscxx . . $ pvpgn/bnetd/account_get_friends(27f2e57ffe21264).(conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)); |
| 515 | t_elem const *curr; |
| 516 | t_friendcxx . . $ pvpgn/bnetd/t_friend# *fr; |
| 517 | |
| 518 | LIST_TRAVERSE_CONSTcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:95:9`!(flist, curr) |
| 519 | { |
| 520 | if ((fr = (t_friendcxx . . $ pvpgn/bnetd/t_friend#*)elem_get_data(curr)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 521 | { |
| 522 | t_accountcxx . . $ pvpgn/bnetd/t_account# *fr_acc = friend_get_accountcxx . . $ pvpgn/bnetd/friend_get_account(9d018d83140d552c).(fr); |
| 523 | t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag; |
| 524 | if (fr->mutualcxx . . $ pvpgn/bnetd/friend_struct#mutual. |
| 525 | && ((conn = connlist_find_connection_by_accountcxx . . $ pvpgn/bnetd/connlist_find_connection_by_account(831fe2ed2f0bd703).(fr_acc)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 526 | && (conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(conn) == channel) |
| 527 | && (!account_get_clancxx . . $ pvpgn/bnetd/account_get_clan(b1e25e267411fd2e).(fr_acc)) |
| 528 | && (!account_get_creating_clancxx . . $ pvpgn/bnetd/account_get_creating_clan(b1e25e267411fd2e).(fr_acc)) |
| 529 | && (clienttag = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(conn)) |
| 530 | && ((clienttag == CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!) || (clienttag == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!)) |
| 531 | && (username = account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(fr_acc))) |
| 532 | { |
| 533 | friend_count++; |
| 534 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, username); |
| 535 | } |
| 536 | } |
| 537 | } |
| 538 | } |
| 539 | else |
| 540 | { |
| 541 | /* If in a private channel, retreive all non-clan war3/w3xp users in the channel */ |
| 542 | for (conn = channel_get_firstcxx . . $ pvpgn/bnetd/channel_get_first(77c4a1edc1ac6ba1).(channel); conn; conn = channel_get_nextcxx . . $ pvpgn/bnetd/channel_get_next(181375335219f0cb).()) |
| 543 | { |
| 544 | t_accountcxx . . $ pvpgn/bnetd/t_account# * acc; |
| 545 | t_clienttagcxx . . $ pvpgn/t_clienttag# clienttag; |
| 546 | if ((conn != c) |
| 547 | && (acc = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(conn)) |
| 548 | && (!account_get_clancxx . . $ pvpgn/bnetd/account_get_clan(b1e25e267411fd2e).(acc)) |
| 549 | && (!account_get_creating_clancxx . . $ pvpgn/bnetd/account_get_creating_clan(b1e25e267411fd2e).(acc)) |
| 550 | && (clienttag = conn_get_clienttagcxx . . $ pvpgn/bnetd/conn_get_clienttag(8bd2285a65940781).(conn)) |
| 551 | && ((clienttag == CLIENTTAG_WAR3XP_UINTcxx . . $ `src/common/tag.h:113:9`!) || (clienttag == CLIENTTAG_WARCRAFT3_UINTcxx . . $ `src/common/tag.h:111:9`!)) |
| 552 | && (username = conn_get_usernamecxx . . $ `src/bnetd/connection.h:361:9`!(conn))) |
| 553 | { |
| 554 | friend_count++; |
| 555 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, username); |
| 556 | } |
| 557 | } |
| 558 | } |
| 559 | bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..server_clan_createreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#server_clan_createreply..friend_countcxx . . $ pvpgn/$anonymous_type_37d0d0c67ba6cc0e_151#friend_count., friend_count); |
| 560 | conn_push_outqueuecxx . . $ pvpgn/bnetd/conn_push_outqueue(212cf84cd7032d49).(c, rpacket); |
| 561 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 562 | |
| 563 | return 0; |
| 564 | } |
| 565 | |
| 566 | extern int clanmember_on_change_statuscxx . . $ pvpgn/bnetd/clanmember_on_change_status(d12aaa857ef4d493).(t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member) |
| 567 | { |
| 568 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 569 | if (member == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 570 | { |
| 571 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clanmember"); |
| 572 | return -1; |
| 573 | } |
| 574 | if (member->clancxx . . $ pvpgn/bnetd/_clanmember#clan. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 575 | { |
| 576 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 577 | return -1; |
| 578 | } |
| 579 | if ((rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 580 | { |
| 581 | char tmpstr[2]; |
| 582 | const char *append_str; |
| 583 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_clanmemberupdatecxx . . $ pvpgn/t_server_clanmemberupdate#)); |
| 584 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_CLANMEMBERUPDATEcxx . . $ `src/common/bnet_protocol.h:4059:9`!); |
| 585 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, account_get_namecxx . . $ `src/bnetd/account.h:115:10`!((t_account*)member->memberacc)); |
| 586 | tmpstr[0] = member->statuscxx . . $ pvpgn/bnetd/_clanmember#status.; |
| 587 | append_str = clanmember_get_online_statuscxx . . $ pvpgn/bnetd/clanmember_get_online_status(87b0b518d0f7733d).(member, &tmpstr[1]); |
| 588 | packet_append_datacxx . . $ pvpgn/packet_append_data(d82347a7305550af).(rpacket, tmpstr, 2); |
| 589 | if (append_str) |
| 590 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, append_str); |
| 591 | else |
| 592 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, ""); |
| 593 | clan_send_packet_to_online_memberscxx . . $ pvpgn/bnetd/clan_send_packet_to_online_members(3930e223f0c15736).(member->clancxx . . $ pvpgn/bnetd/_clanmember#clan., rpacket); |
| 594 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 595 | } |
| 596 | return 0; |
| 597 | } |
| 598 | |
| 599 | extern int clanmember_on_change_status_by_connectioncxx . . $ pvpgn/bnetd/clanmember_on_change_status_by_connection(c4dfbc2386fe4fc3).(t_connection * conn) |
| 600 | { |
| 601 | t_packetcxx . . $ pvpgn/t_packet# * rpacket; |
| 602 | t_accountcxx . . $ pvpgn/bnetd/t_account# *acc; |
| 603 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *member; |
| 604 | if (!(conn)) |
| 605 | { |
| 606 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL conn"); |
| 607 | return -1; |
| 608 | } |
| 609 | if ((acc = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(conn)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 610 | return -1; |
| 611 | if ((member = account_get_clanmembercxx . . $ pvpgn/bnetd/account_get_clanmember(4ce48d4e65930331).(acc)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 612 | return -1; |
| 613 | if (member->clancxx . . $ pvpgn/bnetd/_clanmember#clan. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 614 | return -1; |
| 615 | if ((rpacket = packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_bnetcxx . . $ pvpgn/packet_class_bnet.)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 616 | { |
| 617 | char tmpstr[2]; |
| 618 | const char *append_str; |
| 619 | packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, sizeof(t_server_clanmemberupdatecxx . . $ pvpgn/t_server_clanmemberupdate#)); |
| 620 | packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket, SERVER_CLANMEMBERUPDATEcxx . . $ `src/common/bnet_protocol.h:4059:9`!); |
| 621 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, account_get_namecxx . . $ `src/bnetd/account.h:115:10`!(acc)); |
| 622 | tmpstr[0] = member->statuscxx . . $ pvpgn/bnetd/_clanmember#status.; |
| 623 | append_str = clanmember_get_online_status_by_connectioncxx . . $ pvpgn/bnetd/clanmember_get_online_status_by_connection(d9d5404bf0a840e3).(conn, &tmpstr[1]); |
| 624 | packet_append_datacxx . . $ pvpgn/packet_append_data(d82347a7305550af).(rpacket, tmpstr, 2); |
| 625 | if (append_str) |
| 626 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, append_str); |
| 627 | else |
| 628 | packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, ""); |
| 629 | clan_send_packet_to_online_memberscxx . . $ pvpgn/bnetd/clan_send_packet_to_online_members(3930e223f0c15736).(member->clancxx . . $ pvpgn/bnetd/_clanmember#clan., rpacket); |
| 630 | packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket); |
| 631 | } |
| 632 | return 0; |
| 633 | } |
| 634 | |
| 635 | extern int clan_unload_memberscxx . . $ pvpgn/bnetd/clan_unload_members(6091e08b3a5a3db6).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 636 | { |
| 637 | t_elem *curr; |
| 638 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *member; |
| 639 | |
| 640 | if (clan->memberscxx . . $ pvpgn/bnetd/clan#members.) |
| 641 | { |
| 642 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clan->members, curr) |
| 643 | { |
| 644 | if (!(member = (t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember#*)elem_get_data(curr))) |
| 645 | { |
| 646 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL entry in list"); |
| 647 | continue; |
| 648 | } |
| 649 | list_remove_elem(clan->memberscxx . . $ pvpgn/bnetd/clan#members., &curr); |
| 650 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)member); |
| 651 | } |
| 652 | |
| 653 | if (list_destroy(clan->memberscxx . . $ pvpgn/bnetd/clan#members.) < 0) |
| 654 | return -1; |
| 655 | |
| 656 | clan->memberscxx . . $ pvpgn/bnetd/clan#members. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 657 | } |
| 658 | |
| 659 | return 0; |
| 660 | } |
| 661 | |
| 662 | extern int clan_remove_all_memberscxx . . $ pvpgn/bnetd/clan_remove_all_members(6091e08b3a5a3db6).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 663 | { |
| 664 | t_elem *curr; |
| 665 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *member; |
| 666 | |
| 667 | if (clan->memberscxx . . $ pvpgn/bnetd/clan#members.) |
| 668 | { |
| 669 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clan->members, curr) |
| 670 | { |
| 671 | if (!(member = (t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember#*)elem_get_data(curr))) |
| 672 | { |
| 673 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL entry in list"); |
| 674 | continue; |
| 675 | } |
| 676 | if (member->memberacccxx . . $ pvpgn/bnetd/_clanmember#memberacc. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 677 | account_set_clanmembercxx . . $ pvpgn/bnetd/account_set_clanmember(5828098b1d22acf3).((t_accountcxx . . $ pvpgn/bnetd/t_account#*)member->memberacccxx . . $ pvpgn/bnetd/_clanmember#memberacc., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 678 | list_remove_elem(clan->memberscxx . . $ pvpgn/bnetd/clan#members., &curr); |
| 679 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)member); |
| 680 | } |
| 681 | |
| 682 | if (list_destroy(clan->memberscxx . . $ pvpgn/bnetd/clan#members.) < 0) |
| 683 | return -1; |
| 684 | |
| 685 | clan->memberscxx . . $ pvpgn/bnetd/clan#members. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 686 | } |
| 687 | |
| 688 | return 0; |
| 689 | } |
| 690 | |
| 691 | extern int clanlist_remove_clancxx . . $ pvpgn/bnetd/clanlist_remove_clan(6091e08b3a5a3db6).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 692 | { |
| 693 | t_elem * elem; |
| 694 | if (clan == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 695 | { |
| 696 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "get NULL clan"); |
| 697 | return -1; |
| 698 | } |
| 699 | if (list_remove_data(clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head., clan, &elem) < 0) |
| 700 | { |
| 701 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not delete clan entry"); |
| 702 | return -1; |
| 703 | } |
| 704 | return 0; |
| 705 | } |
| 706 | |
| 707 | extern int clan_removecxx . . $ pvpgn/bnetd/clan_remove(4c679297bf94b9eb).(t_clantagcxx . . $ pvpgn/bnetd/t_clantag# clantag) |
| 708 | { |
| 709 | return storagecxx . . $ pvpgn/bnetd/storage.->remove_clancxx . . $ pvpgn/bnetd/$anonymous_type_c7c18ce0294b47dd_0#remove_clan.(clantag); |
| 710 | } |
| 711 | |
| 712 | extern int clan_savecxx . . $ pvpgn/bnetd/clan_save(6091e08b3a5a3db6).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 713 | { |
| 714 | if (clan->createdcxx . . $ pvpgn/bnetd/clan#created. <= 0) |
| 715 | { |
| 716 | if (nowcxx . . $ pvpgn/bnetd/now. - clan->creation_timecxx . . $ pvpgn/bnetd/clan#creation_time. > 120) |
| 717 | { |
| 718 | clanlist_remove_clancxx . . $ pvpgn/bnetd/clanlist_remove_clan(6091e08b3a5a3db6).(clan); |
| 719 | clan_destroycxx . . $ pvpgn/bnetd/clan_destroy(6091e08b3a5a3db6).(clan); |
| 720 | } |
| 721 | return 0; |
| 722 | } |
| 723 | |
| 724 | storagecxx . . $ pvpgn/bnetd/storage.->write_clancxx . . $ pvpgn/bnetd/$anonymous_type_c7c18ce0294b47dd_0#write_clan.(clan); |
| 725 | |
| 726 | clan->modifiedcxx . . $ pvpgn/bnetd/clan#modified. = 0; |
| 727 | |
| 728 | return 0; |
| 729 | } |
| 730 | |
| 731 | extern t_list *clanlistcxx . . $ pvpgn/bnetd/clanlist(7a6cb11de248e2c9).(void) |
| 732 | { |
| 733 | return clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head.; |
| 734 | } |
| 735 | |
| 736 | extern int clanlist_add_clancxx . . $ pvpgn/bnetd/clanlist_add_clan(6091e08b3a5a3db6).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 737 | { |
| 738 | if (!(clan)) |
| 739 | { |
| 740 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 741 | return -1; |
| 742 | } |
| 743 | |
| 744 | if (!(clan->clanidcxx . . $ pvpgn/bnetd/clan#clanid.)) |
| 745 | clan->clanidcxx . . $ pvpgn/bnetd/clan#clanid. = ++max_clanidcxx . . $ pvpgn/bnetd/max_clanid.; |
| 746 | |
| 747 | list_append_data(clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head., clan); |
| 748 | |
| 749 | return clan->clanidcxx . . $ pvpgn/bnetd/clan#clanid.; |
| 750 | } |
| 751 | |
| 752 | int clanlist_loadcxx . . $ pvpgn/bnetd/clanlist_load(b126dc7c1de90089).(void) |
| 753 | { |
| 754 | // make sure to unload previous clanlist before loading again |
| 755 | if (clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head.) |
| 756 | clanlist_unloadcxx . . $ pvpgn/bnetd/clanlist_unload(b126dc7c1de90089).(); |
| 757 | |
| 758 | clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head. = list_create(); |
| 759 | |
| 760 | storagecxx . . $ pvpgn/bnetd/storage.->load_clanscxx . . $ pvpgn/bnetd/$anonymous_type_c7c18ce0294b47dd_0#load_clans.(_cb_load_clanscxx . . $ pvpgn/bnetd/_cb_load_clans(dedf1e9b1c614a07).); |
| 761 | |
| 762 | return 0; |
| 763 | } |
| 764 | |
| 765 | extern int clanlist_savecxx . . $ pvpgn/bnetd/clanlist_save(b126dc7c1de90089).(void) |
| 766 | { |
| 767 | t_elem *curr; |
| 768 | t_clancxx . . $ pvpgn/bnetd/t_clan# *clan; |
| 769 | |
| 770 | if (clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head.) |
| 771 | { |
| 772 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clanlist_head, curr) |
| 773 | { |
| 774 | if (!(clan = (t_clancxx . . $ pvpgn/bnetd/t_clan#*)elem_get_data(curr))) |
| 775 | { |
| 776 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL entry in list"); |
| 777 | continue; |
| 778 | } |
| 779 | if (clan->modifiedcxx . . $ pvpgn/bnetd/clan#modified.) |
| 780 | clan_savecxx . . $ pvpgn/bnetd/clan_save(6091e08b3a5a3db6).(clan); |
| 781 | } |
| 782 | |
| 783 | } |
| 784 | |
| 785 | return 0; |
| 786 | } |
| 787 | |
| 788 | extern int clanlist_unloadcxx . . $ pvpgn/bnetd/clanlist_unload(b126dc7c1de90089).(void) |
| 789 | { |
| 790 | t_elem *curr; |
| 791 | t_clancxx . . $ pvpgn/bnetd/t_clan# *clan; |
| 792 | |
| 793 | if (clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head.) |
| 794 | { |
| 795 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clanlist_head, curr) |
| 796 | { |
| 797 | if (!(clan = (t_clancxx . . $ pvpgn/bnetd/t_clan#*)elem_get_data(curr))) |
| 798 | { |
| 799 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL entry in list"); |
| 800 | continue; |
| 801 | } |
| 802 | if (clan->clannamecxx . . $ pvpgn/bnetd/clan#clanname.) |
| 803 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)clan->clanname); |
| 804 | if (clan->clan_motdcxx . . $ pvpgn/bnetd/clan#clan_motd.) |
| 805 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)clan->clan_motd); |
| 806 | clan_unload_memberscxx . . $ pvpgn/bnetd/clan_unload_members(6091e08b3a5a3db6).(clan); |
| 807 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)clan); |
| 808 | list_remove_elem(clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head., &curr); |
| 809 | } |
| 810 | |
| 811 | if (list_destroy(clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head.) < 0) |
| 812 | return -1; |
| 813 | |
| 814 | clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 815 | } |
| 816 | |
| 817 | return 0; |
| 818 | } |
| 819 | |
| 820 | extern t_clancxx . . $ pvpgn/bnetd/t_clan# *clanlist_find_clan_by_clanidcxx . . $ pvpgn/bnetd/clanlist_find_clan_by_clanid(8e7bfb2a07f0508e).(unsigned cid) |
| 821 | { |
| 822 | t_elem *curr; |
| 823 | t_clancxx . . $ pvpgn/bnetd/t_clan# *clan; |
| 824 | |
| 825 | if (clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head.) |
| 826 | { |
| 827 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clanlist_head, curr) |
| 828 | { |
| 829 | if (!(clan = (t_clancxx . . $ pvpgn/bnetd/t_clan#*)elem_get_data(curr))) |
| 830 | { |
| 831 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL entry in list"); |
| 832 | continue; |
| 833 | } |
| 834 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_tracecxx . . $ pvpgn/eventlog_level_trace., __FUNCTION__, "trace {}", clan->clanidcxx . . $ pvpgn/bnetd/clan#clanid.); |
| 835 | if (clan->createdcxx . . $ pvpgn/bnetd/clan#created. && (clan->clanidcxx . . $ pvpgn/bnetd/clan#clanid. == cid)) |
| 836 | return clan; |
| 837 | } |
| 838 | |
| 839 | } |
| 840 | |
| 841 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 842 | } |
| 843 | |
| 844 | extern t_clancxx . . $ pvpgn/bnetd/t_clan# *clanlist_find_clan_by_clantagcxx . . $ pvpgn/bnetd/clanlist_find_clan_by_clantag(8e7bfb2a07f0508e).(t_clantagcxx . . $ pvpgn/bnetd/t_clantag# clantag) |
| 845 | { |
| 846 | t_elem *curr; |
| 847 | t_clancxx . . $ pvpgn/bnetd/t_clan# *clan; |
| 848 | char * needle; |
| 849 | |
| 850 | if (clantag == 0) |
| 851 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 852 | |
| 853 | needle = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!(clantag_to_str(clantag)); |
| 854 | if (clanlist_headcxx . . $ pvpgn/bnetd/clanlist_head.) |
| 855 | { |
| 856 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clanlist_head, curr) |
| 857 | { |
| 858 | if (!(clan = (t_clancxx . . $ pvpgn/bnetd/t_clan#*)elem_get_data(curr))) |
| 859 | { |
| 860 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL entry in list"); |
| 861 | continue; |
| 862 | } |
| 863 | if (clan->createdcxx . . $ pvpgn/bnetd/clan#created. && !strcasecmp(needle, clantag_to_strcxx . . $ pvpgn/bnetd/clantag_to_str(81a3ae90da26a711).(clan->tagcxx . . $ pvpgn/bnetd/clan#tag.))) { |
| 864 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!(needle); |
| 865 | return clan; |
| 866 | } |
| 867 | } |
| 868 | |
| 869 | } |
| 870 | |
| 871 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!(needle); |
| 872 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 873 | } |
| 874 | |
| 875 | extern t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *clan_find_membercxx . . $ pvpgn/bnetd/clan_find_member(25bc33fde35a58c6).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan, t_accountcxx . . $ pvpgn/bnetd/t_account# * memberacc) |
| 876 | { |
| 877 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *member; |
| 878 | t_elem *curr; |
| 879 | if (!(clan)) |
| 880 | { |
| 881 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 882 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 883 | } |
| 884 | if (!(clan->memberscxx . . $ pvpgn/bnetd/clan#members.)) |
| 885 | { |
| 886 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL clan->members"); |
| 887 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 888 | } |
| 889 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clan->members, curr) |
| 890 | { |
| 891 | if (!(member = (t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember#*)elem_get_data(curr))) |
| 892 | { |
| 893 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL element in list"); |
| 894 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 895 | } |
| 896 | if (member->memberacccxx . . $ pvpgn/bnetd/_clanmember#memberacc. == memberacc) |
| 897 | return member; |
| 898 | } |
| 899 | |
| 900 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 901 | } |
| 902 | |
| 903 | extern t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *clan_find_member_by_namecxx . . $ pvpgn/bnetd/clan_find_member_by_name(817adf809366c39).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan, char const *membername) |
| 904 | { |
| 905 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *member; |
| 906 | t_elem *curr; |
| 907 | if (!(clan)) |
| 908 | { |
| 909 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 910 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 911 | } |
| 912 | if (!(clan->memberscxx . . $ pvpgn/bnetd/clan#members.)) |
| 913 | { |
| 914 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL clan->members"); |
| 915 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 916 | } |
| 917 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clan->members, curr) |
| 918 | { |
| 919 | if (!(member = (t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember#*)elem_get_data(curr))) |
| 920 | { |
| 921 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL element in list"); |
| 922 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 923 | } |
| 924 | if (strcasecmp(account_get_namecxx . . $ `src/bnetd/account.h:115:10`!((t_account*)member->memberacc), membername) == 0) |
| 925 | return member; |
| 926 | } |
| 927 | |
| 928 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 929 | } |
| 930 | |
| 931 | extern t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *clan_find_member_by_uidcxx . . $ pvpgn/bnetd/clan_find_member_by_uid(49a0b388d37d57f5).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan, unsigned int memberuid) |
| 932 | { |
| 933 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *member; |
| 934 | t_elem *curr; |
| 935 | if (!(clan)) |
| 936 | { |
| 937 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 938 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 939 | } |
| 940 | if (!(clan->memberscxx . . $ pvpgn/bnetd/clan#members.)) |
| 941 | { |
| 942 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL clan->members"); |
| 943 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 944 | } |
| 945 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clan->members, curr) |
| 946 | { |
| 947 | if (!(member = (t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember#*)elem_get_data(curr))) |
| 948 | { |
| 949 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL element in list"); |
| 950 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 951 | } |
| 952 | if (account_get_uidcxx . . $ `src/bnetd/account.h:91:9`!((t_account*)member->memberacc) == memberuid) |
| 953 | return member; |
| 954 | } |
| 955 | |
| 956 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 957 | } |
| 958 | |
| 959 | extern t_accountcxx . . $ pvpgn/bnetd/t_account# *clanmember_get_accountcxx . . $ pvpgn/bnetd/clanmember_get_account(b971855a6b077072).(t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member) |
| 960 | { |
| 961 | if (!(member)) |
| 962 | { |
| 963 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clanmember"); |
| 964 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 965 | } |
| 966 | |
| 967 | return (t_accountcxx . . $ pvpgn/bnetd/t_account# *)member->memberacccxx . . $ pvpgn/bnetd/_clanmember#memberacc.; |
| 968 | } |
| 969 | |
| 970 | extern int clanmember_set_accountcxx . . $ pvpgn/bnetd/clanmember_set_account(6b6650fe6c11bbc4).(t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member, t_accountcxx . . $ pvpgn/bnetd/t_account# * memberacc) |
| 971 | { |
| 972 | if (!(member)) |
| 973 | { |
| 974 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clanmember"); |
| 975 | return -1; |
| 976 | } |
| 977 | |
| 978 | member->memberacccxx . . $ pvpgn/bnetd/_clanmember#memberacc. = memberacc; |
| 979 | return 0; |
| 980 | } |
| 981 | |
| 982 | extern t_connection *clanmember_get_conncxx . . $ pvpgn/bnetd/clanmember_get_conn(6d9762d7066c7746).(t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member) |
| 983 | { |
| 984 | t_accountcxx . . $ pvpgn/bnetd/t_account# * account; |
| 985 | |
| 986 | if (!(member)) |
| 987 | { |
| 988 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clanmember"); |
| 989 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 990 | } |
| 991 | |
| 992 | if (!(account = (t_accountcxx . . $ pvpgn/bnetd/t_account#*)member->memberacccxx . . $ pvpgn/bnetd/_clanmember#memberacc.)) |
| 993 | { |
| 994 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "member as NULL account"); |
| 995 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 996 | } |
| 997 | |
| 998 | return account_get_conncxx . . $ pvpgn/bnetd/account_get_conn(831fe2ed2f0bd703).(account); |
| 999 | } |
| 1000 | |
| 1001 | extern char clanmember_get_statuscxx . . $ pvpgn/bnetd/clanmember_get_status(54878624261d8c60).(t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member) |
| 1002 | { |
| 1003 | if (!(member)) |
| 1004 | { |
| 1005 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clanmember"); |
| 1006 | return 0; |
| 1007 | } |
| 1008 | |
| 1009 | if ((member->statuscxx . . $ pvpgn/bnetd/_clanmember#status. == CLAN_NEWcxx . . $ `src/bnetd/clan.h:102:9`!) && (nowcxx . . $ pvpgn/bnetd/now. - member->join_timecxx . . $ pvpgn/bnetd/_clanmember#join_time. > prefs_get_clan_newer_timecxx . . $ pvpgn/bnetd/prefs_get_clan_newer_time(db52760e79bf9054).() * 3600)) |
| 1010 | { |
| 1011 | member->statuscxx . . $ pvpgn/bnetd/_clanmember#status. = CLAN_PEONcxx . . $ `src/bnetd/clan.h:101:9`!; |
| 1012 | member->clancxx . . $ pvpgn/bnetd/_clanmember#clan.->modifiedcxx . . $ pvpgn/bnetd/clan#modified. = 1; |
| 1013 | #ifdef WITH_SQL |
| 1014 | member->modified = 1; |
| 1015 | #endif |
| 1016 | } |
| 1017 | |
| 1018 | return member->statuscxx . . $ pvpgn/bnetd/_clanmember#status.; |
| 1019 | } |
| 1020 | |
| 1021 | extern int clanmember_set_statuscxx . . $ pvpgn/bnetd/clanmember_set_status(8370cd72d0cb3a0b).(t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member, char status) |
| 1022 | { |
| 1023 | if (!(member)) |
| 1024 | { |
| 1025 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clanmember"); |
| 1026 | return -1; |
| 1027 | } |
| 1028 | |
| 1029 | if (member->statuscxx . . $ pvpgn/bnetd/_clanmember#status. != status) |
| 1030 | { |
| 1031 | member->statuscxx . . $ pvpgn/bnetd/_clanmember#status. = status; |
| 1032 | member->clancxx . . $ pvpgn/bnetd/_clanmember#clan.->modifiedcxx . . $ pvpgn/bnetd/clan#modified. = 1; |
| 1033 | #ifdef WITH_SQL |
| 1034 | member->modified = 1; |
| 1035 | #endif |
| 1036 | } |
| 1037 | return 0; |
| 1038 | } |
| 1039 | |
| 1040 | extern int clanmember_set_join_timecxx . . $ pvpgn/bnetd/clanmember_set_join_time(8f87cdd393e525cc).(t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member, stdcxx . . $ std/::time_tcxx . . $ std/time_t# join_time) |
| 1041 | { |
| 1042 | if (!(member)) { |
| 1043 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clanmember"); |
| 1044 | return 0; |
| 1045 | } |
| 1046 | |
| 1047 | member->join_timecxx . . $ pvpgn/bnetd/_clanmember#join_time. = join_time; |
| 1048 | |
| 1049 | return 0; |
| 1050 | } |
| 1051 | |
| 1052 | extern stdcxx . . $ std/::time_tcxx . . $ std/time_t# clanmember_get_join_timecxx . . $ pvpgn/bnetd/clanmember_get_join_time(eb10b27a016fad21).(t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member) |
| 1053 | { |
| 1054 | if (!(member)) |
| 1055 | { |
| 1056 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clanmember"); |
| 1057 | return 0; |
| 1058 | } |
| 1059 | |
| 1060 | return member->join_timecxx . . $ pvpgn/bnetd/_clanmember#join_time.; |
| 1061 | } |
| 1062 | |
| 1063 | extern t_clancxx . . $ pvpgn/bnetd/t_clan# *clanmember_get_clancxx . . $ pvpgn/bnetd/clanmember_get_clan(18fc6df730a9c54c).(t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member) |
| 1064 | { |
| 1065 | if (!(member)) |
| 1066 | { |
| 1067 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clanmember"); |
| 1068 | return 0; |
| 1069 | } |
| 1070 | |
| 1071 | return member->clancxx . . $ pvpgn/bnetd/_clanmember#clan.; |
| 1072 | } |
| 1073 | |
| 1074 | extern int clanmember_get_fullmembercxx . . $ pvpgn/bnetd/clanmember_get_fullmember(d12aaa857ef4d493).(t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member) |
| 1075 | { |
| 1076 | if (!(member)) { |
| 1077 | ERROR0cxx . . $ `src/common/eventlog.h:73:9`!("got NULL clanmember"); |
| 1078 | return -1; |
| 1079 | } |
| 1080 | |
| 1081 | return member->fullmembercxx . . $ pvpgn/bnetd/_clanmember#fullmember.; |
| 1082 | } |
| 1083 | |
| 1084 | extern int clanmember_set_fullmembercxx . . $ pvpgn/bnetd/clanmember_set_fullmember(7ffb9f43622f570).(t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member, int fullmember) |
| 1085 | { |
| 1086 | if (!(member)) { |
| 1087 | ERROR0cxx . . $ `src/common/eventlog.h:73:9`!("got NULL clanmember"); |
| 1088 | return -1; |
| 1089 | } |
| 1090 | |
| 1091 | if (!(fullmember)) { |
| 1092 | ERROR0cxx . . $ `src/common/eventlog.h:73:9`!("got NULL fullmember"); |
| 1093 | return -1; |
| 1094 | } |
| 1095 | |
| 1096 | member->fullmembercxx . . $ pvpgn/bnetd/_clanmember#fullmember. = fullmember; |
| 1097 | |
| 1098 | return 0; |
| 1099 | } |
| 1100 | |
| 1101 | extern const char *clanmember_get_online_statuscxx . . $ pvpgn/bnetd/clanmember_get_online_status(87b0b518d0f7733d).(t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member, char *status) |
| 1102 | { |
| 1103 | return clanmember_get_online_status_by_connectioncxx . . $ pvpgn/bnetd/clanmember_get_online_status_by_connection(d9d5404bf0a840e3).(clanmember_get_conncxx . . $ pvpgn/bnetd/clanmember_get_conn(6d9762d7066c7746).(member), status); |
| 1104 | } |
| 1105 | |
| 1106 | extern const char *clanmember_get_online_status_by_connectioncxx . . $ pvpgn/bnetd/clanmember_get_online_status_by_connection(d9d5404bf0a840e3).(t_connection * conn, char *status) |
| 1107 | { |
| 1108 | if (conn && (conn_get_statecxx . . $ pvpgn/bnetd/conn_get_state(14586157a79399d4).(conn) != conn_state_empty)) |
| 1109 | { |
| 1110 | t_gamecxx . . $ pvpgn/bnetd/t_game# *game; |
| 1111 | t_channelcxx . . $ pvpgn/bnetd/t_channel# *channel; |
| 1112 | if ((game = conn_get_gamecxx . . $ pvpgn/bnetd/conn_get_game(692151a8f99bc3ef).(conn)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1113 | { |
| 1114 | if (game_get_flagcxx . . $ pvpgn/bnetd/game_get_flag(98b2c43fe55f6682).(game) == game_flag_privatecxx . . $ pvpgn/bnetd/game_flag_private.) |
| 1115 | (*status) = SERVER_CLAN_MEMBER_PRIVATE_GAMEcxx . . $ `src/common/bnet_protocol.h:3723:9`!; |
| 1116 | else |
| 1117 | (*status) = SERVER_CLAN_MEMBER_GAMEcxx . . $ `src/common/bnet_protocol.h:3722:9`!; |
| 1118 | return game_get_namecxx . . $ pvpgn/bnetd/game_get_name(743fb6d1aa411c4e).(game); |
| 1119 | } |
| 1120 | if ((channel = conn_get_channelcxx . . $ pvpgn/bnetd/conn_get_channel(17dd609cd0747384).(conn)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1121 | { |
| 1122 | (*status) = SERVER_CLAN_MEMBER_CHANNELcxx . . $ `src/common/bnet_protocol.h:3721:9`!; |
| 1123 | return channel_get_namecxx . . $ pvpgn/bnetd/channel_get_name(7800017c14723985).(channel); |
| 1124 | } |
| 1125 | |
| 1126 | (*status) = SERVER_CLAN_MEMBER_ONLINEcxx . . $ `src/common/bnet_protocol.h:3720:9`!; |
| 1127 | } |
| 1128 | else |
| 1129 | (*status) = SERVER_CLAN_MEMBER_OFFLINEcxx . . $ `src/common/bnet_protocol.h:3719:9`!; |
| 1130 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1131 | } |
| 1132 | |
| 1133 | extern int clanmember_set_onlinecxx . . $ pvpgn/bnetd/clanmember_set_online(c4dfbc2386fe4fc3).(t_connection * c) |
| 1134 | { |
| 1135 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *member; |
| 1136 | t_accountcxx . . $ pvpgn/bnetd/t_account# *acc; |
| 1137 | |
| 1138 | if (!c) |
| 1139 | { |
| 1140 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1141 | return -1; |
| 1142 | } |
| 1143 | |
| 1144 | if ((acc = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) && (member = account_get_clanmembercxx . . $ pvpgn/bnetd/account_get_clanmember(4ce48d4e65930331).(acc))) |
| 1145 | { |
| 1146 | clanmember_on_change_statuscxx . . $ pvpgn/bnetd/clanmember_on_change_status(d12aaa857ef4d493).(member); |
| 1147 | } |
| 1148 | |
| 1149 | return 0; |
| 1150 | } |
| 1151 | |
| 1152 | extern int clanmember_set_offlinecxx . . $ pvpgn/bnetd/clanmember_set_offline(c4dfbc2386fe4fc3).(t_connection * c) |
| 1153 | { |
| 1154 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *member; |
| 1155 | t_accountcxx . . $ pvpgn/bnetd/t_account# *acc; |
| 1156 | |
| 1157 | if (!c) |
| 1158 | { |
| 1159 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL connection"); |
| 1160 | return -1; |
| 1161 | } |
| 1162 | |
| 1163 | if ((acc = conn_get_accountcxx . . $ pvpgn/bnetd/conn_get_account(8df8b24b7c17a7f3).(c)) && (member = account_get_clanmember_forcedcxx . . $ pvpgn/bnetd/account_get_clanmember_forced(4ce48d4e65930331).(acc))) |
| 1164 | { |
| 1165 | clanmember_on_change_statuscxx . . $ pvpgn/bnetd/clanmember_on_change_status(d12aaa857ef4d493).(member); |
| 1166 | } |
| 1167 | |
| 1168 | return 0; |
| 1169 | } |
| 1170 | |
| 1171 | extern int clan_get_createdcxx . . $ pvpgn/bnetd/clan_get_created(6091e08b3a5a3db6).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 1172 | { |
| 1173 | if (!(clan)) |
| 1174 | { |
| 1175 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1176 | return -1; |
| 1177 | } |
| 1178 | |
| 1179 | return clan->createdcxx . . $ pvpgn/bnetd/clan#created.; |
| 1180 | } |
| 1181 | |
| 1182 | extern int clan_set_createdcxx . . $ pvpgn/bnetd/clan_set_created(3a82cfd82b391e24).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan, int created) |
| 1183 | { |
| 1184 | if (!(clan)) |
| 1185 | { |
| 1186 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1187 | return -1; |
| 1188 | } |
| 1189 | |
| 1190 | clan->createdcxx . . $ pvpgn/bnetd/clan#created. = created; |
| 1191 | |
| 1192 | return 0; |
| 1193 | } |
| 1194 | |
| 1195 | extern char clan_get_modifiedcxx . . $ pvpgn/bnetd/clan_get_modified(3931364155ee2c56).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 1196 | { |
| 1197 | if (!(clan)) |
| 1198 | { |
| 1199 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1200 | return -1; |
| 1201 | } |
| 1202 | |
| 1203 | return clan->modifiedcxx . . $ pvpgn/bnetd/clan#modified.; |
| 1204 | } |
| 1205 | |
| 1206 | extern int clan_set_modifiedcxx . . $ pvpgn/bnetd/clan_set_modified(a93227109bec7ad3).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan, char modified) |
| 1207 | { |
| 1208 | if (!(clan)) |
| 1209 | { |
| 1210 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1211 | return -1; |
| 1212 | } |
| 1213 | |
| 1214 | clan->modifiedcxx . . $ pvpgn/bnetd/clan#modified. = modified; |
| 1215 | |
| 1216 | return 0; |
| 1217 | } |
| 1218 | |
| 1219 | extern char clan_get_channel_typecxx . . $ pvpgn/bnetd/clan_get_channel_type(3931364155ee2c56).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 1220 | { |
| 1221 | if (!(clan)) |
| 1222 | { |
| 1223 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1224 | return -1; |
| 1225 | } |
| 1226 | |
| 1227 | return clan->channel_typecxx . . $ pvpgn/bnetd/clan#channel_type.; |
| 1228 | } |
| 1229 | |
| 1230 | extern int clan_set_channel_typecxx . . $ pvpgn/bnetd/clan_set_channel_type(a93227109bec7ad3).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan, char channel_type) |
| 1231 | { |
| 1232 | if (!(clan)) |
| 1233 | { |
| 1234 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1235 | return -1; |
| 1236 | } |
| 1237 | |
| 1238 | clan->channel_typecxx . . $ pvpgn/bnetd/clan#channel_type. = channel_type; |
| 1239 | |
| 1240 | return 0; |
| 1241 | } |
| 1242 | |
| 1243 | extern t_list *clan_get_memberscxx . . $ pvpgn/bnetd/clan_get_members(26783f42c3b86af0).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 1244 | { |
| 1245 | if (!(clan)) |
| 1246 | { |
| 1247 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1248 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1249 | } |
| 1250 | |
| 1251 | return clan->memberscxx . . $ pvpgn/bnetd/clan#members.; |
| 1252 | } |
| 1253 | |
| 1254 | extern char const *clan_get_namecxx . . $ pvpgn/bnetd/clan_get_name(49ae76a143b2b3).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 1255 | { |
| 1256 | if (!(clan)) |
| 1257 | { |
| 1258 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1259 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1260 | } |
| 1261 | |
| 1262 | return clan->clannamecxx . . $ pvpgn/bnetd/clan#clanname.; |
| 1263 | } |
| 1264 | |
| 1265 | extern t_clantagcxx . . $ pvpgn/bnetd/t_clantag# clan_get_clantagcxx . . $ pvpgn/bnetd/clan_get_clantag(1e16ca1cec114489).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 1266 | { |
| 1267 | if (!(clan)) |
| 1268 | { |
| 1269 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1270 | return 0; |
| 1271 | } |
| 1272 | |
| 1273 | return clan->tagcxx . . $ pvpgn/bnetd/clan#tag.; |
| 1274 | } |
| 1275 | |
| 1276 | extern char const *clan_get_motdcxx . . $ pvpgn/bnetd/clan_get_motd(49ae76a143b2b3).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 1277 | { |
| 1278 | if (!(clan)) |
| 1279 | { |
| 1280 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1281 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1282 | } |
| 1283 | |
| 1284 | return clan->clan_motdcxx . . $ pvpgn/bnetd/clan#clan_motd.; |
| 1285 | } |
| 1286 | |
| 1287 | extern int clan_set_motdcxx . . $ pvpgn/bnetd/clan_set_motd(aba9c10be9ace918).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan, const char *motd) |
| 1288 | { |
| 1289 | if (!(clan)) |
| 1290 | { |
| 1291 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1292 | return -1; |
| 1293 | } |
| 1294 | if (!(motd)) |
| 1295 | { |
| 1296 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL motd"); |
| 1297 | return -1; |
| 1298 | } |
| 1299 | else |
| 1300 | { |
| 1301 | if (clan->clan_motdcxx . . $ pvpgn/bnetd/clan#clan_motd.) |
| 1302 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)clan->clan_motd); |
| 1303 | clan->clan_motdcxx . . $ pvpgn/bnetd/clan#clan_motd. = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!(motd); |
| 1304 | } |
| 1305 | return 0; |
| 1306 | } |
| 1307 | |
| 1308 | extern unsigned int clan_get_clanidcxx . . $ pvpgn/bnetd/clan_get_clanid(1e16ca1cec114489).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 1309 | { |
| 1310 | if (!(clan)) |
| 1311 | { |
| 1312 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1313 | return 0; |
| 1314 | } |
| 1315 | |
| 1316 | return clan->clanidcxx . . $ pvpgn/bnetd/clan#clanid.; |
| 1317 | } |
| 1318 | |
| 1319 | extern int clan_set_creation_timecxx . . $ pvpgn/bnetd/clan_set_creation_time(ac2f83eebe36ee1e).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan, stdcxx . . $ std/::time_tcxx . . $ std/time_t# c_time) |
| 1320 | { |
| 1321 | if (!(clan)) |
| 1322 | { |
| 1323 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1324 | return 0; |
| 1325 | } |
| 1326 | |
| 1327 | clan->creation_timecxx . . $ pvpgn/bnetd/clan#creation_time. = c_time; |
| 1328 | |
| 1329 | return 0; |
| 1330 | } |
| 1331 | |
| 1332 | extern stdcxx . . $ std/::time_tcxx . . $ std/time_t# clan_get_creation_timecxx . . $ pvpgn/bnetd/clan_get_creation_time(fb1978a3cd20c67c).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 1333 | { |
| 1334 | if (!(clan)) |
| 1335 | { |
| 1336 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1337 | return 0; |
| 1338 | } |
| 1339 | |
| 1340 | return clan->creation_timecxx . . $ pvpgn/bnetd/clan#creation_time.; |
| 1341 | } |
| 1342 | |
| 1343 | extern t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *clan_add_membercxx . . $ pvpgn/bnetd/clan_add_member(d2839d873797151a).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan, t_accountcxx . . $ pvpgn/bnetd/t_account# * memberacc, char status) |
| 1344 | { |
| 1345 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *member; |
| 1346 | |
| 1347 | if (!(clan)) |
| 1348 | { |
| 1349 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clan"); |
| 1350 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1351 | } |
| 1352 | |
| 1353 | if (!(clan->memberscxx . . $ pvpgn/bnetd/clan#members.)) |
| 1354 | { |
| 1355 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "found NULL clan->members"); |
| 1356 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1357 | } |
| 1358 | |
| 1359 | member = (t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember#*)xmalloccxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:43:9`!(sizeof(t_clanmember)); |
| 1360 | member->memberacccxx . . $ pvpgn/bnetd/_clanmember#memberacc. = memberacc; |
| 1361 | member->statuscxx . . $ pvpgn/bnetd/_clanmember#status. = status; |
| 1362 | member->join_timecxx . . $ pvpgn/bnetd/_clanmember#join_time. = nowcxx . . $ pvpgn/bnetd/now.; |
| 1363 | member->clancxx . . $ pvpgn/bnetd/_clanmember#clan. = clan; |
| 1364 | member->fullmembercxx . . $ pvpgn/bnetd/_clanmember#fullmember. = 0; /* clanmember is invited */ |
| 1365 | #ifdef WITH_SQL |
| 1366 | member->modified = 1; |
| 1367 | #endif |
| 1368 | |
| 1369 | list_append_data(clan->memberscxx . . $ pvpgn/bnetd/clan#members., member); |
| 1370 | |
| 1371 | account_set_clanmembercxx . . $ pvpgn/bnetd/account_set_clanmember(5828098b1d22acf3).(memberacc, member); |
| 1372 | |
| 1373 | clan->modifiedcxx . . $ pvpgn/bnetd/clan#modified. = 1; |
| 1374 | |
| 1375 | return member; |
| 1376 | } |
| 1377 | |
| 1378 | extern int clan_remove_membercxx . . $ pvpgn/bnetd/clan_remove_member(b047ad00324891dc).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan, t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# * member) |
| 1379 | { |
| 1380 | t_elem * elem; |
| 1381 | |
| 1382 | if (!member) |
| 1383 | return -1; |
| 1384 | if (list_remove_data(clan->memberscxx . . $ pvpgn/bnetd/clan#members., member, &elem) < 0) |
| 1385 | { |
| 1386 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "could not remove member"); |
| 1387 | return -1; |
| 1388 | } |
| 1389 | if (member->memberacccxx . . $ pvpgn/bnetd/_clanmember#memberacc. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1390 | { |
| 1391 | account_set_clanmembercxx . . $ pvpgn/bnetd/account_set_clanmember(5828098b1d22acf3).((t_accountcxx . . $ pvpgn/bnetd/t_account#*)member->memberacccxx . . $ pvpgn/bnetd/_clanmember#memberacc., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 1392 | if (member->fullmembercxx . . $ pvpgn/bnetd/_clanmember#fullmember. == 1) |
| 1393 | storagecxx . . $ pvpgn/bnetd/storage.->remove_clanmembercxx . . $ pvpgn/bnetd/$anonymous_type_c7c18ce0294b47dd_0#remove_clanmember.(account_get_uidcxx . . $ `src/bnetd/account.h:91:9`!((t_account*)member->memberacc)); |
| 1394 | } |
| 1395 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)member); |
| 1396 | clan->modifiedcxx . . $ pvpgn/bnetd/clan#modified. = 1; |
| 1397 | return 0; |
| 1398 | } |
| 1399 | |
| 1400 | extern t_clancxx . . $ pvpgn/bnetd/t_clan# *clan_createcxx . . $ pvpgn/bnetd/clan_create(52cf30ee556d2195).(t_accountcxx . . $ pvpgn/bnetd/t_account# * chieftain_acc, t_clantagcxx . . $ pvpgn/bnetd/t_clantag# clantag, const char *clanname, const char *motd) |
| 1401 | { |
| 1402 | t_clancxx . . $ pvpgn/bnetd/t_clan# *clan; |
| 1403 | t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember# *member; |
| 1404 | |
| 1405 | clan = (t_clancxx . . $ pvpgn/bnetd/t_clan#*)xmalloccxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:43:9`!(sizeof(t_clan)); |
| 1406 | member = (t_clanmembercxx . . $ pvpgn/bnetd/t_clanmember#*)xmalloccxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:43:9`!(sizeof(t_clanmember)); |
| 1407 | |
| 1408 | if (!(clanname)) |
| 1409 | { |
| 1410 | eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error., __FUNCTION__, "got NULL clanname"); |
| 1411 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)clan); |
| 1412 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)member); |
| 1413 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1414 | } |
| 1415 | |
| 1416 | clan->clannamecxx . . $ pvpgn/bnetd/clan#clanname. = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!(clanname); |
| 1417 | |
| 1418 | if (!(motd)) |
| 1419 | clan->clan_motdcxx . . $ pvpgn/bnetd/clan#clan_motd. = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!("This is a newly created clan"); |
| 1420 | else |
| 1421 | clan->clan_motdcxx . . $ pvpgn/bnetd/clan#clan_motd. = xstrdupcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:49:9`!(motd); |
| 1422 | |
| 1423 | clan->creation_timecxx . . $ pvpgn/bnetd/clan#creation_time. = nowcxx . . $ pvpgn/bnetd/now.; |
| 1424 | clan->tagcxx . . $ pvpgn/bnetd/clan#tag. = clantag; |
| 1425 | clan->clanidcxx . . $ pvpgn/bnetd/clan#clanid. = ++max_clanidcxx . . $ pvpgn/bnetd/max_clanid.; |
| 1426 | clan->createdcxx . . $ pvpgn/bnetd/clan#created. = 0; |
| 1427 | clan->modifiedcxx . . $ pvpgn/bnetd/clan#modified. = 1; |
| 1428 | clan->channel_typecxx . . $ pvpgn/bnetd/clan#channel_type. = prefs_get_clan_channel_default_privatecxx . . $ pvpgn/bnetd/prefs_get_clan_channel_default_private(db52760e79bf9054).(); |
| 1429 | |
| 1430 | clan->memberscxx . . $ pvpgn/bnetd/clan#members. = list_create(); |
| 1431 | |
| 1432 | member->memberacccxx . . $ pvpgn/bnetd/_clanmember#memberacc. = chieftain_acc; |
| 1433 | member->statuscxx . . $ pvpgn/bnetd/_clanmember#status. = CLAN_CHIEFTAINcxx . . $ `src/bnetd/clan.h:98:9`!; |
| 1434 | member->join_timecxx . . $ pvpgn/bnetd/_clanmember#join_time. = clan->creation_timecxx . . $ pvpgn/bnetd/clan#creation_time.; |
| 1435 | member->fullmembercxx . . $ pvpgn/bnetd/_clanmember#fullmember. = 1; /* chief should be considered invited */ |
| 1436 | member->clancxx . . $ pvpgn/bnetd/_clanmember#clan. = clan; |
| 1437 | #ifdef WITH_SQL |
| 1438 | member->modified = 1; |
| 1439 | #endif |
| 1440 | |
| 1441 | list_append_data(clan->memberscxx . . $ pvpgn/bnetd/clan#members., member); |
| 1442 | |
| 1443 | account_set_clanmembercxx . . $ pvpgn/bnetd/account_set_clanmember(5828098b1d22acf3).(chieftain_acc, member); |
| 1444 | |
| 1445 | return clan; |
| 1446 | } |
| 1447 | |
| 1448 | extern int clan_destroycxx . . $ pvpgn/bnetd/clan_destroy(6091e08b3a5a3db6).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 1449 | { |
| 1450 | if (!clan) |
| 1451 | return 0; |
| 1452 | if (clan->clannamecxx . . $ pvpgn/bnetd/clan#clanname.) |
| 1453 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)clan->clanname); |
| 1454 | if (clan->clan_motdcxx . . $ pvpgn/bnetd/clan#clan_motd.) |
| 1455 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)clan->clan_motd); |
| 1456 | clan_remove_all_memberscxx . . $ pvpgn/bnetd/clan_remove_all_members(6091e08b3a5a3db6).(clan); |
| 1457 | xfreecxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/xalloc.h:51:9`!((void *)clan); |
| 1458 | return 0; |
| 1459 | } |
| 1460 | |
| 1461 | extern unsigned clan_get_member_countcxx . . $ pvpgn/bnetd/clan_get_member_count(1e16ca1cec114489).(t_clancxx . . $ pvpgn/bnetd/t_clan# * clan) |
| 1462 | { |
| 1463 | t_elem *curr; |
| 1464 | unsigned count = 0; |
| 1465 | LIST_TRAVERSEcxx . . $ `/build/tmp.prHwK0hYwT/package/src/common/list.h:94:9`!(clan->members, curr) |
| 1466 | { |
| 1467 | if ((elem_get_data(curr)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1468 | count++; |
| 1469 | } |
| 1470 | return count; |
| 1471 | } |
| 1472 | |
| 1473 | extern t_clantagcxx . . $ pvpgn/bnetd/t_clantag# str_to_clantagcxx . . $ pvpgn/bnetd/str_to_clantag(c61c63047ce273de).(const char *str) |
| 1474 | { |
| 1475 | t_clantagcxx . . $ pvpgn/bnetd/t_clantag# tag = 0; |
| 1476 | |
| 1477 | if (str[0]) |
| 1478 | { |
| 1479 | tag |= str[0] << 24; |
| 1480 | if (str[1]) |
| 1481 | { |
| 1482 | tag |= str[1] << 16; |
| 1483 | if (str[2]) |
| 1484 | { |
| 1485 | tag |= str[2] << 8; |
| 1486 | if (str[3]) |
| 1487 | tag |= str[3]; |
| 1488 | } |
| 1489 | } |
| 1490 | } |
| 1491 | |
| 1492 | return tag; |
| 1493 | } |
| 1494 | |
| 1495 | extern const char * clantag_to_strcxx . . $ pvpgn/bnetd/clantag_to_str(81a3ae90da26a711).(t_clantagcxx . . $ pvpgn/bnetd/t_clantag# tag) |
| 1496 | { |
| 1497 | static char tagstr[sizeof(tag)+1]; |
| 1498 | |
| 1499 | stdcxx . . $ std/::sprintfcxx . . $ std/sprintf(bb743b22d71e45d5).(tagstr, "%c%c%c%c", tag >> 24, (tag >> 16) & 0xff, (tag >> 8) & 0xff, tag & 0xff); |
| 1500 | return tagstr; |
| 1501 | } |
| 1502 | |
| 1503 | } |
| 1504 | |
| 1505 | } |