UOperatingSystemUserManager
#include <OperatingSystemSimulator/Public/Core/OperatingSystemUserManager.h>class UOperatingSystemUserManagerDefined in OperatingSystemUserManager.h:41
Inherits:
USaveGame
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemUserManager["UOperatingSystemUserManager"]
class USaveGame["USaveGame"]
USaveGame <|-- UOperatingSystemUserManager
Collaboration diagram
Section titled “Collaboration diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemUserManager["UOperatingSystemUserManager"]
class FOperatingSystemUserManagerSaveData["FOperatingSystemUserManagerSaveData"]
UOperatingSystemUserManager *-- FOperatingSystemUserManagerSaveData
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemUserManager {
+UOperatingSystemUserManager()
+FindUserByEmail(const FText &TestEmail, FOperatingSystemUse bool
+FindUserByUsername(const FText &TestUsername, FOperatingSystem bool
+CheckUserExistForOperatingSystem(const UOperatingSystem *TargetOS, const FOp bool
+CheckUserExist(const FOperatingSystemUser &TestUser, const bool
+HasUsers() const bool
+AuthorizeUser(const FText &Email, const FText &Password, bool
+GetAllUsers(TArray< FOperatingSystemUser > &OutUsers) c
+CreateGenericUser(const FOperatingSystemUser &NewUser) bool
+CreateNewUser(UOperatingSystem *TargetOS, const FOperatin bool
+GetAllUsersForOS(const UOperatingSystem *TargetOS) const TSet< FOperatingSystemUser() >
+UpdateUserDetails(FOperatingSystemUser &TargetUser, const FOp bool
+ForEachUserInOS(const UOperatingSystem *TargetOS, const TFu
+ForEachUserInOS(const UOperatingSystem *TargetOS, const TFu
+ForEachUser(const TFunctionRef< bool(const FOperatingSy
+ForEachUser(const TFunctionRef< bool(FOperatingSystemUs
+CreateUserManager() UOperatingSystemUserManager() *
+GetUserManager(const UObject *WorldContextObject) UOperatingSystemUserManager() *
+GetUserKey(const UOperatingSystem *TargetOS) FString
+Users : TMap< FString, FOperatingSystemUserManag
+K2_OnUserCreated(const FOperatingSystemUser &CreatedUser)
+K2_OnUserUpdated(FOperatingSystemUser &TargetUser, const FOp
+bHasBlueprintOnUserCreated : uint8
+bHasBlueprintOnUserUpdated : uint8
+Internal_CreateUser(const FString &InKey, const FOperatingSyste bool
+Internal_Save()
}
Caller impact — ForEachUser
Section titled “Caller impact — ForEachUser”Documented call sites inside the plugin (4):
flowchart LR UOperatingSystemUserManager__ForEachUser["UOperatingSystemUserManager::ForEachUser"] UOperatingSystemUserManager__CheckUserExist["UOperatingSystemUserManager::CheckUserExist"] UOperatingSystemUserManager__CheckUserExist --> UOperatingSystemUserManager__ForEachUser UOperatingSystemUserManager__FindUserByEmail["UOperatingSystemUserManager::FindUserByEmail"] UOperatingSystemUserManager__FindUserByEmail --> UOperatingSystemUserManager__ForEachUser UOperatingSystemUserManager__FindUserByUsername["UOperatingSystemUserManager::FindUserByUsername"] UOperatingSystemUserManager__FindUserByUsername --> UOperatingSystemUserManager__ForEachUser UOperatingSystemUserManager__UpdateUserDetails["UOperatingSystemUserManager::UpdateUserDetails"] UOperatingSystemUserManager__UpdateUserDetails --> UOperatingSystemUserManager__ForEachUser
Caller impact — GetUserManager
Section titled “Caller impact — GetUserManager”Documented call sites inside the plugin (4):
flowchart LR UOperatingSystemUserManager__GetUserManager["UOperatingSystemUserManager::GetUserManager"] UOperatingSystemMailManager__RegisterNewMailAccount["UOperatingSystemMailManager::RegisterNewMailAccount"] UOperatingSystemMailManager__RegisterNewMailAccount --> UOperatingSystemUserManager__GetUserManager UOperatingSystemMailManager__ReplyToEmail["UOperatingSystemMailManager::ReplyToEmail"] UOperatingSystemMailManager__ReplyToEmail --> UOperatingSystemUserManager__GetUserManager UOperatingSystemMailManager__SendEmail["UOperatingSystemMailManager::SendEmail"] UOperatingSystemMailManager__SendEmail --> UOperatingSystemUserManager__GetUserManager UOperatingSystemMailManager__SendEmailFromDataTable["UOperatingSystemMailManager::SendEmailFromDataTable"] UOperatingSystemMailManager__SendEmailFromDataTable --> UOperatingSystemUserManager__GetUserManager
Caller impact — GetUserKey
Section titled “Caller impact — GetUserKey”Documented call sites inside the plugin (4):
flowchart LR UOperatingSystemUserManager__GetUserKey["UOperatingSystemUserManager::GetUserKey"] UOperatingSystemUserManager__CreateNewUser["UOperatingSystemUserManager::CreateNewUser"] UOperatingSystemUserManager__CreateNewUser --> UOperatingSystemUserManager__GetUserKey UOperatingSystemUserManager__ForEachUserInOS["UOperatingSystemUserManager::ForEachUserInOS"] UOperatingSystemUserManager__ForEachUserInOS --> UOperatingSystemUserManager__GetUserKey UOperatingSystemUserManager__ForEachUserInOS --> UOperatingSystemUserManager__GetUserKey UOperatingSystemUserManager__GetAllUsersForOS["UOperatingSystemUserManager::GetAllUsersForOS"] UOperatingSystemUserManager__GetAllUsersForOS --> UOperatingSystemUserManager__GetUserKey
Manager class for operating system users.
This class manages the creation, retrieval, and modification of users in an operating system. It provides various methods for finding users, checking user existence, authorizing users, and performing user operations. Users are stored in a mapping structure where the key is the user’s email and the value is the user’s data. The class inherits from USaveGame to enable saving and loading of user data.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemUserManager | ||
bool | FindUserByEmail | Finds a user by email. |
bool | FindUserByUsername | Finds a user by their username. |
bool | CheckUserExistForOperatingSystem const | Check if a user exists for the given operating system. |
bool | CheckUserExist const | Checks if a user exists in the operating system user manager. It can be used to verify if a user already exists before performing any operations related to user management. |
bool | HasUsers const | Checks if there are any users. |
bool | AuthorizeUser | Authorizes a user by comparing the provided email and password with the stored user data. |
void | GetAllUsers const | Retrieves all the operating system users managed by this user manager. |
bool | CreateGenericUser | Creates a generic user in the operating system user manager. |
bool | CreateNewUser | Create a new user in the operating system. |
TSet< FOperatingSystemUser > | GetAllUsersForOS const | Retrieves all the users for a given operating system. |
bool | UpdateUserDetails | public UOperatingSystemUserManager::UpdateUserDetails Updates the details for the given user. If you don’t want specific data to change, simply leave them empty or null. |
void | ForEachUserInOS const | Executes a given function for each user in the specified operating system. |
void | ForEachUserInOS | Iterates over each user in the given operating system and calls the provided function on each user. If the function returns true, the iteration stops. |
void | ForEachUser const | Applies a given function to each user in the operating system user manager. |
void | ForEachUser | Executes a lambda function for each user in the operating system user manager. |
UOperatingSystemUserManager
Section titled “UOperatingSystemUserManager”UOperatingSystemUserManager()Defined in OperatingSystemUserManager.h:56
Section titled “Defined in OperatingSystemUserManager.h:56”FindUserByEmail
Section titled “FindUserByEmail”bool FindUserByEmail(const FText & TestEmail, FOperatingSystemUser & OutUser)Defined in OperatingSystemUserManager.h:97 Finds a user by email.
Searches for a user with the specified email and retrieves their information. If the email is empty or whitespace, an error will be logged and the method will return false. If the email matches the default email for the “No Reply” user, the “No Reply” user information will be returned. If a user with the specified email is found, their information will be stored in the OutUser parameter. If the found user’s color is invalid, it will be updated and saved to the database.
Parameters
Section titled “Parameters”-
TestEmailThe email to search for. -
OutUser[out] The user information if found.
Returns
Section titled “Returns”True if a user was found and retrieved successfully, false otherwise.
Referenced by
Section titled “Referenced by”References
Section titled “References”EmailForEachUserGetOS_LOG_ERRORReset
FindUserByUsername
Section titled “FindUserByUsername”bool FindUserByUsername(const FText & TestUsername, FOperatingSystemUser & OutUser)Defined in OperatingSystemUserManager.h:114 Finds a user by their username.
This method searches for a user with the given username and populates the provided FOperatingSystemUser object with the found user’s details.
Parameters
Section titled “Parameters”-
TestUsernameThe username to search for. -
OutUserThe FOperatingSystemUser object to populate with the found user’s details.
Returns
Section titled “Returns”True if a user with the given username was found, false otherwise.
References
Section titled “References”ForEachUserGetOS_LOG_ERRORResetUsername
CheckUserExistForOperatingSystem
Section titled “CheckUserExistForOperatingSystem”const
bool CheckUserExistForOperatingSystem(const UOperatingSystem * TargetOS, const FOperatingSystemUser & TestUser, const bool bCheckByUsernameOnly) constDefined in OperatingSystemUserManager.h:132 Check if a user exists for the given operating system.
This method checks if the specified user exists for the specified operating system.
Parameters
Section titled “Parameters”-
TargetOSThe target operating system to check for user existence. -
TestUserThe user object to compare against the operating system users. -
bCheckByUsernameOnlyFlag indicating if the check should only be performed based on username. If this flag is true, the method will only check if the username of the TestUser matches any of the usernames in the operating system users. If this flag is false, the method will compare the entire TestUser object with each operating system user to determine if a match exists.
Returns
Section titled “Returns”true if a match is found for the specified user, false otherwise.
References
Section titled “References”CheckUserExist
Section titled “CheckUserExist”const
bool CheckUserExist(const FOperatingSystemUser & TestUser, const bool bCheckByUsernameOnly) constDefined in OperatingSystemUserManager.h:143 Checks if a user exists in the operating system user manager. It can be used to verify if a user already exists before performing any operations related to user management.
Parameters
Section titled “Parameters”-
TestUserThe user to check for existence. -
bCheckByUsernameOnlySpecifies whether to perform the existence check based on username only. Set to true to perform the check based on username only, or false to perform full user comparison.
Returns
Section titled “Returns”True if the user exists, false otherwise.
References
Section titled “References”HasUsers
Section titled “HasUsers”const
bool HasUsers() constDefined in OperatingSystemUserManager.h:150 Checks if there are any users.
Returns
Section titled “Returns”True if there are users, false otherwise.
References
Section titled “References”AuthorizeUser
Section titled “AuthorizeUser”bool AuthorizeUser(const FText & Email, const FText & Password, FOperatingSystemUser & OutAuthorizedUser)Defined in OperatingSystemUserManager.h:161 Authorizes a user by comparing the provided email and password with the stored user data.
Parameters
Section titled “Parameters”-
EmailThe email of the user to authorize. -
PasswordThe password of the user to authorize. -
OutAuthorizedUserThe authorized user object if the authorization is successful.
Returns
Section titled “Returns”True if the user is authorized, false otherwise.
References
Section titled “References”GetAllUsers
Section titled “GetAllUsers”const
void GetAllUsers(TArray< FOperatingSystemUser > & OutUsers) constDefined in OperatingSystemUserManager.h:173 Retrieves all the operating system users managed by this user manager.
This method populates the provided array OutUsers with the operating system users. The array OutUsers is cleared and then filled with the operating system users managed by this user manager. The method does not return any values.
Parameters
Section titled “Parameters”OutUsersThe array to be populated with the operating system users.
References
Section titled “References”CreateGenericUser
Section titled “CreateGenericUser”bool CreateGenericUser(const FOperatingSystemUser & NewUser)Defined in OperatingSystemUserManager.h:182 Creates a generic user in the operating system user manager.
Parameters
Section titled “Parameters”NewUserThe operating system user to create.
Returns
Section titled “Returns”True if the user was successfully created, false otherwise.
References
Section titled “References”CreateNewUser
Section titled “CreateNewUser”bool CreateNewUser(UOperatingSystem * TargetOS, const FOperatingSystemUser & NewUser)Defined in OperatingSystemUserManager.h:193 Create a new user in the operating system.
This method creates a new user in the specified operating system.
Parameters
Section titled “Parameters”-
TargetOSThe operating system in which to create the user. -
NewUserThe user data of the new user.
Returns
Section titled “Returns”True if the user is created successfully, false otherwise.
References
Section titled “References”AddNotificationGetUserKeyInternal_CreateUserIsValidMAKE_ERROROperatingSystemOS_LOG_ERROR
GetAllUsersForOS
Section titled “GetAllUsersForOS”const
TSet< FOperatingSystemUser > GetAllUsersForOS(const UOperatingSystem * TargetOS) constDefined in OperatingSystemUserManager.h:203 Retrieves all the users for a given operating system.
This method returns a set of operating system users associated with the specified operating system.
Parameters
Section titled “Parameters”TargetOSThe operating system for which to retrieve the users.
Returns
Section titled “Returns”A set of operating system users for the specified operating system.
References
Section titled “References”UpdateUserDetails
Section titled “UpdateUserDetails”bool UpdateUserDetails(FOperatingSystemUser & TargetUser, const FOperatingSystemUser & UpdatedDetails)Defined in OperatingSystemUserManager.h:214 public UOperatingSystemUserManager::UpdateUserDetails Updates the details for the given user. If you don’t want specific data to change, simply leave them empty or null.
Parameters
Section titled “Parameters”-
TargetUserUser to update -
UpdatedDetailsDetails to update. If a setting is null or empty, it is not updated
Returns
Section titled “Returns”True if the details were updated. False otherwise.
References
Section titled “References”ForEachUserInOS
Section titled “ForEachUserInOS”const
void ForEachUserInOS(const UOperatingSystem * TargetOS, const TFunctionRef< bool(const FOperatingSystemUser &)> Func) constDefined in OperatingSystemUserManager.h:223 Executes a given function for each user in the specified operating system.
Parameters
Section titled “Parameters”-
TargetOSThe operating system for which the function should be executed. -
FuncThe function to be executed for each user. It should accept a constant reference to an FOperatingSystemUser object and return a bool value.
Referenced by
Section titled “Referenced by”References
Section titled “References”ForEachUserInOS
Section titled “ForEachUserInOS”void ForEachUserInOS(const UOperatingSystem * TargetOS, const TFunctionRef< bool(FOperatingSystemUser &)> Func)Defined in OperatingSystemUserManager.h:235 Iterates over each user in the given operating system and calls the provided function on each user. If the function returns true, the iteration stops.
Parameters
Section titled “Parameters”-
TargetOSThe target operating system to iterate users on. -
FuncThe function to call on each user. It should take an FOperatingSystemUser reference as input and return a boolean value indicating whether to stop the iteration.
References
Section titled “References”ForEachUser
Section titled “ForEachUser”const
void ForEachUser(const TFunctionRef< bool(const FOperatingSystemUser &)> & Func) constDefined in OperatingSystemUserManager.h:247 Applies a given function to each user in the operating system user manager.
The function receives a constant reference to an FOperatingSystemUser object and must return a boolean value. If the function returns true, the loop is stopped and no further users are processed.
Parameters
Section titled “Parameters”FuncA TFunctionRef object that represents the function to be applied to each user.
Referenced by
Section titled “Referenced by”References
Section titled “References”ForEachUser
Section titled “ForEachUser”void ForEachUser(const TFunctionRef< bool(FOperatingSystemUser &)> & Func)Defined in OperatingSystemUserManager.h:258 Executes a lambda function for each user in the operating system user manager.
This method iterates over each user in the operating system user manager and executes the provided lambda function for each user. The lambda function should take a reference to an FOperatingSystemUser object as a parameter and return a boolean value indicating whether the iteration should stop or continue.
Parameters
Section titled “Parameters”FuncA lambda function that takes a reference to an FOperatingSystemUser object as a parameter and returns a boolean value.
References
Section titled “References”Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemUserManager * | CreateUserManager static | Create a new instance of the User Manager class. It checks if a save game file exists and loads it if found. If not, it creates a new instance and returns it. |
UOperatingSystemUserManager * | GetUserManager static | Returns the user manager instance associated with the given WorldContextObject. |
FString | GetUserKey static | Retrieves the user key for the specified operating system. |
CreateUserManager
Section titled “CreateUserManager”static
static UOperatingSystemUserManager * CreateUserManager()Defined in OperatingSystemUserManager.h:63 Create a new instance of the User Manager class. It checks if a save game file exists and loads it if found. If not, it creates a new instance and returns it.
Returns
Section titled “Returns”A pointer to UOperatingSystemUserManager instance.
Referenced by
Section titled “Referenced by”References
Section titled “References”GetGetSettingsNEW_SOFT_OBJOS_LOG
GetUserManager
Section titled “GetUserManager”static
static UOperatingSystemUserManager * GetUserManager(const UObject * WorldContextObject)Defined in OperatingSystemUserManager.h:71 Returns the user manager instance associated with the given WorldContextObject.
Parameters
Section titled “Parameters”WorldContextObjectThe world context object used to retrieve the user manager.
Returns
Section titled “Returns”The user manager instance.
Referenced by
Section titled “Referenced by”References
Section titled “References”GetUserKey
Section titled “GetUserKey”static
static FString GetUserKey(const UOperatingSystem * TargetOS)Defined in OperatingSystemUserManager.h:81 Retrieves the user key for the specified operating system.
This method returns a unique identifier that represents the user associated with the given operating system.
Parameters
Section titled “Parameters”TargetOSThe pointer to the operating system to retrieve the user key for.
Returns
Section titled “Returns”The user key as a string.
Referenced by
Section titled “Referenced by”References
Section titled “References”Protected Attributes
Section titled “Protected Attributes”| Return | Name | Description |
|---|---|---|
TMap< FString, FOperatingSystemUserManagerSaveData > | Users | This map associates user names (as strings) with their respective save data (as FOperatingSystemUserManagerSaveData objects). |
TMap< FString, FOperatingSystemUserManagerSaveData > UsersDefined in OperatingSystemUserManager.h:52 This map associates user names (as strings) with their respective save data (as FOperatingSystemUserManagerSaveData objects).
Referenced by
Section titled “Referenced by”ForEachUserForEachUserForEachUserInOSForEachUserInOSGetAllUsersGetAllUsersForOSHasUsersInternal_CreateUser
Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
void | K2_OnUserCreated | Blueprint implementable event called when a user is created. |
void | K2_OnUserUpdated | BlueprintImplementableEvent called when a user’s details are updated. The updated user details are provided as input parameters. |
K2_OnUserCreated
Section titled “K2_OnUserCreated”void K2_OnUserCreated(const FOperatingSystemUser & CreatedUser)Defined in OperatingSystemUserManager.h:276 Blueprint implementable event called when a user is created.
This event is called when a user is created in the OperatingSystemUserManager class. It passes the created user as a parameter.
Parameters
Section titled “Parameters”CreatedUserThe user that was created.
Referenced by
Section titled “Referenced by”K2_OnUserUpdated
Section titled “K2_OnUserUpdated”void K2_OnUserUpdated(FOperatingSystemUser & TargetUser, const FOperatingSystemUser & UpdatedDetails)Defined in OperatingSystemUserManager.h:285 BlueprintImplementableEvent called when a user’s details are updated. The updated user details are provided as input parameters.
Parameters
Section titled “Parameters”-
TargetUserThe user object being updated. Passed by reference to allow modifications. -
UpdatedDetailsThe new user details to be applied.
Referenced by
Section titled “Referenced by”Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
uint8 | bHasBlueprintOnUserCreated | |
uint8 | bHasBlueprintOnUserUpdated |
bHasBlueprintOnUserCreated
Section titled “bHasBlueprintOnUserCreated”uint8 bHasBlueprintOnUserCreatedDefined in OperatingSystemUserManager.h:45
Referenced by
Section titled “Referenced by”bHasBlueprintOnUserUpdated
Section titled “bHasBlueprintOnUserUpdated”uint8 bHasBlueprintOnUserUpdatedDefined in OperatingSystemUserManager.h:46
Referenced by
Section titled “Referenced by”Private Methods
Section titled “Private Methods”| Return | Name | Description |
|---|---|---|
bool | Internal_CreateUser | |
void | Internal_Save |
Internal_CreateUser
Section titled “Internal_CreateUser”bool Internal_CreateUser(const FString & InKey, const FOperatingSystemUser & NewUser)Defined in OperatingSystemUserManager.h:262
Referenced by
Section titled “Referenced by”References
Section titled “References”bHasBlueprintOnUserCreatedInternal_SaveIsValidK2_OnUserCreatedOS_LOG_ERROROS_LOG_VERBOSEUsernameUsers
Internal_Save
Section titled “Internal_Save”void Internal_Save()Defined in OperatingSystemUserManager.h:263
Referenced by
Section titled “Referenced by”References
Section titled “References”GetOS_LOG_ERROROS_LOG_VERBOSE