Better fix for clearing stored guids

This commit is contained in:
momo5502 2023-04-17 21:13:18 +02:00
parent 07362a41ef
commit 4cab2a73bd
3 changed files with 15 additions and 7 deletions

View File

@ -135,11 +135,6 @@ namespace auth
int send_connect_data_stub(const game::netsrc_t sock, game::netadr_t* adr, const char* data, const int len) int send_connect_data_stub(const game::netsrc_t sock, game::netadr_t* adr, const char* data, const int len)
{ {
for (auto& xuid : client_xuids)
{
xuid = 0;
}
try try
{ {
const auto is_connect_sequence = len >= 7 && strncmp("connect", data, 7) == 0; const auto is_connect_sequence = len >= 7 && strncmp("connect", data, 7) == 0;
@ -321,6 +316,14 @@ namespace auth
return xuid; return xuid;
} }
void clear_stored_guids()
{
for (auto& xuid : client_xuids)
{
xuid = 0;
}
}
struct component final : generic_component struct component final : generic_component
{ {
void post_unpack() override void post_unpack() override

View File

@ -4,4 +4,5 @@ namespace auth
{ {
uint64_t get_guid(); uint64_t get_guid();
uint64_t get_guid(size_t client_num); uint64_t get_guid(size_t client_num);
void clear_stored_guids();
} }

View File

@ -3,6 +3,7 @@
#include "game/game.hpp" #include "game/game.hpp"
#include "party.hpp" #include "party.hpp"
#include "auth.hpp"
#include "network.hpp" #include "network.hpp"
#include "scheduler.hpp" #include "scheduler.hpp"
#include "workshop.hpp" #include "workshop.hpp"
@ -39,6 +40,8 @@ namespace party
void connect_to_lobby(const game::netadr_t& addr, const std::string& mapname, const std::string& gamemode, void connect_to_lobby(const game::netadr_t& addr, const std::string& mapname, const std::string& gamemode,
const std::string& usermap_id, const std::string& mod_id) const std::string& usermap_id, const std::string& mod_id)
{ {
auth::clear_stored_guids();
workshop::load_mod_if_needed(usermap_id, mod_id); workshop::load_mod_if_needed(usermap_id, mod_id);
game::XSESSION_INFO info{}; game::XSESSION_INFO info{};
@ -56,7 +59,8 @@ namespace party
} }
void connect_to_lobby_with_mode(const game::netadr_t& addr, const game::eModes mode, const std::string& mapname, void connect_to_lobby_with_mode(const game::netadr_t& addr, const game::eModes mode, const std::string& mapname,
const std::string& gametype, const std::string& usermap_id, const std::string& mod_id, const std::string& gametype, const std::string& usermap_id,
const std::string& mod_id,
const bool was_retried = false) const bool was_retried = false)
{ {
if (game::Com_SessionMode_IsMode(mode)) if (game::Com_SessionMode_IsMode(mode))