示例#1
0
		public static bool GetQueryUGCPreviewURL(UGCQueryHandle_t handle, uint index, out string pchURL, uint cchURLSize) {
			InteropHelp.TestIfAvailableClient();
			IntPtr pchURL2 = Marshal.AllocHGlobal((int)cchURLSize);
			bool ret = NativeMethods.ISteamUGC_GetQueryUGCPreviewURL(handle, index, pchURL2, cchURLSize);
			pchURL = ret ? InteropHelp.PtrToStringUTF8(pchURL2) : null;
			Marshal.FreeHGlobal(pchURL2);
			return ret;
		}
		public static bool GetQueryUGCAdditionalPreview(UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, uint cchURLSize, out bool pbIsImage) {
			InteropHelp.TestIfAvailableGameServer();
			IntPtr pchURLOrVideoID2 = Marshal.AllocHGlobal((int)cchURLSize);
			bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCAdditionalPreview(handle, index, previewIndex, pchURLOrVideoID2, cchURLSize, out pbIsImage);
			pchURLOrVideoID = ret ? InteropHelp.PtrToStringUTF8(pchURLOrVideoID2) : null;
			Marshal.FreeHGlobal(pchURLOrVideoID2);
			return ret;
		}
		public static bool GetQueryUGCMetadata(UGCQueryHandle_t handle, uint index, out string pchMetadata, uint cchMetadatasize) {
			InteropHelp.TestIfAvailableGameServer();
			IntPtr pchMetadata2 = Marshal.AllocHGlobal((int)cchMetadatasize);
			bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCMetadata(handle, index, pchMetadata2, cchMetadatasize);
			pchMetadata = ret ? InteropHelp.PtrToStringUTF8(pchMetadata2) : null;
			Marshal.FreeHGlobal(pchMetadata2);
			return ret;
		}
示例#4
0
 public static bool AddRequiredTag(UGCQueryHandle_t handle, string pTagName)
 {
     InteropHelp.TestIfAvailableClient();
     bool result;
     using (InteropHelp.UTF8StringHandle uTF8StringHandle = new InteropHelp.UTF8StringHandle(pTagName))
     {
         result = NativeMethods.ISteamUGC_AddRequiredTag(handle, uTF8StringHandle);
     }
     return result;
 }
示例#5
0
		public static bool GetQueryUGCAdditionalPreview(UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, uint cchURLSize, out string pchOriginalFileName, uint cchOriginalFileNameSize, out EItemPreviewType pPreviewType) {
			InteropHelp.TestIfAvailableClient();
			IntPtr pchURLOrVideoID2 = Marshal.AllocHGlobal((int)cchURLSize);
			IntPtr pchOriginalFileName2 = Marshal.AllocHGlobal((int)cchOriginalFileNameSize);
			bool ret = NativeMethods.ISteamUGC_GetQueryUGCAdditionalPreview(handle, index, previewIndex, pchURLOrVideoID2, cchURLSize, pchOriginalFileName2, cchOriginalFileNameSize, out pPreviewType);
			pchURLOrVideoID = ret ? InteropHelp.PtrToStringUTF8(pchURLOrVideoID2) : null;
			Marshal.FreeHGlobal(pchURLOrVideoID2);
			pchOriginalFileName = ret ? InteropHelp.PtrToStringUTF8(pchOriginalFileName2) : null;
			Marshal.FreeHGlobal(pchOriginalFileName2);
			return ret;
		}
