mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-03-30 22:29:04 +03:00
Avoid SteamAPICall_t errors
This commit is contained in:
parent
ba0fa2e102
commit
69b342c504
@ -90,6 +90,8 @@ namespace Facepunch.Steamworks.Callbacks.Workshop
|
|||||||
{
|
{
|
||||||
public override int CallbackId { get { return Index.UGC + 4; } }
|
public override int CallbackId { get { return Index.UGC + 4; } }
|
||||||
|
|
||||||
|
public SteamNative.UGCUpdateHandle_t UpdateHandle;
|
||||||
|
|
||||||
[StructLayout( LayoutKind.Sequential, Pack = 8 )]
|
[StructLayout( LayoutKind.Sequential, Pack = 8 )]
|
||||||
internal struct Data
|
internal struct Data
|
||||||
{
|
{
|
||||||
|
@ -48,7 +48,7 @@ namespace Facepunch.Steamworks
|
|||||||
ulong b = 0;
|
ulong b = 0;
|
||||||
ulong t = 0;
|
ulong t = 0;
|
||||||
|
|
||||||
workshop.steamworks.native.ugc.GetItemUpdateProgress( SubmitItemUpdate.Handle, out b, out t );
|
workshop.steamworks.native.ugc.GetItemUpdateProgress( SubmitItemUpdate.UpdateHandle, out b, out t );
|
||||||
|
|
||||||
if ( t == 0 )
|
if ( t == 0 )
|
||||||
return 0;
|
return 0;
|
||||||
@ -68,7 +68,7 @@ namespace Facepunch.Steamworks
|
|||||||
ulong b = 0;
|
ulong b = 0;
|
||||||
ulong t = 0;
|
ulong t = 0;
|
||||||
|
|
||||||
workshop.steamworks.native.ugc.GetItemUpdateProgress( SubmitItemUpdate.Handle, out b, out t );
|
workshop.steamworks.native.ugc.GetItemUpdateProgress( SubmitItemUpdate.UpdateHandle, out b, out t );
|
||||||
return (int) b;
|
return (int) b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ namespace Facepunch.Steamworks
|
|||||||
ulong b = 0;
|
ulong b = 0;
|
||||||
ulong t = 0;
|
ulong t = 0;
|
||||||
|
|
||||||
workshop.steamworks.native.ugc.GetItemUpdateProgress( SubmitItemUpdate.Handle, out b, out t );
|
workshop.steamworks.native.ugc.GetItemUpdateProgress( SubmitItemUpdate.UpdateHandle, out b, out t );
|
||||||
return (int)t;
|
return (int)t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -132,25 +132,25 @@ namespace Facepunch.Steamworks
|
|||||||
|
|
||||||
private void PublishChanges()
|
private void PublishChanges()
|
||||||
{
|
{
|
||||||
ulong UpdateId = workshop.ugc.StartItemUpdate( workshop.steamworks.AppId, Id );
|
SteamNative.UGCUpdateHandle_t UpdateHandle = workshop.ugc.StartItemUpdate( workshop.steamworks.AppId, Id );
|
||||||
|
|
||||||
if ( Title != null )
|
if ( Title != null )
|
||||||
workshop.ugc.SetItemTitle( UpdateId, Title );
|
workshop.ugc.SetItemTitle( UpdateHandle, Title );
|
||||||
|
|
||||||
if ( Description != null )
|
if ( Description != null )
|
||||||
workshop.ugc.SetItemDescription( UpdateId, Description );
|
workshop.ugc.SetItemDescription( UpdateHandle, Description );
|
||||||
|
|
||||||
if ( Folder != null )
|
if ( Folder != null )
|
||||||
workshop.ugc.SetItemContent( UpdateId, Folder );
|
workshop.ugc.SetItemContent( UpdateHandle, Folder );
|
||||||
|
|
||||||
// if ( Tags != null && Tags.Count > 0 )
|
// if ( Tags != null && Tags.Count > 0 )
|
||||||
// workshop.ugc.SetItemTags( UpdateId, Tags.ToArray() );
|
// workshop.ugc.SetItemTags( UpdateId, Tags.ToArray() );
|
||||||
|
|
||||||
if ( Visibility.HasValue )
|
if ( Visibility.HasValue )
|
||||||
workshop.ugc.SetItemVisibility( UpdateId, (SteamNative.RemoteStoragePublishedFileVisibility)(uint)Visibility.Value );
|
workshop.ugc.SetItemVisibility( UpdateHandle, (SteamNative.RemoteStoragePublishedFileVisibility)(uint)Visibility.Value );
|
||||||
|
|
||||||
if ( PreviewImage != null )
|
if ( PreviewImage != null )
|
||||||
workshop.ugc.SetItemPreview( UpdateId, PreviewImage ); // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size
|
workshop.ugc.SetItemPreview( UpdateHandle, PreviewImage ); // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size
|
||||||
|
|
||||||
/*
|
/*
|
||||||
workshop.ugc.SetItemUpdateLanguage( UpdateId, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set
|
workshop.ugc.SetItemUpdateLanguage( UpdateId, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set
|
||||||
@ -165,8 +165,9 @@ namespace Facepunch.Steamworks
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
SubmitItemUpdate = new SubmitItemUpdate();
|
SubmitItemUpdate = new SubmitItemUpdate();
|
||||||
SubmitItemUpdate.Handle = workshop.ugc.SubmitItemUpdate( UpdateId, ChangeNote );
|
SubmitItemUpdate.Handle = workshop.ugc.SubmitItemUpdate( UpdateHandle, ChangeNote );
|
||||||
SubmitItemUpdate.OnResult = OnChangesSubmitted;
|
SubmitItemUpdate.OnResult = OnChangesSubmitted;
|
||||||
|
SubmitItemUpdate.UpdateHandle = UpdateHandle;
|
||||||
workshop.steamworks.AddCallResult( SubmitItemUpdate );
|
workshop.steamworks.AddCallResult( SubmitItemUpdate );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ namespace Facepunch.Steamworks.Interop
|
|||||||
{
|
{
|
||||||
internal unsafe abstract class CallResult : IDisposable
|
internal unsafe abstract class CallResult : IDisposable
|
||||||
{
|
{
|
||||||
public ulong Handle;
|
public SteamNative.SteamAPICall_t Handle;
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user