示例#1
0
 private void PackageInfoCallback(SteamApps.PackageInfoCallback packageInfo, JobID jobid)
 {
     foreach (var package in packageInfo.Packages)
     {
         PackageInfo[package.PackageID] = package;
     }
 }
示例#2
0
        void OnPackageInfo(SteamApps.PackageInfoCallback callback)
        {
            var req = GetRequest(r => r.JobID == callback.JobID);

            if (req == null)
            {
                return;
            }

            var package = callback.Packages
                          .FirstOrDefault(p => p.PackageID == req.PackageID);

            if (package == null || package.Status == SteamApps.PackageInfoCallback.Package.PackageStatus.Unknown)
            {
                IRC.Instance.Send(req.Channel, "{0}: Unable to request package name for {1}: unknown PackageID", req.Requester.Nickname, req.PackageID);
                return;
            }

            var name = package.Data["name"].AsString();

            if (string.IsNullOrEmpty(name))
            {
                IRC.Instance.Send(req.Channel, "{0}: Unable to request package name for {1}: no name assigned", req.Requester.Nickname, req.PackageID);
                return;
            }

            IRC.Instance.Send(req.Channel, "{0}: {1}: {2} (http://store.steampowered.com/sub/{1})", req.Requester.Nickname, req.PackageID, name);
        }