EOS_Connect_CreateDeviceId

EOS API reference page for EOS_Connect_CreateDeviceId

6 分钟可读完

This function is part of the Connect Interface.

Remarks

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 EOS_Connect_Login using the EOS_ECT_DEVICEID_ACCESS_TOKEN credentials type. If a Device ID already exists for the local user on the device then EOS_DuplicateNotAllowed error result is returned and the caller should proceed to calling EOS_Connect_Login directly.

Parameters

EOS_Connect_CreateDeviceId

Parameter Type And NameUsage Information
EOS_HConnect Handle
const EOS_Connect_CreateDeviceIdOptions* Optionsstructure containing operation input parameters.
void* ClientDataarbitrary data that is passed back to you in the CompletionDelegate.
const EOS_Connect_OnCreateDeviceIdCallback CompletionDelegatea callback that is fired when the create operation completes, either successfully or in error.

Callback Function Information

Because this function is asynchronous, it employs a callback of type EOS_Connect_OnCreateDeviceIdCallback to report the results of its operation.

Callback Parameters

EOS_Connect_OnCreateDeviceIdCallback

Parameter Type And NameUsage Information
const EOS_Connect_CreateDeviceIdCallbackInfo* DataOutput parameters for the EOS_Connect_CreateDeviceId function.