示例#6
0
 /// <summary>
 /// Configures the request to limit the cache time to 1 hour, then sends it.
 /// </summary>
 /// <param name="query">The UGC query to send.</param>
 /// <returns>The API call result of the query.</returns>
 internal static SteamAPICall_t ConfigureAndSend(UGCQueryHandle_t query)
 {
     SteamUGC.SetAllowCachedResponse(query, 3600U);
     return(SteamUGC.SendQueryUGCRequest(query));
 }
		public static bool SetReturnTotalOnly(UGCQueryHandle_t handle, bool bReturnTotalOnly) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerUGC_SetReturnTotalOnly(handle, bReturnTotalOnly);
		}
		public static bool SetReturnKeyValueTags(UGCQueryHandle_t handle, bool bReturnKeyValueTags) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerUGC_SetReturnKeyValueTags(handle, bReturnKeyValueTags);
		}
    public void RenderOnGUI()
    {
        GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height));
        GUILayout.Label("Variables:");
        GUILayout.Label("m_UGCQueryHandle: " + m_UGCQueryHandle);
        GUILayout.Label("m_PublishedFileId: " + m_PublishedFileId);
        GUILayout.Label("m_UGCUpdateHandle: " + m_UGCUpdateHandle);
        GUILayout.EndArea();

        GUILayout.BeginVertical("box");
        m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33));

        if (GUILayout.Button("CreateQueryUserUGCRequest(SteamUser.GetSteamID().GetAccountID(), EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Screenshots, EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc, AppId_t.Invalid, SteamUtils.GetAppID(), 1)"))
        {
            m_UGCQueryHandle = SteamUGC.CreateQueryUserUGCRequest(SteamUser.GetSteamID().GetAccountID(), EUserUGCList.k_EUserUGCList_Published, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Screenshots, EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc, AppId_t.Invalid, SteamUtils.GetAppID(), 1);
            print("SteamUGC.CreateQueryUserUGCRequest(" + SteamUser.GetSteamID().GetAccountID() + ", " + EUserUGCList.k_EUserUGCList_Published + ", " + EUGCMatchingUGCType.k_EUGCMatchingUGCType_Screenshots + ", " + EUserUGCListSortOrder.k_EUserUGCListSortOrder_CreationOrderDesc + ", " + AppId_t.Invalid + ", " + SteamUtils.GetAppID() + ", " + 1 + ") : " + m_UGCQueryHandle);
        }

        if (GUILayout.Button("CreateQueryAllUGCRequest(EUGCQuery.k_EUGCQuery_RankedByPublicationDate, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items, AppId_t.Invalid, SteamUtils.GetAppID(), 1)"))
        {
            m_UGCQueryHandle = SteamUGC.CreateQueryAllUGCRequest(EUGCQuery.k_EUGCQuery_RankedByPublicationDate, EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items, AppId_t.Invalid, SteamUtils.GetAppID(), 1);
            print("SteamUGC.CreateQueryAllUGCRequest(" + EUGCQuery.k_EUGCQuery_RankedByPublicationDate + ", " + EUGCMatchingUGCType.k_EUGCMatchingUGCType_Items + ", " + AppId_t.Invalid + ", " + SteamUtils.GetAppID() + ", " + 1 + ") : " + m_UGCQueryHandle);
        }

        if (GUILayout.Button("CreateQueryUGCDetailsRequest(PublishedFileIDs, (uint)PublishedFileIDs.Length)"))
        {
            PublishedFileId_t[] PublishedFileIDs = new PublishedFileId_t[] { TestConstants.Instance.k_PublishedFileId_Champions };
            m_UGCQueryHandle = SteamUGC.CreateQueryUGCDetailsRequest(PublishedFileIDs, (uint)PublishedFileIDs.Length);
            print("SteamUGC.CreateQueryUGCDetailsRequest(" + PublishedFileIDs + ", " + (uint)PublishedFileIDs.Length + ") : " + m_UGCQueryHandle);
        }

        if (GUILayout.Button("SendQueryUGCRequest(m_UGCQueryHandle)"))
        {
            SteamAPICall_t handle = SteamUGC.SendQueryUGCRequest(m_UGCQueryHandle);
            OnSteamUGCQueryCompletedCallResult.Set(handle);
            print("SteamUGC.SendQueryUGCRequest(" + m_UGCQueryHandle + ") : " + handle);
        }

        if (GUILayout.Button("GetQueryUGCResult(m_UGCQueryHandle, 0, out Details)"))
        {
            SteamUGCDetails_t Details;
            bool ret = SteamUGC.GetQueryUGCResult(m_UGCQueryHandle, 0, out Details);
            print(Details.m_nPublishedFileId + " -- " + Details.m_eResult + " -- " + Details.m_eFileType + " -- " + Details.m_nCreatorAppID + " -- " + Details.m_nConsumerAppID + " -- " + Details.m_rgchTitle + " -- " + Details.m_rgchDescription + " -- " + Details.m_ulSteamIDOwner + " -- " + Details.m_rtimeCreated + " -- " + Details.m_rtimeUpdated + " -- " + Details.m_rtimeAddedToUserList + " -- " + Details.m_eVisibility + " -- " + Details.m_bBanned + " -- " + Details.m_bAcceptedForUse + " -- " + Details.m_bTagsTruncated + " -- " + Details.m_rgchTags + " -- " + Details.m_hFile + " -- " + Details.m_hPreviewFile + " -- " + Details.m_pchFileName + " -- " + Details.m_nFileSize + " -- " + Details.m_nPreviewFileSize + " -- " + Details.m_rgchURL + " -- " + Details.m_unVotesUp + " -- " + Details.m_unVotesDown + " -- " + Details.m_flScore + " -- " + Details.m_unNumChildren);
            print("SteamUGC.GetQueryUGCResult(" + m_UGCQueryHandle + ", " + 0 + ", " + "out Details" + ") : " + ret + " -- " + Details);
        }

        if (GUILayout.Button("GetQueryUGCPreviewURL(m_UGCQueryHandle, 0, out URL, 1024)"))
        {
            string URL;
            bool   ret = SteamUGC.GetQueryUGCPreviewURL(m_UGCQueryHandle, 0, out URL, 1024);
            print("SteamUGC.GetQueryUGCPreviewURL(" + m_UGCQueryHandle + ", " + 0 + ", " + "out URL" + ", " + 1024 + ") : " + ret + " -- " + URL);
        }

        if (GUILayout.Button("GetQueryUGCMetadata(m_UGCQueryHandle, 0, out Metadata, Constants.k_cchDeveloperMetadataMax)"))
        {
            string Metadata;
            bool   ret = SteamUGC.GetQueryUGCMetadata(m_UGCQueryHandle, 0, out Metadata, Constants.k_cchDeveloperMetadataMax);
            print("SteamUGC.GetQueryUGCMetadata(" + m_UGCQueryHandle + ", " + 0 + ", " + "out Metadata" + ", " + Constants.k_cchDeveloperMetadataMax + ") : " + ret + " -- " + Metadata);
        }

        if (GUILayout.Button("GetQueryUGCChildren(m_UGCQueryHandle, 0, PublishedFileIDs, (uint)PublishedFileIDs.Length)"))
        {
            PublishedFileId_t[] PublishedFileIDs = new PublishedFileId_t[1];             // Use SteamUGCDetails_t.m_unNumChildren instead...
            bool ret = SteamUGC.GetQueryUGCChildren(m_UGCQueryHandle, 0, PublishedFileIDs, (uint)PublishedFileIDs.Length);
            print("SteamUGC.GetQueryUGCChildren(" + m_UGCQueryHandle + ", " + 0 + ", " + PublishedFileIDs + ", " + (uint)PublishedFileIDs.Length + ") : " + ret);
        }

        if (GUILayout.Button("GetQueryUGCStatistic(m_UGCQueryHandle, 0, EItemStatistic.k_EItemStatistic_NumSubscriptions, out StatValue)"))
        {
            ulong StatValue;
            bool  ret = SteamUGC.GetQueryUGCStatistic(m_UGCQueryHandle, 0, EItemStatistic.k_EItemStatistic_NumSubscriptions, out StatValue);
            print("SteamUGC.GetQueryUGCStatistic(" + m_UGCQueryHandle + ", " + 0 + ", " + EItemStatistic.k_EItemStatistic_NumSubscriptions + ", " + "out StatValue" + ") : " + ret + " -- " + StatValue);
        }

        if (GUILayout.Button("GetQueryUGCNumAdditionalPreviews(m_UGCQueryHandle, 0)"))
        {
            uint ret = SteamUGC.GetQueryUGCNumAdditionalPreviews(m_UGCQueryHandle, 0);
            print("SteamUGC.GetQueryUGCNumAdditionalPreviews(" + m_UGCQueryHandle + ", " + 0 + ") : " + ret);
        }

        if (GUILayout.Button("GetQueryUGCAdditionalPreview(m_UGCQueryHandle, 0, 0, out pchURLOrVideoID, 1024, out pchOriginalFileName, 260, out pPreviewType)"))
        {
            // Should check GetQueryUGCNumAdditionalPreviews first.
            string           pchURLOrVideoID;
            string           pchOriginalFileName;
            EItemPreviewType pPreviewType;
            bool             ret = SteamUGC.GetQueryUGCAdditionalPreview(m_UGCQueryHandle, 0, 0, out pchURLOrVideoID, 1024, out pchOriginalFileName, 260, out pPreviewType);
            print("SteamUGC.GetQueryUGCAdditionalPreview(" + m_UGCQueryHandle + ", " + 0 + ", " + 0 + ", " + "out pchURLOrVideoID" + ", " + 1024 + ", " + "out pchOriginalFileName" + ", " + 260 + ", " + "out pPreviewType" + ") : " + ret + " -- " + pchURLOrVideoID + " -- " + pchOriginalFileName + " -- " + pPreviewType);
        }

        if (GUILayout.Button("GetQueryUGCNumKeyValueTags(m_UGCQueryHandle, 0)"))
        {
            uint ret = SteamUGC.GetQueryUGCNumKeyValueTags(m_UGCQueryHandle, 0);
            print("SteamUGC.GetQueryUGCNumKeyValueTags(" + m_UGCQueryHandle + ", " + 0 + ") : " + ret);
        }

        if (GUILayout.Button("GetQueryUGCKeyValueTag(m_UGCQueryHandle, 0, 0, out Key, 260, out Value, 260)"))
        {
            string Key;
            string Value;
            bool   ret = SteamUGC.GetQueryUGCKeyValueTag(m_UGCQueryHandle, 0, 0, out Key, 260, out Value, 260);
            print("SteamUGC.GetQueryUGCKeyValueTag(" + m_UGCQueryHandle + ", " + 0 + ", " + 0 + ", " + "out Key" + ", " + 260 + ", " + "out Value" + ", " + 260 + ") : " + ret + " -- " + Key + " -- " + Value);
        }

        if (GUILayout.Button("ReleaseQueryUGCRequest(m_UGCQueryHandle)"))
        {
            bool ret = SteamUGC.ReleaseQueryUGCRequest(m_UGCQueryHandle);
            print("SteamUGC.ReleaseQueryUGCRequest(" + m_UGCQueryHandle + ") : " + ret);
        }

        if (GUILayout.Button("AddRequiredTag(m_UGCQueryHandle, \"Co-op\")"))
        {
            bool ret = SteamUGC.AddRequiredTag(m_UGCQueryHandle, "Co-op");
            print("SteamUGC.AddRequiredTag(" + m_UGCQueryHandle + ", " + "\"Co-op\"" + ") : " + ret);
        }

        if (GUILayout.Button("AddExcludedTag(m_UGCQueryHandle, \"Co-op\")"))
        {
            bool ret = SteamUGC.AddExcludedTag(m_UGCQueryHandle, "Co-op");
            print("SteamUGC.AddExcludedTag(" + m_UGCQueryHandle + ", " + "\"Co-op\"" + ") : " + ret);
        }

        if (GUILayout.Button("SetReturnOnlyIDs(m_UGCQueryHandle, true)"))
        {
            bool ret = SteamUGC.SetReturnOnlyIDs(m_UGCQueryHandle, true);
            print("SteamUGC.SetReturnOnlyIDs(" + m_UGCQueryHandle + ", " + true + ") : " + ret);
        }

        if (GUILayout.Button("SetReturnKeyValueTags(m_UGCQueryHandle, true)"))
        {
            bool ret = SteamUGC.SetReturnKeyValueTags(m_UGCQueryHandle, true);
            print("SteamUGC.SetReturnKeyValueTags(" + m_UGCQueryHandle + ", " + true + ") : " + ret);
        }

        if (GUILayout.Button("SetReturnLongDescription(m_UGCQueryHandle, true)"))
        {
            bool ret = SteamUGC.SetReturnLongDescription(m_UGCQueryHandle, true);
            print("SteamUGC.SetReturnLongDescription(" + m_UGCQueryHandle + ", " + true + ") : " + ret);
        }

        if (GUILayout.Button("SetReturnMetadata(m_UGCQueryHandle, true)"))
        {
            bool ret = SteamUGC.SetReturnMetadata(m_UGCQueryHandle, true);
            print("SteamUGC.SetReturnMetadata(" + m_UGCQueryHandle + ", " + true + ") : " + ret);
        }

        if (GUILayout.Button("SetReturnChildren(m_UGCQueryHandle, true)"))
        {
            bool ret = SteamUGC.SetReturnChildren(m_UGCQueryHandle, true);
            print("SteamUGC.SetReturnChildren(" + m_UGCQueryHandle + ", " + true + ") : " + ret);
        }

        if (GUILayout.Button("SetReturnAdditionalPreviews(m_UGCQueryHandle, true)"))
        {
            bool ret = SteamUGC.SetReturnAdditionalPreviews(m_UGCQueryHandle, true);
            print("SteamUGC.SetReturnAdditionalPreviews(" + m_UGCQueryHandle + ", " + true + ") : " + ret);
        }

        if (GUILayout.Button("SetReturnTotalOnly(m_UGCQueryHandle, true)"))
        {
            bool ret = SteamUGC.SetReturnTotalOnly(m_UGCQueryHandle, true);
            print("SteamUGC.SetReturnTotalOnly(" + m_UGCQueryHandle + ", " + true + ") : " + ret);
        }

        if (GUILayout.Button("SetReturnPlaytimeStats(m_UGCQueryHandle, 7)"))
        {
            bool ret = SteamUGC.SetReturnPlaytimeStats(m_UGCQueryHandle, 7);
            print("SteamUGC.SetReturnPlaytimeStats(" + m_UGCQueryHandle + ", " + 7 + ") : " + ret);
        }

        if (GUILayout.Button("SetLanguage(m_UGCQueryHandle, \"english\")"))
        {
            bool ret = SteamUGC.SetLanguage(m_UGCQueryHandle, "english");
            print("SteamUGC.SetLanguage(" + m_UGCQueryHandle + ", " + "\"english\"" + ") : " + ret);
        }

        if (GUILayout.Button("SetAllowCachedResponse(m_UGCQueryHandle, 5)"))
        {
            bool ret = SteamUGC.SetAllowCachedResponse(m_UGCQueryHandle, 5);
            print("SteamUGC.SetAllowCachedResponse(" + m_UGCQueryHandle + ", " + 5 + ") : " + ret);
        }

        if (GUILayout.Button("SetCloudFileNameFilter(m_UGCQueryHandle, \"\")"))
        {
            bool ret = SteamUGC.SetCloudFileNameFilter(m_UGCQueryHandle, "");
            print("SteamUGC.SetCloudFileNameFilter(" + m_UGCQueryHandle + ", " + "\"\"" + ") : " + ret);
        }

        if (GUILayout.Button("SetMatchAnyTag(m_UGCQueryHandle, true)"))
        {
            bool ret = SteamUGC.SetMatchAnyTag(m_UGCQueryHandle, true);
            print("SteamUGC.SetMatchAnyTag(" + m_UGCQueryHandle + ", " + true + ") : " + ret);
        }

        if (GUILayout.Button("SetSearchText(m_UGCQueryHandle, \"Test\")"))
        {
            bool ret = SteamUGC.SetSearchText(m_UGCQueryHandle, "Test");
            print("SteamUGC.SetSearchText(" + m_UGCQueryHandle + ", " + "\"Test\"" + ") : " + ret);
        }

        if (GUILayout.Button("SetRankedByTrendDays(m_UGCQueryHandle, 7)"))
        {
            bool ret = SteamUGC.SetRankedByTrendDays(m_UGCQueryHandle, 7);
            print("SteamUGC.SetRankedByTrendDays(" + m_UGCQueryHandle + ", " + 7 + ") : " + ret);
        }

        if (GUILayout.Button("AddRequiredKeyValueTag(m_UGCQueryHandle, \"TestKey\", \"TestValue\")"))
        {
            bool ret = SteamUGC.AddRequiredKeyValueTag(m_UGCQueryHandle, "TestKey", "TestValue");
            print("SteamUGC.AddRequiredKeyValueTag(" + m_UGCQueryHandle + ", " + "\"TestKey\"" + ", " + "\"TestValue\"" + ") : " + ret);
        }

        if (GUILayout.Button("RequestUGCDetails(m_PublishedFileId, 5)"))
        {
            SteamAPICall_t handle = SteamUGC.RequestUGCDetails(m_PublishedFileId, 5);
            OnSteamUGCRequestUGCDetailsResultCallResult.Set(handle);
            print("SteamUGC.RequestUGCDetails(" + m_PublishedFileId + ", " + 5 + ") : " + handle);
        }

        if (GUILayout.Button("CreateItem(SteamUtils.GetAppID(), EWorkshopFileType.k_EWorkshopFileTypeCommunity)"))
        {
            SteamAPICall_t handle = SteamUGC.CreateItem(SteamUtils.GetAppID(), EWorkshopFileType.k_EWorkshopFileTypeCommunity);
            OnCreateItemResultCallResult.Set(handle);
            print("SteamUGC.CreateItem(" + SteamUtils.GetAppID() + ", " + EWorkshopFileType.k_EWorkshopFileTypeCommunity + ") : " + handle);
        }

        if (GUILayout.Button("StartItemUpdate(SteamUtils.GetAppID(), m_PublishedFileId)"))
        {
            m_UGCUpdateHandle = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), m_PublishedFileId);
            print("SteamUGC.StartItemUpdate(" + SteamUtils.GetAppID() + ", " + m_PublishedFileId + ") : " + m_UGCUpdateHandle);
        }

        if (GUILayout.Button("SetItemTitle(m_UGCUpdateHandle, \"This is a Test\")"))
        {
            bool ret = SteamUGC.SetItemTitle(m_UGCUpdateHandle, "This is a Test");
            print("SteamUGC.SetItemTitle(" + m_UGCUpdateHandle + ", " + "\"This is a Test\"" + ") : " + ret);
        }

        if (GUILayout.Button("SetItemDescription(m_UGCUpdateHandle, \"This is the test description.\")"))
        {
            bool ret = SteamUGC.SetItemDescription(m_UGCUpdateHandle, "This is the test description.");
            print("SteamUGC.SetItemDescription(" + m_UGCUpdateHandle + ", " + "\"This is the test description.\"" + ") : " + ret);
        }

        if (GUILayout.Button("SetItemUpdateLanguage(m_UGCUpdateHandle, \"english\")"))
        {
            bool ret = SteamUGC.SetItemUpdateLanguage(m_UGCUpdateHandle, "english");
            print("SteamUGC.SetItemUpdateLanguage(" + m_UGCUpdateHandle + ", " + "\"english\"" + ") : " + ret);
        }

        if (GUILayout.Button("SetItemMetadata(m_UGCUpdateHandle, \"This is the test metadata.\")"))
        {
            bool ret = SteamUGC.SetItemMetadata(m_UGCUpdateHandle, "This is the test metadata.");
            print("SteamUGC.SetItemMetadata(" + m_UGCUpdateHandle + ", " + "\"This is the test metadata.\"" + ") : " + ret);
        }

        if (GUILayout.Button("SetItemVisibility(m_UGCUpdateHandle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic)"))
        {
            bool ret = SteamUGC.SetItemVisibility(m_UGCUpdateHandle, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic);
            print("SteamUGC.SetItemVisibility(" + m_UGCUpdateHandle + ", " + ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic + ") : " + ret);
        }

        if (GUILayout.Button("SetItemTags(m_UGCUpdateHandle, new string[] {\"Tag One\", \"Tag Two\", \"Test Tags\", \"Sorry\"})"))
        {
            bool ret = SteamUGC.SetItemTags(m_UGCUpdateHandle, new string[] { "Tag One", "Tag Two", "Test Tags", "Sorry" });
            print("SteamUGC.SetItemTags(" + m_UGCUpdateHandle + ", " + new string[] { "Tag One", "Tag Two", "Test Tags", "Sorry" } +") : " + ret);
        }

        if (GUILayout.Button("SetItemContent(m_UGCUpdateHandle, Application.dataPath + \"/Scenes\")"))
        {
            bool ret = SteamUGC.SetItemContent(m_UGCUpdateHandle, Application.dataPath + "/Scenes");
            print("SteamUGC.SetItemContent(" + m_UGCUpdateHandle + ", " + Application.dataPath + "/Scenes" + ") : " + ret);
        }

        if (GUILayout.Button("SetItemPreview(m_UGCUpdateHandle, Application.dataPath + \"/PreviewImage.jpg\")"))
        {
            bool ret = SteamUGC.SetItemPreview(m_UGCUpdateHandle, Application.dataPath + "/PreviewImage.jpg");
            print("SteamUGC.SetItemPreview(" + m_UGCUpdateHandle + ", " + Application.dataPath + "/PreviewImage.jpg" + ") : " + ret);
        }

        if (GUILayout.Button("RemoveItemKeyValueTags(m_UGCUpdateHandle, \"TestKey\")"))
        {
            bool ret = SteamUGC.RemoveItemKeyValueTags(m_UGCUpdateHandle, "TestKey");
            print("SteamUGC.RemoveItemKeyValueTags(" + m_UGCUpdateHandle + ", " + "\"TestKey\"" + ") : " + ret);
        }

        if (GUILayout.Button("AddItemKeyValueTag(m_UGCUpdateHandle, \"TestKey\", \"TestValue\")"))
        {
            bool ret = SteamUGC.AddItemKeyValueTag(m_UGCUpdateHandle, "TestKey", "TestValue");
            print("SteamUGC.AddItemKeyValueTag(" + m_UGCUpdateHandle + ", " + "\"TestKey\"" + ", " + "\"TestValue\"" + ") : " + ret);
        }

        if (GUILayout.Button("AddItemPreviewFile(m_UGCUpdateHandle, Application.dataPath + \"/PreviewImage.jpg\", EItemPreviewType.k_EItemPreviewType_Image)"))
        {
            bool ret = SteamUGC.AddItemPreviewFile(m_UGCUpdateHandle, Application.dataPath + "/PreviewImage.jpg", EItemPreviewType.k_EItemPreviewType_Image);
            print("SteamUGC.AddItemPreviewFile(" + m_UGCUpdateHandle + ", " + Application.dataPath + "/PreviewImage.jpg" + ", " + EItemPreviewType.k_EItemPreviewType_Image + ") : " + ret);
        }

        if (GUILayout.Button("AddItemPreviewVideo(m_UGCUpdateHandle, \"jHgZh4GV9G0\")"))
        {
            bool ret = SteamUGC.AddItemPreviewVideo(m_UGCUpdateHandle, "jHgZh4GV9G0");
            print("SteamUGC.AddItemPreviewVideo(" + m_UGCUpdateHandle + ", " + "\"jHgZh4GV9G0\"" + ") : " + ret);
        }

        if (GUILayout.Button("UpdateItemPreviewFile(m_UGCUpdateHandle, 0, Application.dataPath + \"/PreviewImage.jpg\")"))
        {
            bool ret = SteamUGC.UpdateItemPreviewFile(m_UGCUpdateHandle, 0, Application.dataPath + "/PreviewImage.jpg");
            print("SteamUGC.UpdateItemPreviewFile(" + m_UGCUpdateHandle + ", " + 0 + ", " + Application.dataPath + "/PreviewImage.jpg" + ") : " + ret);
        }

        if (GUILayout.Button("UpdateItemPreviewVideo(m_UGCUpdateHandle, 0, \"jHgZh4GV9G0\")"))
        {
            bool ret = SteamUGC.UpdateItemPreviewVideo(m_UGCUpdateHandle, 0, "jHgZh4GV9G0");
            print("SteamUGC.UpdateItemPreviewVideo(" + m_UGCUpdateHandle + ", " + 0 + ", " + "\"jHgZh4GV9G0\"" + ") : " + ret);
        }

        if (GUILayout.Button("RemoveItemPreview(m_UGCUpdateHandle, 0)"))
        {
            bool ret = SteamUGC.RemoveItemPreview(m_UGCUpdateHandle, 0);
            print("SteamUGC.RemoveItemPreview(" + m_UGCUpdateHandle + ", " + 0 + ") : " + ret);
        }

        if (GUILayout.Button("SubmitItemUpdate(m_UGCUpdateHandle, \"Test Changenote\")"))
        {
            SteamAPICall_t handle = SteamUGC.SubmitItemUpdate(m_UGCUpdateHandle, "Test Changenote");
            OnSubmitItemUpdateResultCallResult.Set(handle);
            print("SteamUGC.SubmitItemUpdate(" + m_UGCUpdateHandle + ", " + "\"Test Changenote\"" + ") : " + handle);
        }

        {
            ulong             BytesProcessed;
            ulong             BytesTotal;
            EItemUpdateStatus ret = SteamUGC.GetItemUpdateProgress(m_UGCUpdateHandle, out BytesProcessed, out BytesTotal);
            GUILayout.Label("GetItemUpdateProgress(m_UGCUpdateHandle, out BytesProcessed, out BytesTotal) : " + ret + " -- " + BytesProcessed + " -- " + BytesTotal);
        }

        if (GUILayout.Button("SetUserItemVote(TestConstants.Instance.k_PublishedFileId_Champions, true)"))
        {
            SteamAPICall_t handle = SteamUGC.SetUserItemVote(TestConstants.Instance.k_PublishedFileId_Champions, true);
            OnSetUserItemVoteResultCallResult.Set(handle);
            print("SteamUGC.SetUserItemVote(" + TestConstants.Instance.k_PublishedFileId_Champions + ", " + true + ") : " + handle);
        }

        if (GUILayout.Button("GetUserItemVote(TestConstants.Instance.k_PublishedFileId_Champions)"))
        {
            SteamAPICall_t handle = SteamUGC.GetUserItemVote(TestConstants.Instance.k_PublishedFileId_Champions);
            OnGetUserItemVoteResultCallResult.Set(handle);
            print("SteamUGC.GetUserItemVote(" + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle);
        }

        if (GUILayout.Button("AddItemToFavorites(SteamUtils.GetAppID(), TestConstants.Instance.k_PublishedFileId_Champions)"))
        {
            SteamAPICall_t handle = SteamUGC.AddItemToFavorites(SteamUtils.GetAppID(), TestConstants.Instance.k_PublishedFileId_Champions);
            OnUserFavoriteItemsListChangedCallResult.Set(handle);
            print("SteamUGC.AddItemToFavorites(" + SteamUtils.GetAppID() + ", " + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle);
        }

        if (GUILayout.Button("RemoveItemFromFavorites(SteamUtils.GetAppID(), TestConstants.Instance.k_PublishedFileId_Champions)"))
        {
            SteamAPICall_t handle = SteamUGC.RemoveItemFromFavorites(SteamUtils.GetAppID(), TestConstants.Instance.k_PublishedFileId_Champions);
            OnUserFavoriteItemsListChangedCallResult.Set(handle);
            print("SteamUGC.RemoveItemFromFavorites(" + SteamUtils.GetAppID() + ", " + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle);
        }

        if (GUILayout.Button("SubscribeItem(TestConstants.Instance.k_PublishedFileId_Champions)"))
        {
            SteamAPICall_t handle = SteamUGC.SubscribeItem(TestConstants.Instance.k_PublishedFileId_Champions);
            OnRemoteStorageSubscribePublishedFileResultCallResult.Set(handle);
            print("SteamUGC.SubscribeItem(" + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle);
        }

        if (GUILayout.Button("UnsubscribeItem(TestConstants.Instance.k_PublishedFileId_Champions)"))
        {
            SteamAPICall_t handle = SteamUGC.UnsubscribeItem(TestConstants.Instance.k_PublishedFileId_Champions);
            OnRemoteStorageUnsubscribePublishedFileResultCallResult.Set(handle);
            print("SteamUGC.UnsubscribeItem(" + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle);
        }

        GUILayout.Label("GetNumSubscribedItems() : " + SteamUGC.GetNumSubscribedItems());

        if (GUILayout.Button("GetSubscribedItems(PublishedFileID, (uint)PublishedFileID.Length)"))
        {
            PublishedFileId_t[] PublishedFileID = new PublishedFileId_t[1];
            uint ret = SteamUGC.GetSubscribedItems(PublishedFileID, (uint)PublishedFileID.Length);
            m_PublishedFileId = PublishedFileID[0];
            print("SteamUGC.GetSubscribedItems(" + PublishedFileID + ", " + (uint)PublishedFileID.Length + ") : " + ret);
            print(m_PublishedFileId);
        }

        GUILayout.Label("GetItemState(PublishedFileID) : " + (EItemState)SteamUGC.GetItemState(m_PublishedFileId));

        {
            ulong  SizeOnDisk;
            string Folder;
            uint   punTimeStamp;
            bool   ret = SteamUGC.GetItemInstallInfo(m_PublishedFileId, out SizeOnDisk, out Folder, 1024, out punTimeStamp);
            GUILayout.Label("GetItemInstallInfo(m_PublishedFileId, out SizeOnDisk, out Folder, 1024, out punTimeStamp) : " + ret + " -- " + SizeOnDisk + " -- " + Folder + " -- " + punTimeStamp);
        }

        if (GUILayout.Button("GetItemDownloadInfo(m_PublishedFileId, out BytesDownloaded, out BytesTotal)"))
        {
            ulong BytesDownloaded;
            ulong BytesTotal;
            bool  ret = SteamUGC.GetItemDownloadInfo(m_PublishedFileId, out BytesDownloaded, out BytesTotal);
            print("SteamUGC.GetItemDownloadInfo(" + m_PublishedFileId + ", " + "out BytesDownloaded" + ", " + "out BytesTotal" + ") : " + ret + " -- " + BytesDownloaded + " -- " + BytesTotal);
        }

        if (GUILayout.Button("DownloadItem(m_PublishedFileId, true)"))
        {
            bool ret = SteamUGC.DownloadItem(m_PublishedFileId, true);
            print("SteamUGC.DownloadItem(" + m_PublishedFileId + ", " + true + ") : " + ret);
        }

        if (GUILayout.Button("BInitWorkshopForGameServer((DepotId_t)481, \"C:/UGCTest\")"))
        {
            bool ret = SteamUGC.BInitWorkshopForGameServer((DepotId_t)481, "C:/UGCTest");
            print("SteamUGC.BInitWorkshopForGameServer(" + (DepotId_t)481 + ", " + "\"C:/UGCTest\"" + ") : " + ret);
        }

        if (GUILayout.Button("SuspendDownloads(true)"))
        {
            SteamUGC.SuspendDownloads(true);
            print("SteamUGC.SuspendDownloads(" + true + ")");
        }

        if (GUILayout.Button("StartPlaytimeTracking(PublishedFileIds, (uint)PublishedFileIds.Length)"))
        {
            PublishedFileId_t[] PublishedFileIds = new PublishedFileId_t[] { TestConstants.Instance.k_PublishedFileId_Champions };
            SteamAPICall_t      handle           = SteamUGC.StartPlaytimeTracking(PublishedFileIds, (uint)PublishedFileIds.Length);
            OnStartPlaytimeTrackingResultCallResult.Set(handle);
            print("SteamUGC.StartPlaytimeTracking(" + PublishedFileIds + ", " + (uint)PublishedFileIds.Length + ") : " + handle);
        }

        if (GUILayout.Button("StopPlaytimeTracking(PublishedFileIds, (uint)PublishedFileIds.Length)"))
        {
            PublishedFileId_t[] PublishedFileIds = new PublishedFileId_t[] { TestConstants.Instance.k_PublishedFileId_Champions };
            SteamAPICall_t      handle           = SteamUGC.StopPlaytimeTracking(PublishedFileIds, (uint)PublishedFileIds.Length);
            OnStopPlaytimeTrackingResultCallResult.Set(handle);
            print("SteamUGC.StopPlaytimeTracking(" + PublishedFileIds + ", " + (uint)PublishedFileIds.Length + ") : " + handle);
        }

        if (GUILayout.Button("StopPlaytimeTrackingForAllItems()"))
        {
            SteamAPICall_t handle = SteamUGC.StopPlaytimeTrackingForAllItems();
            OnStopPlaytimeTrackingResultCallResult.Set(handle);
            print("SteamUGC.StopPlaytimeTrackingForAllItems() : " + handle);
        }

        if (GUILayout.Button("AddDependency(m_PublishedFileId, TestConstants.Instance.k_PublishedFileId_Champions)"))
        {
            SteamAPICall_t handle = SteamUGC.AddDependency(m_PublishedFileId, TestConstants.Instance.k_PublishedFileId_Champions);
            OnAddUGCDependencyResultCallResult.Set(handle);
            print("SteamUGC.AddDependency(" + m_PublishedFileId + ", " + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle);
        }

        if (GUILayout.Button("RemoveDependency(m_PublishedFileId, TestConstants.Instance.k_PublishedFileId_Champions)"))
        {
            SteamAPICall_t handle = SteamUGC.RemoveDependency(m_PublishedFileId, TestConstants.Instance.k_PublishedFileId_Champions);
            OnRemoveUGCDependencyResultCallResult.Set(handle);
            print("SteamUGC.RemoveDependency(" + m_PublishedFileId + ", " + TestConstants.Instance.k_PublishedFileId_Champions + ") : " + handle);
        }

        if (GUILayout.Button("AddAppDependency(m_PublishedFileId, SteamUtils.GetAppID())"))
        {
            SteamAPICall_t handle = SteamUGC.AddAppDependency(m_PublishedFileId, SteamUtils.GetAppID());
            OnAddAppDependencyResultCallResult.Set(handle);
            print("SteamUGC.AddAppDependency(" + m_PublishedFileId + ", " + SteamUtils.GetAppID() + ") : " + handle);
        }

        if (GUILayout.Button("RemoveAppDependency(m_PublishedFileId, SteamUtils.GetAppID())"))
        {
            SteamAPICall_t handle = SteamUGC.RemoveAppDependency(m_PublishedFileId, SteamUtils.GetAppID());
            OnRemoveAppDependencyResultCallResult.Set(handle);
            print("SteamUGC.RemoveAppDependency(" + m_PublishedFileId + ", " + SteamUtils.GetAppID() + ") : " + handle);
        }

        if (GUILayout.Button("GetAppDependencies(m_PublishedFileId)"))
        {
            SteamAPICall_t handle = SteamUGC.GetAppDependencies(m_PublishedFileId);
            OnGetAppDependenciesResultCallResult.Set(handle);
            print("SteamUGC.GetAppDependencies(" + m_PublishedFileId + ") : " + handle);
        }

        if (GUILayout.Button("DeleteItem(m_PublishedFileId)"))
        {
            SteamAPICall_t handle = SteamUGC.DeleteItem(m_PublishedFileId);
            OnDeleteItemResultCallResult.Set(handle);
            print("SteamUGC.DeleteItem(" + m_PublishedFileId + ") : " + handle);
        }

        GUILayout.EndScrollView();
        GUILayout.EndVertical();
    }
		public static bool SetSearchText(UGCQueryHandle_t handle, string pSearchText) {
			InteropHelp.TestIfAvailableGameServer();
			using (var pSearchText2 = new InteropHelp.UTF8StringHandle(pSearchText)) {
				return NativeMethods.ISteamGameServerUGC_SetSearchText(handle, pSearchText2);
			}
		}
