// Copyright Epic Games, Inc. All Rights Reserved.
// This file is automatically generated. Changes to this file may be overwritten.
namespace Epic.OnlineServices.Connect
{
public sealed partial class ConnectInterface : Handle
{
public ConnectInterface()
{
}
public ConnectInterface(System.IntPtr innerHandle) : base(innerHandle)
{
}
///
/// The most recent version of the API.
///
public const int AddnotifyauthexpirationApiLatest = 1;
///
/// The most recent version of the API.
///
public const int AddnotifyloginstatuschangedApiLatest = 1;
///
/// The most recent version of the API.
///
public const int CopyidtokenApiLatest = 1;
///
/// The most recent version of the API.
///
public const int CopyproductuserexternalaccountbyaccountidApiLatest = 1;
///
/// The most recent version of the API.
///
public const int CopyproductuserexternalaccountbyaccounttypeApiLatest = 1;
///
/// The most recent version of the API.
///
public const int CopyproductuserexternalaccountbyindexApiLatest = 1;
///
/// The most recent version of the API.
///
public const int CopyproductuserinfoApiLatest = 1;
///
/// The most recent version of the API.
///
public const int CreatedeviceidApiLatest = 1;
///
/// Max length of a device model name, not including the terminating null
///
public const int CreatedeviceidDevicemodelMaxLength = 64;
///
/// The most recent version of the API.
///
public const int CreateuserApiLatest = 1;
///
/// The most recent version of the struct.
///
public const int CredentialsApiLatest = 1;
///
/// The most recent version of the API.
///
public const int DeletedeviceidApiLatest = 1;
///
/// Max length of an external account ID in string form
///
public const int ExternalAccountIdMaxLength = 256;
///
/// The most recent version of the struct.
///
public const int ExternalaccountinfoApiLatest = 1;
///
/// The most recent version of the API.
///
public const int GetexternalaccountmappingApiLatest = 1;
///
/// DEPRECATED! Use instead.
///
public const int GetexternalaccountmappingsApiLatest = GetexternalaccountmappingApiLatest;
///
/// The most recent version of the API.
///
public const int GetproductuserexternalaccountcountApiLatest = 1;
///
/// The most recent version of the API.
///
public const int GetproductuseridmappingApiLatest = 1;
///
/// The most recent version of the struct.
///
public const int IdtokenApiLatest = 1;
///
/// The most recent version of the API.
///
public const int LinkaccountApiLatest = 1;
///
/// The most recent version of the API.
///
public const int LoginApiLatest = 2;
///
/// The most recent version of the API.
///
public const int OnauthexpirationcallbackApiLatest = 1;
///
/// The most recent version of the API.
///
public const int QueryexternalaccountmappingsApiLatest = 1;
///
/// Maximum number of account IDs that can be queried at once
///
public const int QueryexternalaccountmappingsMaxAccountIds = 128;
///
/// The most recent version of the API.
///
public const int QueryproductuseridmappingsApiLatest = 2;
///
/// Timestamp value representing an undefined time for last login time.
///
public const int TimeUndefined = -1;
///
/// The most recent version of the API.
///
public const int TransferdeviceidaccountApiLatest = 1;
///
/// The most recent version of the API.
///
public const int UnlinkaccountApiLatest = 1;
///
/// The most recent version of the struct.
///
public const int UserlogininfoApiLatest = 1;
///
/// Max length of a display name, not including the terminating null.
///
public const int UserlogininfoDisplaynameMaxLength = 32;
///
/// The most recent version of the API.
///
public const int VerifyidtokenApiLatest = 1;
///
/// Register to receive upcoming authentication expiration notifications.
/// Notification is approximately 10 minutes prior to expiration.
/// Call again with valid third party credentials to refresh access.
/// must call RemoveNotifyAuthExpiration to remove the notification.
///
/// structure containing the API version of the callback to use.
/// arbitrary data that is passed back to you in the callback.
/// a callback that is fired when the authentication is about to expire.
///
/// handle representing the registered callback.
///
public ulong AddNotifyAuthExpiration(ref AddNotifyAuthExpirationOptions options, object clientData, OnAuthExpirationCallback notification)
{
AddNotifyAuthExpirationOptionsInternal optionsInternal = new AddNotifyAuthExpirationOptionsInternal();
optionsInternal.Set(ref options);
var clientDataAddress = System.IntPtr.Zero;
var notificationInternal = new OnAuthExpirationCallbackInternal(OnAuthExpirationCallbackInternalImplementation);
Helper.AddCallback(out clientDataAddress, clientData, notification, notificationInternal);
var funcResult = Bindings.EOS_Connect_AddNotifyAuthExpiration(InnerHandle, ref optionsInternal, clientDataAddress, notificationInternal);
Helper.Dispose(ref optionsInternal);
Helper.AssignNotificationIdToCallback(clientDataAddress, funcResult);
return funcResult;
}
///
/// Register to receive user login status updates.
/// must call RemoveNotifyLoginStatusChanged to remove the notification.
///
/// structure containing the API version of the callback to use.
/// arbitrary data that is passed back to you in the callback.
/// a callback that is fired when the login status for a user changes.
///
/// handle representing the registered callback.
///
public ulong AddNotifyLoginStatusChanged(ref AddNotifyLoginStatusChangedOptions options, object clientData, OnLoginStatusChangedCallback notification)
{
AddNotifyLoginStatusChangedOptionsInternal optionsInternal = new AddNotifyLoginStatusChangedOptionsInternal();
optionsInternal.Set(ref options);
var clientDataAddress = System.IntPtr.Zero;
var notificationInternal = new OnLoginStatusChangedCallbackInternal(OnLoginStatusChangedCallbackInternalImplementation);
Helper.AddCallback(out clientDataAddress, clientData, notification, notificationInternal);
var funcResult = Bindings.EOS_Connect_AddNotifyLoginStatusChanged(InnerHandle, ref optionsInternal, clientDataAddress, notificationInternal);
Helper.Dispose(ref optionsInternal);
Helper.AssignNotificationIdToCallback(clientDataAddress, funcResult);
return funcResult;
}
///
/// Fetches an ID token for a Product User ID.
///
///
/// Structure containing information about the ID token to copy.
/// The ID token for the given user, if it exists and is valid; use when finished.
///
/// if the information is available and passed out in OutIdToken.
/// if you pass a null pointer for the out parameter.
/// if the ID token is not found or expired.
///
public Result CopyIdToken(ref CopyIdTokenOptions options, out IdToken? outIdToken)
{
CopyIdTokenOptionsInternal optionsInternal = new CopyIdTokenOptionsInternal();
optionsInternal.Set(ref options);
var outIdTokenAddress = System.IntPtr.Zero;
var funcResult = Bindings.EOS_Connect_CopyIdToken(InnerHandle, ref optionsInternal, ref outIdTokenAddress);
Helper.Dispose(ref optionsInternal);
Helper.Get(outIdTokenAddress, out outIdToken);
if (outIdToken != null)
{
Bindings.EOS_Connect_IdToken_Release(outIdTokenAddress);
}
return funcResult;
}
///
/// Fetch information about an external account linked to a Product User ID.
/// On a successful call, the caller must release the returned structure using the API.
///
///
/// Structure containing the target external account ID.
/// The external account info data for the user with given external account ID.
///
/// An that indicates the external account data was copied into the OutExternalAccountInfo.
/// if the information is available and passed out in OutExternalAccountInfo.
/// if you pass a null pointer for the out parameter.
/// if the account data doesn't exist or hasn't been queried yet.
///
public Result CopyProductUserExternalAccountByAccountId(ref CopyProductUserExternalAccountByAccountIdOptions options, out ExternalAccountInfo? outExternalAccountInfo)
{
CopyProductUserExternalAccountByAccountIdOptionsInternal optionsInternal = new CopyProductUserExternalAccountByAccountIdOptionsInternal();
optionsInternal.Set(ref options);
var outExternalAccountInfoAddress = System.IntPtr.Zero;
var funcResult = Bindings.EOS_Connect_CopyProductUserExternalAccountByAccountId(InnerHandle, ref optionsInternal, ref outExternalAccountInfoAddress);
Helper.Dispose(ref optionsInternal);
Helper.Get(outExternalAccountInfoAddress, out outExternalAccountInfo);
if (outExternalAccountInfo != null)
{
Bindings.EOS_Connect_ExternalAccountInfo_Release(outExternalAccountInfoAddress);
}
return funcResult;
}
///
/// Fetch information about an external account of a specific type linked to a Product User ID.
/// On a successful call, the caller must release the returned structure using the API.
///
///
/// Structure containing the target external account type.
/// The external account info data for the user with given external account type.
///
/// An that indicates the external account data was copied into the OutExternalAccountInfo.
/// if the information is available and passed out in OutExternalAccountInfo.
/// if you pass a null pointer for the out parameter.
/// if the account data doesn't exist or hasn't been queried yet.
///
public Result CopyProductUserExternalAccountByAccountType(ref CopyProductUserExternalAccountByAccountTypeOptions options, out ExternalAccountInfo? outExternalAccountInfo)
{
CopyProductUserExternalAccountByAccountTypeOptionsInternal optionsInternal = new CopyProductUserExternalAccountByAccountTypeOptionsInternal();
optionsInternal.Set(ref options);
var outExternalAccountInfoAddress = System.IntPtr.Zero;
var funcResult = Bindings.EOS_Connect_CopyProductUserExternalAccountByAccountType(InnerHandle, ref optionsInternal, ref outExternalAccountInfoAddress);
Helper.Dispose(ref optionsInternal);
Helper.Get(outExternalAccountInfoAddress, out outExternalAccountInfo);
if (outExternalAccountInfo != null)
{
Bindings.EOS_Connect_ExternalAccountInfo_Release(outExternalAccountInfoAddress);
}
return funcResult;
}
///
/// Fetch information about an external account linked to a Product User ID.
/// On a successful call, the caller must release the returned structure using the API.
///
///
/// Structure containing the target index.
/// The external account info data for the user with given index.
///
/// An that indicates the external account data was copied into the OutExternalAccountInfo.
/// if the information is available and passed out in OutExternalAccountInfo.
/// if you pass a null pointer for the out parameter.
/// if the account data doesn't exist or hasn't been queried yet.
///
public Result CopyProductUserExternalAccountByIndex(ref CopyProductUserExternalAccountByIndexOptions options, out ExternalAccountInfo? outExternalAccountInfo)
{
CopyProductUserExternalAccountByIndexOptionsInternal optionsInternal = new CopyProductUserExternalAccountByIndexOptionsInternal();
optionsInternal.Set(ref options);
var outExternalAccountInfoAddress = System.IntPtr.Zero;
var funcResult = Bindings.EOS_Connect_CopyProductUserExternalAccountByIndex(InnerHandle, ref optionsInternal, ref outExternalAccountInfoAddress);
Helper.Dispose(ref optionsInternal);
Helper.Get(outExternalAccountInfoAddress, out outExternalAccountInfo);
if (outExternalAccountInfo != null)
{
Bindings.EOS_Connect_ExternalAccountInfo_Release(outExternalAccountInfoAddress);
}
return funcResult;
}
///
/// Fetch information about a Product User, using the external account that they most recently logged in with as the reference.
/// On a successful call, the caller must release the returned structure using the API.
///
///
/// Structure containing the target external account ID.
/// The external account info data last logged in for the user.
///
/// An that indicates the external account data was copied into the OutExternalAccountInfo.
/// if the information is available and passed out in OutExternalAccountInfo.
/// if you pass a null pointer for the out parameter.
/// if the account data doesn't exist or hasn't been queried yet.
///
public Result CopyProductUserInfo(ref CopyProductUserInfoOptions options, out ExternalAccountInfo? outExternalAccountInfo)
{
CopyProductUserInfoOptionsInternal optionsInternal = new CopyProductUserInfoOptionsInternal();
optionsInternal.Set(ref options);
var outExternalAccountInfoAddress = System.IntPtr.Zero;
var funcResult = Bindings.EOS_Connect_CopyProductUserInfo(InnerHandle, ref optionsInternal, ref outExternalAccountInfoAddress);
Helper.Dispose(ref optionsInternal);
Helper.Get(outExternalAccountInfoAddress, out outExternalAccountInfo);
if (outExternalAccountInfo != null)
{
Bindings.EOS_Connect_ExternalAccountInfo_Release(outExternalAccountInfoAddress);
}
return funcResult;
}
///
/// Create a new unique pseudo-account that can be used to identify the current user profile on the local device.
///
/// This function is intended to be used by mobile games and PC games that wish to allow
/// a new user to start playing without requiring to login to the game using any user identity.
/// In addition to this, the Device ID feature is used to automatically login the local user
/// also when they have linked at least one external user account(s) with the local Device ID.
///
/// It is possible to link many devices with the same user's account keyring using the Device ID feature.
///
/// Linking a device later or immediately with a real user account will ensure that the player
/// will not lose their progress if they switch devices or lose the device at some point,
/// as they will be always able to login with one of their linked real accounts and also link
/// another new device with the user account associations keychain. Otherwise, without having
/// at least one permanent user account linked to the Device ID, the player would lose all of their
/// game data and progression permanently should something happen to their device or the local
/// user profile on the device.
///
/// After a successful one-time CreateDeviceId operation, the game can login the local user
/// automatically on subsequent game starts with using the
/// credentials type. If a Device ID already exists for the local user on the device then
/// error result is returned and the caller should proceed to calling directly.
///
/// structure containing operation input parameters.
/// arbitrary data that is passed back to you in the CompletionDelegate.
/// a callback that is fired when the create operation completes, either successfully or in error.
public void CreateDeviceId(ref CreateDeviceIdOptions options, object clientData, OnCreateDeviceIdCallback completionDelegate)
{
CreateDeviceIdOptionsInternal optionsInternal = new CreateDeviceIdOptionsInternal();
optionsInternal.Set(ref options);
var clientDataAddress = System.IntPtr.Zero;
var completionDelegateInternal = new OnCreateDeviceIdCallbackInternal(OnCreateDeviceIdCallbackInternalImplementation);
Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
Bindings.EOS_Connect_CreateDeviceId(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
Helper.Dispose(ref optionsInternal);
}
///
/// Create an account association with the Epic Online Service as a product user given their external auth credentials.
///
/// structure containing a continuance token from a "user not found" response during Login (always try login first).
/// arbitrary data that is passed back to you in the CompletionDelegate.
/// a callback that is fired when the create operation completes, either successfully or in error.
public void CreateUser(ref CreateUserOptions options, object clientData, OnCreateUserCallback completionDelegate)
{
CreateUserOptionsInternal optionsInternal = new CreateUserOptionsInternal();
optionsInternal.Set(ref options);
var clientDataAddress = System.IntPtr.Zero;
var completionDelegateInternal = new OnCreateUserCallbackInternal(OnCreateUserCallbackInternalImplementation);
Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
Bindings.EOS_Connect_CreateUser(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
Helper.Dispose(ref optionsInternal);
}
///
/// Delete any existing Device ID access credentials for the current user profile on the local device.
///
/// The deletion is permanent and it is not possible to recover lost game data and progression
/// if the Device ID had not been linked with at least one real external user account.
///
/// On Android and iOS devices, uninstalling the application will automatically delete any local
/// Device ID credentials created by the application.
///
/// On Desktop platforms (Linux, macOS, Windows), Device ID credentials are not automatically deleted.
/// Applications may re-use existing Device ID credentials for the local OS user when the application is
/// re-installed, or call the DeleteDeviceId API on the first run to ensure a fresh start for the user.
///
/// structure containing operation input parameters
/// arbitrary data that is passed back to you in the CompletionDelegate
/// a callback that is fired when the delete operation completes, either successfully or in error
public void DeleteDeviceId(ref DeleteDeviceIdOptions options, object clientData, OnDeleteDeviceIdCallback completionDelegate)
{
DeleteDeviceIdOptionsInternal optionsInternal = new DeleteDeviceIdOptionsInternal();
optionsInternal.Set(ref options);
var clientDataAddress = System.IntPtr.Zero;
var completionDelegateInternal = new OnDeleteDeviceIdCallbackInternal(OnDeleteDeviceIdCallbackInternalImplementation);
Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
Bindings.EOS_Connect_DeleteDeviceId(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
Helper.Dispose(ref optionsInternal);
}
///
/// Fetch a Product User ID that maps to an external account ID cached from a previous query.
///
/// structure containing the local user and target external account ID.
///
/// The Product User ID, previously retrieved from the backend service, for the given target external account.
///
public ProductUserId GetExternalAccountMapping(ref GetExternalAccountMappingsOptions options)
{
GetExternalAccountMappingsOptionsInternal optionsInternal = new GetExternalAccountMappingsOptionsInternal();
optionsInternal.Set(ref options);
var funcResult = Bindings.EOS_Connect_GetExternalAccountMapping(InnerHandle, ref optionsInternal);
Helper.Dispose(ref optionsInternal);
ProductUserId funcResultReturn;
Helper.Get(funcResult, out funcResultReturn);
return funcResultReturn;
}
///
/// Fetch a Product User ID that is logged in. This Product User ID is in the Epic Online Services namespace.
///
/// an index into the list of logged in users. If the index is out of bounds, the returned Product User ID will be invalid.
///
/// the Product User ID associated with the index passed.
///
public ProductUserId GetLoggedInUserByIndex(int index)
{
var funcResult = Bindings.EOS_Connect_GetLoggedInUserByIndex(InnerHandle, index);
ProductUserId funcResultReturn;
Helper.Get(funcResult, out funcResultReturn);
return funcResultReturn;
}
///
/// Fetch the number of product users that are logged in.
///
///
/// the number of product users logged in.
///
public int GetLoggedInUsersCount()
{
var funcResult = Bindings.EOS_Connect_GetLoggedInUsersCount(InnerHandle);
return funcResult;
}
///
/// Fetches the login status for an Product User ID. This Product User ID is considered logged in as long as the underlying access token has not expired.
///
/// the Product User ID of the user being queried.
///
/// the enum value of a user's login status.
///
public LoginStatus GetLoginStatus(ProductUserId localUserId)
{
var localUserIdInnerHandle = System.IntPtr.Zero;
Helper.Set(localUserId, ref localUserIdInnerHandle);
var funcResult = Bindings.EOS_Connect_GetLoginStatus(InnerHandle, localUserIdInnerHandle);
return funcResult;
}
///
/// Fetch the number of linked external accounts for a Product User ID.
///
///
/// The Options associated with retrieving the external account info count.
///
/// Number of external accounts or 0 otherwise.
///
public uint GetProductUserExternalAccountCount(ref GetProductUserExternalAccountCountOptions options)
{
GetProductUserExternalAccountCountOptionsInternal optionsInternal = new GetProductUserExternalAccountCountOptionsInternal();
optionsInternal.Set(ref options);
var funcResult = Bindings.EOS_Connect_GetProductUserExternalAccountCount(InnerHandle, ref optionsInternal);
Helper.Dispose(ref optionsInternal);
return funcResult;
}
///
/// Fetch an external account ID, in string form, that maps to a given Product User ID.
///
/// structure containing the local user and target Product User ID.
/// The buffer into which the external account ID data should be written. The buffer must be long enough to hold a string of .
///
/// The size of the OutBuffer in characters.
/// The input buffer should include enough space to be null-terminated.
/// When the function returns, this parameter will be filled with the length of the string copied into OutBuffer.
///
///
/// An that indicates the external account ID was copied into the OutBuffer.
/// if the information is available and passed out in OutUserInfo.
/// if you pass a null pointer for the out parameter.
/// if the mapping doesn't exist or hasn't been queried yet.
/// if the OutBuffer is not large enough to receive the external account ID. InOutBufferLength contains the required minimum length to perform the operation successfully.
///
public Result GetProductUserIdMapping(ref GetProductUserIdMappingOptions options, out Utf8String outBuffer)
{
GetProductUserIdMappingOptionsInternal optionsInternal = new GetProductUserIdMappingOptionsInternal();
optionsInternal.Set(ref options);
int inOutBufferLength = ExternalAccountIdMaxLength + 1;
System.IntPtr outBufferAddress = Helper.AddAllocation(inOutBufferLength);
var funcResult = Bindings.EOS_Connect_GetProductUserIdMapping(InnerHandle, ref optionsInternal, outBufferAddress, ref inOutBufferLength);
Helper.Dispose(ref optionsInternal);
Helper.Get(outBufferAddress, out outBuffer);
Helper.Dispose(ref outBufferAddress);
return funcResult;
}
///
/// Link a set of external auth credentials with an existing product user on the Epic Online Service.
///
/// structure containing a continuance token from a "user not found" response during Login (always try login first) and a currently logged in user not already associated with this external auth provider.
/// arbitrary data that is passed back to you in the CompletionDelegate.
/// a callback that is fired when the link operation completes, either successfully or in error.
public void LinkAccount(ref LinkAccountOptions options, object clientData, OnLinkAccountCallback completionDelegate)
{
LinkAccountOptionsInternal optionsInternal = new LinkAccountOptionsInternal();
optionsInternal.Set(ref options);
var clientDataAddress = System.IntPtr.Zero;
var completionDelegateInternal = new OnLinkAccountCallbackInternal(OnLinkAccountCallbackInternalImplementation);
Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
Bindings.EOS_Connect_LinkAccount(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
Helper.Dispose(ref optionsInternal);
}
///
/// Login/Authenticate given a valid set of external auth credentials.
///
/// structure containing the external account credentials and type to use during the login operation.
/// arbitrary data that is passed back to you in the CompletionDelegate.
/// a callback that is fired when the login operation completes, either successfully or in error.
public void Login(ref LoginOptions options, object clientData, OnLoginCallback completionDelegate)
{
LoginOptionsInternal optionsInternal = new LoginOptionsInternal();
optionsInternal.Set(ref options);
var clientDataAddress = System.IntPtr.Zero;
var completionDelegateInternal = new OnLoginCallbackInternal(OnLoginCallbackInternalImplementation);
Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
Bindings.EOS_Connect_Login(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
Helper.Dispose(ref optionsInternal);
}
///
/// Retrieve the equivalent Product User IDs from a list of external account IDs from supported account providers.
/// The values will be cached and retrievable through .
/// A common use case is to query other users who are connected through the same account system as the local user.
/// Queries using external account IDs of another account system may not be available, depending on the account system specifics.
///
/// structure containing a list of external account IDs, in string form, to query for the Product User ID representation.
/// arbitrary data that is passed back to you in the CompletionDelegate.
/// a callback that is fired when the query operation completes, either successfully or in error.
public void QueryExternalAccountMappings(ref QueryExternalAccountMappingsOptions options, object clientData, OnQueryExternalAccountMappingsCallback completionDelegate)
{
QueryExternalAccountMappingsOptionsInternal optionsInternal = new QueryExternalAccountMappingsOptionsInternal();
optionsInternal.Set(ref options);
var clientDataAddress = System.IntPtr.Zero;
var completionDelegateInternal = new OnQueryExternalAccountMappingsCallbackInternal(OnQueryExternalAccountMappingsCallbackInternalImplementation);
Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
Bindings.EOS_Connect_QueryExternalAccountMappings(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
Helper.Dispose(ref optionsInternal);
}
///
/// Retrieve the equivalent external account mappings from a list of Product User IDs.
///
/// The values will be cached and retrievable via , ,
/// or .
///
///
///
///
///
///
///
///
/// structure containing a list of Product User IDs to query for the external account representation.
/// arbitrary data that is passed back to you in the CompletionDelegate.
/// a callback that is fired when the query operation completes, either successfully or in error.
public void QueryProductUserIdMappings(ref QueryProductUserIdMappingsOptions options, object clientData, OnQueryProductUserIdMappingsCallback completionDelegate)
{
QueryProductUserIdMappingsOptionsInternal optionsInternal = new QueryProductUserIdMappingsOptionsInternal();
optionsInternal.Set(ref options);
var clientDataAddress = System.IntPtr.Zero;
var completionDelegateInternal = new OnQueryProductUserIdMappingsCallbackInternal(OnQueryProductUserIdMappingsCallbackInternalImplementation);
Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
Bindings.EOS_Connect_QueryProductUserIdMappings(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
Helper.Dispose(ref optionsInternal);
}
///
/// Unregister from receiving expiration notifications.
///
/// handle representing the registered callback.
public void RemoveNotifyAuthExpiration(ulong inId)
{
Bindings.EOS_Connect_RemoveNotifyAuthExpiration(InnerHandle, inId);
Helper.RemoveCallbackByNotificationId(inId);
}
///
/// Unregister from receiving user login status updates.
///
/// handle representing the registered callback.
public void RemoveNotifyLoginStatusChanged(ulong inId)
{
Bindings.EOS_Connect_RemoveNotifyLoginStatusChanged(InnerHandle, inId);
Helper.RemoveCallbackByNotificationId(inId);
}
///
/// Transfer a Device ID pseudo-account and the product user associated with it into another
/// keychain linked with real user accounts (such as Epic Games, PlayStation(TM)Network, Xbox Live, and other).
///
/// This function allows transferring a product user, i.e. the local user's game progression
/// backend data from a Device ID owned keychain into a keychain with real user accounts
/// linked to it. The transfer of Device ID owned product user into a keychain of real user
/// accounts allows persisting the user's game data on the backend in the event that they
/// would lose access to the local device or otherwise switch to another device or platform.
///
/// This function is only applicable in the situation of where the local user first plays
/// the game using the anonymous Device ID login, then later logs in using a real user
/// account that they have also already used to play the same game or another game under the
/// same organization within Epic Online Services. In such situation, while normally the login
/// attempt with a real user account would return and an
/// and allow calling the API to link it with the Device ID's keychain,
/// instead the login operation succeeds and finds an existing user because the association
/// already exists. Because the user cannot have two product users simultaneously to play with,
/// the game should prompt the user to choose which profile to keep and which one to discard
/// permanently. Based on the user choice, the game may then proceed to transfer the Device ID
/// login into the keychain that is persistent and backed by real user accounts, and if the user
/// chooses so, move the product user as well into the destination keychain and overwrite the
/// existing previous product user with it. To clarify, moving the product user with the Device ID
/// login in this way into a persisted keychain allows to preserve the so far only locally persisted
/// game progression and thus protect the user against a case where they lose access to the device.
///
/// On success, the completion callback will return the preserved that remains
/// logged in while the discarded has been invalidated and deleted permanently.
/// Consecutive logins using the existing Device ID login type or the external account will
/// connect the user to the same backend data belonging to the preserved .
///
/// Example walkthrough: Cross-platform mobile game using the anonymous Device ID login.
///
/// For onboarding new users, the game will attempt to always automatically login the local user
/// by calling using the login type. If the local
/// Device ID credentials are not found, and the game wants a frictionless entry for the first time
/// user experience, the game will automatically call to create new
/// Device ID pseudo-account and then login the local user into it. Consecutive game starts will
/// thus automatically login the user to their locally persisted Device ID account.
///
/// The user starts playing anonymously using the Device ID login type and makes significant game progress.
/// Later, they login using an external account that they have already used previously for the
/// same game perhaps on another platform, or another game owned by the same organization.
/// In such case, will automatically login the user to their existing account
/// linking keychain and create automatically a new empty product user for this product.
///
/// In order for the user to use their existing previously created keychain and have the locally
/// created Device ID login reference to that keychain instead, the user's current product user
/// needs to be moved to be under that keychain so that their existing game progression will be
/// preserved. To do so, the game can call to transfer the
/// Device ID login and the product user associated with it into the other keychain that has real
/// external user account(s) linked to it. Note that it is important that the game either automatically
/// checks that the other product user does not have any meaningful progression data, or otherwise
/// will prompt the user to make the choice on which game progression to preserve and which can
/// be discarded permanently. The other product user will be discarded permanently and cannot be
/// recovered, so it is very important that the user is guided to make the right choice to a
/// accidental loss of all game progression.
///
///
///
/// structure containing the logged in product users and specifying which one will be preserved.
/// arbitrary data that is passed back to you in the CompletionDelegate.
/// a callback that is fired when the transfer operation completes, either successfully or in error.
public void TransferDeviceIdAccount(ref TransferDeviceIdAccountOptions options, object clientData, OnTransferDeviceIdAccountCallback completionDelegate)
{
TransferDeviceIdAccountOptionsInternal optionsInternal = new TransferDeviceIdAccountOptionsInternal();
optionsInternal.Set(ref options);
var clientDataAddress = System.IntPtr.Zero;
var completionDelegateInternal = new OnTransferDeviceIdAccountCallbackInternal(OnTransferDeviceIdAccountCallbackInternalImplementation);
Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
Bindings.EOS_Connect_TransferDeviceIdAccount(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
Helper.Dispose(ref optionsInternal);
}
///
/// Unlink external auth credentials from the owning keychain of a logged in product user.
///
/// This function allows recovering the user from scenarios where they have accidentally proceeded to creating
/// a new product user for the local native user account, instead of linking it with an existing keychain that
/// they have previously created by playing the game (or another game owned by the organization) on another platform.
///
/// In such scenario, after the initial platform login and a new product user creation, the user wishes to re-login
/// using other set of external auth credentials to connect with their existing game progression data. In order to
/// allow automatic login also on the current platform, they will need to unlink the accidentally created new keychain
/// and product user and then use the and APIs to link the local native platform
/// account with that previously created existing product user and its owning keychain.
///
/// In another scenario, the user may simply want to disassociate the account that they have logged in with from the current
/// keychain that it is linked with, perhaps to link it against another keychain or to separate the game progressions again.
///
/// In order to protect against account theft, it is only possible to unlink user accounts that have been authenticated
/// and logged in to the product user in the current session. This prevents a malicious actor from gaining access to one
/// of the linked accounts and using it to remove all other accounts linked with the keychain. This also prevents a malicious
/// actor from replacing the unlinked account with their own corresponding account on the same platform, as the unlinking
/// operation will ensure that any existing authentication session cannot be used to re-link and overwrite the entry without
/// authenticating with one of the other linked accounts in the keychain. These restrictions limit the potential attack surface
/// related to account theft scenarios.
///
/// structure containing operation input parameters.
/// arbitrary data that is passed back to you in the CompletionDelegate.
/// a callback that is fired when the unlink operation completes, either successfully or in error.
public void UnlinkAccount(ref UnlinkAccountOptions options, object clientData, OnUnlinkAccountCallback completionDelegate)
{
UnlinkAccountOptionsInternal optionsInternal = new UnlinkAccountOptionsInternal();
optionsInternal.Set(ref options);
var clientDataAddress = System.IntPtr.Zero;
var completionDelegateInternal = new OnUnlinkAccountCallbackInternal(OnUnlinkAccountCallbackInternalImplementation);
Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
Bindings.EOS_Connect_UnlinkAccount(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
Helper.Dispose(ref optionsInternal);
}
///
/// Verify a given ID token for authenticity and validity.
///
/// structure containing information about the ID token to verify.
/// arbitrary data that is passed back to you in the callback.
/// a callback that is fired when the operation completes, either successfully or in error.
public void VerifyIdToken(ref VerifyIdTokenOptions options, object clientData, OnVerifyIdTokenCallback completionDelegate)
{
VerifyIdTokenOptionsInternal optionsInternal = new VerifyIdTokenOptionsInternal();
optionsInternal.Set(ref options);
var clientDataAddress = System.IntPtr.Zero;
var completionDelegateInternal = new OnVerifyIdTokenCallbackInternal(OnVerifyIdTokenCallbackInternalImplementation);
Helper.AddCallback(out clientDataAddress, clientData, completionDelegate, completionDelegateInternal);
Bindings.EOS_Connect_VerifyIdToken(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
Helper.Dispose(ref optionsInternal);
}
[MonoPInvokeCallback(typeof(OnAuthExpirationCallbackInternal))]
internal static void OnAuthExpirationCallbackInternalImplementation(ref AuthExpirationCallbackInfoInternal data)
{
OnAuthExpirationCallback callback;
AuthExpirationCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
{
callback(ref callbackInfo);
}
}
[MonoPInvokeCallback(typeof(OnCreateDeviceIdCallbackInternal))]
internal static void OnCreateDeviceIdCallbackInternalImplementation(ref CreateDeviceIdCallbackInfoInternal data)
{
OnCreateDeviceIdCallback callback;
CreateDeviceIdCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
{
callback(ref callbackInfo);
}
}
[MonoPInvokeCallback(typeof(OnCreateUserCallbackInternal))]
internal static void OnCreateUserCallbackInternalImplementation(ref CreateUserCallbackInfoInternal data)
{
OnCreateUserCallback callback;
CreateUserCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
{
callback(ref callbackInfo);
}
}
[MonoPInvokeCallback(typeof(OnDeleteDeviceIdCallbackInternal))]
internal static void OnDeleteDeviceIdCallbackInternalImplementation(ref DeleteDeviceIdCallbackInfoInternal data)
{
OnDeleteDeviceIdCallback callback;
DeleteDeviceIdCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
{
callback(ref callbackInfo);
}
}
[MonoPInvokeCallback(typeof(OnLinkAccountCallbackInternal))]
internal static void OnLinkAccountCallbackInternalImplementation(ref LinkAccountCallbackInfoInternal data)
{
OnLinkAccountCallback callback;
LinkAccountCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
{
callback(ref callbackInfo);
}
}
[MonoPInvokeCallback(typeof(OnLoginCallbackInternal))]
internal static void OnLoginCallbackInternalImplementation(ref LoginCallbackInfoInternal data)
{
OnLoginCallback callback;
LoginCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
{
callback(ref callbackInfo);
}
}
[MonoPInvokeCallback(typeof(OnLoginStatusChangedCallbackInternal))]
internal static void OnLoginStatusChangedCallbackInternalImplementation(ref LoginStatusChangedCallbackInfoInternal data)
{
OnLoginStatusChangedCallback callback;
LoginStatusChangedCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
{
callback(ref callbackInfo);
}
}
[MonoPInvokeCallback(typeof(OnQueryExternalAccountMappingsCallbackInternal))]
internal static void OnQueryExternalAccountMappingsCallbackInternalImplementation(ref QueryExternalAccountMappingsCallbackInfoInternal data)
{
OnQueryExternalAccountMappingsCallback callback;
QueryExternalAccountMappingsCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
{
callback(ref callbackInfo);
}
}
[MonoPInvokeCallback(typeof(OnQueryProductUserIdMappingsCallbackInternal))]
internal static void OnQueryProductUserIdMappingsCallbackInternalImplementation(ref QueryProductUserIdMappingsCallbackInfoInternal data)
{
OnQueryProductUserIdMappingsCallback callback;
QueryProductUserIdMappingsCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
{
callback(ref callbackInfo);
}
}
[MonoPInvokeCallback(typeof(OnTransferDeviceIdAccountCallbackInternal))]
internal static void OnTransferDeviceIdAccountCallbackInternalImplementation(ref TransferDeviceIdAccountCallbackInfoInternal data)
{
OnTransferDeviceIdAccountCallback callback;
TransferDeviceIdAccountCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
{
callback(ref callbackInfo);
}
}
[MonoPInvokeCallback(typeof(OnUnlinkAccountCallbackInternal))]
internal static void OnUnlinkAccountCallbackInternalImplementation(ref UnlinkAccountCallbackInfoInternal data)
{
OnUnlinkAccountCallback callback;
UnlinkAccountCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
{
callback(ref callbackInfo);
}
}
[MonoPInvokeCallback(typeof(OnVerifyIdTokenCallbackInternal))]
internal static void OnVerifyIdTokenCallbackInternalImplementation(ref VerifyIdTokenCallbackInfoInternal data)
{
OnVerifyIdTokenCallback callback;
VerifyIdTokenCallbackInfo callbackInfo;
if (Helper.TryGetAndRemoveCallback(ref data, out callback, out callbackInfo))
{
callback(ref callbackInfo);
}
}
}
}