ControllerInterface: fix DSU using the same client uid between server and controllers queries

that's not the way it's supposed to work
This commit is contained in:
Filoppi 2021-05-15 12:25:31 +03:00
parent c648058efd
commit 83806462ec
1 changed files with 3 additions and 3 deletions

View File

@ -141,7 +141,6 @@ public:
private:
const std::string m_name;
const int m_index;
u32 m_client_uid = Common::Random::GenerateValue<u32>();
sf::UdpSocket m_socket;
SteadyClock::time_point m_next_reregister = SteadyClock::time_point::min();
Proto::MessageType::PadDataResponse m_pad_data{};
@ -314,7 +313,6 @@ static void Restart()
StopHotplugThread();
s_client_uid = Common::Random::GenerateValue<u32>();
s_next_listports = std::chrono::steady_clock::time_point::min();
for (auto& server : s_servers)
{
@ -327,6 +325,8 @@ static void Restart()
PopulateDevices(); // Only removes devices
s_client_uid = Common::Random::GenerateValue<u32>();
if (s_servers_enabled && !s_servers.empty())
StartHotplugThread();
}
@ -502,7 +502,7 @@ void Device::UpdateInput()
{
m_next_reregister = now + SERVER_REREGISTER_INTERVAL;
Proto::Message<Proto::MessageType::PadDataRequest> msg(m_client_uid);
Proto::Message<Proto::MessageType::PadDataRequest> msg(s_client_uid);
auto& data_req = msg.m_message;
data_req.register_flags = Proto::RegisterFlags::PadID;
data_req.pad_id_to_register = m_index;