Browse Source
Merge pull request #7773 from lioncash/udp-deprecated
input_common/udp_client: Replace deprecated from_string()/to_ulong() functions
pull/15/merge
Morph
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
6 additions and
6 deletions
-
src/input_common/drivers/udp_client.cpp
-
src/input_common/drivers/udp_client.h
|
|
|
@ -339,7 +339,7 @@ void UDPClient::StartCommunication(std::size_t client, const std::string& host, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const PadIdentifier UDPClient::GetPadIdentifier(std::size_t pad_index) const { |
|
|
|
PadIdentifier UDPClient::GetPadIdentifier(std::size_t pad_index) const { |
|
|
|
const std::size_t client = pad_index / PADS_PER_CLIENT; |
|
|
|
return { |
|
|
|
.guid = clients[client].uuid, |
|
|
|
@ -348,9 +348,9 @@ const PadIdentifier UDPClient::GetPadIdentifier(std::size_t pad_index) const { |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
const Common::UUID UDPClient::GetHostUUID(const std::string host) const { |
|
|
|
const auto ip = boost::asio::ip::address_v4::from_string(host); |
|
|
|
const auto hex_host = fmt::format("{:06x}", ip.to_ulong()); |
|
|
|
Common::UUID UDPClient::GetHostUUID(const std::string& host) const { |
|
|
|
const auto ip = boost::asio::ip::make_address_v4(host); |
|
|
|
const auto hex_host = fmt::format("{:06x}", ip.to_uint()); |
|
|
|
return Common::UUID{hex_host}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -145,8 +145,8 @@ private: |
|
|
|
void OnPortInfo(Response::PortInfo); |
|
|
|
void OnPadData(Response::PadData, std::size_t client); |
|
|
|
void StartCommunication(std::size_t client, const std::string& host, u16 port); |
|
|
|
const PadIdentifier GetPadIdentifier(std::size_t pad_index) const; |
|
|
|
const Common::UUID GetHostUUID(const std::string host) const; |
|
|
|
PadIdentifier GetPadIdentifier(std::size_t pad_index) const; |
|
|
|
Common::UUID GetHostUUID(const std::string& host) const; |
|
|
|
|
|
|
|
Common::Input::ButtonNames GetUIButtonName(const Common::ParamPackage& params) const; |
|
|
|
|
|
|
|
|