Open 3D Engine LocalUser Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
LocalUser::LocalUserRequests Class Referenceabstract

#include <LocalUserRequestBus.h>

Inherits AZ::EBusTraits.

Public Member Functions

virtual AZStd::shared_ptr< LocalUserProfileFindLocalUserProfile (AzFramework::LocalUserId localUserId)=0
 
virtual AZ::u32 GetMaxLocalUsers () const =0
 
virtual bool IsLocalUserSignedIn (AzFramework::LocalUserId localUserId)=0
 
virtual AZStd::string GetLocalUserName (AzFramework::LocalUserId localUserId)=0
 
virtual AZ::u32 AssignLocalUserIdToLocalPlayerSlot (AzFramework::LocalUserId localUserId, AZ::u32 localPlayerSlot=LocalPlayerSlotAny)=0
 
virtual AZ::u32 RemoveLocalUserIdFromLocalPlayerSlot (AzFramework::LocalUserId localUserId)=0
 
virtual AzFramework::LocalUserId GetLocalUserIdAssignedToLocalPlayerSlot (AZ::u32 localPlayerSlot)=0
 
virtual AZ::u32 GetLocalPlayerSlotOccupiedByLocalUserId (AzFramework::LocalUserId localUserId)=0
 
virtual void ClearAllLocalUserIdToLocalPlayerSlotAssignments ()=0
 Clears all previously assigned local user id to local player slot associations.
 

Static Public Member Functions

static AzFramework::LocalUserId GetPrimaryLocalUserId ()
 
static AzFramework::LocalUserId GetLocalUserIdAt (AZ::u32 localPlayerSlot)
 
static AZStd::shared_ptr< LocalUserProfileGetPrimaryLocalUserProfile ()
 
static AZStd::shared_ptr< LocalUserProfileGetLocalUserProfile (AzFramework::LocalUserId localUserId)
 
static AZStd::shared_ptr< LocalUserProfileGetLocalUserProfileAt (AZ::u32 localPlayerSlot)
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single
 
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single
 

Detailed Description

EBus interface used to make queries/requests related to the assignment of local user ids to local player slots, along with queries/requests related to individual local user profiles.

Please note that while some platforms have no concept of a local user profile (in which case GetLocalUserProfile will always return null), most other functions will remain valid because on those platforms local user ids can be represented instead by unique input device indices.

Member Function Documentation

◆ AssignLocalUserIdToLocalPlayerSlot()

virtual AZ::u32 LocalUser::LocalUserRequests::AssignLocalUserIdToLocalPlayerSlot ( AzFramework::LocalUserId  localUserId,
AZ::u32  localPlayerSlot = LocalPlayerSlotAny 
)
pure virtual

Assign a local user id into a local player slot.

Parameters
[in]localUserIdThe local user id to assign into a local player slot.
[in]localPlayerSlotThe local player slot to assign the local user id into. LocalPlayerSlotAny uses the first available local slot.
Returns
The local player slot that localUserId was assigned to, or LocalPlayerSlotNone.

◆ FindLocalUserProfile()

virtual AZStd::shared_ptr< LocalUserProfile > LocalUser::LocalUserRequests::FindLocalUserProfile ( AzFramework::LocalUserId  localUserId)
pure virtual

Finds a specific local user profile based on their local user id.

Parameters
[in]localUserIdThe local user id of the local user profile to retrieve.
Returns
A shared pointer to the local user profile if found, otherwise an empty one.

◆ GetLocalPlayerSlotOccupiedByLocalUserId()

virtual AZ::u32 LocalUser::LocalUserRequests::GetLocalPlayerSlotOccupiedByLocalUserId ( AzFramework::LocalUserId  localUserId)
pure virtual

Get the local player slot that a local user id is assigned to.

Parameters
[in]localUserIdThe local user id to query.
Returns
The local player slot that has localUserId assigned, or LocalPlayerSlotNone.

◆ GetLocalUserIdAssignedToLocalPlayerSlot()

virtual AzFramework::LocalUserId LocalUser::LocalUserRequests::GetLocalUserIdAssignedToLocalPlayerSlot ( AZ::u32  localPlayerSlot)
pure virtual

Get the local user id that is assigned to a local player slot.

