diff --git a/src/client/component/auth.cpp b/src/client/component/auth.cpp index e870dfc5..959d6e57 100644 --- a/src/client/component/auth.cpp +++ b/src/client/component/auth.cpp @@ -109,20 +109,29 @@ namespace auth int send_connect_data_stub(const game::netsrc_t sock, game::netadr_t* adr, const char* data, int len) { - std::string buffer{}; - - const auto is_connect_sequence = len >= 7 && strncmp("connect", data, 7) == 0; - if (is_connect_sequence) + try { - buffer.append("connect"); - buffer.push_back(' '); - buffer.append(serialize_connect_data(data, len)); + std::string buffer{}; - data = buffer.data(); - len = static_cast(buffer.size()); + const auto is_connect_sequence = len >= 7 && strncmp("connect", data, 7) == 0; + if (is_connect_sequence) + { + buffer.append("connect"); + buffer.push_back(' '); + buffer.append(serialize_connect_data(data, len)); + + data = buffer.data(); + len = static_cast(buffer.size()); + } + + return reinterpret_cast(0x142173600_g)(sock, adr, data, len); + } + catch (std::exception& e) + { + printf("Error: %s\n", e.what()); } - return reinterpret_cast(0x142173600_g)(sock, adr, data, len); + return 0; } void handle_connect_packet(const game::netadr_t& target, const network::data_view& data)