Skip to content

UOperatingSystemUserManager

#include <OperatingSystemSimulator/Public/Core/OperatingSystemUserManager.h>
class UOperatingSystemUserManager

Defined in OperatingSystemUserManager.h:41

Inherits: USaveGame

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemUserManager["UOperatingSystemUserManager"]
  class USaveGame["USaveGame"]
  USaveGame <|-- UOperatingSystemUserManager
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemUserManager["UOperatingSystemUserManager"]
  class FOperatingSystemUserManagerSaveData["FOperatingSystemUserManagerSaveData"]
  UOperatingSystemUserManager *-- FOperatingSystemUserManagerSaveData
---
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()
  }

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

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

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.

ReturnNameDescription
UOperatingSystemUserManager
boolFindUserByEmailFinds a user by email.
boolFindUserByUsernameFinds a user by their username.
boolCheckUserExistForOperatingSystem constCheck if a user exists for the given operating system.
boolCheckUserExist constChecks 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.
boolHasUsers constChecks if there are any users.
boolAuthorizeUserAuthorizes a user by comparing the provided email and password with the stored user data.
voidGetAllUsers constRetrieves all the operating system users managed by this user manager.
boolCreateGenericUserCreates a generic user in the operating system user manager.
boolCreateNewUserCreate a new user in the operating system.
TSet< FOperatingSystemUser >GetAllUsersForOS constRetrieves all the users for a given operating system.
boolUpdateUserDetailspublic UOperatingSystemUserManager::UpdateUserDetails Updates the details for the given user. If you don’t want specific data to change, simply leave them empty or null.
voidForEachUserInOS constExecutes a given function for each user in the specified operating system.
voidForEachUserInOSIterates over each user in the given operating system and calls the provided function on each user. If the function returns true, the iteration stops.
voidForEachUser constApplies a given function to each user in the operating system user manager.
voidForEachUserExecutes a lambda function for each user in the operating system user manager.

UOperatingSystemUserManager()

Defined in OperatingSystemUserManager.h:56

Section titled “Defined in OperatingSystemUserManager.h:56”
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.

  • TestEmail The email to search for.

  • OutUser [out] The user information if found.

True if a user was found and retrieved successfully, false otherwise.


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.

  • TestUsername The username to search for.

  • OutUser The FOperatingSystemUser object to populate with the found user’s details.

True if a user with the given username was found, false otherwise.


const

bool CheckUserExistForOperatingSystem(const UOperatingSystem * TargetOS, const FOperatingSystemUser & TestUser, const bool bCheckByUsernameOnly) const

Defined 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.

  • TargetOS The target operating system to check for user existence.

  • TestUser The user object to compare against the operating system users.

  • bCheckByUsernameOnly Flag 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.

true if a match is found for the specified user, false otherwise.


const

bool CheckUserExist(const FOperatingSystemUser & TestUser, const bool bCheckByUsernameOnly) const

Defined 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.

  • TestUser The user to check for existence.

  • bCheckByUsernameOnly Specifies 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.

True if the user exists, false otherwise.


const

bool HasUsers() const

Defined in OperatingSystemUserManager.h:150 Checks if there are any users.

True if there are users, false otherwise.


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.

  • Email The email of the user to authorize.

  • Password The password of the user to authorize.

  • OutAuthorizedUser The authorized user object if the authorization is successful.

True if the user is authorized, false otherwise.


const

void GetAllUsers(TArray< FOperatingSystemUser > & OutUsers) const

Defined 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.

  • OutUsers The array to be populated with the operating system users.

bool CreateGenericUser(const FOperatingSystemUser & NewUser)

Defined in OperatingSystemUserManager.h:182 Creates a generic user in the operating system user manager.

  • NewUser The operating system user to create.

True if the user was successfully created, false otherwise.


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.

  • TargetOS The operating system in which to create the user.

  • NewUser The user data of the new user.

True if the user is created successfully, false otherwise.


const

TSet< FOperatingSystemUser > GetAllUsersForOS(const UOperatingSystem * TargetOS) const

Defined 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.

  • TargetOS The operating system for which to retrieve the users.

A set of operating system users for the specified operating system.


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.

  • TargetUser User to update

  • UpdatedDetails Details to update. If a setting is null or empty, it is not updated

True if the details were updated. False otherwise.


const

void ForEachUserInOS(const UOperatingSystem * TargetOS, const TFunctionRef< bool(const FOperatingSystemUser &)> Func) const

Defined in OperatingSystemUserManager.h:223 Executes a given function for each user in the specified operating system.

  • TargetOS The operating system for which the function should be executed.

  • Func The function to be executed for each user. It should accept a constant reference to an FOperatingSystemUser object and return a bool value.


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.

  • TargetOS The target operating system to iterate users on.

  • Func The 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.


const

void ForEachUser(const TFunctionRef< bool(const FOperatingSystemUser &)> & Func) const

Defined 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.

  • Func A TFunctionRef object that represents the function to be applied to each user.

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.

  • Func A lambda function that takes a reference to an FOperatingSystemUser object as a parameter and returns a boolean value.
ReturnNameDescription
UOperatingSystemUserManager *CreateUserManager staticCreate 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 staticReturns the user manager instance associated with the given WorldContextObject.
FStringGetUserKey staticRetrieves the user key for the specified operating system.

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.

A pointer to UOperatingSystemUserManager instance.


static

static UOperatingSystemUserManager * GetUserManager(const UObject * WorldContextObject)

Defined in OperatingSystemUserManager.h:71 Returns the user manager instance associated with the given WorldContextObject.

  • WorldContextObject The world context object used to retrieve the user manager.

The user manager instance.


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.

  • TargetOS The pointer to the operating system to retrieve the user key for.

The user key as a string.

ReturnNameDescription
TMap< FString, FOperatingSystemUserManagerSaveData >UsersThis map associates user names (as strings) with their respective save data (as FOperatingSystemUserManagerSaveData objects).

TMap< FString, FOperatingSystemUserManagerSaveData > Users

Defined in OperatingSystemUserManager.h:52 This map associates user names (as strings) with their respective save data (as FOperatingSystemUserManagerSaveData objects).

ReturnNameDescription
voidK2_OnUserCreatedBlueprint implementable event called when a user is created.
voidK2_OnUserUpdatedBlueprintImplementableEvent called when a user’s details are updated. The updated user details are provided as input parameters.

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.

  • CreatedUser The user that was created.

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.

  • TargetUser The user object being updated. Passed by reference to allow modifications.

  • UpdatedDetails The new user details to be applied.

ReturnNameDescription
uint8bHasBlueprintOnUserCreated
uint8bHasBlueprintOnUserUpdated

uint8 bHasBlueprintOnUserCreated

Defined in OperatingSystemUserManager.h:45


uint8 bHasBlueprintOnUserUpdated

Defined in OperatingSystemUserManager.h:46

ReturnNameDescription
boolInternal_CreateUser
voidInternal_Save

bool Internal_CreateUser(const FString & InKey, const FOperatingSystemUser & NewUser)

Defined in OperatingSystemUserManager.h:262


void Internal_Save()

Defined in OperatingSystemUserManager.h:263

  • Get
  • OS_LOG_ERROR
  • OS_LOG_VERBOSE