LootLocker Unity SDK 8.0.0
Game backend SDK for Unity
Loading...
Searching...
No Matches
Player Files

Detailed Description

CDN-backed file storage scoped to a player's profile.

Best suited for large files such as screenshots, cloud saves, or profile pictures that benefit from CDN delivery. For small key-value data prefer Metadata. Each file upload requires a declared purpose; files can be marked private to restrict visibility. Up to five revisions per file are retained, with revert capability in the Web Console.

See the LootLocker documentation.

Function Documentation

◆ DeletePlayerFile()

static void LootLocker.Requests.LootLockerSDKManager.DeletePlayerFile ( int  fileId,
Action< LootLockerResponse onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

The file will be deleted immediately and the action can not be reversed.

You will get the ID of files when you upload a file, or with GetAllPlayerFiles().

Parameters
fileIdId of the file. You can get the ID of files when you upload a file, or with GetAllPlayerFiles()
onCompleteonComplete Action for handling the response of type LootLockerResponse
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

◆ GetAllPlayerFiles() [1/2]

static void LootLocker.Requests.LootLockerSDKManager.GetAllPlayerFiles ( Action< LootLockerPlayerFilesResponse onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

Returns all the files that your currently active player own.

Parameters
onCompleteonComplete Action for handling the response of type LootLockerPlayerFilesResponse
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

◆ GetAllPlayerFiles() [2/2]

static void LootLocker.Requests.LootLockerSDKManager.GetAllPlayerFiles ( int  playerId,
Action< LootLockerPlayerFilesResponse onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

Returns all public files that the player with the provided playerID owns.

Parameters
playerIdThe ID of the player whose public files to retrieve
onCompleteonComplete Action for handling the response of type LootLockerPlayerFilesResponse
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

◆ GetPlayerFile()

static void LootLocker.Requests.LootLockerSDKManager.GetPlayerFile ( int  fileId,
Action< LootLockerPlayerFile onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

Returns a URL where you can access the file.

You can get the ID of files when you upload them, or call the list endpoint.

Parameters
fileIdId of the file, can be retrieved with GetAllPlayerFiles() or when the file is uploaded
onCompleteonComplete Action for handling the response of type LootLockerPlayerFile
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

◆ UpdatePlayerFile() [1/3]

static void LootLocker.Requests.LootLockerSDKManager.UpdatePlayerFile ( int  fileId,
byte[]  fileBytes,
Action< LootLockerPlayerFile onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

Update an existing player file with a new file using a byte array.

Can be useful if you want to upload without storing anything on disk.

Parameters
fileIdId of the file. You can get the ID of files when you upload a file, or with GetAllPlayerFiles()
fileBytesByte array to upload
onCompleteonComplete Action for handling the response of type LootLockerPlayerFile
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

◆ UpdatePlayerFile() [2/3]

static void LootLocker.Requests.LootLockerSDKManager.UpdatePlayerFile ( int  fileId,
FileStream  fileStream,
Action< LootLockerPlayerFile onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

Update an existing player file with a new file using a Filestream.

Can be useful if you want to upload without storing anything on disk.

Parameters
fileIdId of the file. You can get the ID of files when you upload a file, or with GetAllPlayerFiles()
fileStreamFilestream to upload
onCompleteonComplete Action for handling the response of type LootLockerPlayerFile
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

◆ UpdatePlayerFile() [3/3]

static void LootLocker.Requests.LootLockerSDKManager.UpdatePlayerFile ( int  fileId,
string  pathToFile,
Action< LootLockerPlayerFile onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

Update an existing player file with a new file.

Parameters
fileIdId of the file. You can get the ID of files when you upload a file, or with GetAllPlayerFiles()
pathToFilePath to the file, example: Application.persistentDataPath + "/" + fileName;
onCompleteonComplete Action for handling the response of type LootLockerPlayerFile
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

◆ UploadPlayerFile() [1/6]

static void LootLocker.Requests.LootLockerSDKManager.UploadPlayerFile ( byte[]  fileBytes,
string  fileName,
string  filePurpose,
Action< LootLockerPlayerFile onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

Upload a file using a byte array.

Can be useful if you want to upload without storing anything on disk. The file will be owned by the currently active player.

Parameters
fileBytesByte array to upload
fileNameName of the file on LootLocker
filePurposePurpose of the file, example: savefile/config
onCompleteonComplete Action for handling the response of type LootLockerPlayerFile
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

◆ UploadPlayerFile() [2/6]

static void LootLocker.Requests.LootLockerSDKManager.UploadPlayerFile ( byte[]  fileBytes,
string  fileName,
string  filePurpose,
bool  isPublic,
Action< LootLockerPlayerFile onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

Upload a file using a byte array.

Can be useful if you want to upload without storing anything on disk. The file will be owned by the currently active player.

Parameters
fileBytesByte array to upload
fileNameName of the file on LootLocker
filePurposePurpose of the file, example: savefile/config
isPublicShould this file be viewable by other players?
onCompleteonComplete Action for handling the response of type LootLockerPlayerFile
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

◆ UploadPlayerFile() [3/6]

static void LootLocker.Requests.LootLockerSDKManager.UploadPlayerFile ( FileStream  fileStream,
string  filePurpose,
Action< LootLockerPlayerFile onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

Upload a file using a Filestream.

The file will be owned by the currently active player.

Parameters
fileStreamFilestream to upload
filePurposePurpose of the file, example: savefile/config
onCompleteonComplete Action for handling the response of type LootLockerPlayerFile
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

◆ UploadPlayerFile() [4/6]

static void LootLocker.Requests.LootLockerSDKManager.UploadPlayerFile ( FileStream  fileStream,
string  filePurpose,
bool  isPublic,
Action< LootLockerPlayerFile onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

Upload a file using a Filestream.

The file will be owned by the currently active player.

Parameters
fileStreamFilestream to upload
filePurposePurpose of the file, example: savefile/config
isPublicShould this file be viewable by other players?
onCompleteonComplete Action for handling the response of type LootLockerPlayerFile
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

◆ UploadPlayerFile() [5/6]

static void LootLocker.Requests.LootLockerSDKManager.UploadPlayerFile ( string  pathToFile,
string  filePurpose,
Action< LootLockerPlayerFile onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

Upload a file with the provided name and content.

The file will be owned by the player with the provided playerID. It will not be viewable by other players.

Parameters
pathToFilePath to the file, example: Application.persistentDataPath + "/" + fileName;
filePurposePurpose of the file, example: savefile/config
onCompleteonComplete Action for handling the response of type LootLockerPlayerFile
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

◆ UploadPlayerFile() [6/6]

static void LootLocker.Requests.LootLockerSDKManager.UploadPlayerFile ( string  pathToFile,
string  filePurpose,
bool  isPublic,
Action< LootLockerPlayerFile onComplete,
string  forPlayerWithUlid = null 
)
inlinestatic

Upload a file with the provided name and content.

The file will be owned by the currently active player.

Parameters
pathToFilePath to the file, example: Application.persistentDataPath + "/" + fileName;
filePurposePurpose of the file, example: savefile/config
isPublicShould this file be viewable by other players?
onCompleteonComplete Action for handling the response of type LootLockerPlayerFile
forPlayerWithUlidOptional : Execute the request for the specified player. If not supplied, the default player will be used.

Functions

static void LootLocker.Requests.LootLockerSDKManager.GetPlayerFile (int fileId, Action< LootLockerPlayerFile > onComplete, string forPlayerWithUlid=null)
 Returns a URL where you can access the file.
 
static void LootLocker.Requests.LootLockerSDKManager.GetAllPlayerFiles (Action< LootLockerPlayerFilesResponse > onComplete, string forPlayerWithUlid=null)
 Returns all the files that your currently active player own.
 
static void LootLocker.Requests.LootLockerSDKManager.GetAllPlayerFiles (int playerId, Action< LootLockerPlayerFilesResponse > onComplete, string forPlayerWithUlid=null)
 Returns all public files that the player with the provided playerID owns.
 
static void LootLocker.Requests.LootLockerSDKManager.UploadPlayerFile (string pathToFile, string filePurpose, bool isPublic, Action< LootLockerPlayerFile > onComplete, string forPlayerWithUlid=null)
 Upload a file with the provided name and content.
 
static void LootLocker.Requests.LootLockerSDKManager.UploadPlayerFile (string pathToFile, string filePurpose, Action< LootLockerPlayerFile > onComplete, string forPlayerWithUlid=null)
 Upload a file with the provided name and content.
 
static void LootLocker.Requests.LootLockerSDKManager.UploadPlayerFile (FileStream fileStream, string filePurpose, bool isPublic, Action< LootLockerPlayerFile > onComplete, string forPlayerWithUlid=null)
 Upload a file using a Filestream.
 
static void LootLocker.Requests.LootLockerSDKManager.UploadPlayerFile (FileStream fileStream, string filePurpose, Action< LootLockerPlayerFile > onComplete, string forPlayerWithUlid=null)
 Upload a file using a Filestream.
 
static void LootLocker.Requests.LootLockerSDKManager.UploadPlayerFile (byte[] fileBytes, string fileName, string filePurpose, bool isPublic, Action< LootLockerPlayerFile > onComplete, string forPlayerWithUlid=null)
 Upload a file using a byte array.
 
static void LootLocker.Requests.LootLockerSDKManager.UploadPlayerFile (byte[] fileBytes, string fileName, string filePurpose, Action< LootLockerPlayerFile > onComplete, string forPlayerWithUlid=null)
 Upload a file using a byte array.
 
static void LootLocker.Requests.LootLockerSDKManager.UpdatePlayerFile (int fileId, string pathToFile, Action< LootLockerPlayerFile > onComplete, string forPlayerWithUlid=null)
 Update an existing player file with a new file.
 
static void LootLocker.Requests.LootLockerSDKManager.UpdatePlayerFile (int fileId, FileStream fileStream, Action< LootLockerPlayerFile > onComplete, string forPlayerWithUlid=null)
 Update an existing player file with a new file using a Filestream.
 
static void LootLocker.Requests.LootLockerSDKManager.UpdatePlayerFile (int fileId, byte[] fileBytes, Action< LootLockerPlayerFile > onComplete, string forPlayerWithUlid=null)
 Update an existing player file with a new file using a byte array.
 
static void LootLocker.Requests.LootLockerSDKManager.DeletePlayerFile (int fileId, Action< LootLockerResponse > onComplete, string forPlayerWithUlid=null)
 The file will be deleted immediately and the action can not be reversed.