コード例 #1
0
            internal ScreenshotAddedCallback(JobID jobID, CMsgClientUCMAddScreenshotResponse msg)
            {
                JobID = jobID;

                Result       = ( EResult )msg.eresult;
                ScreenshotID = msg.screenshotid;
            }
コード例 #2
0
        /// <summary>
        /// Requests details for a specific item of user generated content from the Steam servers.
        /// Results are returned in a <see cref="UGCDetailsCallback"/>.
        /// </summary>
        /// <param name="ugcId">The unique user generated content id.</param>
        /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="Callback&lt;T&gt;"/>.</returns>
        public JobID RequestUGCDetails(UGCHandle ugcId)
        {
            var request = new ClientMsgProtobuf <CMsgClientUFSGetUGCDetails>(EMsg.ClientUFSGetUGCDetails);

            request.SourceJobID = Client.GetNextJobID();

            request.Body.hcontent = ugcId;

            this.Client.Send(request);

            return(request.SourceJobID);
        }
コード例 #3
0
        /// <summary>
        /// Requests details for a specific item of user generated content from the Steam servers.
        /// Results are returned in a <see cref="UGCDetailsCallback"/>.
        /// The returned <see cref="AsyncJob{T}"/> can also be awaited to retrieve the callback result.
        /// </summary>
        /// <param name="ugcId">The unique user generated content id.</param>
        /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="UGCDetailsCallback"/>.</returns>
        public AsyncJob <UGCDetailsCallback> RequestUGCDetails(UGCHandle ugcId)
        {
            if (ugcId == null)
            {
                throw new ArgumentNullException(nameof(ugcId));
            }

            var request = new ClientMsgProtobuf <CMsgClientUFSGetUGCDetails>(EMsg.ClientUFSGetUGCDetails);

            request.SourceJobID = Client.GetNextJobID();

            request.Body.hcontent = ugcId;

            this.Client.Send(request);

            return(new AsyncJob <UGCDetailsCallback>(this.Client, request.SourceJobID));
        }
コード例 #4
0
ファイル: Callbacks.cs プロジェクト: zorrolg/SteamKit
                internal LeaderboardEntry(CMsgClientLBSGetLBEntriesResponse.Entry entry)
                {
                    GlobalRank = entry.global_rank;
                    Score      = entry.score;
                    SteamID    = new SteamID(entry.steam_id_user);
                    UGCId      = new UGCHandle(entry.ugc_id);

                    var details = new List <int>();

                    using (var stream = new MemoryStream(entry.details))
                    {
                        while ((stream.Length - stream.Position) >= sizeof(int))
                        {
                            details.Add(stream.ReadInt32());
                        }
                    }

                    Details = new ReadOnlyCollection <int>(details);
                }