diff options
| -rw-r--r-- | src/common/web_result.h | 2 | ||||
| -rw-r--r-- | src/core/telemetry_session.cpp | 11 | ||||
| -rw-r--r-- | src/core/telemetry_session.h | 2 | ||||
| -rw-r--r-- | src/web_service/telemetry_json.cpp | 5 | ||||
| -rw-r--r-- | src/web_service/telemetry_json.h | 5 | ||||
| -rw-r--r-- | src/web_service/web_backend.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu/compatdb.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/compatdb.h | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_web.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/discord_impl.h | 2 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 2 |
11 files changed, 27 insertions, 19 deletions
diff --git a/src/common/web_result.h b/src/common/web_result.h index 13610a7ea..969926674 100644 --- a/src/common/web_result.h +++ b/src/common/web_result.h | |||
| @@ -21,4 +21,4 @@ struct WebResult { | |||
| 21 | std::string result_string; | 21 | std::string result_string; |
| 22 | std::string returned_data; | 22 | std::string returned_data; |
| 23 | }; | 23 | }; |
| 24 | } // namespace Commo \ No newline at end of file | 24 | } // namespace Common |
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 09c85297a..c02188adc 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -28,11 +28,12 @@ static u64 GenerateTelemetryId() { | |||
| 28 | mbedtls_entropy_context entropy; | 28 | mbedtls_entropy_context entropy; |
| 29 | mbedtls_entropy_init(&entropy); | 29 | mbedtls_entropy_init(&entropy); |
| 30 | mbedtls_ctr_drbg_context ctr_drbg; | 30 | mbedtls_ctr_drbg_context ctr_drbg; |
| 31 | const char* personalization = "yuzu Telemetry ID"; | 31 | std::string personalization = "yuzu Telemetry ID"; |
| 32 | 32 | ||
| 33 | mbedtls_ctr_drbg_init(&ctr_drbg); | 33 | mbedtls_ctr_drbg_init(&ctr_drbg); |
| 34 | mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, | 34 | ASSERT(mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, |
| 35 | (const unsigned char*)personalization, strlen(personalization)); | 35 | reinterpret_cast<const unsigned char*>(personalization.c_str()), |
| 36 | personalization.size()) == 0) | ||
| 36 | ASSERT(mbedtls_ctr_drbg_random(&ctr_drbg, reinterpret_cast<unsigned char*>(&telemetry_id), | 37 | ASSERT(mbedtls_ctr_drbg_random(&ctr_drbg, reinterpret_cast<unsigned char*>(&telemetry_id), |
| 37 | sizeof(u64)) == 0); | 38 | sizeof(u64)) == 0); |
| 38 | 39 | ||
| @@ -88,7 +89,7 @@ u64 RegenerateTelemetryId() { | |||
| 88 | return new_telemetry_id; | 89 | return new_telemetry_id; |
| 89 | } | 90 | } |
| 90 | 91 | ||
| 91 | bool VerifyLogin(std::string username, std::string token) { | 92 | bool VerifyLogin(const std::string& username, const std::string& token) { |
| 92 | #ifdef ENABLE_WEB_SERVICE | 93 | #ifdef ENABLE_WEB_SERVICE |
| 93 | return WebService::VerifyLogin(Settings::values.web_api_url, username, token); | 94 | return WebService::VerifyLogin(Settings::values.web_api_url, username, token); |
| 94 | #else | 95 | #else |
| @@ -120,7 +121,7 @@ TelemetrySession::TelemetrySession() { | |||
| 120 | u64 program_id{}; | 121 | u64 program_id{}; |
| 121 | const Loader::ResultStatus res{System::GetInstance().GetAppLoader().ReadProgramId(program_id)}; | 122 | const Loader::ResultStatus res{System::GetInstance().GetAppLoader().ReadProgramId(program_id)}; |
| 122 | if (res == Loader::ResultStatus::Success) { | 123 | if (res == Loader::ResultStatus::Success) { |
| 123 | std::string formatted_program_id{fmt::format("{:016X}", program_id)}; | 124 | const std::string formatted_program_id{fmt::format("{:016X}", program_id)}; |
| 124 | AddField(Telemetry::FieldType::Session, "ProgramId", formatted_program_id); | 125 | AddField(Telemetry::FieldType::Session, "ProgramId", formatted_program_id); |
| 125 | 126 | ||
| 126 | std::string name; | 127 | std::string name; |
diff --git a/src/core/telemetry_session.h b/src/core/telemetry_session.h index e6976ad45..cec271df0 100644 --- a/src/core/telemetry_session.h +++ b/src/core/telemetry_session.h | |||
| @@ -56,6 +56,6 @@ u64 RegenerateTelemetryId(); | |||
| 56 | * @param func A function that gets exectued when the verification is finished | 56 | * @param func A function that gets exectued when the verification is finished |
| 57 | * @returns Future with bool indicating whether the verification succeeded | 57 | * @returns Future with bool indicating whether the verification succeeded |
| 58 | */ | 58 | */ |
| 59 | bool VerifyLogin(std::string username, std::string token); | 59 | bool VerifyLogin(const std::string& username, const std::string& token); |
| 60 | 60 | ||
| 61 | } // namespace Core | 61 | } // namespace Core |
diff --git a/src/web_service/telemetry_json.cpp b/src/web_service/telemetry_json.cpp index a0b7f9c4e..033ea1ea4 100644 --- a/src/web_service/telemetry_json.cpp +++ b/src/web_service/telemetry_json.cpp | |||
| @@ -10,6 +10,11 @@ | |||
| 10 | 10 | ||
| 11 | namespace WebService { | 11 | namespace WebService { |
| 12 | 12 | ||
| 13 | TelemetryJson::TelemetryJson(const std::string& host, const std::string& username, | ||
| 14 | const std::string& token) | ||
| 15 | : host(std::move(host)), username(std::move(username)), token(std::move(token)) {} | ||
| 16 | TelemetryJson::~TelemetryJson() = default; | ||
| 17 | |||
| 13 | template <class T> | 18 | template <class T> |
| 14 | void TelemetryJson::Serialize(Telemetry::FieldType type, const std::string& name, T value) { | 19 | void TelemetryJson::Serialize(Telemetry::FieldType type, const std::string& name, T value) { |
| 15 | sections[static_cast<u8>(type)][name] = value; | 20 | sections[static_cast<u8>(type)][name] = value; |
diff --git a/src/web_service/telemetry_json.h b/src/web_service/telemetry_json.h index 9bc886538..29d565964 100644 --- a/src/web_service/telemetry_json.h +++ b/src/web_service/telemetry_json.h | |||
| @@ -18,9 +18,8 @@ namespace WebService { | |||
| 18 | */ | 18 | */ |
| 19 | class TelemetryJson : public Telemetry::VisitorInterface { | 19 | class TelemetryJson : public Telemetry::VisitorInterface { |
| 20 | public: | 20 | public: |
| 21 | TelemetryJson(const std::string& host, const std::string& username, const std::string& token) | 21 | TelemetryJson(const std::string& host, const std::string& username, const std::string& token); |
| 22 | : host(host), username(username), token(token) {} | 22 | ~TelemetryJson(); |
| 23 | ~TelemetryJson() = default; | ||
| 24 | 23 | ||
| 25 | void Visit(const Telemetry::Field<bool>& field) override; | 24 | void Visit(const Telemetry::Field<bool>& field) override; |
| 26 | void Visit(const Telemetry::Field<double>& field) override; | 25 | void Visit(const Telemetry::Field<double>& field) override; |
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index a726fb8eb..3a3f44dc2 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp | |||
| @@ -13,12 +13,12 @@ | |||
| 13 | 13 | ||
| 14 | namespace WebService { | 14 | namespace WebService { |
| 15 | 15 | ||
| 16 | static constexpr char API_VERSION[]{"1"}; | 16 | constexpr char API_VERSION[]{"1"}; |
| 17 | 17 | ||
| 18 | constexpr int HTTP_PORT = 80; | 18 | constexpr u32 HTTP_PORT = 80; |
| 19 | constexpr int HTTPS_PORT = 443; | 19 | constexpr u32 HTTPS_PORT = 443; |
| 20 | 20 | ||
| 21 | constexpr int TIMEOUT_SECONDS = 30; | 21 | constexpr u32 TIMEOUT_SECONDS = 30; |
| 22 | 22 | ||
| 23 | Client::JWTCache Client::jwt_cache{}; | 23 | Client::JWTCache Client::jwt_cache{}; |
| 24 | 24 | ||
diff --git a/src/yuzu/compatdb.cpp b/src/yuzu/compatdb.cpp index 45f8b4461..91e754274 100644 --- a/src/yuzu/compatdb.cpp +++ b/src/yuzu/compatdb.cpp | |||
| @@ -27,7 +27,11 @@ CompatDB::CompatDB(QWidget* parent) | |||
| 27 | 27 | ||
| 28 | CompatDB::~CompatDB() = default; | 28 | CompatDB::~CompatDB() = default; |
| 29 | 29 | ||
| 30 | enum class CompatDBPage { Intro = 0, Selection = 1, Final = 2 }; | 30 | enum class CompatDBPage { |
| 31 | Intro = 0, | ||
| 32 | Selection = 1, | ||
| 33 | Final = 2, | ||
| 34 | }; | ||
| 31 | 35 | ||
| 32 | void CompatDB::Submit() { | 36 | void CompatDB::Submit() { |
| 33 | QButtonGroup* compatibility = new QButtonGroup(this); | 37 | QButtonGroup* compatibility = new QButtonGroup(this); |
diff --git a/src/yuzu/compatdb.h b/src/yuzu/compatdb.h index 0a0f27cca..ca0dd11d6 100644 --- a/src/yuzu/compatdb.h +++ b/src/yuzu/compatdb.h | |||
| @@ -21,7 +21,6 @@ public: | |||
| 21 | private: | 21 | private: |
| 22 | std::unique_ptr<Ui::CompatDB> ui; | 22 | std::unique_ptr<Ui::CompatDB> ui; |
| 23 | 23 | ||
| 24 | private slots: | ||
| 25 | void Submit(); | 24 | void Submit(); |
| 26 | void EnableNext(); | 25 | void EnableNext(); |
| 27 | }; | 26 | }; |
diff --git a/src/yuzu/configuration/configure_web.cpp b/src/yuzu/configuration/configure_web.cpp index cfca08014..4b5c39e26 100644 --- a/src/yuzu/configuration/configure_web.cpp +++ b/src/yuzu/configuration/configure_web.cpp | |||
| @@ -25,7 +25,7 @@ ConfigureWeb::ConfigureWeb(QWidget* parent) | |||
| 25 | this->setConfiguration(); | 25 | this->setConfiguration(); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | ConfigureWeb::~ConfigureWeb() {} | 28 | ConfigureWeb::~ConfigureWeb() = default; |
| 29 | 29 | ||
| 30 | void ConfigureWeb::setConfiguration() { | 30 | void ConfigureWeb::setConfiguration() { |
| 31 | ui->web_credentials_disclaimer->setWordWrap(true); | 31 | ui->web_credentials_disclaimer->setWordWrap(true); |
diff --git a/src/yuzu/discord_impl.h b/src/yuzu/discord_impl.h index d71428c10..4bfda8cdf 100644 --- a/src/yuzu/discord_impl.h +++ b/src/yuzu/discord_impl.h | |||
| @@ -11,7 +11,7 @@ namespace DiscordRPC { | |||
| 11 | class DiscordImpl : public DiscordInterface { | 11 | class DiscordImpl : public DiscordInterface { |
| 12 | public: | 12 | public: |
| 13 | DiscordImpl(); | 13 | DiscordImpl(); |
| 14 | ~DiscordImpl(); | 14 | ~DiscordImpl() override; |
| 15 | 15 | ||
| 16 | void Pause() override; | 16 | void Pause() override; |
| 17 | void Update() override; | 17 | void Update() override; |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 2d6e0d4fc..f236c63c5 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -115,7 +115,7 @@ void GMainWindow::ShowTelemetryCallout() { | |||
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | UISettings::values.callout_flags |= static_cast<uint32_t>(CalloutFlag::Telemetry); | 117 | UISettings::values.callout_flags |= static_cast<uint32_t>(CalloutFlag::Telemetry); |
| 118 | static const QString telemetry_message = | 118 | const QString telemetry_message = |
| 119 | tr("<a href='https://citra-emu.org/entry/telemetry-and-why-thats-a-good-thing/'>Anonymous " | 119 | tr("<a href='https://citra-emu.org/entry/telemetry-and-why-thats-a-good-thing/'>Anonymous " |
| 120 | "data is collected</a> to help improve yuzu. " | 120 | "data is collected</a> to help improve yuzu. " |
| 121 | "<br/><br/>Would you like to share your usage data with us?"); | 121 | "<br/><br/>Would you like to share your usage data with us?"); |