示例#11
0
		public static extern bool ISteamGameServerUGC_SetSearchText(UGCQueryHandle_t handle, InteropHelp.UTF8StringHandle pSearchText);
示例#12
0
		public static uint GetQueryUGCNumAdditionalPreviews(UGCQueryHandle_t handle, uint index) {
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamUGC_GetQueryUGCNumAdditionalPreviews(handle, index);
		}
		/// <summary>
		/// <para> Options only for querying user UGC</para>
		/// </summary>
		public static bool SetCloudFileNameFilter(UGCQueryHandle_t handle, string pMatchCloudFileName) {
			InteropHelp.TestIfAvailableGameServer();
			using (var pMatchCloudFileName2 = new InteropHelp.UTF8StringHandle(pMatchCloudFileName)) {
				return NativeMethods.ISteamGameServerUGC_SetCloudFileNameFilter(handle, pMatchCloudFileName2);
			}
		}
示例#14
0
		public static bool SetReturnChildren(UGCQueryHandle_t handle, bool bReturnChildren) {
			InteropHelp.TestIfAvailableClient();
			return NativeMethods.ISteamUGC_SetReturnChildren(handle, bReturnChildren);
		}
示例#15
0
 internal unsafe void SetQueryData_SetReturnOnlyIDs(UGCQueryHandle_t handle, bool bReturnOnlyIDs)
 {
     SteamUGC.SetReturnOnlyIDs(_handle, true);
 }
