v1.0.13.1 (first post-1.0 patch)

This commit is contained in:
Regalis11
2023-05-10 15:07:17 +03:00
parent 96fb49ba14
commit ee1db852b1
272 changed files with 5738 additions and 2413 deletions
@@ -35,22 +35,22 @@ namespace Steamworks.Ugc
/// <summary>
/// The given title of this item
/// </summary>
public string Title { get; internal set; }
public string? Title { get; internal set; }
/// <summary>
/// The description of this item, in your local language if available
/// </summary>
public string Description { get; internal set; }
public string? Description { get; internal set; }
/// <summary>
/// A list of tags for this item, all lowercase
/// </summary>
public string[] Tags { get; internal set; }
public string[]? Tags { get; internal set; }
/// <summary>
/// A dictionary of key value tags for this item, only available from queries WithKeyValueTags(true)
/// </summary>
public Dictionary<string,string> KeyValueTags { get; internal set; }
public Dictionary<string,string>? KeyValueTags { get; internal set; }
/// <summary>
/// App Id of the app that created this item
@@ -123,14 +123,14 @@ namespace Steamworks.Ugc
public bool IsSubscribed => (State & ItemState.Subscribed) == ItemState.Subscribed;
public bool NeedsUpdate => (State & ItemState.NeedsUpdate) == ItemState.NeedsUpdate;
public string Directory
public string? Directory
{
get
{
ulong size = 0;
uint ts = 0;
if (SteamUGC.Internal.GetItemInstallInfo(Id, ref size, out var strVal, ref ts)) { return strVal; }
if (SteamUGC.Internal != null && SteamUGC.Internal.GetItemInstallInfo(Id, ref size, out var strVal, ref ts)) { return strVal; }
return null;
}
}
@@ -147,7 +147,7 @@ namespace Steamworks.Ugc
ulong downloaded = 0;
ulong total = 0;
if ( SteamUGC.Internal.GetItemDownloadInfo( Id, ref downloaded, ref total ) )
if ( SteamUGC.Internal != null && SteamUGC.Internal.GetItemDownloadInfo( Id, ref downloaded, ref total ) )
return (long) total;
return -1;
@@ -166,7 +166,7 @@ namespace Steamworks.Ugc
ulong downloaded = 0;
ulong total = 0;
if ( SteamUGC.Internal.GetItemDownloadInfo( Id, ref downloaded, ref total ) )
if ( SteamUGC.Internal != null && SteamUGC.Internal.GetItemDownloadInfo( Id, ref downloaded, ref total ) )
return (long)downloaded;
return -1;
@@ -185,7 +185,7 @@ namespace Steamworks.Ugc
ulong size = 0;
uint ts = 0;
if ( !SteamUGC.Internal.GetItemInstallInfo( Id, ref size, out _, ref ts ) )
if ( SteamUGC.Internal is null || !SteamUGC.Internal.GetItemInstallInfo( Id, ref size, out _, ref ts ) )
return 0;
return (long) size;
@@ -201,7 +201,7 @@ namespace Steamworks.Ugc
{
ulong size = 0;
uint ts = 0;
if ( !SteamUGC.Internal.GetItemInstallInfo( Id, ref size, out _, ref ts ) )
if ( SteamUGC.Internal is null || !SteamUGC.Internal.GetItemInstallInfo( Id, ref size, out _, ref ts ) )
return null;
return Epoch.ToDateTime(ts);
@@ -226,7 +226,7 @@ namespace Steamworks.Ugc
//possibly similar properties should also be changed
ulong downloaded = 0;
ulong total = 0;
if (SteamUGC.Internal.GetItemDownloadInfo(Id, ref downloaded, ref total) && total > 0)
if (SteamUGC.Internal != null && SteamUGC.Internal.GetItemDownloadInfo(Id, ref downloaded, ref total) && total > 0)
{
return (float)((double)downloaded / (double)total);
}
@@ -277,7 +277,7 @@ namespace Steamworks.Ugc
/// </summary>
public bool HasTag( string find )
{
if ( Tags.Length == 0 ) return false;
if ( Tags is null || Tags.Length == 0 ) return false;
return Tags.Contains( find, StringComparer.OrdinalIgnoreCase );
}
@@ -287,6 +287,7 @@ namespace Steamworks.Ugc
/// </summary>
public async Task<bool> Subscribe ()
{
if (SteamUGC.Internal is null) { return false; }
var result = await SteamUGC.Internal.SubscribeItem( _id );
return result?.Result == Result.OK;
}
@@ -296,7 +297,7 @@ namespace Steamworks.Ugc
/// If CancellationToken is default then there is 60 seconds timeout
/// Progress will be set to 0-1
/// </summary>
public async Task<bool> DownloadAsync( Action<float> progress = null, int milisecondsUpdateDelay = 60, CancellationToken ct = default )
public async Task<bool> DownloadAsync( Action<float>? progress = null, int milisecondsUpdateDelay = 60, CancellationToken ct = default )
{
return await SteamUGC.DownloadAsync( Id, progress, milisecondsUpdateDelay, ct );
}
@@ -305,7 +306,8 @@ namespace Steamworks.Ugc
/// Allows the user to unsubscribe from this item
/// </summary>
public async Task<bool> Unsubscribe ()
{
{
if (SteamUGC.Internal is null) { return false; }
var result = await SteamUGC.Internal.UnsubscribeItem( _id );
return result?.Result == Result.OK;
}
@@ -315,6 +317,7 @@ namespace Steamworks.Ugc
/// </summary>
public async Task<bool> AddFavorite()
{
if (SteamUGC.Internal is null) { return false; }
var result = await SteamUGC.Internal.AddItemToFavorites(details.ConsumerAppID, _id);
return result?.Result == Result.OK;
}
@@ -324,6 +327,7 @@ namespace Steamworks.Ugc
/// </summary>
public async Task<bool> RemoveFavorite()
{
if (SteamUGC.Internal is null) { return false; }
var result = await SteamUGC.Internal.RemoveItemFromFavorites(details.ConsumerAppID, _id);
return result?.Result == Result.OK;
}
@@ -333,6 +337,7 @@ namespace Steamworks.Ugc
/// </summary>
public async Task<Result?> Vote( bool up )
{
if (SteamUGC.Internal is null) { return null; }
var r = await SteamUGC.Internal.SetUserItemVote( Id, up );
return r?.Result;
}
@@ -342,6 +347,7 @@ namespace Steamworks.Ugc
/// </summary>
public async Task<UserItemVote?> GetUserVote()
{
if (SteamUGC.Internal is null) { return null; }
var result = await SteamUGC.Internal.GetUserItemVote(_id);
if (!result.HasValue)
return null;
@@ -351,27 +357,27 @@ namespace Steamworks.Ugc
/// <summary>
/// Return a URL to view this item online
/// </summary>
public string Url => $"http://steamcommunity.com/sharedfiles/filedetails/?source=Facepunch.Steamworks&id={Id}";
public string Url => $"https://steamcommunity.com/sharedfiles/filedetails/?source=Facepunch.Steamworks&id={Id}";
/// <summary>
/// The URl to view this item's changelog
/// </summary>
public string ChangelogUrl => $"http://steamcommunity.com/sharedfiles/filedetails/changelog/{Id}";
public string ChangelogUrl => $"https://steamcommunity.com/sharedfiles/filedetails/changelog/{Id}";
/// <summary>
/// The URL to view the comments on this item
/// </summary>
public string CommentsUrl => $"http://steamcommunity.com/sharedfiles/filedetails/comments/{Id}";
public string CommentsUrl => $"https://steamcommunity.com/sharedfiles/filedetails/comments/{Id}";
/// <summary>
/// The URL to discuss this item
/// </summary>
public string DiscussUrl => $"http://steamcommunity.com/sharedfiles/filedetails/discussions/{Id}";
public string DiscussUrl => $"https://steamcommunity.com/sharedfiles/filedetails/discussions/{Id}";
/// <summary>
/// The URL to view this items stats online
/// </summary>
public string StatsUrl => $"http://steamcommunity.com/sharedfiles/filedetails/stats/{Id}";
public string StatsUrl => $"https://steamcommunity.com/sharedfiles/filedetails/stats/{Id}";
public ulong NumSubscriptions { get; internal set; }
public ulong NumFavorites { get; internal set; }
@@ -390,12 +396,12 @@ namespace Steamworks.Ugc
/// <summary>
/// The URL to the preview image for this item
/// </summary>
public string PreviewImageUrl { get; internal set; }
public string? PreviewImageUrl { get; internal set; }
/// <summary>
/// The metadata string for this item, only available from queries WithMetadata(true)
/// </summary>
public string Metadata { get; internal set; }
public string? Metadata { get; internal set; }
/// <summary>
/// Edit this item