(1c5ce3fee) More descriptive error messages when publishing a Workshop item fails.

This commit is contained in:
Joonas Rikkonen
2019-06-15 19:44:13 +03:00
parent 6f3d9d7191
commit 03a7093486
45 changed files with 461 additions and 235 deletions
@@ -24,6 +24,7 @@ namespace Facepunch.Steamworks
public bool Publishing { get; internal set; }
public ItemType? Type { get; set; }
public string Error { get; internal set; } = null;
public SteamNative.Result? ErrorCode { get; internal set; } = null;
public string ChangeNote { get; set; } = "";
public uint WorkshopUploadAppId { get; set; }
public string MetaData { get; set; } = null;
@@ -99,6 +100,7 @@ namespace Facepunch.Steamworks
Publishing = true;
Error = null;
ErrorCode = null;
if ( Id == 0 )
{
@@ -129,12 +131,14 @@ namespace Facepunch.Steamworks
if ( obj.Result == SteamNative.Result.OK && !Failed )
{
Error = null;
ErrorCode = null;
Id = obj.PublishedFileId;
PublishChanges();
return;
}
Error = $"Error creating new file: {obj.Result} ({obj.PublishedFileId})";
ErrorCode = obj.Result;
Publishing = false;
OnChangesSubmitted?.Invoke( (Result) obj.Result );
@@ -221,6 +225,7 @@ namespace Facepunch.Steamworks
NeedToAgreeToWorkshopLegal = obj.UserNeedsToAcceptWorkshopLegalAgreement;
Publishing = false;
ErrorCode = obj.Result;
Error = obj.Result != SteamNative.Result.OK
? $"Error publishing changes: {obj.Result} ({NeedToAgreeToWorkshopLegal})"
: null;
@@ -20,7 +20,7 @@ namespace SteamNative
//
// EResult
//
internal enum Result : int
public enum Result : int
{
OK = 1,
Fail = 2,