-
Notifications
You must be signed in to change notification settings - Fork 2
progression_snapshot
Epic Online Services: Progression Snapshot Interface
The Progression Snapshot Interface allows storing player-specific game data for the purposes of supporting an end-user experience for Epic account merging. As of today, the concept of merging two separate Epic accounts, owned by the same user, into a single Epic account does not exist. However, this type of account merging is a feature that will be made available to users of Epic Accounts in the future. The progression snapshot feature becomes relevant for users in cases where they have two separate Epic accounts, and have played the same game on both of the accounts. In such a case, if the user chooses to merge their Epic accounts into a single account, the Epic overlay will be able to present a snapshot view of their game progress for both accounts. This allows users to choose their preferred game progression to preserve as a result of the account merge operation.
These functions are provided for handling progression snapshot:
- EpicGames_ProgressionSnapshot_AddProgression
- EpicGames_ProgressionSnapshot_BeginSnapshot
- EpicGames_ProgressionSnapshot_DeleteSnapshot
- EpicGames_ProgressionSnapshot_EndSnapshot
- EpicGames_ProgressionSnapshot_SubmitSnapshot
Epic Online Services Function: EOS_ProgressionSnapshot_AddProgression
This function stores a Key/Value pair in memory for a given snapshot.
If multiple calls happen with the same key, the last invocation wins, overwriting the previous value for that given key. The order in which the Key/Value pairs are added is stored as is for later retrieval/display. Ideally, you would make multiple calls to EpicGames_ProgressionSnapshot_AddProgression followed by a single call to EpicGames_ProgressionSnapshot_SubmitSnapshot.
Syntax:
EpicGames_ProgressionSnapshot_AddProgression(snapshotId, key, value)
Argument | Type | Description |
---|---|---|
snapshotId | Real | The Snapshot ID received via a EpicGames_ProgressionSnapshot_BeginSnapshot function. |
key | String | The key in a key/value pair of progression entry |
value | String | The value in a key/value pair of progression entry |
Returns:
N/A
Example:
identifier = EpicGames_ProgressionSnapshot_BeginSnapshot(local_UserId);
EpicGames_ProgressionSnapshot_AddProgression(identifier, "PlayerName", "Hero");
The code sample above shows an example of how to create a snapshot (EpicGames_ProgressionSnapshot_BeginSnapshot) and add a progression value to it.
Epic Online Services Function: EOS_ProgressionSnapshot_BeginSnapshot
This function creates a new progression-snapshot resource for a given user.
The function will return a progression-snapshot identifier output parameter. Use that identifier to reference the snapshot in the other functions:
- EpicGames_ProgressionSnapshot_AddProgression
- EpicGames_ProgressionSnapshot_DeleteSnapshot
- EpicGames_ProgressionSnapshot_EndSnapshot
- EpicGames_ProgressionSnapshot_SubmitSnapshot
Syntax:
EpicGames_ProgressionSnapshot_BeginSnapshot(local_UserId)
Argument | Type | Description |
---|---|---|
local_UserId | String | The Product User ID of the local user to whom the key/value pair belongs |
Returns:
Example:
identifier = EpicGames_ProgressionSnapshot_BeginSnapshot(local_UserId);
EpicGames_ProgressionSnapshot_AddProgression(identifier, "PlayerName", "Hero");
The code sample above shows how to create a snapshot and add a progression value to it (EpicGames_ProgressionSnapshot_AddProgression).
Epic Online Services Function: EOS_ProgressionSnapshot_DeleteSnapshot
This function wipes out all progression data for the given user from the service. However, any previous progression data that haven't been submitted yet are retained.
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_ProgressionSnapshot_DeleteSnapshot(userId)
Argument | Type | Description |
---|---|---|
userId | String | The Product User ID of the local user to whom the key/value pair belong |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | Real | "EpicGames_ProgressionSnapshot_DeleteSnapshot" |
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_ProgressionSnapshot_DeleteSnapshot(userId);
The code sample above saves the identifier that can be used inside a Social Async Event.
if (async_load[? "type"] == "EpicGames_ProgressionSnapshot_DeleteSnapshot")
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_ProgressionSnapshot_EndSnapshot
This function cleans up and releases resources associated with the given progression snapshot identifier.
Note
This function should be called after submission (EpicGames_ProgressionSnapshot_SubmitSnapshot).
Syntax:
EpicGames_ProgressionSnapshot_EndSnapshot(snapshotId)
Argument | Type | Description |
---|---|---|
snapshotId | String | The Snapshot ID received via a call to the EpicGames_ProgressionSnapshot_BeginSnapshot function. |
Returns:
Example:
result = EpicGames_ProgressionSnapshot_EndSnapshot(snapshotId);
if (result.status == EpicGames_Success)
{
show_debug_message("EpicGames_ProgressionSnapshot_EndSnapshot: success");
}
The code above matches the response status and logs the success of the task.
Epic Online Services Function: EOS_ProgressionSnapshot_SubmitSnapshot
This function saves the previously added Key/Value pairs of a given Snapshot to the service.
Note
This will overwrite any prior progression data stored with the service that's associated with the user.
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_ProgressionSnapshot_SubmitSnapshot(snapshotId)
Argument | Type | Description |
---|---|---|
snapshotId | Real | The Snapshot ID received via a call to the EpicGames_ProgressionSnapshot_BeginSnapshot function. |
Returns:
Triggers:
Key | Type | Description |
---|---|---|
type | String | "EpicGames_ProgressionSnapshot_SubmitSnapshot" |
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_ProgressionSnapshot_SubmitSnapshot(snapshotId);
The code sample above saves the identifier that can be used inside a Social Async Event.
if (async_load[? "type"] == "EpicGames_ProgressionSnapshot_SubmitSnapshot")
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.
YoYoGames 2024