示例#16
0
		/// <summary>
		/// <para> Options to set for querying UGC</para>
		/// </summary>
		public static bool AddRequiredTag(UGCQueryHandle_t handle, string pTagName) {
			InteropHelp.TestIfAvailableClient();
			using (var pTagName2 = new InteropHelp.UTF8StringHandle(pTagName)) {
				return NativeMethods.ISteamUGC_AddRequiredTag(handle, pTagName2);
			}
		}
示例#17
0
		public static extern bool ISteamGameServerUGC_AddRequiredKeyValueTag(UGCQueryHandle_t handle, InteropHelp.UTF8StringHandle pKey, InteropHelp.UTF8StringHandle pValue);
示例#18
0
		public static extern bool ISteamGameServerUGC_SetRankedByTrendDays(UGCQueryHandle_t handle, uint unDays);
		public static bool SetLanguage(UGCQueryHandle_t handle, string pchLanguage) {
			InteropHelp.TestIfAvailableGameServer();
			using (var pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage)) {
				return NativeMethods.ISteamGameServerUGC_SetLanguage(handle, pchLanguage2);
			}
		}
		public static bool AddRequiredKeyValueTag(UGCQueryHandle_t handle, string pKey, string pValue) {
			InteropHelp.TestIfAvailableGameServer();
			using (var pKey2 = new InteropHelp.UTF8StringHandle(pKey))
			using (var pValue2 = new InteropHelp.UTF8StringHandle(pValue)) {
				return NativeMethods.ISteamGameServerUGC_AddRequiredKeyValueTag(handle, pKey2, pValue2);
			}
		}
		public static bool SetAllowCachedResponse(UGCQueryHandle_t handle, uint unMaxAgeSeconds) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerUGC_SetAllowCachedResponse(handle, unMaxAgeSeconds);
		}
		/// <summary>
		/// <para> Retrieve an individual result after receiving the callback for querying UGC</para>
		/// </summary>
		public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerUGC_GetQueryUGCResult(handle, index, out pDetails);
		}
		/// <summary>
		/// <para> Options only for querying all UGC</para>
		/// </summary>
		public static bool SetMatchAnyTag(UGCQueryHandle_t handle, bool bMatchAnyTag) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerUGC_SetMatchAnyTag(handle, bMatchAnyTag);
		}
		public static bool AddExcludedTag(UGCQueryHandle_t handle, string pTagName) {
			InteropHelp.TestIfAvailableGameServer();
			using (var pTagName2 = new InteropHelp.UTF8StringHandle(pTagName)) {
				return NativeMethods.ISteamGameServerUGC_AddExcludedTag(handle, pTagName2);
			}
		}
		/// <summary>
		/// <para> Release the request to free up memory, after retrieving results</para>
		/// </summary>
		public static bool ReleaseQueryUGCRequest(UGCQueryHandle_t handle) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerUGC_ReleaseQueryUGCRequest(handle);
		}
