chore: make yuzu REUSE compliant
[REUSE] is a specification that aims at making file copyright
information consistent, so that it can be both human and machine
readable. It basically requires that all files have a header containing
copyright and licensing information. When this isn't possible, like
when dealing with binary assets, generated files or embedded third-party
dependencies, it is permitted to insert copyright information in the
`.reuse/dep5` file.
Oh, and it also requires that all the licenses used in the project are
present in the `LICENSES` folder, that's why the diff is so huge.
This can be done automatically with `reuse download --all`.
The `reuse` tool also contains a handy subcommand that analyzes the
project and tells whether or not the project is (still) compliant,
`reuse lint`.
Following REUSE has a few advantages over the current approach:
- Copyright information is easy to access for users / downstream
- Files like `dist/license.md` do not need to exist anymore, as
`.reuse/dep5` is used instead
- `reuse lint` makes it easy to ensure that copyright information of
files like binary assets / images is always accurate and up to date
To add copyright information of files that didn't have it I looked up
who committed what and when, for each file. As yuzu contributors do not
have to sign a CLA or similar I couldn't assume that copyright ownership
was of the "yuzu Emulator Project", so I used the name and/or email of
the commit author instead.
[REUSE]: https://reuse.software
Follow-up to 01cf05bc75b1e47beb08937439f3ed9339e7b254
2022-05-15 00:06:02 +00:00
|
|
|
// SPDX-FileCopyrightText: 2017 Citra Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-05-02 04:09:15 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-10-09 18:47:24 +00:00
|
|
|
#include <string>
|
2017-05-02 04:09:15 +00:00
|
|
|
#include "common/telemetry.h"
|
|
|
|
|
2020-11-18 12:53:10 +00:00
|
|
|
namespace FileSys {
|
|
|
|
class ContentProvider;
|
|
|
|
}
|
|
|
|
|
2019-05-29 01:12:23 +00:00
|
|
|
namespace Loader {
|
|
|
|
class AppLoader;
|
|
|
|
}
|
|
|
|
|
2020-11-18 12:53:10 +00:00
|
|
|
namespace Service::FileSystem {
|
|
|
|
class FileSystemController;
|
|
|
|
}
|
|
|
|
|
2017-05-02 04:09:15 +00:00
|
|
|
namespace Core {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Instruments telemetry for this emulation session. Creates a new set of telemetry fields on each
|
|
|
|
* session, logging any one-time fields. Interfaces with the telemetry backend used for submitting
|
|
|
|
* data to the web service. Submits session data on close.
|
|
|
|
*/
|
2019-05-29 01:07:34 +00:00
|
|
|
class TelemetrySession {
|
2017-05-02 04:09:15 +00:00
|
|
|
public:
|
2019-05-29 01:12:23 +00:00
|
|
|
explicit TelemetrySession();
|
2017-05-02 04:09:15 +00:00
|
|
|
~TelemetrySession();
|
|
|
|
|
2019-05-29 01:07:34 +00:00
|
|
|
TelemetrySession(const TelemetrySession&) = delete;
|
|
|
|
TelemetrySession& operator=(const TelemetrySession&) = delete;
|
|
|
|
|
|
|
|
TelemetrySession(TelemetrySession&&) = delete;
|
|
|
|
TelemetrySession& operator=(TelemetrySession&&) = delete;
|
|
|
|
|
2019-05-29 01:12:23 +00:00
|
|
|
/**
|
|
|
|
* Adds the initial telemetry info necessary when starting up a title.
|
|
|
|
*
|
|
|
|
* This includes information such as:
|
|
|
|
* - Telemetry ID
|
|
|
|
* - Initialization time
|
|
|
|
* - Title ID
|
|
|
|
* - Title name
|
|
|
|
* - Title file format
|
|
|
|
* - Miscellaneous settings values.
|
|
|
|
*
|
2020-11-18 12:53:10 +00:00
|
|
|
* @param app_loader The application loader to use to retrieve
|
|
|
|
* title-specific information.
|
|
|
|
* @param fsc Filesystem controller to use to retrieve info.
|
|
|
|
* @param content_provider Content provider to use to retrieve info.
|
2019-05-29 01:12:23 +00:00
|
|
|
*/
|
2020-11-18 12:53:10 +00:00
|
|
|
void AddInitialInfo(Loader::AppLoader& app_loader,
|
|
|
|
const Service::FileSystem::FileSystemController& fsc,
|
|
|
|
const FileSys::ContentProvider& content_provider);
|
2019-05-29 01:12:23 +00:00
|
|
|
|
2017-05-02 04:09:15 +00:00
|
|
|
/**
|
|
|
|
* Wrapper around the Telemetry::FieldCollection::AddField method.
|
|
|
|
* @param type Type of the field to add.
|
|
|
|
* @param name Name of the field to add.
|
|
|
|
* @param value Value for the field to add.
|
|
|
|
*/
|
|
|
|
template <typename T>
|
2020-08-18 18:21:50 +00:00
|
|
|
void AddField(Common::Telemetry::FieldType type, const char* name, T value) {
|
2017-05-02 04:09:15 +00:00
|
|
|
field_collection.AddField(type, name, std::move(value));
|
|
|
|
}
|
|
|
|
|
2018-10-26 14:21:45 +00:00
|
|
|
/**
|
|
|
|
* Submits a Testcase.
|
|
|
|
* @returns A bool indicating whether the submission succeeded
|
|
|
|
*/
|
|
|
|
bool SubmitTestcase();
|
|
|
|
|
2017-05-02 04:09:15 +00:00
|
|
|
private:
|
2020-08-18 18:21:50 +00:00
|
|
|
/// Tracks all added fields for the session
|
|
|
|
Common::Telemetry::FieldCollection field_collection;
|
2017-05-02 04:09:15 +00:00
|
|
|
};
|
|
|
|
|
2017-08-23 04:08:07 +00:00
|
|
|
/**
|
|
|
|
* Gets TelemetryId, a unique identifier used for the user's telemetry sessions.
|
|
|
|
* @returns The current TelemetryId for the session.
|
|
|
|
*/
|
|
|
|
u64 GetTelemetryId();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Regenerates TelemetryId, a unique identifier used for the user's telemetry sessions.
|
|
|
|
* @returns The new TelemetryId that was generated.
|
|
|
|
*/
|
|
|
|
u64 RegenerateTelemetryId();
|
|
|
|
|
2017-09-19 01:18:26 +00:00
|
|
|
/**
|
|
|
|
* Verifies the username and token.
|
2018-03-26 19:31:19 +00:00
|
|
|
* @param username yuzu username to use for authentication.
|
|
|
|
* @param token yuzu token to use for authentication.
|
2017-09-19 01:18:26 +00:00
|
|
|
* @returns Future with bool indicating whether the verification succeeded
|
|
|
|
*/
|
2018-09-17 15:16:01 +00:00
|
|
|
bool VerifyLogin(const std::string& username, const std::string& token);
|
2017-09-19 01:18:26 +00:00
|
|
|
|
2017-05-02 04:09:15 +00:00
|
|
|
} // namespace Core
|