Steamworks.SteamUGC.GetItemInstallInfo C# (CSharp) Méthode

GetItemInstallInfo() public static méthode

get info about currently installed content on disc for items that have k_EItemStateInstalled set

if k_EItemStateLegacyItem is set, pchFolder contains the path to the legacy file itself (not a folder)

public static GetItemInstallInfo ( PublishedFileId_t nPublishedFileID, ulong &punSizeOnDisk, string &pchFolder, uint cchFolderSize, uint &punTimeStamp ) : bool
nPublishedFileID PublishedFileId_t
punSizeOnDisk ulong
pchFolder string
cchFolderSize uint
punTimeStamp uint
Résultat bool
		public static bool GetItemInstallInfo(PublishedFileId_t nPublishedFileID, out ulong punSizeOnDisk, out string pchFolder, uint cchFolderSize, out uint punTimeStamp) {
			InteropHelp.TestIfAvailableClient();
			IntPtr pchFolder2 = Marshal.AllocHGlobal((int)cchFolderSize);
			bool ret = NativeMethods.ISteamUGC_GetItemInstallInfo(nPublishedFileID, out punSizeOnDisk, pchFolder2, cchFolderSize, out punTimeStamp);
			pchFolder = ret ? InteropHelp.PtrToStringUTF8(pchFolder2) : null;
			Marshal.FreeHGlobal(pchFolder2);
			return ret;
		}

Usage Example

        public void CheckSubscribedItems(string _multiLevelCache = @"c:\", string _singleLevelCache = @"c:\", string StorageContainerPath = @"c:\")
        {
            if (!SteamManager.Initialized)
            {
                return;
            }

            uint number = SteamUGC.GetNumSubscribedItems();

            PublishedFileId_t[] items = new PublishedFileId_t[number];
            SteamUGC.GetSubscribedItems(items, number);
            long itemCount = (long)number;

            for (long x = 0; x <= itemCount - 1; x++)
            {
                //if (items[x].ToString().Contains("468449740"))
                //{                }
                //if (!isItemInstalledOnYargis(items[x], _multiLevelCache, _singleLevelCache))  //We can use SteamManager.SteamUGCworkshop.getID to verify if it is still valid.
                //{
                ulong  punSizeOnDisk;
                string pchFolder;
                uint   cchFolderSize = 260;
                uint   punTimeStamp;
                bool   inReadyOnSteam = SteamUGC.GetItemInstallInfo(items[x], out punSizeOnDisk, out pchFolder, cchFolderSize, out punTimeStamp);
                if (inReadyOnSteam)
                {
                    installFiles(pchFolder, _multiLevelCache, StorageContainerPath);
                }
                //}
                Console.Write("[" + x + "]: " + items[x] + ", ");
            }
            Console.WriteLine("");
        }