-
Notifications
You must be signed in to change notification settings - Fork 3
user_info
Epic Online Services Interface: User Info Interface
Each Epic Online Services (EOS) user account has a unique identifier that the service uses internally to refer to the account. The User Info Interface bridges the gap between the user's account IDentifier and information about the user, such as display name, country and preferred language, and so on. You can retrieve this information for both remote users and logged-in, local users.
These functions are provided for handling user info:
- EpicGames_UserInfo_CopyExternalUserInfoByAccountId
- EpicGames_UserInfo_CopyExternalUserInfoByAccountType
- EpicGames_UserInfo_CopyExternalUserInfoByIndex
- EpicGames_UserInfo_CopyUserInfo
- EpicGames_UserInfo_GetExternalUserInfoCount
- EpicGames_UserInfo_QueryUserInfo
- EpicGames_UserInfo_QueryUserInfoByDisplayName
- EpicGames_UserInfo_QueryUserInfoByExternalAccount
These are the structures used by this API:
These are the constants used by this API:
Epic Online Services Function: EOS_UserInfo_CopyExternalUserInfoByAccountId
This function fetches an external user info for a given external account ID.
Note
Requires a previous call to EpicGames_UserInfo_QueryUserInfoByExternalAccount to store values in cache.
Syntax:
EpicGames_UserInfo_CopyExternalUserInfoByAccountId(accountID, accountID_target, accountID_external)
Argument | Type | Description |
---|---|---|
accountID | String | The Epic Account ID of the local player requesting the information |
accountID_target | String | The Epic Account ID of the player whose information is being retrieved |
accountID_external | String | The external account ID associated with the (external) user info to retrieve from the cache; cannot be null |
Returns:
Example:
var _struct = EpicGames_UserInfo_CopyExternalUserInfoByAccountId(accountID, accountID_target, accountID_external);
if (_struct.status == EpicGames_Success)
{
DisplayName = _struct.DisplayName;
}
The above code shows an example of how the function should be used. The external user info data is returned given the provided accountID.
Epic Online Services Function: EOS_UserInfo_CopyExternalUserInfoByAccountType
This function fetches an external user info for a given external account type.
Note
Requires a previous call to EpicGames_UserInfo_QueryUserInfoByExternalAccount to store values in cache.
Syntax:
EpicGames_UserInfo_CopyExternalUserInfoByAccountType(accountID, accountID_target, accountType)
Argument | Type | Description |
---|---|---|
accountID | String | The Epic Account ID of the local player requesting the information |
accountID_target | String | The Epic Account ID of the player whose information is being retrieved |
accountType | EpicGames_ExternalAccountType | Account type of the external user info to retrieve from the cache |
Returns:
Example:
var _struct = EpicGames_UserInfo_CopyExternalUserInfoByAccountType(accountID, accountID_target, accountType);
if (_struct.status == EpicGames_Success)
{
DisplayName = _struct.DisplayName;
}
The above code shows an example of how the function should be used. The external user info data is returned given the provided account type.
Epic Online Services Function: EOS_UserInfo_CopyExternalUserInfoByIndex
This function fetches an external user info from a given index.
Note
Requires a previous call to EpicGames_UserInfo_QueryUserInfoByExternalAccount to store values in cache.
Syntax:
EpicGames_UserInfo_CopyExternalUserInfoByIndex(accountID, accountID_target, index)
Argument | Type | Description |
---|---|---|
accountID | String | The Epic Account ID of the local player requesting the information |
accountID_target | String | The Epic Account ID of the player whose information is being retrieved |
index | Real | Index of the external user info to retrieve from the cache |
Returns:
Example:
var _count = EpicGames_UserInfo_GetExternalUserInfoCount(accountID, accountID_target);
for(var i = 0 ; i < _count ; i ++)
{
var _struct = EpicGames_UserInfo_CopyExternalUserInfoByIndex(i);
DisplayName = _struct.DisplayName;
}
The above code shows an example of how the function should be used. The external user info data is returned given the provided index (from a cached array).
Epic Online Services Function: EOS_UserInfo_CopyUserInfo
This function is used to immediately retrieve a copy of user information based on an Epic Account ID, cached by a previous call to EpicGames_UserInfo_QueryUserInfo.
Syntax:
EpicGames_UserInfo_CopyUserInfo(accountID, accountID_target)
Argument | Type | Description |
---|---|---|
accountID | String | The Epic Account ID of the local player requesting the information |
accountID_target | String | The Epic Account ID of the player whose information is being retrieved |
Returns:
Example:
var _struct = EpicGames_UserInfo_CopyUserInfo(accountID, accountID_target);
if (_struct.status == EpicGames_Success)
{
nickname = _struct.Nickname;
}
The above code shows an example of how the function should be used. The user info data is returned given the provided account ID.
Epic Online Services Function: EOS_UserInfo_GetExternalUserInfoCount
This function fetches the number of external user information that are cached locally.
Note
Requires a previous call to EpicGames_UserInfo_QueryUserInfoByExternalAccount to store values in cache.
Syntax:
EpicGames_UserInfo_GetExternalUserInfoCount(accountID, accountID_target)
Argument | Type | Description |
---|---|---|
accountID | String | The Epic Account ID of the local player requesting the information |
accountID_target | String | The Epic Account ID of the player whose information is being retrieved |
Returns:
Example:
var _count = EpicGames_UserInfo_GetExternalUserInfoCount(accountID, accountID_target);
for(var i = 0 ; i < _count ; i ++)
{
var _struct = EpicGames_UserInfo_CopyExternalUserInfoByIndex(i);
DisplayName = _struct.DisplayName;
}
The above code shows an example of how the function should be used. After a successful call to EpicGames_UserInfo_QueryUserInfoByExternalAccount, the function EpicGames_UserInfo_GetExternalUserInfoCount will return the number of entries in the query array which can then be accessed using the EpicGames_UserInfo_CopyExternalUserInfoByIndex function.
Epic Online Services Function: EOS_UserInfo_QueryUserInfo
This function is used to start an asynchronous query to retrieve information, such as display name, about another account. Once the callback has been fired with a successful EpicGames_Result, it is possible to call the function:
EpicGames_UserInfo_CopyUserInfo
to receive an UserInfo containing the available information.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
EpicGames_UserInfo_QueryUserInfo(accountID, accountID_target)
Argument | Type | Description |
---|---|---|
accountID | String | The Epic Account ID of the local player requesting the information |
accountID_target | String | The Epic Account ID of the player whose information is being retrieved |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "EpicGames_UserInfo_QueryUserInfo"
|
status | EpicGames_Result | The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors |
status_message | String | Text representation of the status code |
identifier | Real | The asynchronous listener ID. |
Example:
identifier = EpicGames_UserInfo_QueryUserInfo();
The code sample above saves the identifier that can be used inside a Social Async Event.
if (async_load[? "type"] == "EpicGames_UserInfo_QueryUserInfo")
if (async_load[? "identifier"] == identifier)
{
if (async_load[? "status"] == EpicGames_Success)
{
show_debug_message(async_load[? "type"] + " succeeded!");
}
else
{
show_debug_message(async_load[? "type"] + " failed: " + async_load[? "status_message"]);
}
}
The code above matches the response against the correct event type and logs the success of the task.
Epic Online Services Function: EOS_UserInfo_QueryUserInfoByDisplayName
This function is used to start an asynchronous query to retrieve user information by display name. This can be useful for getting the AccountId for a display name. Once the callback has been fired with a successful EpicGames_Result, it is possible to call the function:
to receive a UserInfo containing the available information.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
EpicGames_UserInfo_QueryUserInfoByDisplayName(accountID, DisplayName)
Argument | Type | Description |
---|---|---|
accountID | String | The Epic Account ID of the local player requesting the information |
DisplayName | String | Display name of the player being queried |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "EpicGames_UserInfo_QueryUserInfoByDisplayName"
|
status | EpicGames_Result | The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors |
status_message | String | Text representation of the status code |
identifier | Real | The asynchronous listener ID. |
Example:
identifier = EpicGames_UserInfo_QueryUserInfoByDisplayName();
The code sample above saves the identifier that can be used inside a Social Async Event.
if (async_load[? "type"] == "EpicGames_UserInfo_QueryUserInfoByDisplayName")
if (async_load[? "identifier"] == identifier)
{
if (async_load[? "status"] == EpicGames_Success)
{
show_debug_message(async_load[? "type"] + " succeeded!");
}
else
{
show_debug_message(async_load[? "type"] + " failed: " + async_load[? "status_message"]);
}
}
The code above matches the response against the correct event type and logs the success of the task.
Epic Online Services Function: EOS_UserInfo_QueryUserInfoByExternalAccount
This function is used to start an asynchronous query to retrieve user information by external accounts. This can be useful for getting the AccountId for external accounts. Once the callback has been fired with a successful EpicGames_Result, it is possible to call one of the following functions:
- EpicGames_UserInfo_CopyExternalUserInfoByAccountId
- EpicGames_UserInfo_CopyExternalUserInfoByAccountType
- EpicGames_UserInfo_CopyExternalUserInfoByIndex
to receive a ExternalUserInfo containing the available information.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
EpicGames_UserInfo_QueryUserInfoByExternalAccount(accountID, ExternalAccountId, accountType)
Argument | Type | Description |
---|---|---|
accountID | String | The Epic Account ID of the local player requesting the information |
ExternalAccountId | String | External account ID of the user whose information is being retrieved |
accountType | EpicGames_ExternalAccountType | Account type of the external user info to query |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | The string "EpicGames_UserInfo_QueryUserInfoByExternalAccount"
|
status | EpicGames_Result | The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors |
status_message | String | Text representation of the status code |
identifier | Real | The asynchronous listener ID. |
Example:
identifier = EpicGames_UserInfo_QueryUserInfoByExternalAccount();
The code sample above saves the identifier that can be used inside a Social Async Event.
if (async_load[? "type"] == "EpicGames_UserInfo_QueryUserInfoByExternalAccount")
if (async_load[? "identifier"] == identifier)
{
if (async_load[? "status"] == EpicGames_Success)
{
show_debug_message(async_load[? "type"] + " succeeded!");
}
else
{
show_debug_message(async_load[? "type"] + " failed: " + async_load[? "status_message"]);
}
}
Epic Online Services Enum: EOS_EExternalAccountType
These constants are used to describe the type of an external account or connection.
These constants are also part of the ExternalAccountInfo struct.
These constants are referenced by the following functions:
- EpicGames_UserInfo_CopyExternalUserInfoByAccountType
- EpicGames_UserInfo_QueryUserInfoByExternalAccount
These constants are referenced by the following structs:
Member | Description |
---|---|
EpicGames_EAT_EPIC |
External account is associated with Epic Games |
EpicGames_EAT_STEAM |
External account is associated with Steam |
EpicGames_EAT_PSN |
External account is associated with PlayStation(TM)Network |
EpicGames_EAT_XBL |
External account is associated with Xbox Live |
EpicGames_EAT_DISCORD |
External account is associated with Discord |
EpicGames_EAT_GOG |
External account is associated with GOG |
EpicGames_EAT_NINTENDO |
External account is associated with Nintendo With both EOS Connect and EOS UserInfo APIs, the associated account type is Nintendo Service Account ID. Local user authentication is possible using Nintendo Account ID, while the account type does not get exposed to the SDK in queries related to linked accounts information. |
EpicGames_EAT_UPLAY |
External account is associated with Uplay |
EpicGames_EAT_OPENID |
External account is associated with an OpenID Provider |
EpicGames_EAT_APPLE |
External account is associated with Apple |
EpicGames_EAT_GOOGLE |
External account is associated with Google |
EpicGames_EAT_OCULUS |
External account is associated with Oculus |
EpicGames_EAT_ITCHIO |
External account is associated with itch.io |
EpicGames_EAT_AMAZON |
External account is associated with Amazon |
The external user info is represented by a struct and contains information about a single external user info.
This struct is referenced by the following functions:
- EpicGames_UserInfo_CopyExternalUserInfoByAccountId
- EpicGames_UserInfo_CopyExternalUserInfoByAccountType
- EpicGames_UserInfo_CopyExternalUserInfoByIndex
Member | Type | Description |
---|---|---|
status | EpicGames_Result | The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors |
status_message | String | Text representation of the status code |
DisplayName | String | The display name of the external account. Can be null. |
AccountId | String | The ID of the external account. Can be null. |
AccountType | EpicGames_ExternalAccountType | The type of the external account. |
The user info is represented by a struct and contains information about a single user info.
This struct is referenced by the following functions:
Member | Type | Description |
---|---|---|
status | EpicGames_Result | The status code for the operation. EpicGames_Success indicates that the operation succeeded; other codes indicate errors |
status_message | String | Text representation of the status code. |
DisplayName | String | The display name. This may be null. |
Country | String | The name of the owner's country. This may be null. |
Nickname | String | A nickname/alias for the target user assigned by the local user. This may be null. |
PreferredLanguage | String | The ISO 639 language code for the user's preferred language. This may be null. |
AccountID | String | The Epic Account ID of the user |
YoYoGames 2024