Debian Codegraph @

src/d2cs/handle_d2cs.cpp

raw symbols SCIP
1 /*
2 * Copyright (C) 2000,2001 Onlyer ([email protected])
3 * Copyright (C) 2004 Olaf Freyer ([email protected])
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19 #include "common/setup_before.h"cxx . . $ `<file>/src/common/setup_before.h`/
20 #include "setup.h"cxx . . $ `<file>/src/d2cs/setup.h`/
21 #include "handle_d2cs.h"cxx . . $ `<file>/src/d2cs/handle_d2cs.h`/
22
23 #include <cstring>
24 #include <ctime>
25
26 #include "compat/mkdir.h"cxx . . $ `<file>/src/compat/mkdir.h`/
27 #include "compat/pdir.h"cxx . . $ `<file>/src/compat/pdir.h`/
28 #include "compat/psock.h"cxx . . $ `<file>/src/compat/psock.h`/
29 #include "compat/statmacros.h"cxx . . $ `<file>/src/compat/statmacros.h`/
30 #include "common/eventlog.h"cxx . . $ `<file>/src/common/eventlog.h`/
31 #include "common/xalloc.h"cxx . . $ `<file>/src/common/xalloc.h`/
32 #include "common/d2cs_d2dbs_ladder.h"cxx . . $ `<file>/src/common/d2cs_d2dbs_ladder.h`/
33 #include "game.h"cxx . . $ `<file>/src/d2cs/game.h`/
34 #include "bnetd.h"cxx . . $ `<file>/src/d2cs/bnetd.h`/
35 #include "serverqueue.h"cxx . . $ `<file>/src/d2cs/serverqueue.h`/
36 #include "prefs.h"cxx . . $ `<file>/src/d2cs/prefs.h`/
37 #include "d2ladder.h"cxx . . $ `<file>/src/d2cs/d2ladder.h`/
38 #include "d2charfile.h"cxx . . $ `<file>/src/d2cs/d2charfile.h`/
39 #include "d2charlist.h"cxx . . $ `<file>/src/d2cs/d2charlist.h`/
40
41 #ifdef HAVE_ARPA_INET_Hcxx . . $ `build/config.h:13:9`!
42 # include <arpa/inet.h>
43 #endif
44 #ifdef HAVE_WS2TCPIP_H
45 # include <Ws2tcpip.h>
46 #endif
47
48 #include "common/setup_after.h"cxx . . $ `<file>/src/common/setup_after.h`/
49
50
51 namespace pvpgncxx . . $ pvpgn/
52 {
53
54 namespace d2cscxx . . $ pvpgn/d2cs/
55 {
56
57 static int d2cs_send_client_laddercxx . . $ pvpgn/d2cs/d2cs_send_client_ladder(99c542d0a67da9ed).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, unsigned char type, unsigned short from);
58 static unsigned int d2cs_try_joingamecxx . . $ pvpgn/d2cs/d2cs_try_joingame(d50089198af1f705).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# const * c, t_gamecxx . . $ pvpgn/d2cs/t_game# const * game, char const * gamepass);
59
60 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_loginreq)
61 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_createcharreq)
62 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_creategamereq)
63 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_joingamereq)
64 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_gamelistreq)
65 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_gameinforeq)
66 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_charloginreq)
67 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_deletecharreq)
68 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_ladderreq)
69 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_motdreq)
70 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_cancelcreategame)
71 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_charladderreq)
72 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_charlistreq)
73 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_charlistreq_110)
74 DECLARE_PACKET_HANDLERcxx . . $ `src/d2cs/setup.h:68:9`!(on_client_convertcharreq)
75
76
77 static t_packet_handle_tablecxx . . $ pvpgn/d2cs/t_packet_handle_table# d2cs_packet_handle_tablecxx . . $ pvpgn/d2cs/d2cs_packet_handle_table.[]={
78 /* 0x00 */ { 0, conn_state_nonecxx . . $ pvpgn/d2cs/conn_state_none., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! },
79 /* 0x01 */ { sizeof(t_client_d2cs_loginreqcxx . . $ pvpgn/t_client_d2cs_loginreq#), conn_state_connectedcxx . . $ pvpgn/d2cs/conn_state_connected., on_client_loginreqcxx . . $ pvpgn/d2cs/on_client_loginreq(5937b18ec8c7bf53). },
80 /* 0x02 */ { sizeof(t_client_d2cs_createcharreqcxx . . $ pvpgn/t_client_d2cs_createcharreq#), conn_state_authedcxx . . $ pvpgn/d2cs/conn_state_authed.|conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_createcharreqcxx . . $ pvpgn/d2cs/on_client_createcharreq(5937b18ec8c7bf53). },
81 /* 0x03 */ { sizeof(t_client_d2cs_creategamereqcxx . . $ pvpgn/t_client_d2cs_creategamereq#), conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_creategamereqcxx . . $ pvpgn/d2cs/on_client_creategamereq(5937b18ec8c7bf53). },
82 /* 0x04 */ { sizeof(t_client_d2cs_joingamereqcxx . . $ pvpgn/t_client_d2cs_joingamereq#), conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_joingamereqcxx . . $ pvpgn/d2cs/on_client_joingamereq(5937b18ec8c7bf53). },
83 /* 0x05 */ { sizeof(t_client_d2cs_gamelistreqcxx . . $ pvpgn/t_client_d2cs_gamelistreq#), conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_gamelistreqcxx . . $ pvpgn/d2cs/on_client_gamelistreq(5937b18ec8c7bf53). },
84 /* 0x06 */ { sizeof(t_client_d2cs_gameinforeqcxx . . $ pvpgn/t_client_d2cs_gameinforeq#), conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_gameinforeqcxx . . $ pvpgn/d2cs/on_client_gameinforeq(5937b18ec8c7bf53). },
85 /* 0x07 */ { sizeof(t_client_d2cs_charloginreqcxx . . $ pvpgn/t_client_d2cs_charloginreq#), conn_state_authedcxx . . $ pvpgn/d2cs/conn_state_authed.|conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_charloginreqcxx . . $ pvpgn/d2cs/on_client_charloginreq(5937b18ec8c7bf53). },
86 /* 0x08 */ { 0, conn_state_nonecxx . . $ pvpgn/d2cs/conn_state_none., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! },
87 /* 0x09 */ { 0, conn_state_nonecxx . . $ pvpgn/d2cs/conn_state_none., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! },
88 /* 0x0a */ { sizeof(t_client_d2cs_deletecharreqcxx . . $ pvpgn/t_client_d2cs_deletecharreq#), conn_state_authedcxx . . $ pvpgn/d2cs/conn_state_authed.|conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_deletecharreqcxx . . $ pvpgn/d2cs/on_client_deletecharreq(5937b18ec8c7bf53). },
89 /* 0x0b */ { 0, conn_state_nonecxx . . $ pvpgn/d2cs/conn_state_none., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! },
90 /* 0x0c */ { 0, conn_state_nonecxx . . $ pvpgn/d2cs/conn_state_none., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! },
91 /* 0x0d */ { 0, conn_state_nonecxx . . $ pvpgn/d2cs/conn_state_none., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! },
92 /* 0x0e */ { 0, conn_state_nonecxx . . $ pvpgn/d2cs/conn_state_none., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! },
93 /* 0x0f */ { 0, conn_state_nonecxx . . $ pvpgn/d2cs/conn_state_none., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! },
94 /* 0x10 */ { 0, conn_state_nonecxx . . $ pvpgn/d2cs/conn_state_none., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! },
95 /* 0x11 */ { sizeof(t_client_d2cs_ladderreqcxx . . $ pvpgn/t_client_d2cs_ladderreq#), conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_ladderreqcxx . . $ pvpgn/d2cs/on_client_ladderreq(5937b18ec8c7bf53). },
96 /* 0x12 */ { sizeof(t_client_d2cs_motdreqcxx . . $ pvpgn/t_client_d2cs_motdreq#), conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_motdreqcxx . . $ pvpgn/d2cs/on_client_motdreq(5937b18ec8c7bf53). },
97 /* 0x13 */ { sizeof(t_client_d2cs_cancelcreategamecxx . . $ pvpgn/t_client_d2cs_cancelcreategame#),conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_cancelcreategamecxx . . $ pvpgn/d2cs/on_client_cancelcreategame(5937b18ec8c7bf53).},
98 /* 0x14 */ { 0, conn_state_nonecxx . . $ pvpgn/d2cs/conn_state_none., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! },
99 /* 0x15 */ { 0, conn_state_nonecxx . . $ pvpgn/d2cs/conn_state_none., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! },
100 /* 0x16 */ { sizeof(t_client_d2cs_charladderreqcxx . . $ pvpgn/t_client_d2cs_charladderreq#), conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_charladderreqcxx . . $ pvpgn/d2cs/on_client_charladderreq(5937b18ec8c7bf53). },
101 /* 0x17 */ { sizeof(t_client_d2cs_charlistreqcxx . . $ pvpgn/t_client_d2cs_charlistreq#), conn_state_authedcxx . . $ pvpgn/d2cs/conn_state_authed.|conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_charlistreqcxx . . $ pvpgn/d2cs/on_client_charlistreq(5937b18ec8c7bf53). },
102 /* 0x18 */ { sizeof(t_client_d2cs_convertcharreqcxx . . $ pvpgn/t_client_d2cs_convertcharreq#), conn_state_authedcxx . . $ pvpgn/d2cs/conn_state_authed.|conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_convertcharreqcxx . . $ pvpgn/d2cs/on_client_convertcharreq(5937b18ec8c7bf53). },
103 /* 0x19 */ { sizeof(t_client_d2cs_charlistreq_110cxx . . $ pvpgn/t_client_d2cs_charlistreq_110#), conn_state_authedcxx . . $ pvpgn/d2cs/conn_state_authed.|conn_state_char_authedcxx . . $ pvpgn/d2cs/conn_state_char_authed., on_client_charlistreq_110cxx . . $ pvpgn/d2cs/on_client_charlistreq_110(5937b18ec8c7bf53). }
104 };
105
106
107 extern int d2cs_handle_d2cs_packetcxx . . $ pvpgn/d2cs/d2cs_handle_d2cs_packet(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
108 {
109 return conn_process_packetcxx . . $ pvpgn/d2cs/conn_process_packet(2bc178548fb00cfb).(c,packet,d2cs_packet_handle_tablecxx . . $ pvpgn/d2cs/d2cs_packet_handle_table.,NELEMScxx . . $ `src/d2cs/setup.h:69:9`!(d2cs_packet_handle_table));
110 }
111
112 static int on_client_loginreqcxx . . $ pvpgn/d2cs/on_client_loginreq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
113 {
114 t_packetcxx . . $ pvpgn/t_packet# * bnpacket;
115 char const * account;
116 t_sqcxx . . $ pvpgn/d2cs/t_sq# * sq;
117 unsigned int sessionnum;
118
119 if (!(account=packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet,sizeof(t_client_d2cs_loginreqcxx . . $ pvpgn/t_client_d2cs_loginreq#),MAX_CHARNAME_LENcxx . . $ MAX_CHARNAME_LEN.))) {
120 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad account name");
121 return -1;
122 }
123 if (d2char_check_acctnamecxx . . $ pvpgn/d2cs/d2char_check_acctname(5c4306d8553b3696).(account)<0) {
124 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad account name");
125 return -1;
126 }
127 if (!bnetd_conncxx . . $ pvpgn/d2cs/bnetd_conn(2c2f9695855bd8ac).()) {
128 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_warncxx . . $ pvpgn/eventlog_level_warn.,__FUNCTION__,"d2cs is offline with bnetd, login request will be rejected");
129 return -1;
130 }
131 sessionnum=bn_int_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_loginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_loginreq..sessionnumcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_2#sessionnum.);
132 conn_set_bnetd_sessionnumcxx . . $ pvpgn/d2cs/conn_set_bnetd_sessionnum(2fb9731f9a7a8931).(c,sessionnum);
133 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info.,__FUNCTION__,"got client (*{}) login request sessionnum=0x{:X}",account,sessionnum);
134 if ((bnpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cs_bnetdcxx . . $ pvpgn/packet_class_d2cs_bnetd.))) {
135 if ((sq=sq_createcxx . . $ pvpgn/d2cs/sq_create(5729c0f3ffc7f2dd).(d2cs_conn_get_sessionnumcxx . . $ pvpgn/d2cs/d2cs_conn_get_sessionnum(efed4e5eb0be6497).(c),packet,0))) {
136 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(bnpacket,sizeof(t_d2cs_bnetd_accountloginreqcxx . . $ pvpgn/t_d2cs_bnetd_accountloginreq#));
137 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(bnpacket,D2CS_BNETD_ACCOUNTLOGINREQcxx . . $ `src/common/d2cs_bnetd_protocol.h:62:9`!);
138 bn_int_set(&bnpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_bnetd_accountloginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_bnetd_accountloginreq..hcxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_5#h..seqnocxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_0#seqno.,sq_get_seqnocxx . . $ pvpgn/d2cs/sq_get_seqno(b4250823e36b6ab).(sq));
139 bn_int_set(&bnpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_bnetd_accountloginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_bnetd_accountloginreq..seqnocxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_5#seqno.,
140 bn_int_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_loginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_loginreq..seqnocxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_2#seqno.));
141 bn_int_set(&bnpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_bnetd_accountloginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_bnetd_accountloginreq..sessionkeycxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_5#sessionkey.,
142 bn_int_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_loginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_loginreq..sessionkeycxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_2#sessionkey.));
143 bn_int_set(&bnpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_bnetd_accountloginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_bnetd_accountloginreq..sessionnumcxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_5#sessionnum.,sessionnum);
144 stdcxx . . $ std/::memcpy(bnpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_bnetd_accountloginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_bnetd_accountloginreq..secret_hashcxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_5#secret_hash.,
145 packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_loginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_loginreq..secret_hashcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_2#secret_hash.,
146 sizeof(bnpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_bnetd_accountloginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_bnetd_accountloginreq..secret_hashcxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_5#secret_hash.));
147 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(bnpacket,account);
148 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(bnetd_conncxx . . $ pvpgn/d2cs/bnetd_conn(2c2f9695855bd8ac).(),bnpacket);
149 }
150 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(bnpacket);
151 }
152 return 0;
153 }
154
155 static int on_client_createcharreqcxx . . $ pvpgn/d2cs/on_client_createcharreq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
156 {
157 t_packetcxx . . $ pvpgn/t_packet# * rpacket, * bnpacket;
158 char const * charname;
159 char const * account;
160 char * path;
161 t_sqcxx . . $ pvpgn/d2cs/t_sq# * sq;
162 unsigned int reply;
163 unsigned short status, chclass;
164 t_d2charinfo_filecxx . . $ pvpgn/t_d2charinfo_file# data;
165
166 if (!(charname=packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet,sizeof(t_client_d2cs_createcharreqcxx . . $ pvpgn/t_client_d2cs_createcharreq#),MAX_CHARNAME_LENcxx . . $ MAX_CHARNAME_LEN.))) {
167 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad character name");
168 return -1;
169 }
170 if (!(account=d2cs_conn_get_accountcxx . . $ pvpgn/d2cs/d2cs_conn_get_account(204e3869d17161f9).(c))) {
171 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"missing account for character {}",charname);
172 return -1;
173 }
174 chclass=bn_short_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_createcharreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_createcharreq..chclasscxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_4#chclass.);
175 status=bn_short_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_createcharreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_createcharreq..statuscxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_4#status.);
176
177 path=(char*)xmalloccxx . . $ `src/common/xalloc.h:43:9`!(std::strlen(prefs_get_charinfo_dir())+1+std::strlen(account)+1);
178 d2char_get_infodir_namecxx . . $ pvpgn/d2cs/d2char_get_infodir_name(e4809bc172bbfbe1).(path,account);
179 try {
180 Directorycxx . . $ pvpgn/Directory# dircxx . . $ pvpgn/Directory#Directory(a3b17e0268c60856).(pathcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).);
181 } catch (const Directorycxx . . $ pvpgn/Directory#::OpenErrorcxx . . $ pvpgn/Directory#OpenError#&) {
182 INFO1cxx . . $ `src/common/eventlog.h:84:9`!("(*{}) charinfo directory do not exist, building it",account);
183 p_mkdircxx . . $ `src/compat/mkdir.h:51:11`!(path,S_IRWXUcxx . . $ `<external>/14710646456994434043/fcntl.h:109:10`!);
184 }
185 xfreecxx . . $ `src/common/xalloc.h:51:9`!(path);
186
187 if (d2char_createcxx . . $ pvpgn/d2cs/d2char_create(c348fa9f1d8d7613).(account,charname,chclass,status)<0) {
188 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_warncxx . . $ pvpgn/eventlog_level_warn.,__FUNCTION__,"error create character {} for account {}",charname,account);
189 reply=D2CS_CLIENT_CREATECHARREPLY_ALREADY_EXISTcxx . . $ `src/common/d2cs_protocol.h:83:9`!;
190 } else if (d2charinfo_loadcxx . . $ pvpgn/d2cs/d2charinfo_load(aca657f4e6b90ade).(account,charname,&data)<0) {
191 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"error loading charinfo for character {}(*{})",charname,account);
192 reply=D2CS_CLIENT_CREATECHARREPLY_FAILEDcxx . . $ `src/common/d2cs_protocol.h:82:9`!;
193 } else {
194 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info.,__FUNCTION__,"character {}(*{}) created",charname,account);
195 reply=D2CS_CLIENT_CREATECHARREPLY_SUCCEEDcxx . . $ `src/common/d2cs_protocol.h:81:9`!;
196 conn_set_charinfocxx . . $ pvpgn/d2cs/conn_set_charinfo(e7ef76122ed37433).(c,&data.summarycxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#summary.);
197 if ((bnpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cs_bnetdcxx . . $ pvpgn/packet_class_d2cs_bnetd.))) {
198 if ((sq=sq_createcxx . . $ pvpgn/d2cs/sq_create(5729c0f3ffc7f2dd).(d2cs_conn_get_sessionnumcxx . . $ pvpgn/d2cs/d2cs_conn_get_sessionnum(efed4e5eb0be6497).(c),packet,0))) {
199 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(bnpacket,sizeof(t_d2cs_bnetd_charloginreqcxx . . $ pvpgn/t_d2cs_bnetd_charloginreq#));
200 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(bnpacket,D2CS_BNETD_CHARLOGINREQcxx . . $ `src/common/d2cs_bnetd_protocol.h:82:9`!);
201 bn_int_set(&bnpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_bnetd_charloginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_bnetd_charloginreq..hcxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_7#h..seqnocxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_0#seqno.,sq_get_seqnocxx . . $ pvpgn/d2cs/sq_get_seqno(b4250823e36b6ab).(sq));
202 bn_int_set(&bnpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_bnetd_charloginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_bnetd_charloginreq..sessionnumcxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_7#sessionnum.,
203 conn_get_bnetd_sessionnumcxx . . $ pvpgn/d2cs/conn_get_bnetd_sessionnum(efed4e5eb0be6497).(c));
204 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(bnpacket,charname);
205 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(bnpacket,(char const *)&data.portraitcxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#portrait.);
206 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(bnetd_conncxx . . $ pvpgn/d2cs/bnetd_conn(2c2f9695855bd8ac).(),bnpacket);
207 }
208 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(bnpacket);
209 }
210 return 0;
211 }
212 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
213 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_createcharreplycxx . . $ pvpgn/t_d2cs_client_createcharreply#));
214 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_CREATECHARREPLYcxx . . $ `src/common/d2cs_protocol.h:75:9`!);
215 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_createcharreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_createcharreply..replycxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_5#reply.,reply);
216 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
217 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
218 }
219 return 0;
220 }
221
222 static int on_client_creategamereqcxx . . $ pvpgn/d2cs/on_client_creategamereq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
223 {
224 char const * gamename;
225 char const * gamepass;
226 char const * gamedesc;
227 t_gamecxx . . $ pvpgn/d2cs/t_game# * game;
228 t_d2gscxx . . $ pvpgn/d2cs/t_d2gs# * gs;
229 t_gqcxx . . $ pvpgn/d2cs/t_gq# * gq;
230 unsigned int tempflag,gameflag;
231 unsigned int leveldiff, maxchar, difficulty, expansion, hardcore, ladder;
232 unsigned int seqno, reply;
233 unsigned int pos;
234 t_elem * elem;
235
236 pos=sizeof(t_client_d2cs_creategamereqcxx . . $ pvpgn/t_client_d2cs_creategamereq#);
237 if (!(gamename=packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet,pos,MAX_GAMENAME_LENcxx . . $ MAX_GAMENAME_LEN.))) {
238 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad game name");
239 return -1;
240 }
241 pos+=stdcxx . . $ std/::strlen(gamename)+1;
242 if (!(gamepass=packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet,pos,MAX_GAMEPASS_LENcxx . . $ MAX_GAMEPASS_LEN.))) {
243 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad game pass");
244 return -1;
245 }
246 pos+=stdcxx . . $ std/::strlen(gamepass)+1;
247 if (!(gamedesc=packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet,pos,MAX_GAMEDESC_LENcxx . . $ MAX_GAMEDESC_LEN.))) {
248 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad game desc");
249 return -1;
250 }
251 tempflag=bn_int_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_creategamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_creategamereq..gameflagcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_6#gameflag.);
252 leveldiff=bn_byte_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_creategamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_creategamereq..leveldiffcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_6#leveldiff.);
253 maxchar=bn_byte_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_creategamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_creategamereq..maxcharcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_6#maxchar.);
254 difficulty=gameflag_get_difficultycxx . . $ `src/d2cs/game.h:65:9`!(tempflag);
255 if (difficulty > conn_get_charinfo_difficultycxx . . $ pvpgn/d2cs/conn_get_charinfo_difficulty(efed4e5eb0be6497).(c)) {
256 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"game difficulty exceed character limit {} {}",difficulty,
257 conn_get_charinfo_difficultycxx . . $ pvpgn/d2cs/conn_get_charinfo_difficulty(efed4e5eb0be6497).(c));
258 return 0;
259 }
260 expansion=conn_get_charinfo_expansioncxx . . $ pvpgn/d2cs/conn_get_charinfo_expansion(efed4e5eb0be6497).(c);
261 hardcore=conn_get_charinfo_hardcorecxx . . $ pvpgn/d2cs/conn_get_charinfo_hardcore(efed4e5eb0be6497).(c);
262 ladder=conn_get_charinfo_laddercxx . . $ pvpgn/d2cs/conn_get_charinfo_ladder(efed4e5eb0be6497).(c);
263 gameflag=gameflag_createcxx . . $ `src/d2cs/game.h:79:9`!(ladder,expansion,hardcore,difficulty);
264
265 gs = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
266 game = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
267 gq=conn_get_gamequeuecxx . . $ pvpgn/d2cs/conn_get_gamequeue(21f4c4cb9db64b4d).(c);
268 if (d2cs_gamelist_find_gamecxx . . $ pvpgn/d2cs/d2cs_gamelist_find_game(6da516f6176bdca0).(gamename)) {
269 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info.,__FUNCTION__,"game name {} is already exist in gamelist",gamename);
270 reply=D2CS_CLIENT_CREATEGAMEREPLY_NAME_EXISTcxx . . $ `src/common/d2cs_protocol.h:113:9`!;
271 } else if (!gq && gqlist_find_gamecxx . . $ pvpgn/d2cs/gqlist_find_game(cb98c57ab88fe94e).(gamename)) {
272 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info.,__FUNCTION__,"game name {} is already exist in game queue",gamename);
273 reply=D2CS_CLIENT_CREATEGAMEREPLY_NAME_EXISTcxx . . $ `src/common/d2cs_protocol.h:113:9`!;
274 } else if (!(gs=d2gslist_choose_servercxx . . $ pvpgn/d2cs/d2gslist_choose_server(b782547d56a6386d).())) {
275 if (gq) {
276 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"client {} is already in game queue",d2cs_conn_get_sessionnumcxx . . $ pvpgn/d2cs/d2cs_conn_get_sessionnum(efed4e5eb0be6497).(c));
277 conn_set_gamequeuecxx . . $ pvpgn/d2cs/conn_set_gamequeue(bd9afd294a72d45a).(c,NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
278 gq_destroycxx . . $ pvpgn/d2cs/gq_destroy(cf9f34ccc49a2ace).(gq,&elem);
279 return 0;
280 } else if ((gq=gq_createcxx . . $ pvpgn/d2cs/gq_create(ef599294f3a56c4e).(d2cs_conn_get_sessionnumcxx . . $ pvpgn/d2cs/d2cs_conn_get_sessionnum(efed4e5eb0be6497).(c), packet, gamename))) {
281 conn_set_gamequeuecxx . . $ pvpgn/d2cs/conn_set_gamequeue(bd9afd294a72d45a).(c,gq);
282 d2cs_send_client_creategamewaitcxx . . $ pvpgn/d2cs/d2cs_send_client_creategamewait(2fb9731f9a7a8931).(c,gqlist_get_lengthcxx . . $ pvpgn/d2cs/gqlist_get_length(db52760e79bf9054).());
283 return 0;
284 }
285 reply=D2CS_CLIENT_CREATEGAMEREPLY_FAILEDcxx . . $ `src/common/d2cs_protocol.h:111:9`!;
286 } else if (hardcore && conn_get_charinfo_deadcxx . . $ pvpgn/d2cs/conn_get_charinfo_dead(efed4e5eb0be6497).(c)) {
287 reply=D2CS_CLIENT_CREATEGAMEREPLY_FAILEDcxx . . $ `src/common/d2cs_protocol.h:111:9`!;
288 } else if (!(game=d2cs_game_createcxx . . $ pvpgn/d2cs/d2cs_game_create(402e99608713bada).(gamename,gamepass,gamedesc,gameflag))) {
289 reply=D2CS_CLIENT_CREATEGAMEREPLY_NAME_EXISTcxx . . $ `src/common/d2cs_protocol.h:113:9`!;
290 } else {
291 reply=D2CS_CLIENT_CREATEGAMEREPLY_SUCCEEDcxx . . $ `src/common/d2cs_protocol.h:110:9`!;
292 game_set_d2gscxx . . $ pvpgn/d2cs/game_set_d2gs(287452e9d86f7c48).(game,gs);
293 d2gs_add_gamenumcxx . . $ pvpgn/d2cs/d2gs_add_gamenum(2f5585d4df0bd933).(gs, 1);
294 game_set_gameflag_laddercxx . . $ pvpgn/d2cs/game_set_gameflag_ladder(b1b6f5a91b93abc1).(game,ladder);
295 game_set_gameflag_expansioncxx . . $ pvpgn/d2cs/game_set_gameflag_expansion(b1b6f5a91b93abc1).(game,expansion);
296 game_set_createdcxx . . $ pvpgn/d2cs/game_set_created(b1b6f5a91b93abc1).(game,0);
297 game_set_leveldiffcxx . . $ pvpgn/d2cs/game_set_leveldiff(b1b6f5a91b93abc1).(game,leveldiff);
298 game_set_charlevelcxx . . $ pvpgn/d2cs/game_set_charlevel(b1b6f5a91b93abc1).(game,conn_get_charinfo_levelcxx . . $ pvpgn/d2cs/conn_get_charinfo_level(efed4e5eb0be6497).(c));
299 game_set_maxcharcxx . . $ pvpgn/d2cs/game_set_maxchar(b1b6f5a91b93abc1).(game,maxchar);
300 game_set_gameflag_difficultycxx . . $ pvpgn/d2cs/game_set_gameflag_difficulty(b1b6f5a91b93abc1).(game,difficulty);
301 game_set_gameflag_hardcorecxx . . $ pvpgn/d2cs/game_set_gameflag_hardcore(b1b6f5a91b93abc1).(game,hardcore);
302 }
303
304 seqno=bn_short_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_creategamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_creategamereq..seqnocxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_6#seqno.);
305 if (reply!=D2CS_CLIENT_CREATEGAMEREPLY_SUCCEEDcxx . . $ `src/common/d2cs_protocol.h:110:9`!) {
306 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
307
308 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
309 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_creategamereplycxx . . $ pvpgn/t_d2cs_client_creategamereply#));
310 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_CREATEGAMEREPLYcxx . . $ `src/common/d2cs_protocol.h:101:9`!);
311 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_creategamereplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_creategamereply..seqnocxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_7#seqno.,seqno);
312 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_creategamereplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_creategamereply..u1cxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_7#u1.,0);
313 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_creategamereplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_creategamereply..gameidcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_7#gameid.,0);
314 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_creategamereplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_creategamereply..replycxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_7#reply.,reply);
315 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
316 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
317 }
318 } else {
319 t_packetcxx . . $ pvpgn/t_packet# * gspacket;
320 t_sqcxx . . $ pvpgn/d2cs/t_sq# * sq;
321 struct in_addr addr;
322
323 if ((gspacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2gscxx . . $ pvpgn/packet_class_d2gs.))) {
324 if ((sq=sq_createcxx . . $ pvpgn/d2cs/sq_create(5729c0f3ffc7f2dd).(d2cs_conn_get_sessionnumcxx . . $ pvpgn/d2cs/d2cs_conn_get_sessionnum(efed4e5eb0be6497).(c),packet,d2cs_game_get_idcxx . . $ pvpgn/d2cs/d2cs_game_get_id(33681cfe92f0a311).(game)))) {
325 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(gspacket,sizeof(t_d2cs_d2gs_creategamereqcxx . . $ pvpgn/t_d2cs_d2gs_creategamereq#));
326 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(gspacket,D2CS_D2GS_CREATEGAMEREQcxx . . $ `src/common/d2cs_d2gs_protocol.h:138:9`!);
327 bn_int_set(&gspacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_d2gs_creategamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_d2gs_creategamereq..hcxx . . $ pvpgn/$anonymous_type_dfcfbe7283f3304a_12#h..seqnocxx . . $ pvpgn/$anonymous_type_dfcfbe7283f3304a_0#seqno.,sq_get_seqnocxx . . $ pvpgn/d2cs/sq_get_seqno(b4250823e36b6ab).(sq));
328 bn_byte_set(&gspacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_d2gs_creategamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_d2gs_creategamereq..difficultycxx . . $ pvpgn/$anonymous_type_dfcfbe7283f3304a_12#difficulty.,difficulty);
329 bn_byte_set(&gspacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_d2gs_creategamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_d2gs_creategamereq..hardcorecxx . . $ pvpgn/$anonymous_type_dfcfbe7283f3304a_12#hardcore.,hardcore);
330 bn_byte_set(&gspacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_d2gs_creategamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_d2gs_creategamereq..expansioncxx . . $ pvpgn/$anonymous_type_dfcfbe7283f3304a_12#expansion.,expansion);
331 bn_byte_set(&gspacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_d2gs_creategamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_d2gs_creategamereq..laddercxx . . $ pvpgn/$anonymous_type_dfcfbe7283f3304a_12#ladder.,ladder);
332 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(gspacket,gamename);
333 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(gspacket,gamepass);
334 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(gspacket,gamedesc);
335 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(gspacket,d2cs_conn_get_accountcxx . . $ pvpgn/d2cs/d2cs_conn_get_account(204e3869d17161f9).(c));
336 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(gspacket,d2cs_conn_get_charnamecxx . . $ pvpgn/d2cs/d2cs_conn_get_charname(204e3869d17161f9).(c));
337 addr.s_addr = htonl(d2cs_conn_get_addrcxx . . $ pvpgn/d2cs/d2cs_conn_get_addr(efed4e5eb0be6497).(c));
338
339 char addrstr[INET_ADDRSTRLENcxx . . $ `<external>/9581057695539925927/in.h:244:9`!] = { 0 };
340 inet_ntop(AF_INETcxx . . $ `<external>/8962547315054503424/socket.h:97:9`!, &(addr), addrstr, sizeof(addrstr));
341 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(gspacket,addrstr);
342 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(d2gs_get_connectioncxx . . $ pvpgn/d2cs/d2gs_get_connection(6e14702ef0a40e9b).(gs),gspacket);
343 }
344 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(gspacket);
345 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info.,__FUNCTION__,"request create game {} on gs {}",gamename,d2gs_get_idcxx . . $ pvpgn/d2cs/d2gs_get_id(986de4a3f93bb0c3).(gs));
346 }
347 }
348 return 0;
349 }
350
351 static int on_client_joingamereqcxx . . $ pvpgn/d2cs/on_client_joingamereq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
352 {
353 char const * gamename;
354 char const * gamepass;
355 char const * charname;
356 char const * account;
357 t_gamecxx . . $ pvpgn/d2cs/t_game# * game;
358 t_d2gscxx . . $ pvpgn/d2cs/t_d2gs# * gs;
359 int reply;
360 unsigned int pos;
361 unsigned int seqno;
362
363 gs = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
364 pos=sizeof(t_client_d2cs_joingamereqcxx . . $ pvpgn/t_client_d2cs_joingamereq#);
365 if (!(gamename=packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet,pos,MAX_GAMENAME_LENcxx . . $ MAX_GAMENAME_LEN.))) {
366 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad game name");
367 return -1;
368 }
369 pos+=stdcxx . . $ std/::strlen(gamename)+1;
370 if (!(gamepass=packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet,pos,MAX_GAMEPASS_LENcxx . . $ MAX_GAMEPASS_LEN.))) {
371 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad game pass");
372 return -1;
373 }
374 if (!(charname=d2cs_conn_get_charnamecxx . . $ pvpgn/d2cs/d2cs_conn_get_charname(204e3869d17161f9).(c))) {
375 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"missing character name for connection");
376 return -1;
377 }
378 if (!(account=d2cs_conn_get_accountcxx . . $ pvpgn/d2cs/d2cs_conn_get_account(204e3869d17161f9).(c))) {
379 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"missing account for connection");
380 return -1;
381 }
382 if (conn_check_multilogincxx . . $ pvpgn/d2cs/conn_check_multilogin(636e7872f5a2b03c).(c,charname)<0) {
383 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"character {} is already logged in",charname);
384 return -1;
385 }
386 if (!(game=d2cs_gamelist_find_gamecxx . . $ pvpgn/d2cs/d2cs_gamelist_find_game(6da516f6176bdca0).(gamename))) {
387 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info.,__FUNCTION__,"game {} not found",gamename);
388 reply=D2CS_CLIENT_JOINGAMEREPLY_NOT_EXISTcxx . . $ `src/common/d2cs_protocol.h:140:9`!;
389 } else if (!(gs=game_get_d2gscxx . . $ pvpgn/d2cs/game_get_d2gs(d8ef2cc2a93b457).(game))) {
390 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"missing game server for game {}",gamename);
391 reply=D2CS_CLIENT_JOINGAMEREPLY_NOT_EXISTcxx . . $ `src/common/d2cs_protocol.h:140:9`!;
392 } else {
393 reply=d2cs_try_joingamecxx . . $ pvpgn/d2cs/d2cs_try_joingame(d50089198af1f705).(c,game,gamepass);
394 }
395
396 seqno=bn_short_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_joingamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_joingamereq..seqnocxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_8#seqno.);
397 if (reply!=D2CS_CLIENT_JOINGAMEREPLY_SUCCEEDcxx . . $ `src/common/d2cs_protocol.h:138:9`!) {
398 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
399
400 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
401 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_joingamereplycxx . . $ pvpgn/t_d2cs_client_joingamereply#));
402 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_JOINGAMEREPLYcxx . . $ `src/common/d2cs_protocol.h:127:9`!);
403 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_joingamereplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_joingamereply..seqnocxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_9#seqno.,seqno);
404 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_joingamereplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_joingamereply..u1cxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_9#u1.,0);
405 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_joingamereplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_joingamereply..gameidcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_9#gameid.,0);
406 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_joingamereplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_joingamereply..addrcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_9#addr.,0);
407 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_joingamereplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_joingamereply..tokencxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_9#token.,0);
408 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_joingamereplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_joingamereply..replycxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_9#reply.,reply);
409 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
410 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
411 }
412 } else {
413 t_packetcxx . . $ pvpgn/t_packet# * gspacket;
414 t_sqcxx . . $ pvpgn/d2cs/t_sq# * sq;
415 struct in_addr addr;
416
417 if ((gspacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2gscxx . . $ pvpgn/packet_class_d2gs.))) {
418 if ((sq=sq_createcxx . . $ pvpgn/d2cs/sq_create(5729c0f3ffc7f2dd).(d2cs_conn_get_sessionnumcxx . . $ pvpgn/d2cs/d2cs_conn_get_sessionnum(efed4e5eb0be6497).(c),packet,d2cs_game_get_idcxx . . $ pvpgn/d2cs/d2cs_game_get_id(33681cfe92f0a311).(game)))) {
419 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(gspacket,sizeof(t_d2cs_d2gs_joingamereqcxx . . $ pvpgn/t_d2cs_d2gs_joingamereq#));
420 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(gspacket,D2CS_D2GS_JOINGAMEREQcxx . . $ `src/common/d2cs_d2gs_protocol.h:168:9`!);
421 bn_int_set(&gspacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_d2gs_joingamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_d2gs_joingamereq..hcxx . . $ pvpgn/$anonymous_type_dfcfbe7283f3304a_14#h..seqnocxx . . $ pvpgn/$anonymous_type_dfcfbe7283f3304a_0#seqno.,sq_get_seqnocxx . . $ pvpgn/d2cs/sq_get_seqno(b4250823e36b6ab).(sq));
422 bn_int_set(&gspacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_d2gs_joingamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_d2gs_joingamereq..gameidcxx . . $ pvpgn/$anonymous_type_dfcfbe7283f3304a_14#gameid.,
423 game_get_d2gs_gameidcxx . . $ pvpgn/d2cs/game_get_d2gs_gameid(33681cfe92f0a311).(game));
424 sq_set_gametokencxx . . $ pvpgn/d2cs/sq_set_gametoken(7475dc365c93b47d).(sq,d2gs_make_tokencxx . . $ pvpgn/d2cs/d2gs_make_token(d57e063c543b4bce).(gs));
425 bn_int_set(&gspacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_d2gs_joingamereqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_d2gs_joingamereq..tokencxx . . $ pvpgn/$anonymous_type_dfcfbe7283f3304a_14#token.,sq_get_gametokencxx . . $ pvpgn/d2cs/sq_get_gametoken(b4250823e36b6ab).(sq));
426 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(gspacket,charname);
427 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(gspacket,account);
428 addr.s_addr = htonl(d2cs_conn_get_addrcxx . . $ pvpgn/d2cs/d2cs_conn_get_addr(efed4e5eb0be6497).(c));
429
430 char addrstr[INET_ADDRSTRLENcxx . . $ `<external>/9581057695539925927/in.h:244:9`!] = { 0 };
431 inet_ntop(AF_INETcxx . . $ `<external>/8962547315054503424/socket.h:97:9`!, &(addr), addrstr, sizeof(addrstr));
432 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(gspacket,addrstr);
433 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(d2gs_get_connectioncxx . . $ pvpgn/d2cs/d2gs_get_connection(6e14702ef0a40e9b).(gs),gspacket);
434 }
435 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(gspacket);
436 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info.,__FUNCTION__,"request join game {} for character {} on gs {}",gamename,
437 charname,d2gs_get_idcxx . . $ pvpgn/d2cs/d2gs_get_id(986de4a3f93bb0c3).(gs));
438 }
439 }
440 return 0;
441 }
442
443 static int on_client_gamelistreqcxx . . $ pvpgn/d2cs/on_client_gamelistreq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
444 {
445 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
446 t_gamecxx . . $ pvpgn/d2cs/t_game# * game;
447 unsigned int count;
448 unsigned int seqno;
449 stdcxx . . $ std/::time_tcxx . . $ std/time_t# now;
450 unsigned int maxlifetime;
451 t_elem const * start_elem;
452 t_elem const * elem;
453
454 seqno=bn_short_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_gamelistreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_gamelistreq..seqnocxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_10#seqno.);
455 /* if (seqno%2) return 0; */
456 count=0;
457 now=stdcxx . . $ std/::timecxx . . $ std/time(a7cd306b2d326b09).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
458 maxlifetime=prefs_get_game_maxlifetimecxx . . $ pvpgn/d2cs/prefs_get_game_maxlifetime(db52760e79bf9054).();
459
460 elem=start_elem=gamelist_get_curr_elemcxx . . $ pvpgn/d2cs/gamelist_get_curr_elem(522bdc31dc152862).();
461 if (!elem) elem=list_get_first_const(d2cs_gamelistcxx . . $ pvpgn/d2cs/d2cs_gamelist(7a6cb11de248e2c9).());
462 else elem=elem_get_next_const(d2cs_gamelistcxx . . $ pvpgn/d2cs/d2cs_gamelist(7a6cb11de248e2c9).(),elem);
463
464 for (; elem != start_elem; elem=elem_get_next_const(d2cs_gamelistcxx . . $ pvpgn/d2cs/d2cs_gamelist(7a6cb11de248e2c9).(),elem)) {
465 if (!elem) {
466 elem=list_get_first_const(d2cs_gamelistcxx . . $ pvpgn/d2cs/d2cs_gamelist(7a6cb11de248e2c9).());
467 if (elem == start_elem) break;
468 }
469 if (!(game=(t_gamecxx . . $ pvpgn/d2cs/t_game#*)elem_get_data(elem))) {
470 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got NULL game");
471 break;
472 }
473 if (maxlifetime && (now-game->create_timecxx . . $ pvpgn/d2cs/$anonymous_type_24810558b88c8e5a_1#create_time.>maxlifetime)) continue;
474 if (!game_get_currcharcxx . . $ pvpgn/d2cs/game_get_currchar(33681cfe92f0a311).(game)) continue;
475 if (!prefs_allow_gamelist_showallcxx . . $ pvpgn/d2cs/prefs_allow_gamelist_showall(db52760e79bf9054).()) {
476 if (conn_get_charinfo_difficultycxx . . $ pvpgn/d2cs/conn_get_charinfo_difficulty(efed4e5eb0be6497).(c)!=game_get_gameflag_difficultycxx . . $ pvpgn/d2cs/game_get_gameflag_difficulty(33681cfe92f0a311).(game)) continue;
477 }
478 if (prefs_hide_pass_gamescxx . . $ pvpgn/d2cs/prefs_hide_pass_games(db52760e79bf9054).())
479 if (d2cs_game_get_passcxx . . $ pvpgn/d2cs/d2cs_game_get_pass(d16e89b4cf68b40f).(game)) continue;
480
481 if (d2cs_try_joingamecxx . . $ pvpgn/d2cs/d2cs_try_joingame(d50089198af1f705).(c,game,"")!=D2CS_CLIENT_JOINGAMEREPLY_SUCCEEDcxx . . $ `src/common/d2cs_protocol.h:138:9`!) continue;
482 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
483 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_gamelistreplycxx . . $ pvpgn/t_d2cs_client_gamelistreply#));
484 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_GAMELISTREPLYcxx . . $ `src/common/d2cs_protocol.h:160:9`!);
485 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gamelistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gamelistreply..seqnocxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_11#seqno.,seqno);
486 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gamelistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gamelistreply..tokencxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_11#token.,d2cs_game_get_idcxx . . $ pvpgn/d2cs/d2cs_game_get_id(33681cfe92f0a311).(game));
487 bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gamelistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gamelistreply..currcharcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_11#currchar.,game_get_currcharcxx . . $ pvpgn/d2cs/game_get_currchar(33681cfe92f0a311).(game));
488 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gamelistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gamelistreply..gameflagcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_11#gameflag.,game_get_gameflagcxx . . $ pvpgn/d2cs/game_get_gameflag(33681cfe92f0a311).(game));
489 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,d2cs_game_get_namecxx . . $ pvpgn/d2cs/d2cs_game_get_name(d16e89b4cf68b40f).(game));
490 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,game_get_desccxx . . $ pvpgn/d2cs/game_get_desc(d16e89b4cf68b40f).(game));
491 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
492 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
493 count++;
494 if (prefs_get_maxgamelistcxx . . $ pvpgn/d2cs/prefs_get_maxgamelist(db52760e79bf9054).() && count>=prefs_get_maxgamelistcxx . . $ pvpgn/d2cs/prefs_get_maxgamelist(db52760e79bf9054).()) break;
495 }
496 }
497 gamelist_set_curr_elemcxx . . $ pvpgn/d2cs/gamelist_set_curr_elem(d3a4f890f2ebf374).(elem);
498 if (count) {
499 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
500 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_gamelistreplycxx . . $ pvpgn/t_d2cs_client_gamelistreply#));
501 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_GAMELISTREPLYcxx . . $ `src/common/d2cs_protocol.h:160:9`!);
502 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gamelistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gamelistreply..seqnocxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_11#seqno.,seqno);
503 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gamelistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gamelistreply..tokencxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_11#token.,0);
504 bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gamelistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gamelistreply..currcharcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_11#currchar.,0);
505 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gamelistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gamelistreply..gameflagcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_11#gameflag.,0);
506 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,"");
507 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,"");
508 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,"");
509 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
510 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
511 }
512 }
513 return 0;
514 }
515
516 static int on_client_gameinforeqcxx . . $ pvpgn/d2cs/on_client_gameinforeq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
517 {
518 t_game_charinfocxx . . $ pvpgn/d2cs/t_game_charinfo# * info;
519 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
520 char const * gamename;
521 t_gamecxx . . $ pvpgn/d2cs/t_game# * game;
522 unsigned int seqno, n;
523
524 if (!(gamename=packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet,sizeof(t_client_d2cs_gameinforeqcxx . . $ pvpgn/t_client_d2cs_gameinforeq#),MAX_GAMENAME_LENcxx . . $ MAX_GAMENAME_LEN.))) {
525 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad game name");
526 return -1;
527 }
528 if (!(game=d2cs_gamelist_find_gamecxx . . $ pvpgn/d2cs/d2cs_gamelist_find_game(6da516f6176bdca0).(gamename))) {
529 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"game {} not found",gamename);
530 return 0;
531 }
532 seqno=bn_short_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_gameinforeqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_gameinforeq..seqnocxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_12#seqno.);
533 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
534 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_gameinforeplycxx . . $ pvpgn/t_d2cs_client_gameinforeply#));
535 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_GAMEINFOREPLYcxx . . $ `src/common/d2cs_protocol.h:180:9`!);
536 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gameinforeplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gameinforeply..seqnocxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_13#seqno.,seqno);
537 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gameinforeplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gameinforeply..gameflagcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_13#gameflag.,game_get_gameflagcxx . . $ pvpgn/d2cs/game_get_gameflag(33681cfe92f0a311).(game));
538 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gameinforeplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gameinforeply..etimecxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_13#etime.,stdcxx . . $ std/::timecxx . . $ std/time(a7cd306b2d326b09).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)-d2cs_game_get_create_timecxx . . $ pvpgn/d2cs/d2cs_game_get_create_time(b198e66ed4b75071).(game));
539 bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gameinforeplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gameinforeply..charlevelcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_13#charlevel.,game_get_charlevelcxx . . $ pvpgn/d2cs/game_get_charlevel(33681cfe92f0a311).(game));
540 bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gameinforeplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gameinforeply..leveldiffcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_13#leveldiff.,game_get_leveldiffcxx . . $ pvpgn/d2cs/game_get_leveldiff(33681cfe92f0a311).(game));
541 bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gameinforeplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gameinforeply..maxcharcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_13#maxchar.,game_get_maxcharcxx . . $ pvpgn/d2cs/game_get_maxchar(33681cfe92f0a311).(game));
542 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket, game_get_desccxx . . $ pvpgn/d2cs/game_get_desc(d16e89b4cf68b40f).(game) ? game_get_desccxx . . $ pvpgn/d2cs/game_get_desc(d16e89b4cf68b40f).(game) : NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
543
544 n=0;
545 BEGIN_LIST_TRAVERSE_DATA_CONSTcxx . . $ `src/d2cs/setup.h:35:9`!(game_get_charlist(game),info,t_game_charinfo)
546 {
547 if (!info->charnamecxx . . $ pvpgn/d2cs/$anonymous_type_24810558b88c8e5a_0#charname.) {
548 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got NULL charname in game {} char list",gamename);
549 continue;
550 }
551 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,info->charnamecxx . . $ pvpgn/d2cs/$anonymous_type_24810558b88c8e5a_0#charname.);
552 bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gameinforeplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gameinforeply..chclasscxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_13#chclass.[n],info->chclasscxx . . $ pvpgn/d2cs/$anonymous_type_24810558b88c8e5a_0#chclass.);
553 /* GUI is limited to a max level of 255 */
554 if (info->levelcxx . . $ pvpgn/d2cs/$anonymous_type_24810558b88c8e5a_0#level. < 255) {
555 bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gameinforeplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gameinforeply..levelcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_13#level.[n],info->levelcxx . . $ pvpgn/d2cs/$anonymous_type_24810558b88c8e5a_0#level.);
556 } else {
557 bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gameinforeplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gameinforeply..levelcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_13#level.[n], 255);
558 }
559 n++;
560 }
561 END_LIST_TRAVERSE_DATA_CONSTcxx . . $ `src/d2cs/setup.h:41:9`!()
562
563 bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_gameinforeplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_gameinforeply..currcharcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_13#currchar.,n);
564 if (n!=game_get_currcharcxx . . $ pvpgn/d2cs/game_get_currchar(33681cfe92f0a311).(game)) {
565 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"game {} character list corrupted",gamename);
566 }
567 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
568 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
569 }
570 return 0;
571 }
572
573 static int on_client_charloginreqcxx . . $ pvpgn/d2cs/on_client_charloginreq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
574 {
575 t_packetcxx . . $ pvpgn/t_packet# * bnpacket;
576 char const * charname;
577 char const * account;
578 t_sqcxx . . $ pvpgn/d2cs/t_sq# * sq;
579 t_d2charinfo_filecxx . . $ pvpgn/t_d2charinfo_file# data;
580 unsigned int expire_time;
581
582 if (!(charname=packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet,sizeof(t_client_d2cs_charloginreqcxx . . $ pvpgn/t_client_d2cs_charloginreq#),MAX_CHARNAME_LENcxx . . $ MAX_CHARNAME_LEN.))) {
583 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad character name");
584 return -1;
585 }
586 if (!(account=d2cs_conn_get_accountcxx . . $ pvpgn/d2cs/d2cs_conn_get_account(204e3869d17161f9).(c))) {
587 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"missing account for connection");
588 return -1;
589 }
590 if (d2charinfo_loadcxx . . $ pvpgn/d2cs/d2charinfo_load(aca657f4e6b90ade).(account,charname,&data)<0) {
591 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"error loading charinfo for character {}(*{})",charname,account);
592 return -1;
593 } else if (!bnetd_conncxx . . $ pvpgn/d2cs/bnetd_conn(2c2f9695855bd8ac).()) {
594 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"no bnetd connection available,character login rejected");
595 return -1;
596 }
597 expire_time = prefs_get_char_expire_timecxx . . $ pvpgn/d2cs/prefs_get_char_expire_time(db52760e79bf9054).();
598 if (expire_time && (stdcxx . . $ std/::timecxx . . $ std/time(a7cd306b2d326b09).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) > bn_int_get(data.headercxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#header..last_timecxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_0#last_time.) + expire_time)) {
599 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
600
601 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
602 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_charloginreplycxx . . $ pvpgn/t_d2cs_client_charloginreply#));
603 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_CHARLOGINREPLYcxx . . $ `src/common/d2cs_protocol.h:204:9`!);
604 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_charloginreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_charloginreply..replycxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_15#reply., D2CS_CLIENT_CHARLOGINREPLY_EXPIREDcxx . . $ `src/common/d2cs_protocol.h:213:9`!);
605 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
606 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
607 }
608 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info.,__FUNCTION__,"character {}(*{}) login rejected due to char expired",charname,account);
609 return 0;
610 }
611
612 conn_set_charinfocxx . . $ pvpgn/d2cs/conn_set_charinfo(e7ef76122ed37433).(c,&data.summarycxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#summary.);
613 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_infocxx . . $ pvpgn/eventlog_level_info.,__FUNCTION__,"got character {}(*{}) login request",charname,account);
614 if ((bnpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cs_bnetdcxx . . $ pvpgn/packet_class_d2cs_bnetd.))) {
615 if ((sq=sq_createcxx . . $ pvpgn/d2cs/sq_create(5729c0f3ffc7f2dd).(d2cs_conn_get_sessionnumcxx . . $ pvpgn/d2cs/d2cs_conn_get_sessionnum(efed4e5eb0be6497).(c),packet,0))) {
616 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(bnpacket,sizeof(t_d2cs_bnetd_charloginreqcxx . . $ pvpgn/t_d2cs_bnetd_charloginreq#));
617 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(bnpacket,D2CS_BNETD_CHARLOGINREQcxx . . $ `src/common/d2cs_bnetd_protocol.h:82:9`!);
618 bn_int_set(&bnpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_bnetd_charloginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_bnetd_charloginreq..hcxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_7#h..seqnocxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_0#seqno.,sq_get_seqnocxx . . $ pvpgn/d2cs/sq_get_seqno(b4250823e36b6ab).(sq));
619 bn_int_set(&bnpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_bnetd_charloginreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_bnetd_charloginreq..sessionnumcxx . . $ pvpgn/$anonymous_type_b0a976df95fb5a1_7#sessionnum.,
620 conn_get_bnetd_sessionnumcxx . . $ pvpgn/d2cs/conn_get_bnetd_sessionnum(efed4e5eb0be6497).(c));
621 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(bnpacket,charname);
622 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(bnpacket,(char const *)&data.portraitcxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#portrait.);
623 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(bnetd_conncxx . . $ pvpgn/d2cs/bnetd_conn(2c2f9695855bd8ac).(),bnpacket);
624 }
625 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(bnpacket);
626 }
627 return 0;
628 }
629
630 static int on_client_deletecharreqcxx . . $ pvpgn/d2cs/on_client_deletecharreq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
631 {
632 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
633 char const * charname;
634 char const * account;
635 unsigned int reply;
636
637 if (!(charname=packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet,sizeof(t_client_d2cs_deletecharreqcxx . . $ pvpgn/t_client_d2cs_deletecharreq#),MAX_CHARNAME_LENcxx . . $ MAX_CHARNAME_LEN.))) {
638 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad character name");
639 return -1;
640 }
641 if (conn_check_multilogincxx . . $ pvpgn/d2cs/conn_check_multilogin(636e7872f5a2b03c).(c,charname)<0) {
642 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"character {} is already logged in",charname);
643 return -1;
644 }
645 d2cs_conn_set_charnamecxx . . $ pvpgn/d2cs/d2cs_conn_set_charname(127e6fcf538cb408).(c,NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
646 account=d2cs_conn_get_accountcxx . . $ pvpgn/d2cs/d2cs_conn_get_account(204e3869d17161f9).(c);
647 if (d2char_deletecxx . . $ pvpgn/d2cs/d2char_delete(5ae29d726ae57f88).(account,charname)<0) {
648 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"failed to delete character {}(*{})",charname,account);
649 reply = D2CS_CLIENT_DELETECHARREPLY_FAILEDcxx . . $ `src/common/d2cs_protocol.h:231:9`!;
650 } else {
651 reply = D2CS_CLIENT_DELETECHARREPLY_SUCCEEDcxx . . $ `src/common/d2cs_protocol.h:230:9`!;
652 }
653 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
654 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_deletecharreplycxx . . $ pvpgn/t_d2cs_client_deletecharreply#));
655 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_DELETECHARREPLYcxx . . $ `src/common/d2cs_protocol.h:223:9`!);
656 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_deletecharreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_deletecharreply..u1cxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_17#u1.,0);
657 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_deletecharreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_deletecharreply..replycxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_17#reply.,reply);
658 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
659 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
660 }
661 return 0;
662 }
663
664 static int on_client_ladderreqcxx . . $ pvpgn/d2cs/on_client_ladderreq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
665 {
666 unsigned char type;
667 unsigned short start_pos;
668
669 type=bn_byte_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_ladderreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_ladderreq..typecxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_18#type.);
670 start_pos=bn_short_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_ladderreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_ladderreq..start_poscxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_18#start_pos.);
671 d2cs_send_client_laddercxx . . $ pvpgn/d2cs/d2cs_send_client_ladder(99c542d0a67da9ed).(c,type,start_pos);
672 return 0;
673 }
674
675 static int d2cs_send_client_laddercxx . . $ pvpgn/d2cs/d2cs_send_client_ladder(99c542d0a67da9ed).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, unsigned char type, unsigned short from)
676 {
677 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
678 t_d2cs_client_ladderinfocxx . . $ pvpgn/t_d2cs_client_ladderinfo# const * ladderinfo;
679 unsigned int curr_len, cont_len, total_len;
680 t_d2cs_client_ladderheadercxx . . $ pvpgn/t_d2cs_client_ladderheader# ladderheader;
681 t_d2cs_client_ladderinfoheadercxx . . $ pvpgn/t_d2cs_client_ladderinfoheader# infoheader;
682 unsigned int start_pos, count, count_per_packet, npacket;
683 unsigned int i, n, curr_pos;
684
685 start_pos=from;
686 count=prefs_get_ladderlist_countcxx . . $ pvpgn/d2cs/prefs_get_ladderlist_count(db52760e79bf9054).();
687 if (d2ladder_get_laddercxx . . $ pvpgn/d2cs/d2ladder_get_ladder(baac11ba510fb44d).(&start_pos,&count,type,&ladderinfo)<0) {
688 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"error get ladder for type {} start_pos {}",type,from);
689 return 0;
690 }
691
692 count_per_packet=14;
693 npacket=count/count_per_packet;
694 if (count % count_per_packet) npacket++;
695
696 curr_len=0;
697 cont_len=0;
698 total_len = count * sizeof(*ladderinfo) + sizeof(ladderheader) + sizeof(infoheader) * npacket;
699 total_len -= 4;
700 bn_short_set(&ladderheader.start_poscxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_20#start_pos.,start_pos);
701 bn_short_set(&ladderheader.u1cxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_20#u1.,0);
702 bn_int_set(&ladderheader.count1cxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_20#count1.,count);
703
704 for (i=0; i< npacket; i++) {
705 curr_len=0;
706 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
707 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_ladderreplycxx . . $ pvpgn/t_d2cs_client_ladderreply#));
708 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_LADDERREPLYcxx . . $ `src/common/d2cs_protocol.h:242:9`!);
709 bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_ladderreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_ladderreply..typecxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_19#type., type);
710 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_ladderreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_ladderreply..total_lencxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_19#total_len., total_len);
711 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_ladderreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_ladderreply..cont_lencxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_19#cont_len.,cont_len);
712 if (i==0) {
713 bn_int_set(&infoheader.count2cxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_21#count2.,count);
714 packet_append_datacxx . . $ pvpgn/packet_append_data(d82347a7305550af).(rpacket,&ladderheader,sizeof(ladderheader));
715 curr_len += sizeof(ladderheader);
716 } else {
717 bn_int_set(&infoheader.count2cxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_21#count2.,0);
718 }
719 packet_append_datacxx . . $ pvpgn/packet_append_data(d82347a7305550af).(rpacket,&infoheader,sizeof(infoheader));
720 curr_len += sizeof(infoheader);
721 for (n=0; n< count_per_packet; n++) {
722 curr_pos = n + i * count_per_packet;
723 if (curr_pos >= count) break;
724 packet_append_datacxx . . $ pvpgn/packet_append_data(d82347a7305550af).(rpacket, ladderinfo+curr_pos, sizeof(*ladderinfo));
725 curr_len += sizeof(*ladderinfo);
726 }
727 if (i==0) {
728 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket, packet_get_sizecxx . . $ pvpgn/packet_get_size(e4ac9e2b4744cb4b).(rpacket)-4);
729 curr_len -= 4;
730 }
731 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_ladderreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_ladderreply..curr_lencxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_19#curr_len.,curr_len);
732 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
733 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
734 }
735 cont_len += curr_len;
736 }
737 return 0;
738 }
739
740 #define MAX_MOTD_LENGTHcxx . . $ `src/d2cs/handle_d2cs.cpp:740:9`! 511
741 static int on_client_motdreqcxx . . $ pvpgn/d2cs/on_client_motdreq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
742 {
743 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
744 char * motd;
745 int motd_len;
746
747 if (!packet)
748 return -1;
749
750 /* client will crash if motd is too long */
751 motd = xstrdupcxx . . $ `src/common/xalloc.h:49:9`!(prefs_get_motd());
752 motd_len = stdcxx . . $ std/::strlen(motd);
753 if (motd_len > MAX_MOTD_LENGTHcxx . . $ `src/d2cs/handle_d2cs.cpp:740:9`!) {
754 WARN2cxx . . $ `src/common/eventlog.h:80:9`!("motd length ({}) exceeds maximun value ({})",motd_len,MAX_MOTD_LENGTHcxx . . $ `src/d2cs/handle_d2cs.cpp:740:9`!);
755 motd[MAX_MOTD_LENGTHcxx . . $ `src/d2cs/handle_d2cs.cpp:740:9`!]='\0';
756 }
757 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
758 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_motdreplycxx . . $ pvpgn/t_d2cs_client_motdreply#));
759 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_MOTDREPLYcxx . . $ `src/common/d2cs_protocol.h:287:9`!);
760 bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_motdreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_motdreply..u1cxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_24#u1.,0);
761 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,motd);
762 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
763 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
764 }
765 xfreecxx . . $ `src/common/xalloc.h:51:9`!(motd);
766 return 0;
767 }
768
769 static int on_client_cancelcreategamecxx . . $ pvpgn/d2cs/on_client_cancelcreategame(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
770 {
771 t_gqcxx . . $ pvpgn/d2cs/t_gq# * gq;
772 t_elem * elem;
773
774 if (!packet)
775 return -1;
776
777 if (!(gq=conn_get_gamequeuecxx . . $ pvpgn/d2cs/conn_get_gamequeue(21f4c4cb9db64b4d).(c))) {
778 return 0;
779 }
780 conn_set_gamequeuecxx . . $ pvpgn/d2cs/conn_set_gamequeue(bd9afd294a72d45a).(c,NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
781 gq_destroycxx . . $ pvpgn/d2cs/gq_destroy(cf9f34ccc49a2ace).(gq,&elem);
782 return 0;
783 }
784
785 static int on_client_charladderreqcxx . . $ pvpgn/d2cs/on_client_charladderreq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
786 {
787 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
788 char const * charname;
789 unsigned int expansion, hardcore, type;
790 int pos;
791
792 if (!(charname=packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet,sizeof(t_client_d2cs_charladderreqcxx . . $ pvpgn/t_client_d2cs_charladderreq#),MAX_CHARNAME_LENcxx . . $ MAX_CHARNAME_LEN.))) {
793 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad character name");
794 return -1;
795 }
796 expansion=bn_int_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_charladderreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_charladderreq..expansioncxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_27#expansion.);
797 hardcore=bn_int_get(packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..client_d2cs_charladderreqcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#client_d2cs_charladderreq..hardcorecxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_27#hardcore.);
798 type=0; /* avoid warning */
799 if (hardcore && expansion) {
800 type=D2LADDER_EXP_HC_OVERALLcxx . . $ `src/common/d2cs_d2dbs_ladder.h:56:9`!;
801 } else if (!hardcore && expansion) {
802 type=D2LADDER_EXP_STD_OVERALLcxx . . $ `src/common/d2cs_d2dbs_ladder.h:57:9`!;
803 } else if (hardcore && !expansion) {
804 type=D2LADDER_HC_OVERALLcxx . . $ `src/common/d2cs_d2dbs_ladder.h:54:9`!;
805 } else if (!hardcore && !expansion) {
806 type=D2LADDER_STD_OVERALLcxx . . $ `src/common/d2cs_d2dbs_ladder.h:55:9`!;
807 }
808 if ((pos=d2ladder_find_character_poscxx . . $ pvpgn/d2cs/d2ladder_find_character_pos(dbfc9165c1ea8dea).(type,charname))<0) {
809 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
810 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_ladderreplycxx . . $ pvpgn/t_d2cs_client_ladderreply#));
811 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_LADDERREPLYcxx . . $ `src/common/d2cs_protocol.h:242:9`!);
812 bn_byte_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_ladderreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_ladderreply..typecxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_19#type., type);
813 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_ladderreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_ladderreply..total_lencxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_19#total_len.,0);
814 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_ladderreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_ladderreply..curr_lencxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_19#curr_len.,0);
815 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_ladderreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_ladderreply..cont_lencxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_19#cont_len.,0);
816 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
817 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
818 }
819 return 0;
820 }
821 pos -= prefs_get_ladderlist_countcxx . . $ pvpgn/d2cs/prefs_get_ladderlist_count(db52760e79bf9054).()/2;
822 if (pos < 0) pos=0;
823 d2cs_send_client_laddercxx . . $ pvpgn/d2cs/d2cs_send_client_ladder(99c542d0a67da9ed).(c,type,pos);
824 return 0;
825 }
826
827 static int on_client_charlistreqcxx . . $ pvpgn/d2cs/on_client_charlistreq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
828 {
829 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
830 char const * account;
831 char const * charname;
832 char * path;
833 t_d2charinfo_filecxx . . $ pvpgn/t_d2charinfo_file# * charinfo;
834 unsigned int n, maxchar;
835 t_elistcxx . . $ pvpgn/t_elist# charlist_head;
836 char const * charlist_sort_order;
837
838 if (!packet)
839 return -1;
840
841 if (!(account=d2cs_conn_get_accountcxx . . $ pvpgn/d2cs/d2cs_conn_get_account(204e3869d17161f9).(c))) {
842 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"missing account for connection");
843 return -1;
844 }
845 path=(char*)xmalloccxx . . $ `src/common/xalloc.h:43:9`!(std::strlen(prefs_get_charinfo_dir())+1+std::strlen(account)+1);
846 charlist_sort_order = prefs_get_charlist_sort_ordercxx . . $ pvpgn/d2cs/prefs_get_charlist_sort_order(33a1f659e94feb42).();
847
848 elist_initcxx . . $ `src/common/elist.h:193:9`!(&charlist_head);
849
850 d2char_get_infodir_namecxx . . $ pvpgn/d2cs/d2char_get_infodir_name(e4809bc172bbfbe1).(path,account);
851 maxchar=prefs_get_maxcharcxx . . $ pvpgn/d2cs/prefs_get_maxchar(db52760e79bf9054).();
852 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
853 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_charlistreplycxx . . $ pvpgn/t_d2cs_client_charlistreply#));
854 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_CHARLISTREPLYcxx . . $ `src/common/d2cs_protocol.h:326:9`!);
855 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_charlistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_charlistreply..u1cxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_29#u1.,0);
856 n=0;
857 try {
858 Directorycxx . . $ pvpgn/Directory# dircxx . . $ pvpgn/Directory#Directory(a3b17e0268c60856).(pathcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).);
859 while ((charname=dir.readcxx . . $ pvpgn/Directory#read(a9f41ea0e82d88cf).())) {
860 charinfo = (t_d2charinfo_filecxx . . $ pvpgn/t_d2charinfo_file#*)xmalloccxx . . $ `src/common/xalloc.h:43:9`!(sizeof(t_d2charinfo_file));
861 if (d2charinfo_loadcxx . . $ pvpgn/d2cs/d2charinfo_load(aca657f4e6b90ade).(account,charname,charinfo)<0) {
862 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"error loading charinfo for {}(*{})",charname,account);
863 xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)charinfo);
864 continue;
865 }
866 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_debugcxx . . $ pvpgn/eventlog_level_debug.,__FUNCTION__,"adding char {} (*{})", charname, account);
867 d2charlist_add_charcxx . . $ pvpgn/d2cs/d2charlist_add_char(c7d3c8db93118531).(&charlist_head,charinfo,0);
868 n++;
869 if (n>=maxchar) break;
870 }
871 if (prefs_allow_newcharcxx . . $ pvpgn/d2cs/prefs_allow_newchar(db52760e79bf9054).() && (n<maxchar)) {
872 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_charlistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_charlistreply..maxcharcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_29#maxchar.,maxchar);
873 } else {
874 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_charlistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_charlistreply..maxcharcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_29#maxchar.,0);
875 }
876 if (!stdcxx . . $ std/::strcmp(charlist_sort_order, "ASC"))
877 {
878 t_elistcxx . . $ pvpgn/t_elist# * curr, * safe;
879 t_d2charlistcxx . . $ pvpgn/d2cs/t_d2charlist# * ccharlist;
880
881 elist_for_each_safecxx . . $ `src/common/elist.h:238:9`!(curr,&charlist_head,safe)
882 {
883 ccharlist = elist_entrycxx . . $ `src/common/elist.h:228:9`!(curr,t_d2charlist,list);
884 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,(char*)ccharlist->charinfocxx . . $ pvpgn/d2cs/d2charlist#charinfo.->headercxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#header..charnamecxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_0#charname.);
885 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,(char *)&ccharlist->charinfocxx . . $ pvpgn/d2cs/d2charlist#charinfo.->portraitcxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#portrait.);
886 xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)ccharlist->charinfo);
887 xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)ccharlist);
888 }
889 }
890 else
891 {
892 t_elistcxx . . $ pvpgn/t_elist# * curr, * safe;
893 t_d2charlistcxx . . $ pvpgn/d2cs/t_d2charlist# * ccharlist;
894
895 elist_for_each_safe_revcxx . . $ `src/common/elist.h:242:9`!(curr,&charlist_head,safe)
896 {
897 ccharlist = elist_entrycxx . . $ `src/common/elist.h:228:9`!(curr,t_d2charlist,list);
898 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,(char*)ccharlist->charinfocxx . . $ pvpgn/d2cs/d2charlist#charinfo.->headercxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#header..charnamecxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_0#charname.);
899 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,(char *)&ccharlist->charinfocxx . . $ pvpgn/d2cs/d2charlist#charinfo.->portraitcxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#portrait.);
900 xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)ccharlist->charinfo);
901 xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)ccharlist);
902
903 }
904 }
905 } catch(const Directorycxx . . $ pvpgn/Directory#::OpenErrorcxx . . $ pvpgn/Directory#OpenError#&) {
906 INFO1cxx . . $ `src/common/eventlog.h:84:9`!("(*{}) charinfo directory do not exist, building it",account);
907 p_mkdircxx . . $ `src/compat/mkdir.h:51:11`!(path,S_IRWXUcxx . . $ `<external>/14710646456994434043/fcntl.h:109:10`!);
908 }
909 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_charlistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_charlistreply..currcharcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_29#currchar.,n);
910 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_charlistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_charlistreply..currchar2cxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_29#currchar2.,n);
911 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
912 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
913 }
914 xfreecxx . . $ `src/common/xalloc.h:51:9`!(path);
915 return 0;
916 }
917
918 static int on_client_charlistreq_110cxx . . $ pvpgn/d2cs/on_client_charlistreq_110(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
919 {
920 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
921 char const * account;
922 char const * charname;
923 char * path;
924
925 t_d2charinfo_filecxx . . $ pvpgn/t_d2charinfo_file# * charinfo;
926 unsigned int n, maxchar;
927 t_elistcxx . . $ pvpgn/t_elist# charlist_head;
928
929 unsigned int exp_time;
930 unsigned int curr_exp_time;
931 char const * charlist_sort_order;
932
933 if (!packet)
934 return -1;
935
936 if (!(account=d2cs_conn_get_accountcxx . . $ pvpgn/d2cs/d2cs_conn_get_account(204e3869d17161f9).(c))) {
937 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"missing account for connection");
938 return -1;
939 }
940 path=(char*)xmalloccxx . . $ `src/common/xalloc.h:43:9`!(std::strlen(prefs_get_charinfo_dir())+1+std::strlen(account)+1);
941 charlist_sort_order = prefs_get_charlist_sort_ordercxx . . $ pvpgn/d2cs/prefs_get_charlist_sort_order(33a1f659e94feb42).();
942
943 elist_initcxx . . $ `src/common/elist.h:193:9`!(&charlist_head);
944
945 d2char_get_infodir_namecxx . . $ pvpgn/d2cs/d2char_get_infodir_name(e4809bc172bbfbe1).(path,account);
946 if (prefs_allow_newcharcxx . . $ pvpgn/d2cs/prefs_allow_newchar(db52760e79bf9054).())
947 maxchar=prefs_get_maxcharcxx . . $ pvpgn/d2cs/prefs_get_maxchar(db52760e79bf9054).();
948 else
949 maxchar=0;
950
951 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
952 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_charlistreply_110cxx . . $ pvpgn/t_d2cs_client_charlistreply_110#));
953 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_CHARLISTREPLY_110cxx . . $ `src/common/d2cs_protocol.h:364:9`!);
954 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_charlistreply_110cxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_charlistreply_110..u1cxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_33#u1.,0);
955 n=0;
956 try {
957 Directorycxx . . $ pvpgn/Directory# dircxx . . $ pvpgn/Directory#Directory(a3b17e0268c60856).(pathcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).);
958
959 exp_time = prefs_get_char_expire_timecxx . . $ pvpgn/d2cs/prefs_get_char_expire_time(db52760e79bf9054).();
960 while ((charname=dir.readcxx . . $ pvpgn/Directory#read(a9f41ea0e82d88cf).())) {
961 charinfo = (t_d2charinfo_filecxx . . $ pvpgn/t_d2charinfo_file#*)xmalloccxx . . $ `src/common/xalloc.h:43:9`!(sizeof(t_d2charinfo_file));
962 if (d2charinfo_loadcxx . . $ pvpgn/d2cs/d2charinfo_load(aca657f4e6b90ade).(account,charname,charinfo)<0) {
963 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"error loading charinfo for {}(*{})",charname,account);
964 xfreecxx . . $ `src/common/xalloc.h:51:9`!(charinfo);
965 continue;
966 }
967 if (exp_time) {
968 curr_exp_time = bn_int_get(charinfo->headercxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#header..last_timecxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_0#last_time.)+exp_time;
969 } else {
970 curr_exp_time = 0x7FFFFFFF;
971 }
972 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_debugcxx . . $ pvpgn/eventlog_level_debug.,__FUNCTION__,"adding char {} (*{})", charname, account);
973 d2charlist_add_charcxx . . $ pvpgn/d2cs/d2charlist_add_char(c7d3c8db93118531).(&charlist_head,charinfo,curr_exp_time);
974 n++;
975 if (n>=maxchar) break;
976 }
977 if (n>=maxchar)
978 maxchar = 0;
979
980 if (!stdcxx . . $ std/::strcmp(charlist_sort_order, "ASC"))
981 {
982 t_elistcxx . . $ pvpgn/t_elist# * curr, *safe;
983 t_d2charlistcxx . . $ pvpgn/d2cs/t_d2charlist# * ccharlist;
984
985 elist_for_each_safecxx . . $ `src/common/elist.h:238:9`!(curr,&charlist_head,safe)
986 {
987 bn_intcxx . . $ pvpgn/bn_int# bn_exp_time;
988
989 ccharlist = elist_entrycxx . . $ `src/common/elist.h:228:9`!(curr,t_d2charlist,list);
990 bn_int_set(&bn_exp_time,ccharlist->expiration_timecxx . . $ pvpgn/d2cs/d2charlist#expiration_time.);
991 packet_append_datacxx . . $ pvpgn/packet_append_data(d82347a7305550af).(rpacket,bn_exp_time,sizeof(bn_exp_time));
992 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,(char*)ccharlist->charinfocxx . . $ pvpgn/d2cs/d2charlist#charinfo.->headercxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#header..charnamecxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_0#charname.);
993 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,(char *)&ccharlist->charinfocxx . . $ pvpgn/d2cs/d2charlist#charinfo.->portraitcxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#portrait.);
994 xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)ccharlist->charinfo);
995 xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)ccharlist);
996 }
997 }
998 else
999 {
1000 t_elistcxx . . $ pvpgn/t_elist# * curr, *safe;
1001 t_d2charlistcxx . . $ pvpgn/d2cs/t_d2charlist# * ccharlist;
1002
1003 elist_for_each_safe_revcxx . . $ `src/common/elist.h:242:9`!(curr,&charlist_head,safe)
1004 {
1005 bn_intcxx . . $ pvpgn/bn_int# bn_exp_time;
1006
1007 ccharlist = elist_entrycxx . . $ `src/common/elist.h:228:9`!(curr,t_d2charlist,list);
1008 bn_int_set(&bn_exp_time,ccharlist->expiration_timecxx . . $ pvpgn/d2cs/d2charlist#expiration_time.);
1009 packet_append_datacxx . . $ pvpgn/packet_append_data(d82347a7305550af).(rpacket,bn_exp_time,sizeof(bn_exp_time));
1010 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,(char*)ccharlist->charinfocxx . . $ pvpgn/d2cs/d2charlist#charinfo.->headercxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#header..charnamecxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_0#charname.);
1011 packet_append_stringcxx . . $ pvpgn/packet_append_string(41801851180b7cbb).(rpacket,(char *)&ccharlist->charinfocxx . . $ pvpgn/d2cs/d2charlist#charinfo.->portraitcxx . . $ pvpgn/$anonymous_type_2b39c4fbe0b22632_3#portrait.);
1012 xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)ccharlist->charinfo);
1013 xfreecxx . . $ `src/common/xalloc.h:51:9`!((void *)ccharlist);
1014 }
1015 }
1016 } catch (const Directorycxx . . $ pvpgn/Directory#::OpenErrorcxx . . $ pvpgn/Directory#OpenError#&) {
1017 INFO1cxx . . $ `src/common/eventlog.h:84:9`!("(*{}) charinfo directory do not exist, building it",account);
1018 p_mkdircxx . . $ `src/compat/mkdir.h:51:11`!(path,S_IRWXUcxx . . $ `<external>/14710646456994434043/fcntl.h:109:10`!);
1019 }
1020 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_charlistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_charlistreply..currcharcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_29#currchar.,n);
1021 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_charlistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_charlistreply..currchar2cxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_29#currchar2.,n);
1022 bn_short_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_charlistreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_charlistreply..maxcharcxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_29#maxchar.,maxchar);
1023
1024 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
1025 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
1026 }
1027 xfreecxx . . $ `src/common/xalloc.h:51:9`!(path);
1028 return 0;
1029 }
1030
1031 static int on_client_convertcharreqcxx . . $ pvpgn/d2cs/on_client_convertcharreq(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
1032 {
1033 t_packetcxx . . $ pvpgn/t_packet# * rpacket;
1034 char const * charname;
1035 char const * account;
1036 unsigned int reply;
1037
1038 if (!(charname=packet_get_str_constcxx . . $ pvpgn/packet_get_str_const(2621638e840efcc6).(packet,sizeof(t_client_d2cs_convertcharreqcxx . . $ pvpgn/t_client_d2cs_convertcharreq#),MAX_CHARNAME_LENcxx . . $ MAX_CHARNAME_LEN.))) {
1039 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"got bad character name");
1040 return -1;
1041 }
1042 if (conn_check_multilogincxx . . $ pvpgn/d2cs/conn_check_multilogin(636e7872f5a2b03c).(c,charname)<0) {
1043 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"character {} is already logged in",charname);
1044 return -1;
1045 }
1046 account=d2cs_conn_get_accountcxx . . $ pvpgn/d2cs/d2cs_conn_get_account(204e3869d17161f9).(c);
1047 if (d2char_convertcxx . . $ pvpgn/d2cs/d2char_convert(5ae29d726ae57f88).(account,charname)<0) {
1048 eventlogcxx . . $ pvpgn/eventlog(f1d8dd72586f1e25).(eventlog_level_errorcxx . . $ pvpgn/eventlog_level_error.,__FUNCTION__,"failed to convert character {}(*{})",charname,account);
1049 reply = D2CS_CLIENT_CONVERTCHARREPLY_FAILEDcxx . . $ `src/common/d2cs_protocol.h:353:9`!;
1050 } else {
1051 reply = D2CS_CLIENT_CONVERTCHARREPLY_SUCCEEDcxx . . $ `src/common/d2cs_protocol.h:352:9`!;
1052 }
1053 if ((rpacket=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
1054 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(rpacket,sizeof(t_d2cs_client_convertcharreplycxx . . $ pvpgn/t_d2cs_client_convertcharreply#));
1055 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(rpacket,D2CS_CLIENT_CONVERTCHARREPLYcxx . . $ `src/common/d2cs_protocol.h:346:9`!);
1056 bn_int_set(&rpacket->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_convertcharreplycxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_convertcharreply..replycxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_31#reply.,reply);
1057 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,rpacket);
1058 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(rpacket);
1059 }
1060 return 0;
1061 }
1062
1063 extern int d2cs_send_client_creategamewaitcxx . . $ pvpgn/d2cs/d2cs_send_client_creategamewait(2fb9731f9a7a8931).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, unsigned int position)
1064 {
1065 t_packetcxx . . $ pvpgn/t_packet# * packet;
1066
1067 ASSERTcxx . . $ `src/d2cs/setup.h:67:9`!(c,-1);
1068 if ((packet=packet_createcxx . . $ pvpgn/packet_create(f721c565085e24c0).(packet_class_d2cscxx . . $ pvpgn/packet_class_d2cs.))) {
1069 packet_set_sizecxx . . $ pvpgn/packet_set_size(a12d8724e4c46208).(packet,sizeof(t_d2cs_client_creategamewaitcxx . . $ pvpgn/t_d2cs_client_creategamewait#));
1070 packet_set_typecxx . . $ pvpgn/packet_set_type(a12d8724e4c46208).(packet,D2CS_CLIENT_CREATEGAMEWAITcxx . . $ `src/common/d2cs_protocol.h:301:9`!);
1071 bn_int_set(&packet->ucxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#u..d2cs_client_creategamewaitcxx . . $ pvpgn/$anonymous_type_a1640d8ff791e3e5_2#$anonymous_type_3#d2cs_client_creategamewait..positioncxx . . $ pvpgn/$anonymous_type_b07e82e2fff2dccd_26#position.,position);
1072 conn_push_outqueuecxx . . $ pvpgn/d2cs/conn_push_outqueue(5937b18ec8c7bf53).(c,packet);
1073 packet_del_refcxx . . $ pvpgn/packet_del_ref(d23439d9c1f63082).(packet);
1074 }
1075 return 0;
1076 }
1077
1078 extern int d2cs_handle_client_creategamecxx . . $ pvpgn/d2cs/d2cs_handle_client_creategame(5937b18ec8c7bf53).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# * c, t_packetcxx . . $ pvpgn/t_packet# * packet)
1079 {
1080 return on_client_creategamereqcxx . . $ pvpgn/d2cs/on_client_creategamereq(5937b18ec8c7bf53).(c,packet);
1081 }
1082
1083 static unsigned int d2cs_try_joingamecxx . . $ pvpgn/d2cs/d2cs_try_joingame(d50089198af1f705).(t_connectioncxx . . $ pvpgn/d2cs/t_connection# const * c, t_gamecxx . . $ pvpgn/d2cs/t_game# const * game, char const * gamepass)
1084 {
1085 unsigned int reply;
1086
1087 ASSERTcxx . . $ `src/d2cs/setup.h:67:9`!(c,D2CS_CLIENT_JOINGAMEREPLY_NOT_EXISTcxx . . $ `src/common/d2cs_protocol.h:140:9`!);
1088 ASSERTcxx . . $ `src/d2cs/setup.h:67:9`!(game,D2CS_CLIENT_JOINGAMEREPLY_NOT_EXISTcxx . . $ `src/common/d2cs_protocol.h:140:9`!);
1089 if (!game_get_createdcxx . . $ pvpgn/d2cs/game_get_created(33681cfe92f0a311).(game)) {
1090 reply=D2CS_CLIENT_JOINGAMEREPLY_NOT_EXISTcxx . . $ `src/common/d2cs_protocol.h:140:9`!;
1091 } else if (!game_get_d2gscxx . . $ pvpgn/d2cs/game_get_d2gs(d8ef2cc2a93b457).(game)) {
1092 reply=D2CS_CLIENT_JOINGAMEREPLY_NOT_EXISTcxx . . $ `src/common/d2cs_protocol.h:140:9`!;
1093 } else if (conn_get_charinfo_laddercxx . . $ pvpgn/d2cs/conn_get_charinfo_ladder(efed4e5eb0be6497).(c) != game_get_gameflag_laddercxx . . $ pvpgn/d2cs/game_get_gameflag_ladder(33681cfe92f0a311).(game)) {
1094 reply=D2CS_CLIENT_JOINGAMEREPLY_NORMAL_LADDERcxx . . $ `src/common/d2cs_protocol.h:148:9`!;
1095 } else if (conn_get_charinfo_expansioncxx . . $ pvpgn/d2cs/conn_get_charinfo_expansion(efed4e5eb0be6497).(c) != game_get_gameflag_expansioncxx . . $ pvpgn/d2cs/game_get_gameflag_expansion(33681cfe92f0a311).(game)) {
1096 reply=D2CS_CLIENT_JOINGAMEREPLY_CLASSIC_EXPANSIONcxx . . $ `src/common/d2cs_protocol.h:146:9`!;
1097 } else if (conn_get_charinfo_hardcorecxx . . $ pvpgn/d2cs/conn_get_charinfo_hardcore(efed4e5eb0be6497).(c) != game_get_gameflag_hardcorecxx . . $ pvpgn/d2cs/game_get_gameflag_hardcore(33681cfe92f0a311).(game)) {
1098 reply=D2CS_CLIENT_JOINGAMEREPLY_HARDCORE_SOFTCOREcxx . . $ `src/common/d2cs_protocol.h:143:9`!;
1099 } else if (conn_get_charinfo_difficultycxx . . $ pvpgn/d2cs/conn_get_charinfo_difficulty(efed4e5eb0be6497).(c) < game_get_gameflag_difficultycxx . . $ pvpgn/d2cs/game_get_gameflag_difficulty(33681cfe92f0a311).(game)) {
1100 reply=D2CS_CLIENT_JOINGAMEREPLY_NORMAL_NIGHTMAREcxx . . $ `src/common/d2cs_protocol.h:144:9`!;
1101 } else if (prefs_allow_gamelimitcxx . . $ pvpgn/d2cs/prefs_allow_gamelimit(db52760e79bf9054).()) {
1102 if (game_get_maxcharcxx . . $ pvpgn/d2cs/game_get_maxchar(33681cfe92f0a311).(game) <= game_get_currcharcxx . . $ pvpgn/d2cs/game_get_currchar(33681cfe92f0a311).(game)) {
1103 reply=D2CS_CLIENT_JOINGAMEREPLY_GAME_FULLcxx . . $ `src/common/d2cs_protocol.h:141:9`!;
1104 } else if (conn_get_charinfo_levelcxx . . $ pvpgn/d2cs/conn_get_charinfo_level(efed4e5eb0be6497).(c) > game_get_maxlevelcxx . . $ pvpgn/d2cs/game_get_maxlevel(33681cfe92f0a311).(game)) {
1105 reply=D2CS_CLIENT_JOINGAMEREPLY_LEVEL_LIMITcxx . . $ `src/common/d2cs_protocol.h:142:9`!;
1106 } else if (conn_get_charinfo_levelcxx . . $ pvpgn/d2cs/conn_get_charinfo_level(efed4e5eb0be6497).(c) < game_get_minlevelcxx . . $ pvpgn/d2cs/game_get_minlevel(33681cfe92f0a311).(game)) {
1107 reply=D2CS_CLIENT_JOINGAMEREPLY_LEVEL_LIMITcxx . . $ `src/common/d2cs_protocol.h:142:9`!;
1108 } else if (stdcxx . . $ std/::strcmp(d2cs_game_get_passcxx . . $ pvpgn/d2cs/d2cs_game_get_pass(d16e89b4cf68b40f).(game),gamepass)) {
1109 reply=D2CS_CLIENT_JOINGAMEREPLY_BAD_PASScxx . . $ `src/common/d2cs_protocol.h:139:9`!;
1110 } else {
1111 reply=D2CS_CLIENT_JOINGAMEREPLY_SUCCEEDcxx . . $ `src/common/d2cs_protocol.h:138:9`!;
1112 }
1113 } else {
1114 if (game_get_currcharcxx . . $ pvpgn/d2cs/game_get_currchar(33681cfe92f0a311).(game) >= MAX_CHAR_PER_GAMEcxx . . $ `src/d2cs/setup.h:72:9`!) {
1115 reply=D2CS_CLIENT_JOINGAMEREPLY_GAME_FULLcxx . . $ `src/common/d2cs_protocol.h:141:9`!;
1116 } else {
1117 reply=D2CS_CLIENT_JOINGAMEREPLY_SUCCEEDcxx . . $ `src/common/d2cs_protocol.h:138:9`!;
1118 }
1119 }
1120 return reply;
1121 }
1122
1123 }
1124 }