Parameters
[in]localPlayerSlotThe local player slot query.
Returns
The local user id that is assigned to localPlayerSlot, or LocalUserIdNone.

◆ GetLocalUserIdAt()

AzFramework::LocalUserId LocalUser::LocalUserRequests::GetLocalUserIdAt ( AZ::u32  localPlayerSlot)
inlinestatic

Convenience function to get the local user id that is assigned to a specified local slot.

Parameters
[in]localPlayerSlotThe local player slot to query.
Returns
The local user id that is assigned to localPlayerSlot, or LocalUserIdNone.

◆ GetLocalUserName()

virtual AZStd::string LocalUser::LocalUserRequests::GetLocalUserName ( AzFramework::LocalUserId  localUserId)
pure virtual

Get the user name associated with a local user id. Platforms that have no concept of a local user profile will return "Player N" where "N" is the local player slot currently occupied by localUserId, or an empty string if they don't currently occupy a local slot.

Parameters
[in]localUserIdThe local user id to query.
Returns
The user name that is associated with localUserId.

◆ GetLocalUserProfile()

AZStd::shared_ptr< LocalUserProfile > LocalUser::LocalUserRequests::GetLocalUserProfile ( AzFramework::LocalUserId  localUserId)
inlinestatic

Convenience function to get a specific local user profile based on their local user id.

Parameters
[in]localUserIdThe local user id of the local user profile to retrieve.
Returns
A shared pointer to the local user profile if found, otherwise an empty one.

◆ GetLocalUserProfileAt()

AZStd::shared_ptr< LocalUserProfile > LocalUser::LocalUserRequests::GetLocalUserProfileAt ( AZ::u32  localPlayerSlot)
inlinestatic

Convenience function to get the specific local user profile assigned to a local slot.

Parameters
[in]localPlayerSlotThe local player slot to query.
Returns
A shared pointer to the local user profile if found, otherwise an empty one.

◆ GetMaxLocalUsers()

virtual AZ::u32 LocalUser::LocalUserRequests::GetMaxLocalUsers ( ) const
pure virtual

Query the maximum number of local uses that can be signed into the system concurrently.

Returns
The maximum number of local uses that can be signed into the system concurrently.

◆ GetPrimaryLocalUserId()

AzFramework::LocalUserId LocalUser::LocalUserRequests::GetPrimaryLocalUserId ( )
inlinestatic

Convenience function to get the local user id that is assigned to the primary local slot.

Returns
The local user id that is assigned to the primary local slot, or LocalUserIdNone.

◆ GetPrimaryLocalUserProfile()

AZStd::shared_ptr< LocalUserProfile > LocalUser::LocalUserRequests::GetPrimaryLocalUserProfile ( )
inlinestatic

Convenience function to get the local user profile assigned to the primary local slot.

Returns
A shared pointer to the local user profile if found, otherwise an empty one.

◆ IsLocalUserSignedIn()

virtual bool LocalUser::LocalUserRequests::IsLocalUserSignedIn ( AzFramework::LocalUserId  localUserId)
pure virtual

Query whether a local user id is signed in. Please note that a user can be assigned to a local player slot but signed out, or signed in but not assigned to a local player slot.

On platforms with no concept of a local user profile, local user ids are instead unique input device indices, so while it may seem counter-intuitive this may still return true.

Parameters
[in]localUserIdThe local user id to query.
Returns
True if localUserId is signed in, false otherwise.

◆ RemoveLocalUserIdFromLocalPlayerSlot()

virtual AZ::u32 LocalUser::LocalUserRequests::RemoveLocalUserIdFromLocalPlayerSlot ( AzFramework::LocalUserId  localUserId)
pure virtual

Remove a local user id from a local player slot.

Parameters
[in]localUserIdThe local user id to remove from a local player slot.
Returns
The local player slot that localUserId was removed from, or LocalPlayerSlotNone.

Member Data Documentation

◆ HandlerPolicy

const AZ::EBusHandlerPolicy LocalUser::LocalUserRequests::HandlerPolicy = AZ::EBusHandlerPolicy::Single
static

EBus Trait: requests can only be sent to and addressed by a single instance (singleton)


The documentation for this class was generated from the following file: