From dcfe0a5febb252e3a4f40c1b25765740a269467f Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Wed, 6 Jul 2022 02:20:39 +0200 Subject: network: Add initial files and enet dependency --- src/network/verify_user.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/network/verify_user.h (limited to 'src/network/verify_user.h') diff --git a/src/network/verify_user.h b/src/network/verify_user.h new file mode 100644 index 000000000..01b9877c8 --- /dev/null +++ b/src/network/verify_user.h @@ -0,0 +1,46 @@ +// Copyright 2018 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include "common/logging/log.h" + +namespace Network::VerifyUser { + +struct UserData { + std::string username; + std::string display_name; + std::string avatar_url; + bool moderator = false; ///< Whether the user is a Citra Moderator. +}; + +/** + * A backend used for verifying users and loading user data. + */ +class Backend { +public: + virtual ~Backend(); + + /** + * Verifies the given token and loads the information into a UserData struct. + * @param verify_UID A GUID that may be used for verification. + * @param token A token that contains user data and verification data. The format and content is + * decided by backends. + */ + virtual UserData LoadUserData(const std::string& verify_UID, const std::string& token) = 0; +}; + +/** + * A null backend where the token is ignored. + * No verification is performed here and the function returns an empty UserData. + */ +class NullBackend final : public Backend { +public: + ~NullBackend(); + + UserData LoadUserData(const std::string& verify_UID, const std::string& token) override; +}; + +} // namespace Network::VerifyUser -- cgit v1.2.3 From 705f7db84dd85555a6aef1e136cf251725cef293 Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Sat, 25 Dec 2021 20:27:52 +0100 Subject: yuzu: Add ui files for multiplayer rooms --- src/network/verify_user.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network/verify_user.h') diff --git a/src/network/verify_user.h b/src/network/verify_user.h index 01b9877c8..5c3852d4a 100644 --- a/src/network/verify_user.h +++ b/src/network/verify_user.h @@ -13,7 +13,7 @@ struct UserData { std::string username; std::string display_name; std::string avatar_url; - bool moderator = false; ///< Whether the user is a Citra Moderator. + bool moderator = false; ///< Whether the user is a yuzu Moderator. }; /** -- cgit v1.2.3 From 6a2dcc8b3d4ed0940e33d60fee701bcdb063eb6b Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Mon, 25 Jul 2022 17:08:20 +0200 Subject: network, yuzu: Improve variable naming and style consistency --- src/network/verify_user.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/network/verify_user.h') diff --git a/src/network/verify_user.h b/src/network/verify_user.h index 5c3852d4a..ddae67e99 100644 --- a/src/network/verify_user.h +++ b/src/network/verify_user.h @@ -25,11 +25,11 @@ public: /** * Verifies the given token and loads the information into a UserData struct. - * @param verify_UID A GUID that may be used for verification. + * @param verify_uid A GUID that may be used for verification. * @param token A token that contains user data and verification data. The format and content is * decided by backends. */ - virtual UserData LoadUserData(const std::string& verify_UID, const std::string& token) = 0; + virtual UserData LoadUserData(const std::string& verify_uid, const std::string& token) = 0; }; /** @@ -40,7 +40,7 @@ class NullBackend final : public Backend { public: ~NullBackend(); - UserData LoadUserData(const std::string& verify_UID, const std::string& token) override; + UserData LoadUserData(const std::string& verify_uid, const std::string& token) override; }; } // namespace Network::VerifyUser -- cgit v1.2.3 From 61ce57b5242984c297283de5868ea4938391a911 Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Mon, 25 Jul 2022 17:18:30 +0200 Subject: network, yuzu: Make copyright headers SPDX-compliant --- src/network/verify_user.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/network/verify_user.h') diff --git a/src/network/verify_user.h b/src/network/verify_user.h index ddae67e99..6fc64d8a3 100644 --- a/src/network/verify_user.h +++ b/src/network/verify_user.h @@ -1,6 +1,5 @@ -// Copyright 2018 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once -- cgit v1.2.3