ISteamRemoteStorage - adambiser/agk-steam-plugin GitHub Wiki
CloudFileDelete
CloudFileDelete(filename as string) as integer
- filename - The name of the file that will be deleted.
Deletes a file from the local disk, and propagates that delete to the cloud.
This is meant to be used when a user actively deletes a file. Use FileForget if you want to remove a file from the Steam Cloud but retain it on the users local disk.
When a file has been deleted it can be re-written with FileWrite to reupload it to the Steam Cloud.
Returns: 1 if the file exists and has been successfully deleted; otherwise, 0 if the file did not exist.
Reference:
ISteamRemoteStorage#FileDelete
CloudFileExists
CloudFileExists(filename as string) as integer
- filename - The name of the file.
Checks whether the specified file exists.
Returns: 1 if the file exists; otherwise, 0.
Reference:
ISteamRemoteStorage#FileExists
CloudFileForget
CloudFileForget(filename as string) as integer
- filename - The name of the file that will be forgotten.
Deletes the file from remote storage, but leaves it on the local disk and remains accessible from the API.
When you are out of Cloud space, this can be used to allow calls to FileWrite to keep working without needing to make the user delete files.
How you decide which files to forget are up to you. It could be a simple Least Recently Used (LRU) queue or something more complicated.
Requiring the user to manage their Cloud-ized files for a game, while is possible to do, it is never recommended. For instance, "Which file would you like to delete so that you may store this new one?" removes a significant advantage of using the Cloud in the first place: its transparency.
Once a file has been deleted or forgotten, calling FileWrite will resynchronize it in the Cloud. Rewriting a forgotten file is the only way to make it persisted again.
Returns: 1 if the file exists and has been successfully forgotten; otherwise, 0.
Reference:
ISteamRemoteStorage#FileForget
CloudFilePersisted
CloudFilePersisted(filename as string) as integer
- filename - The name of the file.
Checks if a specific file is persisted in the steam cloud.
Returns: 1 if the file exists and the file is persisted in the Steam Cloud. 0 if FileForget was called on it and is only available locally.
Reference:
ISteamRemoteStorage#FilePersisted
CloudFileRead
CloudFileRead(filename as string) as integer
- filename - The name of the file to read from.
Opens a binary file, reads the contents of the file into a memblock, and then closes the file.
NOTE: This is a synchronous call and as such is a will block your calling thread on the disk IO, and will also block the SteamAPI, which can cause other threads in your application to block. To avoid "hitching" due to a busy disk on the client machine using FileReadAsync, the asynchronous version of this API is recommended.
Returns: A memblock ID containing the data read from the file. Returns 0 if the file doesn't exist or the read fails.
Reference:
ISteamRemoteStorage#FileRead
CloudFileReadAsync
CloudFileReadAsync(filename as string, offset as integer, length as integer) as integer
- filename - The name of the file to read from.
- offset - The offset in bytes into the file where the read will start from. 0 if you're reading the whole file in one chunk.
- length - The amount of bytes to read starting from the offset. -1 to read the entire file.
Starts an asynchronous read from a file.
The offset and amount to read should be valid for the size of the file, as indicated by GetCloudFileSize.
Returns: A call result handle on success; otherwise 0.
Associated Methods:
GetCloudFileReadAsyncFileName
GetCloudFileReadAsyncMemblock
Reference:
ISteamRemoteStorage#FileReadAsync
ISteamRemoteStorage#RemoteStorageFileReadAsyncComplete_t
GetCloudFileReadAsyncFileName
GetCloudFileReadAsyncFileName(hCallResult as integer) as string
- hCallResult - A CloudFileReadAsync call result handle.
Returns the file name for the CloudFileReadAsync call.
This method should only be used when the call result returned by CloudFileReadAsync has reported a GetCallResultCode of 1.
Returns: The file name.
Reference:
ISteamRemoteStorage#FileReadAsync
ISteamRemoteStorage#RemoteStorageFileReadAsyncComplete_t
GetCloudFileReadAsyncMemblock
GetCloudFileReadAsyncMemblock(hCallResult as integer) as integer
- hCallResult - A CloudFileReadAsync call result handle.
Returns the memblock of the data returned by the CloudFileReadAsync call.
A call result will delete its memblock in DeleteCallResult() so calling code does not need to do so.
This method should only be used when the call result returned by CloudFileReadAsync has reported a GetCallResultCode of 1.
Returns: A memblock ID.
Reference:
ISteamRemoteStorage#FileReadAsync
ISteamRemoteStorage#RemoteStorageFileReadAsyncComplete_t
CloudFileShare
CloudFileShare(filename as string) as integer
- filename - The file to share.
Shares a file with users and features.
Returns: A call result handle on success; otherwise 0.
Associated Methods:
GetCloudFileShareUGCHandle
GetCloudFileShareFileName
Reference:
ISteamRemoteStorage#FileShare
ISteamRemoteStorage#RemoteStorageFileShareResult_t
GetCloudFileShareUGCHandle
GetCloudFileShareUGCHandle(hCallResult as integer) as integer
- hCallResult - A CloudFileShare call result handle.
Returns the UGC handle for the CloudFileShare call.
This method should only be used when the call result returned by CloudFileShare has reported a GetCallResultCode of 1.
Returns: A UGC handle.
Reference:
ISteamRemoteStorage#FileShare
ISteamRemoteStorage#RemoteStorageFileShareResult_t
GetCloudFileShareFileName
GetCloudFileShareFileName(hCallResult as integer) as string
- hCallResult - A CloudFileShare call result handle.
Returns the file name for the CloudFileShare call.
This method should only be used when the call result returned by CloudFileShare has reported a GetCallResultCode of 1.
Returns: The file name.
Reference:
ISteamRemoteStorage#FileShare
ISteamRemoteStorage#RemoteStorageFileShareResult_t
CloudFileWrite
CloudFileWrite(filename as string, memblockID as integer) as integer
- filename - The name of the file to write to.
- memblockID - A memblock of data to write to the file.
Creates a new file, writes the memblock to the file, and then closes the file. If the target file already exists, it is overwritten.
NOTE: This is a synchronous call and as such is a will block your calling thread on the disk IO, and will also block the SteamAPI, which can cause other threads in your application to block. To avoid "hitching" due to a busy disk on the client machine using FileWriteAsync, the asynchronous version of this API is recommended.
Returns: 1 if the write was successful.
Otherwise, 0 under the following conditions:
- The file you're trying to write is larger than 100MiB as defined by k_unMaxCloudFileChunkSize.
- The memblock is empty.
- You tried to write to an invalid path or filename.
- The current user's Steam Cloud storage quota has been exceeded. They may have run out of space, or have too many files.
- Steam could not write to the disk, the location might be read-only.
Reference:
ISteamRemoteStorage#FileWrite
CloudFileWriteAsync
CloudFileWriteAsync(filename as string, memblockID as integer) as integer
- filename - The name of the file to write to.
- memblockID - The memblock containing the data to write to the file.
Creates a new file and asynchronously writes the raw byte data to the Steam Cloud, and then closes the file. If the target file already exists, it is overwritten.
The data in memblock is copied and the memblock can be deleted immediately after calling this method.
Returns: A call result handle on success; otherwise 0.
Associated Methods:
GetCloudFileWriteAsyncFileName
Reference:
ISteamRemoteStorage#FileWriteAsync
ISteamRemoteStorage#RemoteStorageFileWriteAsyncComplete_t
GetCloudFileWriteAsyncFileName
GetCloudFileWriteAsyncFileName(hCallResult as integer) as string
- hCallResult - A CloudFileReadAsync call result handle.
Returns the file name for the CloudFileWriteAsync call.
This method should only be used when the call result returned by CloudFileWriteAsync has reported a GetCallResultCode of 1.
Returns: The file name.
Reference:
ISteamRemoteStorage#FileWriteAsync
ISteamRemoteStorage#RemoteStorageFileWriteAsyncComplete_t
CloudFileWriteStreamCancel
CloudFileWriteStreamCancel(writeHandle as integer) as integer
- writeHandle - The file write stream to cancel.
Cancels a file write stream that was started by FileWriteStreamOpen.
This trashes all of the data written and closes the write stream, but if there was an existing file with this name, it remains untouched.
Returns: 1 or 0. Steamworks SDK docs don't explain.
Reference:
ISteamRemoteStorage#FileWriteStreamCancel
CloudFileWriteStreamClose
CloudFileWriteStreamClose(writeHandle as integer) as integer
- writeHandle - The file write stream to close.
Closes a file write stream that was started by FileWriteStreamOpen.
This flushes the stream to the disk, overwriting the existing file if there was one.
Returns: 1 if the file write stream was successfully closed; otherwise 0.
Reference:
ISteamRemoteStorage#FileWriteStreamClose
CloudFileWriteStreamOpen
CloudFileWriteStreamOpen(filename as string) as integer
- filename - The name of the file to write to.
Creates a new file output stream allowing you to stream out data to the Steam Cloud file in chunks. If the target file already exists, it is not overwritten until FileWriteStreamClose has been called.
Returns: A file write stream handle or -1 if there's a problem.
Reference:
ISteamRemoteStorage#FileWriteStreamOpen
CloudFileWriteStreamWriteChunk
CloudFileWriteStreamWriteChunk(writeHandle as integer, memblockID as integer, offset as integer, length as integer) as integer
- writeHandle - The file write stream to write to.
- memblockID - A memblock containing the data to write.
- offset - The offset within the memblock of the data to write.
- length - The length of the data to write.
Writes a blob of data from a memblock to the file write stream. Data size is restricted to 100 * 1024 * 1024 bytes.
Returns: 1 if the data was successfully written to the file write stream; otherwise 0;
Reference:
ISteamRemoteStorage#FileWriteStreamWriteChunk
CloudFileWriteStreamWriteChunk
CloudFileWriteStreamWriteChunk(writeHandle as integer, memblockID as integer) as integer
- writeHandle - The file write stream to write to.
- memblockID - A memblock containing the data to write.
Writes the entire contents of a memblock to the file write stream. Data size is restricted to 100 * 1024 * 1024 bytes.
Returns: 1 if the data was successfully written to the file write stream; otherwise 0;
Reference:
ISteamRemoteStorage#FileWriteStreamWriteChunk
GetCloudCachedUGCCount
GetCloudCachedUGCCount() as integer
Gets the number of of UGC files that have finished downloading but has not yet been read via UGCRead().
Steamworks SDK has no information on this method.
Returns: An integer.
Reference:
ISteamRemoteStorage#GetCachedUGCCount
GetCloudCachedUGCHandle
GetCloudCachedUGCHandle(index as integer) as integer
- index - The index, from 0 to GetCloudCachedUGCCount - 1.
Gets the UGC handle of the cached UGC files. GetCloudCachedUGCCount should be called before using this method.
Steamworks SDK has no information on this method.
Returns: A UGC handle
Reference:
ISteamRemoteStorage#GetCachedUGCHandle
GetCloudFileCount
GetCloudFileCount() as integer
Gets the total number of local files synchronized by Steam Cloud.
Returns: The number of files present for the current user, including files in subfolders.
Reference:
ISteamRemoteStorage#GetFileCount
GetCloudFileName
GetCloudFileName(index as integer) as string
- index - The index of the file, this should be between 0 and GetFileCount.
Gets the file name at the given index
Returns: The name of the file at the given index. An empty string if the file doesn't exist.
Reference:
ISteamRemoteStorage#GetFileNameAndSize
ISteamRemoteStorage#GetFileCount
GetCloudFileSize
GetCloudFileSize(index as integer) as integer
- index - The index of the file, this should be between 0 and GetFileCount.
Gets the file size at the given index
Returns: The name of the file at the given index. An empty string if the file doesn't exist.
Reference:
ISteamRemoteStorage#GetFileNameAndSize
ISteamRemoteStorage#GetFileCount
GetCloudFileSize
GetCloudFileSize(filename as string) as integer
- filename - The name of the file.
Gets the specified file's size in bytes.
Returns: The size of the file in bytes. Returns 0 if the file does not exist.
Reference:
ISteamRemoteStorage#GetFileSize
GetCloudFileTimestamp
GetCloudFileTimestamp(filename as string) as integer
- filename - The name of the file.
Gets the specified file's last modified timestamp in Unix epoch format (seconds since Jan 1st 1970).
Returns: The last modified timestamp in Unix epoch format.
Reference:
ISteamRemoteStorage#GetFileTimestamp
GetCloudQuotaAvailable
GetCloudQuotaAvailable() as integer
Gets the number of bytes available in the user's Steam Cloud storage.
Returns: An integer.
Reference:
ISteamRemoteStorage#GetQuota
GetCloudQuotaTotal
GetCloudQuotaTotal() as integer
Gets the total amount of bytes the user has access to in the user's Steam Cloud storage.
Returns: An integer.
Reference:
ISteamRemoteStorage#GetQuota
GetCloudFileSyncPlatforms
GetCloudFileSyncPlatforms(filename as string) as integer
- filename - The name of the file.
Obtains the platforms that the specified file will syncronize to.
Returns: Bitfield containing the platforms that the file was set to with SetSyncPlatforms.
Reference:
ISteamRemoteStorage#GetSyncPlatforms
ISteamRemoteStorage#ERemoteStoragePlatform
GetCloudUGCDetailsAppID
GetCloudUGCDetailsAppID(hUGC as integer) as integer
- hUGC - A UGC handle.
Gets the App ID for a UGC item.
Steamworks SDK has no information on this method.
Returns: An App ID.
Reference:
ISteamRemoteStorage#GetUGCDetails
GetCloudUGCDetailsFileName
GetCloudUGCDetailsFileName(hUGC as integer) as string
- hUGC - A UGC handle.
Gets the file name for a UGC item.
Steamworks SDK has no information on this method.
Returns: A string.
Reference:
ISteamRemoteStorage#GetUGCDetails
GetCloudUGCDetailsFileSize
GetCloudUGCDetailsFileSize(hUGC as integer) as integer
- hUGC - A UGC handle.
Gets the file size of a UGC item.
Steamworks SDK has no information on this method.
Returns: An integer.
Reference:
ISteamRemoteStorage#GetUGCDetails
GetCloudUGCDetailsOwner
GetCloudUGCDetailsOwner(hUGC as integer) as integer
- hUGC - A UGC handle.
Gets the Steam ID of the ownder of a UGC item.
Steamworks SDK has no information on this method.
Returns: A Steam ID handle.
Reference:
ISteamRemoteStorage#GetUGCDetails
GetCloudUGCDownloadProgressBytesDownloaded
GetCloudUGCDownloadProgressBytesDownloaded(hUGC as integer) as integer
- hUGC - A UGC handle.
Gets the progress bytes downloaded for a UGC item.
Steamworks SDK has no information on this method.
Returns: An integer.
Reference:
ISteamRemoteStorage#GetUGCDetails
GetCloudUGCDownloadProgressBytesExpected
GetCloudUGCDownloadProgressBytesExpected(hUGC as integer) as integer
- hUGC - A UGC handle.
Gets the progress bytes expected for a UGC item. Can be 0 if function returns false or if the transfer hasn't started yet, so be careful to check for that before dividing to get a percentage.
Steamworks SDK has no information on this method.
Returns: An integer.
Reference:
ISteamRemoteStorage#GetUGCDetails
IsCloudEnabledForAccount
IsCloudEnabledForAccount() as integer
Checks if the account wide Steam Cloud setting is enabled for this user; or if they disabled it in the Settings->Cloud dialog.
Ensure that you are also checking IsCloudEnabledForApp, as these two options are mutually exclusive.
Returns: 1 if Steam Cloud is enabled for this account; otherwise, 0.
Reference:
ISteamRemoteStorage#IsCloudEnabledForAccount
IsCloudEnabledForApp
IsCloudEnabledForApp() as integer
Checks if the per game Steam Cloud setting is enabled for this user; or if they disabled it in the Game Properties->Update dialog.
Ensure that you are also checking IsCloudEnabledForAccount, as these two options are mutually exclusive.
It's generally recommended that you allow the user to toggle this setting within your in-game options, you can toggle it with SetCloudEnabledForApp.
Returns: 1 if Steam Cloud is enabled for this app; otherwise, 0.
Reference:
ISteamRemoteStorage#IsCloudEnabledForApp
SetCloudEnabledForApp
SetCloudEnabledForApp(enabled as integer)
- enabled - 1 to enabled or 0 to disable the Steam Cloud for this application.
Toggles whether the Steam Cloud is enabled for your application.
This setting can be queried with IsCloudEnabledForApp.
NOTE: This must only ever be called as the direct result of the user explicitly requesting that it's enabled or not. This is typically accomplished with a checkbox within your in-game options.
Reference:
ISteamRemoteStorage#SetCloudEnabledForApp
SetCloudFileSyncPlatforms
SetCloudFileSyncPlatforms(filename as string, eRemoteStoragePlatform as integer) as integer
- filename - The name of the file.
- eRemoteStoragePlatform - The platforms that the file will be syncronized to.
Allows you to specify which operating systems a file will be synchronized to.
Use this if you have a multiplatform game but have data which is incompatible between platforms.
Files default to k_ERemoteStoragePlatformAll when they are first created. You can use the bitwise OR operator to specify multiple platforms.
Returns: 1 if the file exists, otherwise 0.
Reference:
ISteamRemoteStorage#SetSyncPlatforms
CloudUGCDownload
CloudUGCDownload(hUGC as integer, priority as integer) as integer
- hUGC - A UGC handle.
- priority - The download priority.
Downloads a UGC file. A priority value of 0 will download the file immediately, otherwise it will wait to download the file until all downloads with a lower priority value are completed. Downloads with equal priority will occur simultaneously.
Steamworks SDK has no information on this method.
Returns: An App ID.
Associated Methods:
GetCloudUGCDownloadHandle
GetCloudUGCDownloadAppID
GetCloudUGCDownloadFileSize
GetCloudUGCDownloadFileName
GetCloudUGCDownloadOwnerID
Reference:
ISteamRemoteStorage#UGCDownload
ISteamRemoteStorage#RemoteStorageDownloadUGCResult_t
CloudUGCDownloadToLocation
CloudUGCDownloadToLocation(hUGC as integer, location as string, priority as integer) as integer
- hUGC - A UGC handle.
- location - The location to download to.
- priority - The download priority.
Downloads a UGC file to the given location. A priority value of 0 will download the file immediately, otherwise it will wait to download the file until all downloads with a lower priority value are completed. Downloads with equal priority will occur simultaneously.
Steamworks SDK has no information on this method.
Returns: An App ID.
Associated Methods:
GetCloudUGCDownloadHandle
GetCloudUGCDownloadAppID
GetCloudUGCDownloadFileSize
GetCloudUGCDownloadFileName
GetCloudUGCDownloadOwnerID
Reference:
ISteamRemoteStorage#UGCDownload
ISteamRemoteStorage#RemoteStorageDownloadUGCResult_t
GetCloudUGCDownloadHandle
GetCloudUGCDownloadHandle(hCallResult as integer) as integer
- hCallResult - A CloudUGCDownload or CloudUGCDownloadToLocation call result handle.
The UGC handle that was attempted to be downloaded for the CloudUGCDownload call result.
This method should only be used when the call result returned by CloudUGCDownload or CloudUGCDownloadToLocation has reported a GetCallResultCode of 1.
Returns: A UGC file handle.
Reference:
ISteamRemoteStorage#UGCDownload
ISteamRemoteStorage#RemoteStorageDownloadUGCResult_t
GetCloudUGCDownloadAppID
GetCloudUGCDownloadAppID(hCallResult as integer) as integer
- hCallResult - A CloudUGCDownload or CloudUGCDownloadToLocation call result handle.
The App ID that created the file for the CloudUGCDownload call result.
This method should only be used when the call result returned by CloudUGCDownload or CloudUGCDownloadToLocation has reported a GetCallResultCode of 1.
Returns: An App ID.
Reference:
ISteamRemoteStorage#UGCDownload
ISteamRemoteStorage#RemoteStorageDownloadUGCResult_t
GetCloudUGCDownloadFileSize
GetCloudUGCDownloadFileSize(hCallResult as integer) as integer
- hCallResult - A CloudUGCDownload or CloudUGCDownloadToLocation call result handle.
The size of the file in bytes for the CloudUGCDownload call result.
This method should only be used when the call result returned by CloudUGCDownload or CloudUGCDownloadToLocation has reported a GetCallResultCode of 1.
Returns: An integer.
Reference:
ISteamRemoteStorage#UGCDownload
ISteamRemoteStorage#RemoteStorageDownloadUGCResult_t
GetCloudUGCDownloadFileName
GetCloudUGCDownloadFileName(hCallResult as integer) as string
- hCallResult - A CloudUGCDownload or CloudUGCDownloadToLocation call result handle.
The name of the UGC file that was downloaded for the CloudUGCDownload call result.
This method should only be used when the call result returned by CloudUGCDownload or CloudUGCDownloadToLocation has reported a GetCallResultCode of 1.
Returns: A string.
Reference:
ISteamRemoteStorage#UGCDownload
ISteamRemoteStorage#RemoteStorageDownloadUGCResult_t
GetCloudUGCDownloadOwnerID
GetCloudUGCDownloadOwnerID(hCallResult as integer) as integer
- hCallResult - A CloudUGCDownload or CloudUGCDownloadToLocation call result handle.
The Steam ID of the user who created the content for the CloudUGCDownload call result.
This method should only be used when the call result returned by CloudUGCDownload or CloudUGCDownloadToLocation has reported a GetCallResultCode of 1.
Returns: A Steam ID handle.
Reference:
ISteamRemoteStorage#UGCDownload
ISteamRemoteStorage#RemoteStorageDownloadUGCResult_t
CloudUGCRead
CloudUGCRead(hUGC as integer, memblockID as integer, dstOffset as integer, length as integer, srcOffset as integer) as integer
- hUGC - A UGC handle.
- memblockID - A memblock ID.
- dstOffset - The offset to write to within the memblock.
- length - The length of data to read/write.
- srcOffset - The offset to read from.
After downloading, gets the content of the UGC file. Small files can be read all at once by calling this function with dstOffset and srcOffset of 0 and length equal to the size of the file. Larger files can be read in chunks to reduce memory usage (since both sides of the IPC client and the game itself must allocate enough memory for each chunk). Once the last byte is read, the file is implicitly closed and further calls to UGCRead will fail unless UGCDownload is called again. For especially large files (anything over 100MB) it is a requirement that the file is read in chunks.
Steamworks SDK has no information on this method.
Returns: An integer. The length read?
Reference:
ISteamRemoteStorage#UGCRead
CloudUGCRead
CloudUGCRead(hUGC as integer, memblockID as integer) as integer
- hUGC - A UGC handle.
- memblockID - A memblock ID.
After downloading, gets the content of the UGC file. This overload should only be used for small files that can be read in one call.
Data is read from offset 0 to memblock offset 0 and the length read is determined by the size of memblock.
Steamworks SDK has no information on this method.
Returns: An integer. The length read?
Reference:
ISteamRemoteStorage#UGCRead
CloudUGCReadClose
CloudUGCReadClose(hUGC as integer)
- hUGC - A UGC handle.
Explicitly closes the UGC file being read (k_EUGCRead_Close).
Steamworks SDK has no information on this method.
Reference:
ISteamRemoteStorage#UGCRead