示例#26
0
    private unsafe void OnSteamUGCQueryCompleted(SteamUGCQueryCompleted_t queryCompleted, bool ioFailure)
    {
        UGCQueryHandle_t handle = queryCompleted.m_handle;

        if (_handle.m_UGCQueryHandle == 0 || ioFailure)
        {
            goto Finish;
        }

        numResultsTotal = queryCompleted.m_unTotalMatchingResults;
        uint results = queryCompleted.m_unNumResultsReturned;

        if (results == 0 || fetchedData == WorkshopQueryData.TotalOnly)
        {
            goto Finish;
        }

        numResultsFetched += results;
        for (uint resulti = 0; resulti < results; resulti++)
        {
            WorkshopQueryResult result = new WorkshopQueryResult();
            SteamUGC.GetQueryUGCPreviewURL(handle, resulti, out result.previewURL, 260);

            SteamUGCDetails_t ugcDetails;
            SteamUGC.GetQueryUGCResult(queryCompleted.m_handle, resulti, out ugcDetails);
            WorkshopQueryResultDetails resultDetails = result.details = new WorkshopQueryResultDetails();

            resultDetails.acceptedForUse = ugcDetails.m_bAcceptedForUse;
            resultDetails.banned         = ugcDetails.m_bBanned;

            resultDetails.title        = ugcDetails.m_rgchTitle;
            resultDetails.description  = ugcDetails.m_rgchDescription;
            resultDetails.steamIDOwner = ugcDetails.m_ulSteamIDOwner;
            resultDetails.score        = ugcDetails.m_flScore;
            resultDetails.visibility   = ugcDetails.m_eVisibility;
            resultDetails.votesDown    = ugcDetails.m_unVotesDown;
            resultDetails.votesUp      = ugcDetails.m_unVotesUp;

            resultDetails.tags          = ugcDetails.m_rgchTags.Split(',');
            resultDetails.tagsTruncated = ugcDetails.m_bTagsTruncated;

            resultDetails.timeAddedToUserList = ugcDetails.m_rtimeAddedToUserList;
            resultDetails.timeCreated         = ugcDetails.m_rtimeCreated;
            resultDetails.timeUpdated         = ugcDetails.m_rtimeUpdated;

            resultDetails.file     = ugcDetails.m_hFile.m_UGCHandle;
            resultDetails.fileName = ugcDetails.m_pchFileName;
            resultDetails.fileSize = ugcDetails.m_nFileSize;
            resultDetails.fileType = ugcDetails.m_eFileType;

            resultDetails.numChildren = ugcDetails.m_unNumChildren;

            resultDetails.previewFile     = ugcDetails.m_hPreviewFile.m_UGCHandle;
            resultDetails.previewFileSize = ugcDetails.m_nPreviewFileSize;

            resultDetails.URL = ugcDetails.m_rgchURL;

            resultDetails.publishedFile = WorkshopItem.GetItem(ugcDetails.m_nPublishedFileId);

            resultDetails.result = ugcDetails.m_eResult;

            if ((fetchedData & WorkshopQueryData.Children) != 0)
            {
                PublishedFileId_t[] children = new PublishedFileId_t[resultDetails.numChildren];
                if (SteamUGC.GetQueryUGCChildren(handle, resulti, children, (uint)children.Length))
                {
                    result.fileList = _.GetArray(children, id => WorkshopItem.GetItem(id));
                }
            }

            if ((fetchedData & WorkshopQueryData.Metadata) != 0)
            {
                SteamUGC.GetQueryUGCMetadata(handle, resulti, out result.metadata, 260);
            }

            if ((fetchedData & WorkshopQueryData.AdditionalPreviews) != 0)
            {
                WorkshopQueryResultAdditionalPreview[] previews = result.additionalPreviews = new WorkshopQueryResultAdditionalPreview[SteamUGC.GetQueryUGCNumAdditionalPreviews(handle, resulti)];
                for (uint previewi = 0; previewi < previews.Length; previewi++)
                {
                    string           url;
                    string           name;
                    EItemPreviewType type;
                    if (SteamUGC.GetQueryUGCAdditionalPreview(handle, resulti, previewi, out url, 260, out name, 260, out type))
                    {
                        previews[previewi] = new WorkshopQueryResultAdditionalPreview(type == EItemPreviewType.k_EItemPreviewType_Image, url);
                    }
                }
            }

            if ((fetchedData & WorkshopQueryData.Statistics) != 0)
            {
                uint[] stats = result.statistics = new uint[8];
                for (WorkshopResultStatistic stat = WorkshopResultStatistic.NumSubscriptions; (int)stat < stats.Length; stat++)
                {
                    ulong val;
                    if (SteamUGC.GetQueryUGCStatistic(handle, resulti, (EItemStatistic)stat, out val))
                    {
                        stats[(int)stat] = (uint)val;
                    }
                }
            }

            ResultFetched?.Invoke(this, result);
        }

        if (numResultsFetched != numResultsTotal && !justOnePage)
        {
            Destroy();
            page++;
            Create();
            Request();
            return;
        }

Finish:
        QueryFinished?.Invoke(this);
    }
		/// <summary>
		/// <para> Send the query to Steam</para>
		/// </summary>
		public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) {
			InteropHelp.TestIfAvailableGameServer();
			return (SteamAPICall_t)NativeMethods.ISteamGameServerUGC_SendQueryUGCRequest(handle);
		}
		public static bool SetReturnLongDescription(UGCQueryHandle_t handle, bool bReturnLongDescription) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerUGC_SetReturnLongDescription(handle, bReturnLongDescription);
		}
		public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, out string pchKey, uint cchKeySize, out string pchValue, uint cchValueSize) {
			InteropHelp.TestIfAvailableGameServer();
			IntPtr pchKey2 = Marshal.AllocHGlobal((int)cchKeySize);
			IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize);
			bool ret = NativeMethods.ISteamGameServerUGC_GetQueryUGCKeyValueTag(handle, index, keyValueTagIndex, pchKey2, cchKeySize, pchValue2, cchValueSize);
			pchKey = ret ? InteropHelp.PtrToStringUTF8(pchKey2) : null;
			Marshal.FreeHGlobal(pchKey2);
			pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null;
			Marshal.FreeHGlobal(pchValue2);
			return ret;
		}
