예제 #1
0
        public void RequestAppInfo(uint appId)
        {
            if (AppInfo.ContainsKey(appId) || bAborted)
            {
                return;
            }

            Action <SteamApps.AppInfoCallback, JobID> cbMethod = (appInfo, jobId) =>
            {
                foreach (var app in appInfo.Apps)
                {
                    Console.WriteLine("Got AppInfo for {0}: {1}", app.AppID, app.Status);
                    AppInfo.Add(app.AppID, app);

                    if (app.Status == SteamApps.AppInfoCallback.App.AppInfoStatus.Unknown)
                    {
                        continue;
                    }

                    KeyValue depots;
                    if (app.Sections.TryGetValue(EAppInfoSection.Depots, out depots))
                    {
                        if (depots[app.AppID.ToString()]["OverridesCDDB"].AsBoolean(false))
                        {
                            AppInfoOverridesCDR[app.AppID] = true;
                        }
                    }
                }
            };

            using (JobCallback <SteamApps.AppInfoCallback> appInfoCallback = new JobCallback <SteamApps.AppInfoCallback>(cbMethod, callbacks, steamApps.GetAppInfo(appId)))
            {
                do
                {
                    WaitForCallbacks();
                }while (!appInfoCallback.Completed && !bAborted);
            }
        }