當前位置: 首頁>>代碼示例>>C#>>正文


C# SteamKit2.JobID類代碼示例

本文整理匯總了C#中SteamKit2.JobID的典型用法代碼示例。如果您正苦於以下問題:C# JobID類的具體用法?C# JobID怎麽用?C# JobID使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JobID類屬於SteamKit2命名空間,在下文中一共展示了JobID類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ScreenshotAddedCallback

			internal ScreenshotAddedCallback( JobID jobID, CMsgClientUCMAddScreenshotResponse msg )
			{
				JobID = jobID;

				Result = ( EResult )msg.eresult;
				ScreenshotID = msg.screenshotid;
			}
開發者ID:Kolpa,項目名稱:SteamKit,代碼行數:7,代碼來源:Callbacks.cs

示例2: QueryCallback

            internal QueryCallback( JobID jobID, CMsgGMSClientServerQueryResponse msg )
            {
                JobID = jobID;

                var serverList = msg.servers
                    .Select( s => new Server( s ) )
                    .ToList();

                this.Servers = new ReadOnlyCollection<Server>( serverList );
            }
開發者ID:Zaharkov,項目名稱:SteamKit,代碼行數:10,代碼來源:Callbacks.cs

示例3: ResponseCallback

            internal ResponseCallback( JobID jobID, CMsgClientRequestAccountDataResponse msg )
            {
                this.JobID = jobID;

                Result = ( EResult )msg.eresult;
                Action = ( ERequestAccountData )msg.action;

                CountMatches = msg.ct_matches;
                AccountName = msg.account_name;
            }
開發者ID:Markusyatina,項目名稱:steam-irc-bot,代碼行數:10,代碼來源:SteamAccountHandler.cs

示例4: OfflineMessageCallback

			internal OfflineMessageCallback(JobID jobID, CMsgClientOfflineMessageNotification msg) {
				JobID = jobID;

				if (msg == null) {
					return;
				}

				OfflineMessages = msg.offline_messages;
				Users = msg.friends_with_offline_messages;
			}
開發者ID:chrschmidt,項目名稱:ArchiSteamFarm,代碼行數:10,代碼來源:ArchiHandler.cs

示例5: FindOrCreateLeaderboardCallback

            internal FindOrCreateLeaderboardCallback( JobID jobID, CMsgClientLBSFindOrCreateLBResponse resp )
            {
                this.JobID = jobID;

                this.Result = ( EResult )resp.eresult;
                this.ID = resp.leaderboard_id;
                this.EntryCount = resp.leaderboard_entry_count;
                this.SortMethod = ( ELeaderboardSortMethod )resp.leaderboard_sort_method;
                this.DisplayType = ( ELeaderboardDisplayType )resp.leaderboard_display_type;
            }
開發者ID:logtcn,項目名稱:SteamKit,代碼行數:10,代碼來源:Callbacks.cs

示例6: PlayingSessionStateCallback

            internal PlayingSessionStateCallback(JobID jobID, CMsgClientPlayingSessionState msg)
            {
                if ((jobID == null) || (msg == null))
                {
                    throw new ArgumentNullException(nameof(jobID) + " || " + nameof(msg));
                }

                JobID = jobID;
                PlayingBlocked = msg.playing_blocked;
            }
開發者ID:Ezzpify,項目名稱:HourBoostr,代碼行數:10,代碼來源:ExtraHandler.cs

示例7: NotificationsCallback

			internal NotificationsCallback(JobID jobID, CMsgClientItemAnnouncements msg) {
				if ((jobID == null) || (msg == null)) {
					throw new ArgumentNullException(nameof(jobID) + " || " + nameof(msg));
				}

				JobID = jobID;

				if (msg.count_new_items > 0) {
					Notifications = new HashSet<ENotification> { ENotification.Items };
				}
			}
開發者ID:Kasp42,項目名稱:ArchiSteamFarm,代碼行數:11,代碼來源:ArchiHandler.cs

示例8: TryRemoveJob

        public static bool TryRemoveJob(JobID jobID, out JobAction job)
        {
            if (Jobs.TryRemove(jobID, out job))
            {
                Log.WriteDebug("Job Manager", "Removed job: {0} ({1} jobs left)", jobID, Jobs.Count);

                return true;
            }

            return false;
        }
開發者ID:qyh214,項目名稱:SteamDatabaseBackend,代碼行數:11,代碼來源:JobManager.cs

