本文整理汇总了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;
}
示例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 );
}
示例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;
}
示例4: OfflineMessageCallback
internal OfflineMessageCallback(JobID jobID, CMsgClientOfflineMessageNotification msg) {
JobID = jobID;
if (msg == null) {
return;
}
OfflineMessages = msg.offline_messages;
Users = msg.friends_with_offline_messages;
}
示例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;
}
示例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;
}
示例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 };
}
}
示例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;
}
示例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));
}
}
示例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();
}
示例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 );
}
示例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;
}
示例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;
}
示例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 );
}
}
示例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);
}