diff options
author | Lioncash <mathew1800@gmail.com> | 2018-08-20 23:24:13 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-08-21 01:48:53 +0200 |
commit | f13a66b963d4ecd53dda7866e947bc3230566d63 (patch) | |
tree | 66326dddaf3d61b4cc991323d70ee0cfa9fc38f6 /src/core/hle/service/acc/profile_manager.cpp | |
parent | profile_manager: Remove unnecessary std::move in AddToProfiles() and CreateNewUser() (diff) | |
download | yuzu-f13a66b963d4ecd53dda7866e947bc3230566d63.tar yuzu-f13a66b963d4ecd53dda7866e947bc3230566d63.tar.gz yuzu-f13a66b963d4ecd53dda7866e947bc3230566d63.tar.bz2 yuzu-f13a66b963d4ecd53dda7866e947bc3230566d63.tar.lz yuzu-f13a66b963d4ecd53dda7866e947bc3230566d63.tar.xz yuzu-f13a66b963d4ecd53dda7866e947bc3230566d63.tar.zst yuzu-f13a66b963d4ecd53dda7866e947bc3230566d63.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/acc/profile_manager.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp index fe9921fb6..9440dc555 100644 --- a/src/core/hle/service/acc/profile_manager.cpp +++ b/src/core/hle/service/acc/profile_manager.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <random> #include <boost/optional.hpp> #include "core/hle/service/acc/profile_manager.h" #include "core/settings.h" @@ -12,6 +13,15 @@ constexpr ResultCode ERROR_TOO_MANY_USERS(ErrorModule::Account, -1); constexpr ResultCode ERROR_USER_ALREADY_EXISTS(ErrorModule::Account, -2); constexpr ResultCode ERROR_ARGUMENT_IS_NULL(ErrorModule::Account, 20); +const UUID& UUID::Generate() { + std::random_device device; + std::mt19937 gen(device()); + std::uniform_int_distribution<u64> distribution(1, std::numeric_limits<u64>::max()); + uuid[0] = distribution(gen); + uuid[1] = distribution(gen); + return *this; +} + ProfileManager::ProfileManager() { // TODO(ogniK): Create the default user we have for now until loading/saving users is added auto user_uuid = UUID{1, 0}; |