Title Storage Sample

Overview of the Title Storage Sample

EOS SDK title storage sample

Before You Begin

The Title Storage Sample uses Epic Account Services to authenticate the local user for demonstration purposes. This requires that the Client Credentials used to initialize the Epic Online Services (EOS) SDK have been assigned to an Application used for Epic Account Services.

The SDK functionality demonstrated in this sample works with any of the supported identity providers for user authentication.

Since the Title Storage Interface does not have the ability to upload or tag files, you will need to do so through the Developer Portal. Note that the Encryption Key you are using when uploading files via the Developer Portal must match the one in SampleConstants.h within the sample. Otherwise, the decryption phase after download will produce incorrect results.

Exploring the Sample

The Title Storage Sample is a simple file explorer for the cloud storage associated with your product. You can log in or out with your account. While logged in, you can browse, download, and view the files associated with your product. If you have tagged any files through the Dev Portal, you can perform queries based on those tags.

The Title Storage Panel

To get started with the Title Storage Sample, locate the Title Storage panel on the right side of the user interface and log in by entering your Host Address and User Credentials (from the Developer Authentication Tool) and pressing the Log In button.

The login screen for the Title Storage sample. Click image to enlarge.

After logging in, you will be able to query, download, and view the files associated with your product, if any exist. The Log In button will change to Log Out, and the user interface for interacting with your files will become available.

The main panel for the title storage page. Click image to enlarge.

The Title Storage Sample features the following functionality:

  • Download: Downloads a single file. Enter the name of the file you want to download in the field next to the Download button, then press the button. The back-end service will determine which file to send based on its file override settings, if any, and the sample will download that file and put it into the file list. Once the download is finished, you will be able to click on the file in the list and see its contents.

  • Query: Populates the file list with all files that have at least one of a set of tags. Enter each tag that you want to include in your query into the text field next to the Add Tag button, one at a time, and press the button to add them to the tag list. You can clear the tag list at any time by pressing the Clear List button. Once the list contains all the tags you want to use in your query, press the Query List button to populate the file list at the bottom of the window with all files that contain at least one of the tags you listed. You can download a file from the list and view its contents by selecting it and pressing with the Download button.

The Console Panel

Log output from the program's operation, including the results of console commands, will appear in the text area at the top of the Console panel, which appears on the lower-left side of the user interface. In addition to pressing the buttons in the Title Storage panel, you can type in console commands at the bottom of the Console panel.

The console panel for the title storage sample. Click image to enlarge.

The following commands are supported:

Command

Arguments

Behavior

GETFILE

FILE_NAME

Downloads the specified file by name from the cloud

TESTFILE

FILE_NAME, FILE_PATH

Retrieves FILE_NAME from the

Title Storage Interface

and compares its contents to the local, unencrypted file at FILE_PATH

HELP

(none)

Prints help information about all the above commands to the console output.

You can add your own console commands in the Game::CreateConsoleCommands function in Game.cpp.

The File Panel

The File panel displays the contents of the currently-selected file (in the Title Storage panel).

The Progress Bar Window

The file transfer operations that the Title Storage Sample performs are asynchronous. While performing these operations, the sample shows a Progress Bar window, a popup with a progress bar, and a Cancel button. Users can interrupt the transfer by clicking Cancel. The sample only runs one file transfer operation at a time, although the Title Storage Interface can support multiple transfer operations at once.

A file transfer in progress. Click image to enlarge.

Exploring the Source Code

Most of the code that interacts with data files is in Samples/TitleStorage/Source/TitleStorage.cpp. The following functions interact with the Title Storage Interface directly:

Function Name

Behavior

QueryList

Retrieves the list of file entries based on currently selected tag.

StartFileDataDownload

Retrieves the contents of a specific file.

CancelCurrentTransfer

Cancels the current file transfer (if any).

These functions do not use the Title Storage Interface directly, but do interact with related data on the local system. They can be helpful as basic guides when building your own systems to manage locally-cached information about files:

Function Name

Behavior

GetFileList

Returns the local file list.

SetFileList

Sets the local file list.

GetLocalData

Returns locally cached data for the file specified. The NoData flag is set to true when there is no data available locally.

SetLocalData

Sets local data for the specified file.

EraseLocalData

Erases local data for the specified file (if it exists).

AddTag

Adds new tag to the set of currently selected tags to be used by list queries.

ClearTags

Remove all currently selected tags

GetCurrentTags

Get selected tags