示例#30
0
    private static void PerformUpload(bool preExisting = false)
    {
        if (preExisting)
        {
            UGCQueryHandle_t handle = SteamUGC.CreateQueryUGCDetailsRequest(new PublishedFileId_t[1]
            {
                new PublishedFileId_t(meta.workshopId)
            }, 1u);
            OnSteamUGCQueryCompletedCallResult = CallResult <SteamUGCQueryCompleted_t> .Create(OnSteamUGCQueryCompleted);

            SteamAPICall_t hAPICall = SteamUGC.SendQueryUGCRequest(handle);
            OnSteamUGCQueryCompletedCallResult.Set(hAPICall);
            return;
        }
        UGCUpdateHandle_t uGCUpdateHandle_t = SteamUGC.StartItemUpdate(SteamUtils.GetAppID(), (PublishedFileId_t)meta.workshopId);

        string[] pTags = null;
        string   type  = meta.type;
        bool     flag  = false;

        if (type.Equals("RagdollPreset"))
        {
            type  = "Model";
            flag  = true;
            pTags = new string[1]
            {
                "Model"
            };
        }
        if (!flag)
        {
            List <string> list = new List <string>();
            if (meta.typeTags == 2)
            {
                list.Add("Lobbies");
            }
            else
            {
                list.Add("Levels");
                if (meta.typeTags > 0 && meta.typeTags < 3)
                {
                    list.Add(TagStrings("WORKSHOP/LevelTypeDesc", meta.typeTags, english: true));
                }
            }
            if (meta.playerTags > 0 && meta.playerTags < 8)
            {
                list.Add(TagStrings("WORKSHOP/RecommendedPlayersDesc", meta.playerTags, english: true));
            }
            if (meta.themeTags != null)
            {
                string[] separator = new string[1]
                {
                    ", "
                };
                string[] collection = meta.themeTags.Split(separator, StringSplitOptions.RemoveEmptyEntries);
                list.AddRange(collection);
            }
            pTags = list.ToArray();
        }
        SteamUGC.SetItemTags(uGCUpdateHandle_t, pTags);
        SteamUGC.SetItemTitle(uGCUpdateHandle_t, meta.title);
        SteamUGC.SetItemDescription(uGCUpdateHandle_t, meta.description);
        SteamUGC.SetItemPreview(uGCUpdateHandle_t, FileTools.ToLocalPath(thumbnail));
        SteamUGC.SetItemContent(uGCUpdateHandle_t, FileTools.ToLocalPath(folder));
        if (flag)
        {
            SteamUGC.SetItemVisibility(uGCUpdateHandle_t, ERemoteStoragePublishedFileVisibility.k_ERemoteStoragePublishedFileVisibilityPublic);
        }
        m_SubmitItemUpdateResult = CallResult <SubmitItemUpdateResult_t> .Create(OnSubmitItemUpdateResult);

        SteamAPICall_t hAPICall2 = SteamUGC.SubmitItemUpdate(uGCUpdateHandle_t, updateNotes);

        m_SubmitItemUpdateResult.Set(hAPICall2);
    }
		public static bool GetQueryUGCStatistic(UGCQueryHandle_t handle, uint index, EItemStatistic eStatType, out uint pStatValue) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerUGC_GetQueryUGCStatistic(handle, index, eStatType, out pStatValue);
		}
		public static bool GetQueryUGCChildren(UGCQueryHandle_t handle, uint index, PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerUGC_GetQueryUGCChildren(handle, index, pvecPublishedFileID, cMaxEntries);
		}
		public static uint GetQueryUGCNumKeyValueTags(UGCQueryHandle_t handle, uint index) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerUGC_GetQueryUGCNumKeyValueTags(handle, index);
		}
		public static bool SetReturnAdditionalPreviews(UGCQueryHandle_t handle, bool bReturnAdditionalPreviews) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerUGC_SetReturnAdditionalPreviews(handle, bReturnAdditionalPreviews);
		}
		public static bool SetRankedByTrendDays(UGCQueryHandle_t handle, uint unDays) {
			InteropHelp.TestIfAvailableGameServer();
			return NativeMethods.ISteamGameServerUGC_SetRankedByTrendDays(handle, unDays);
		}