Unstable 1.1.14.0

This commit is contained in:
Markus Isberg
2023-10-02 16:43:54 +03:00
parent 94f5a93a0c
commit cf8f0de659
606 changed files with 21906 additions and 11456 deletions
@@ -8,22 +8,28 @@ using Steamworks.Data;
namespace Steamworks
{
/// <summary>
/// Undocumented Parental Settings
/// Class for utilizing the Steam Remote Storage API.
/// </summary>
public class SteamRemoteStorage : SteamClientClass<SteamRemoteStorage>
{
internal static ISteamRemoteStorage? Internal => Interface as ISteamRemoteStorage;
internal override void InitializeInterface( bool server )
internal override bool InitializeInterface( bool server )
{
SetInterface( server, new ISteamRemoteStorage( server ) );
if ( Interface is null || Interface.Self == IntPtr.Zero ) return false;
return true;
}
/// <summary>
/// Creates a new file, writes the bytes to the file, and then closes the file.
/// If the target file already exists, it is overwritten
/// </summary>
/// <param name="filename">The path of the file.</param>
/// <param name="data">The bytes of data.</param>
/// <returns>A boolean, detailing whether or not the operation was successful.</returns>
public unsafe static bool FileWrite( string filename, byte[] data )
{
fixed ( byte* ptr = data )
@@ -35,6 +41,7 @@ namespace Steamworks
/// <summary>
/// Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
/// </summary>
/// <param name="filename">The path of the file.</param>
public unsafe static byte[]? FileRead( string filename )
{
if (Internal is null) { return null; }
@@ -46,6 +53,10 @@ namespace Steamworks
fixed ( byte* ptr = buffer )
{
var readsize = Internal.FileRead( filename, (IntPtr)ptr, size );
if ( readsize != size )
{
return null;
}
return buffer;
}
}
@@ -53,26 +64,35 @@ namespace Steamworks
/// <summary>
/// Checks whether the specified file exists.
/// </summary>
/// <param name="filename">The path of the file.</param>
/// <returns>Whether or not the file exists.</returns>
public static bool FileExists( string filename ) => Internal != null && Internal.FileExists( filename );
/// <summary>
/// Checks if a specific file is persisted in the steam cloud.
/// </summary>
/// <param name="filename">The path of the file.</param>
/// <returns>Boolean.</returns>
public static bool FilePersisted( string filename ) => Internal != null && Internal.FilePersisted( filename );
/// <summary>
/// Gets the specified file's last modified date/time.
/// </summary>
/// <param name="filename">The path of the file.</param>
/// <returns>A <see cref="DateTime"/> describing when the file was modified last.</returns>
public static DateTime FileTime( string filename ) => Internal != null ? Epoch.ToDateTime( Internal.GetFileTimestamp( filename ) ) : default;
/// <summary>
/// Gets the specified files size in bytes. 0 if not exists.
/// Returns the specified files size in bytes, or <c>0</c> if the file does not exist.
/// </summary>
/// <param name="filename">The path of the file.</param>
/// <returns>The size of the file in bytes, or <c>0</c> if the file doesn't exist.</returns>
public static int FileSize( string filename ) => Internal?.GetFileSize( filename ) ?? 0;
/// <summary>
/// Deletes the file from remote storage, but leaves it on the local disk and remains accessible from the API.
/// </summary>
/// <returns>A boolean, detailing whether or not the operation was successful.</returns>
public static bool FileForget( string filename ) => Internal != null && Internal.FileForget( filename );
/// <summary>
@@ -82,7 +102,7 @@ namespace Steamworks
/// <summary>
/// Number of bytes total
/// Gets the total number of quota bytes.
/// </summary>
public static ulong QuotaBytes
{
@@ -95,7 +115,7 @@ namespace Steamworks
}
/// <summary>
/// Number of bytes used
/// Gets the total number of quota bytes that have been used.
/// </summary>
public static ulong QuotaUsedBytes
{
@@ -108,7 +128,7 @@ namespace Steamworks
}
/// <summary>
/// Number of bytes remaining until your quota is used
/// Number of bytes remaining until the quota is used.
/// </summary>
public static ulong QuotaRemainingBytes
{
@@ -121,7 +141,7 @@ namespace Steamworks
}
/// <summary>
/// returns true if IsCloudEnabledForAccount AND IsCloudEnabledForApp
/// returns <see langword="true"/> if <see cref="IsCloudEnabledForAccount"/> AND <see cref="IsCloudEnabledForApp"/> are <see langword="true"/>.
/// </summary>
public static bool IsCloudEnabled => IsCloudEnabledForAccount && IsCloudEnabledForApp;
@@ -162,7 +182,7 @@ namespace Steamworks
}
/// <summary>
/// Get a list of filenames synchronized by Steam Cloud
/// Gets a list of filenames synchronized by Steam Cloud.
/// </summary>
public static List<RemoteFile> Files
{
@@ -182,4 +202,4 @@ namespace Steamworks
}
}
}
}
}