コード例 #1
0
        // SteamAPICall_t
        public CallbackHandle SubmitItemUpdate(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchChangeNote /*const char **/, Action <SubmitItemUpdateResult_t, bool> CallbackFunction = null /*Action<SubmitItemUpdateResult_t, bool>*/)
        {
            SteamAPICall_t callback = 0;

            callback = platform.ISteamUGC_SubmitItemUpdate(handle.Value, pchChangeNote);

            if (CallbackFunction == null)
            {
                return(null);
            }

            return(SubmitItemUpdateResult_t.CallResult(steamworks, callback, CallbackFunction));
        }
コード例 #2
0
            private void PublishChanges()
            {
                UpdateHandle = workshop.ugc.StartItemUpdate(workshop.steamworks.AppId, Id);

                if (Title != null)
                {
                    workshop.ugc.SetItemTitle(UpdateHandle, Title);
                }

                if (Description != null)
                {
                    workshop.ugc.SetItemDescription(UpdateHandle, Description);
                }

                if (Folder != null)
                {
                    workshop.ugc.SetItemContent(UpdateHandle, Folder);
                }

                if (Tags != null && Tags.Count > 0)
                {
                    workshop.ugc.SetItemTags(UpdateHandle, Tags.ToArray());
                }

                if (Visibility.HasValue)
                {
                    workshop.ugc.SetItemVisibility(UpdateHandle, (SteamNative.RemoteStoragePublishedFileVisibility)(uint) Visibility.Value);
                }

                if (PreviewImage != null)
                {
                    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.SetItemMetadata( UpdateId, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax)
                 *  workshop.ugc.RemoveItemKeyValueTags( UpdateId, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key
                 *  workshop.ugc.AddItemKeyValueTag( UpdateId, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag.
                 *  workshop.ugc.AddItemPreviewFile( UpdateId, const char *pszPreviewFile, EItemPreviewType type ) = 0; //  add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
                 *  workshop.ugc.AddItemPreviewVideo( UpdateId, const char *pszVideoID ) = 0; //  add preview video for this item
                 *  workshop.ugc.UpdateItemPreviewFile( UpdateId, uint32 index, const char *pszPreviewFile ) = 0; //  updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
                 *  workshop.ugc.UpdateItemPreviewVideo( UpdateId, uint32 index, const char *pszVideoID ) = 0; //  updates an existing preview video for this item
                 *  workshop.ugc.RemoveItemPreview( UpdateId, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted)
                 */

                SubmitItemUpdate = workshop.ugc.SubmitItemUpdate(UpdateHandle, ChangeNote, OnChangesSubmitted);
            }
コード例 #3
0
            private void OnChangesSubmittedInternal(SteamNative.SubmitItemUpdateResult_t obj, bool Failed)
            {
                if (Failed)
                {
                    throw new System.Exception("CreateItemResult_t Failed");
                }

                UpdateHandle               = 0;
                SubmitItemUpdate           = null;
                NeedToAgreeToWorkshopLegal = obj.UserNeedsToAcceptWorkshopLegalAgreement;
                Publishing = false;

                Error = obj.Result != SteamNative.Result.OK
                    ? $"Error publishing changes: {obj.Result} ({NeedToAgreeToWorkshopLegal})"
                    : null;

                OnChangesSubmitted?.Invoke((Result)obj.Result);
            }
コード例 #4
0
            private void OnChangesSubmitted(SteamNative.SubmitItemUpdateResult_t obj, bool Failed)
            {
                if (Failed)
                {
                    throw new System.Exception("CreateItemResult_t Failed");
                }

                UpdateHandle               = 0;
                SubmitItemUpdate           = null;
                NeedToAgreeToWorkshopLegal = obj.UserNeedsToAcceptWorkshopLegalAgreement;
                Publishing = false;

                if (obj.Result == SteamNative.Result.OK)
                {
                    return;
                }

                Error = "Error publishing changes: " + obj.Result.ToString() + " (" + NeedToAgreeToWorkshopLegal + ")";
            }
コード例 #5
0
 // bool
 public bool SetItemPreview(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pszPreviewFile /*const char **/)
 {
     return(platform.ISteamUGC_SetItemPreview(handle.Value, pszPreviewFile));
 }
コード例 #6
0
 // bool
 public bool AddItemPreviewVideo(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pszVideoID /*const char **/)
 {
     return(platform.ISteamUGC_AddItemPreviewVideo(handle.Value, pszVideoID));
 }
コード例 #7
0
            private void PublishChanges()
            {
                if (WorkshopUploadAppId == 0)
                {
                    throw new Exception("WorkshopUploadAppId should not be 0");
                }

                UpdateHandle = workshop.ugc.StartItemUpdate(WorkshopUploadAppId, Id);

                if (Title != null)
                {
                    workshop.ugc.SetItemTitle(UpdateHandle, Title);
                }

                if (Description != null)
                {
                    workshop.ugc.SetItemDescription(UpdateHandle, Description);
                }

                if (Folder != null)
                {
                    var info = new System.IO.DirectoryInfo(Folder);

                    if (!info.Exists)
                    {
                        throw new System.Exception($"Folder doesn't exist ({Folder})");
                    }

                    workshop.ugc.SetItemContent(UpdateHandle, Folder);
                }

                if (Tags != null && Tags.Count > 0)
                {
                    workshop.ugc.SetItemTags(UpdateHandle, Tags.ToArray());
                }

                if (Visibility.HasValue)
                {
                    workshop.ugc.SetItemVisibility(UpdateHandle, (SteamNative.RemoteStoragePublishedFileVisibility)(uint) Visibility.Value);
                }

                if (PreviewImage != null)
                {
                    var info = new System.IO.FileInfo(PreviewImage);

                    if (!info.Exists)
                    {
                        throw new System.Exception($"PreviewImage doesn't exist ({PreviewImage})");
                    }

                    if (info.Length >= 1024 * 1024)
                    {
                        throw new System.Exception($"PreviewImage should be under 1MB ({info.Length})");
                    }

                    workshop.ugc.SetItemPreview(UpdateHandle, PreviewImage);
                }

                if (MetaData != null)
                {
                    workshop.ugc.SetItemMetadata(UpdateHandle, MetaData);
                }

                if (KeyValues != null)
                {
                    foreach (var key in KeyValues)
                    {
                        foreach (var value in key.Value)
                        {
                            workshop.ugc.AddItemKeyValueTag(UpdateHandle, key.Key, value);
                        }
                    }
                }

                /*
                 *  workshop.ugc.SetItemUpdateLanguage( UpdateId, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set
                 *  workshop.ugc.RemoveItemKeyValueTags( UpdateId, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key
                 *  workshop.ugc.AddItemPreviewFile( UpdateId, const char *pszPreviewFile, EItemPreviewType type ) = 0; //  add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
                 *  workshop.ugc.AddItemPreviewVideo( UpdateId, const char *pszVideoID ) = 0; //  add preview video for this item
                 *  workshop.ugc.UpdateItemPreviewFile( UpdateId, uint32 index, const char *pszPreviewFile ) = 0; //  updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
                 *  workshop.ugc.UpdateItemPreviewVideo( UpdateId, uint32 index, const char *pszVideoID ) = 0; //  updates an existing preview video for this item
                 *  workshop.ugc.RemoveItemPreview( UpdateId, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted)
                 */

                SubmitItemUpdate = workshop.ugc.SubmitItemUpdate(UpdateHandle, ChangeNote, OnChangesSubmittedInternal);
            }
コード例 #8
0
 // bool
 public bool UpdateItemPreviewVideo(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, uint index /*uint32*/, string pszVideoID /*const char **/)
 {
     return(platform.ISteamUGC_UpdateItemPreviewVideo(handle.Value, index, pszVideoID));
 }
コード例 #9
0
 // bool
 public bool AddItemPreviewFile(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pszPreviewFile /*const char **/, ItemPreviewType type /*EItemPreviewType*/)
 {
     return(platform.ISteamUGC_AddItemPreviewFile(handle.Value, pszPreviewFile, type));
 }
コード例 #10
0
 // bool
 public bool UpdateItemPreviewFile(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, uint index /*uint32*/, string pszPreviewFile /*const char **/)
 {
     return(platform.ISteamUGC_UpdateItemPreviewFile(handle.Value, index, Utility.GetUtf8Bytes(pszPreviewFile)));
 }
コード例 #11
0
 // bool
 public bool AddItemKeyValueTag(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchKey /*const char **/, string pchValue /*const char **/)
 {
     return(platform.ISteamUGC_AddItemKeyValueTag(handle.Value, pchKey, pchValue));
 }
コード例 #12
0
 // bool
 public bool SetItemTitle(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchTitle /*const char **/)
 {
     return(platform.ISteamUGC_SetItemTitle(handle.Value, Utility.GetUtf8Bytes(pchTitle)));
 }
コード例 #13
0
 // bool
 public bool SetItemVisibility(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, RemoteStoragePublishedFileVisibility eVisibility /*ERemoteStoragePublishedFileVisibility*/)
 {
     return(platform.ISteamUGC_SetItemVisibility(handle.Value, eVisibility));
 }
コード例 #14
0
 // bool
 public bool SetItemMetadata(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchMetaData /*const char **/)
 {
     return(platform.ISteamUGC_SetItemMetadata(handle.Value, pchMetaData));
 }
コード例 #15
0
            private void PublishChanges()
            {
                UpdateHandle = workshop.ugc.StartItemUpdate(WorkshopUploadAppId, Id);

                if (Title != null)
                {
                    workshop.ugc.SetItemTitle(UpdateHandle, Title);
                }

                if (Description != null)
                {
                    workshop.ugc.SetItemDescription(UpdateHandle, Description);
                }

                if (Folder != null)
                {
                    var info = new System.IO.DirectoryInfo(Folder);

                    if (!info.Exists)
                    {
                        throw new System.Exception($"Folder doesn't exist ({Folder})");
                    }

                    workshop.ugc.SetItemContent(UpdateHandle, Folder);
                }

                if (Tags != null && Tags.Count > 0)
                {
                    workshop.ugc.SetItemTags(UpdateHandle, Tags.ToArray());
                }

                if (Visibility.HasValue)
                {
                    workshop.ugc.SetItemVisibility(UpdateHandle, (SteamNative.RemoteStoragePublishedFileVisibility)(uint) Visibility.Value);
                }

                for (int i = 0; i < Images.Count; i++)
                {
                    workshop.ugc.AddItemPreviewFile(UpdateHandle, Images[i], ItemPreviewType.Image);
                }

                for (int i = 0; i < Videos.Count; i++)
                {
                    workshop.ugc.AddItemPreviewVideo(UpdateHandle, Videos[i]);
                }

                if (PreviewImage != null)
                {
                    var info = new System.IO.FileInfo(PreviewImage);

                    if (!info.Exists)
                    {
                        throw new System.Exception($"PreviewImage doesn't exist ({PreviewImage})");
                    }

                    if (info.Length >= 1024 * 1024)
                    {
                        throw new System.Exception($"PreviewImage should be under 1MB ({info.Length})");
                    }

                    workshop.ugc.SetItemPreview(UpdateHandle, PreviewImage);
                }

                /*
                 *  workshop.ugc.SetItemUpdateLanguage( UpdateId, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set
                 *  workshop.ugc.SetItemMetadata( UpdateId, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax)
                 *  workshop.ugc.RemoveItemKeyValueTags( UpdateId, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key
                 *  workshop.ugc.AddItemKeyValueTag( UpdateId, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag.
                 *  workshop.ugc.AddItemPreviewFile( UpdateId, const char *pszPreviewFile, EItemPreviewType type ) = 0; //  add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
                 *  workshop.ugc.AddItemPreviewVideo( UpdateId, const char *pszVideoID ) = 0; //  add preview video for this item
                 *  workshop.ugc.UpdateItemPreviewFile( UpdateId, uint32 index, const char *pszPreviewFile ) = 0; //  updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
                 *  workshop.ugc.UpdateItemPreviewVideo( UpdateId, uint32 index, const char *pszVideoID ) = 0; //  updates an existing preview video for this item
                 *  workshop.ugc.RemoveItemPreview( UpdateId, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted)
                 */

                SubmitItemUpdate = workshop.ugc.SubmitItemUpdate(UpdateHandle, ChangeNote, OnChangesSubmitted);
            }
コード例 #16
0
 // bool
 public bool SetItemDescription(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchDescription /*const char **/)
 {
     return(platform.ISteamUGC_SetItemDescription(handle.Value, pchDescription));
 }
コード例 #17
0
 // bool
 public bool SetItemContent(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pszContentFolder /*const char **/)
 {
     return(platform.ISteamUGC_SetItemContent(handle.Value, pszContentFolder));
 }
コード例 #18
0
 // bool
 public bool RemoveItemPreview(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, uint index /*uint32*/)
 {
     return(platform.ISteamUGC_RemoveItemPreview(handle.Value, index));
 }
コード例 #19
0
 // bool
 public bool RemoveItemKeyValueTags(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchKey /*const char **/)
 {
     return(platform.ISteamUGC_RemoveItemKeyValueTags(handle.Value, pchKey));
 }
コード例 #20
0
 // ItemUpdateStatus
 public ItemUpdateStatus GetItemUpdateProgress(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, out ulong punBytesProcessed /*uint64 **/, out ulong punBytesTotal /*uint64 **/)
 {
     return(platform.ISteamUGC_GetItemUpdateProgress(handle.Value, out punBytesProcessed, out punBytesTotal));
 }
コード例 #21
0
 // bool
 public bool SetItemUpdateLanguage(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchLanguage /*const char **/)
 {
     return(platform.ISteamUGC_SetItemUpdateLanguage(handle.Value, pchLanguage));
 }
コード例 #22
0
 // bool
 public bool AddItemKeyValueTag(UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchKey /*const char **/, string pchValue /*const char **/)
 {
     return(platform.ISteamUGC_AddItemKeyValueTag(handle.Value, Utility.GetUtf8Bytes(pchKey), Utility.GetUtf8Bytes(pchValue)));
 }