From 6517cdd43cb8f9d8afb93bc2226207c9803ca6f3 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 23 Mar 2021 13:19:51 +0200 Subject: [PATCH] Remove EnumerateUserPublishedFiles and EnumerateUserSubscribedFiles --- .../Steam/Handlers/SteamWorkshop/Callbacks.cs | 118 ------------------ .../Handlers/SteamWorkshop/SteamWorkshop.cs | 77 +----------- 2 files changed, 1 insertion(+), 194 deletions(-) diff --git a/SteamKit2/SteamKit2/Steam/Handlers/SteamWorkshop/Callbacks.cs b/SteamKit2/SteamKit2/Steam/Handlers/SteamWorkshop/Callbacks.cs index c277bc2d2..dff58c4f2 100644 --- a/SteamKit2/SteamKit2/Steam/Handlers/SteamWorkshop/Callbacks.cs +++ b/SteamKit2/SteamKit2/Steam/Handlers/SteamWorkshop/Callbacks.cs @@ -4,7 +4,6 @@ */ using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using SteamKit2.Internal; @@ -13,123 +12,6 @@ namespace SteamKit2 { public sealed partial class SteamWorkshop { - /// - /// This callback is received in response to calling . - /// - public sealed class UserPublishedFilesCallback : CallbackMsg - { - /// - /// Represents the details of a single published file. - /// - public sealed class File - { - /// - /// Gets the file ID. - /// - public PublishedFileID FileID { get; private set; } - - - internal File( CMsgClientUCMEnumerateUserPublishedFilesResponse.PublishedFileId file ) - { - this.FileID = file.published_file_id; - } - } - - - /// - /// Gets the result. - /// - public EResult Result { get; private set; } - - /// - /// Gets the list of enumerated files. - /// - public ReadOnlyCollection Files { get; private set; } - - /// - /// Gets the count of total results. - /// - public int TotalResults { get; private set; } - - - internal UserPublishedFilesCallback( JobID jobID, CMsgClientUCMEnumerateUserPublishedFilesResponse msg) - { - this.JobID = jobID; - - this.Result = ( EResult )msg.eresult; - - var fileList = msg.published_files - .Select( f => new File( f ) ) - .ToList(); - - this.Files = new ReadOnlyCollection( fileList ); - - this.TotalResults = ( int )msg.total_results; - } - } - - /// - /// This callback is received in response to calling . - /// - public sealed class UserSubscribedFilesCallback : CallbackMsg - { - /// - /// Represents the details of a single published file. - /// - public sealed class File - { - /// - /// Gets the file ID. - /// - public PublishedFileID FileID { get; private set; } - - /// - /// Gets the time this file was subscribed to. - /// - public DateTime TimeSubscribed { get; private set; } - - - internal File( CMsgClientUCMEnumerateUserSubscribedFilesResponse.PublishedFileId file ) - { - this.FileID = file.published_file_id; - - this.TimeSubscribed = DateUtils.DateTimeFromUnixTime( file.rtime32_subscribed ); - } - } - - - /// - /// Gets the result. - /// - public EResult Result { get; private set; } - - /// - /// Gets the list of enumerated files. - /// - public ReadOnlyCollection Files { get; private set; } - - /// - /// Gets the count of total results. - /// - public int TotalResults { get; private set; } - - - internal UserSubscribedFilesCallback( JobID jobID, CMsgClientUCMEnumerateUserSubscribedFilesResponse msg ) - { - this.JobID = jobID; - - this.Result = ( EResult )msg.eresult; - - var fileList = msg.subscribed_files - .Select( f => new File( f ) ) - .ToList(); - - this.Files = new ReadOnlyCollection( fileList ); - - this.TotalResults = ( int )msg.total_results; - } - } - /// /// This callback is received in response to calling . /// diff --git a/SteamKit2/SteamKit2/Steam/Handlers/SteamWorkshop/SteamWorkshop.cs b/SteamKit2/SteamKit2/Steam/Handlers/SteamWorkshop/SteamWorkshop.cs index 66eed1d95..bd7959cf7 100644 --- a/SteamKit2/SteamKit2/Steam/Handlers/SteamWorkshop/SteamWorkshop.cs +++ b/SteamKit2/SteamKit2/Steam/Handlers/SteamWorkshop/SteamWorkshop.cs @@ -20,8 +20,6 @@ internal SteamWorkshop() { dispatchMap = new Dictionary> { - { EMsg.ClientUCMEnumerateUserPublishedFilesResponse, HandleEnumUserPublishedFiles }, - { EMsg.ClientUCMEnumerateUserSubscribedFilesResponse, HandleEnumUserSubscribedFiles }, { EMsg.ClientUCMEnumeratePublishedFilesByUserActionResponse, HandleEnumPublishedFilesByAction }, }; } @@ -40,15 +38,6 @@ public sealed class EnumerationUserDetails /// public uint AppID { get; set; } - /// - /// Gets or sets the sort order. - /// This value is only used by . - /// - /// - /// The sort order. - /// - public uint SortOrder { get; set; } - /// /// Gets or sets the start index. /// @@ -66,57 +55,7 @@ public sealed class EnumerationUserDetails /// public EWorkshopFileAction UserAction { get; set; } } - - /// - /// Enumerates the list of published files for the current logged in user. - /// Results are returned in a . - /// The returned can also be awaited to retrieve the callback result. - /// - /// The specific details of the request. - /// The Job ID of the request. This can be used to find the appropriate . - public AsyncJob EnumerateUserPublishedFiles( EnumerationUserDetails details ) - { - if ( details == null ) - { - throw new ArgumentNullException( nameof(details) ); - } - - var enumRequest = new ClientMsgProtobuf( EMsg.ClientUCMEnumerateUserPublishedFiles ); - enumRequest.SourceJobID = Client.GetNextJobID(); - - enumRequest.Body.app_id = details.AppID; - enumRequest.Body.sort_order = details.SortOrder; - enumRequest.Body.start_index = details.StartIndex; - - Client.Send( enumRequest ); - - return new AsyncJob( this.Client, enumRequest.SourceJobID ); - } - /// - /// Enumerates the list of subscribed files for the current logged in user. - /// Results are returned in a . - /// The returned can also be awaited to retrieve the callback result. - /// - /// The specific details of the request. - /// The Job ID of the request. This can be used to find the appropriate . - public AsyncJob EnumerateUserSubscribedFiles( EnumerationUserDetails details ) - { - if ( details == null ) - { - throw new ArgumentNullException( nameof(details) ); - } - - var enumRequest = new ClientMsgProtobuf( EMsg.ClientUCMEnumerateUserSubscribedFiles ); - enumRequest.SourceJobID = Client.GetNextJobID(); - - enumRequest.Body.app_id = details.AppID; - enumRequest.Body.start_index = details.StartIndex; - - Client.Send( enumRequest ); - - return new AsyncJob( this.Client, enumRequest.SourceJobID ); - } - + /// /// Enumerates the list of published files for the current logged in user based on user action. /// Results are returned in a . @@ -167,20 +106,6 @@ public override void HandleMsg( IPacketMsg packetMsg ) #region ClientMsg Handlers - void HandleEnumUserPublishedFiles( IPacketMsg packetMsg ) - { - var response = new ClientMsgProtobuf( packetMsg ); - - var callback = new UserPublishedFilesCallback(response.TargetJobID, response.Body); - Client.PostCallback( callback ); - } - void HandleEnumUserSubscribedFiles( IPacketMsg packetMsg ) - { - var response = new ClientMsgProtobuf( packetMsg ); - - var callback = new UserSubscribedFilesCallback( response.TargetJobID, response.Body ); - Client.PostCallback( callback ); - } void HandleEnumPublishedFilesByAction( IPacketMsg packetMsg ) { var response = new ClientMsgProtobuf( packetMsg );