diff options
| author | Filoppi <filippotarpini@hotmail.it> | 2021-05-15 12:25:31 +0300 |
|---|---|---|
| committer | Filoppi <filippotarpini@hotmail.it> | 2021-05-31 02:17:25 +0300 |
| commit | 83806462eca762fc281c309fc80e28ea126dba9f (patch) | |
| tree | 822ac9657f8d07325cdf41f209befdf9ce779366 /Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp | |
| parent | c648058efd4383b2ac69c4ed52e98973b735321b (diff) | |
ControllerInterface: fix DSU using the same client uid between server and controllers queries
that's not the way it's supposed to work
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp index ea855632c9..3d846cba5c 100644 --- a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp @@ -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; |
