Пример #1
0
        internal static void InstallEvents(bool server)
        {
            Dispatch.Install <DownloadItemResult_t>(x =>
            {
                if (x.AppID == SteamClient.AppId)
                {
                    OnDownloadItemResult?.Invoke(x.Result);

                    Ugc.Item item = new Ugc.Item(x.PublishedFileId);
                    if (item.IsInstalled && (onItemInstalled?.ContainsKey(x.PublishedFileId) ?? false))
                    {
                        onItemInstalled[x.PublishedFileId]?.Invoke();
                        onItemInstalled.Remove(x.PublishedFileId);
                    }
                }
            }, server);
            Dispatch.Install <ItemInstalled_t>(x =>
            {
                if (x.AppID == SteamClient.AppId)
                {
                    GlobalOnItemInstalled?.Invoke(x.PublishedFileId);
                    if (onItemInstalled?.ContainsKey(x.PublishedFileId) ?? false)
                    {
                        onItemInstalled[x.PublishedFileId]?.Invoke();
                        onItemInstalled.Remove(x.PublishedFileId);
                    }
                }
            }, server);
        }
Пример #2
0
 internal static void InstallEvents(bool server = false)
 {
     ItemInstalled_t.Install(x => {
         if (x.AppID == SteamClient.AppId)
         {
             GlobalOnItemInstalled?.Invoke(x.PublishedFileId);
             if (onItemInstalled?.ContainsKey(x.PublishedFileId) ?? false)
             {
                 onItemInstalled[x.PublishedFileId]?.Invoke();
                 onItemInstalled.Remove(x.PublishedFileId);
             }
         }
     }, server);
 }