示例9: NotificationsCallback

			internal NotificationsCallback(JobID jobID, CMsgClientUserNotifications msg) {
				JobID = jobID;

				if (msg == null || msg.notifications == null) {
					return;
				}

				Notifications = new List<Notification>(msg.notifications.Count);
				foreach (var notification in msg.notifications) {
					Notifications.Add(new Notification((Notification.ENotificationType) notification.user_notification_type));
				}
			}
開發者ID:Ryzhehvost,項目名稱:ArchiSteamFarm,代碼行數:12,代碼來源:ArchiHandler.cs

示例10: HeartbeatJob

        /// <summary>
        /// Extends the lifetime of a job.
        /// </summary>
        /// <param name="jobId">The job identifier.</param>
        public void HeartbeatJob( JobID jobId )
        {
            AsyncJob asyncJob = GetJob( jobId );

            if ( asyncJob == null )
            {
                // ignore heartbeats for jobs we're not tracking
                return;
            }

            asyncJob.Heartbeat();
        }
開發者ID:Zaharkov,項目名稱:SteamKit,代碼行數:16,代碼來源:AsyncJobManager.cs

示例11: FailJob

        /// <summary>
        /// Marks a certain job as remotely failed.
        /// </summary>
        /// <param name="jobId">The job identifier.</param>
        public void FailJob( JobID jobId )
        {
            AsyncJob asyncJob = GetJob( jobId, andRemove: true );

            if ( asyncJob == null )
            {
                // ignore remote failures for jobs we're not tracking
                return;
            }

            asyncJob.SetFailed( dueToRemoteFailure: true );
            
        }
開發者ID:Zaharkov,項目名稱:SteamKit,代碼行數:17,代碼來源:AsyncJobManager.cs

示例12: UGCDetailsCallback

            internal UGCDetailsCallback( JobID jobID, CMsgClientUFSGetUGCDetailsResponse msg )
            {
                JobID = jobID;

                Result = ( EResult )msg.eresult;

                AppID = msg.app_id;
                Creator = msg.steamid_creator;

                URL = msg.url;

                FileName = msg.filename;
                FileSize = msg.file_size;
            }
開發者ID:Zaharkov,項目名稱:SteamKit,代碼行數:14,代碼來源:Callbacks.cs

示例13: PublishedFilesCallback

            internal PublishedFilesCallback( JobID jobID, CMsgCREEnumeratePublishedFilesResponse msg )
            {
                this.JobID = jobID;

                this.Result = ( EResult )msg.eresult;

                var fileList = msg.published_files
                    .Select( f => new File( f ) )
                    .ToList();

                this.Files = new ReadOnlyCollection<File>( fileList );

                this.TotalResults = ( int )msg.total_results;
            }
開發者ID:Zaharkov,項目名稱:SteamKit,代碼行數:14,代碼來源:Callbacks.cs

示例14: TryCompleteJob

        /// <summary>
        /// Passes a callback to a pending async job.
        /// If the given callback completes the job, the job is removed from this manager.
        /// </summary>
        /// <param name="jobId">The JobID.</param>
        /// <param name="callback">The callback.</param>
        public void TryCompleteJob( JobID jobId, CallbackMsg callback )
        {
            AsyncJob asyncJob = GetJob( jobId );

            if ( asyncJob == null )
            {
                // not a job we are tracking ourselves, can ignore it
                return;
            }

            // pass this callback into the job so it can determine if the job is finished (in the case of multiple responses to a job)
            bool jobFinished = asyncJob.AddResult( callback );

            if ( jobFinished )
            {
                // if the job is finished, we can stop tracking it
                asyncJobs.TryRemove( jobId, out asyncJob );
            }
        }
開發者ID:Zaharkov,項目名稱:SteamKit,代碼行數:25,代碼來源:AsyncJobManager.cs

示例15: PostedCallbackTriggersActionForExplicitJobIDInvalid

        public void PostedCallbackTriggersActionForExplicitJobIDInvalid()
        {
            var jobID = new JobID(123456);
            var callback = new CallbackForTest { JobID = jobID, UniqueID = Guid.NewGuid() };

            var didCall = false;
            Action<CallbackForTest> action = delegate(CallbackForTest cb)
            {
                Assert.Equal(callback.UniqueID, cb.UniqueID);
                Assert.Equal(jobID, cb.JobID);
                didCall = true;
            };

            using (new Callback<CallbackForTest>(action, mgr, JobID.Invalid))
            {
                PostAndRunCallback(callback);
            }

            Assert.True(didCall);
        }
開發者ID:Badca52,項目名稱:SteamKit,代碼行數:20,代碼來源:CallbackManagerFacts.cs


注:本文中的SteamKit2.JobID類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。