Use file-scoped namespaces

This commit is contained in:
Archi
2021-11-10 21:23:24 +01:00
parent 95ad16e26d
commit 1e6ab11d9f
142 changed files with 25006 additions and 25006 deletions

View File

@@ -24,13 +24,13 @@ using JetBrains.Annotations;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IASF : IPlugin {
/// <summary>
/// ASF will call this method right after global config initialization.
/// </summary>
/// <param name="additionalConfigProperties">Extra config properties made out of <see cref="JsonExtensionDataAttribute" />. Can be null if no extra properties are found.</param>
void OnASFInit(IReadOnlyDictionary<string, JToken>? additionalConfigProperties = null);
}
namespace ArchiSteamFarm.Plugins.Interfaces;
[PublicAPI]
public interface IASF : IPlugin {
/// <summary>
/// ASF will call this method right after global config initialization.
/// </summary>
/// <param name="additionalConfigProperties">Extra config properties made out of <see cref="JsonExtensionDataAttribute" />. Can be null if no extra properties are found.</param>
void OnASFInit(IReadOnlyDictionary<string, JToken>? additionalConfigProperties = null);
}

View File

@@ -22,22 +22,22 @@
using ArchiSteamFarm.Steam;
using JetBrains.Annotations;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IBot : IPlugin {
/// <summary>
/// ASF will call this method after removing its own references from it, e.g. after config removal.
/// You should ensure that you'll remove any of your own references to this bot instance in timely manner.
/// Doing so will allow the garbage collector to dispose the bot afterwards, refraining from doing so will create a "memory leak" by keeping the reference alive.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
void OnBotDestroy(Bot bot);
namespace ArchiSteamFarm.Plugins.Interfaces;
/// <summary>
/// ASF will call this method after creating the bot object, e.g. after config creation.
/// Bot config is not yet available at this stage. This function will execute only once for every bot object.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
void OnBotInit(Bot bot);
}
[PublicAPI]
public interface IBot : IPlugin {
/// <summary>
/// ASF will call this method after removing its own references from it, e.g. after config removal.
/// You should ensure that you'll remove any of your own references to this bot instance in timely manner.
/// Doing so will allow the garbage collector to dispose the bot afterwards, refraining from doing so will create a "memory leak" by keeping the reference alive.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
void OnBotDestroy(Bot bot);
/// <summary>
/// ASF will call this method after creating the bot object, e.g. after config creation.
/// Bot config is not yet available at this stage. This function will execute only once for every bot object.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
void OnBotInit(Bot bot);
}

View File

@@ -22,26 +22,26 @@
using ArchiSteamFarm.Steam;
using JetBrains.Annotations;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IBotCardsFarmerInfo : IPlugin {
/// <summary>
/// ASF will call this method when cards farming module is finished on given bot instance. This method will also be called when there is nothing to idle or idling is unavailable, you can use provided boolean value for determining that.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="farmedSomething">Bool value indicating whether the module has finished successfully, so when there was at least one card to drop, and nothing has interrupted us in the meantime.</param>
void OnBotFarmingFinished(Bot bot, bool farmedSomething);
namespace ArchiSteamFarm.Plugins.Interfaces;
/// <summary>
/// ASF will call this method when cards farming module is started on given bot instance. The module is started only when there are valid cards to drop, so this method won't be called when there is nothing to idle.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
void OnBotFarmingStarted(Bot bot);
[PublicAPI]
public interface IBotCardsFarmerInfo : IPlugin {
/// <summary>
/// ASF will call this method when cards farming module is finished on given bot instance. This method will also be called when there is nothing to idle or idling is unavailable, you can use provided boolean value for determining that.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="farmedSomething">Bool value indicating whether the module has finished successfully, so when there was at least one card to drop, and nothing has interrupted us in the meantime.</param>
void OnBotFarmingFinished(Bot bot, bool farmedSomething);
/// <summary>
/// ASF will call this method when cards farming module is stopped on given bot instance. The stop could be a result of a natural finish, or other situations (e.g. Steam networking issues, user commands).
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
void OnBotFarmingStopped(Bot bot);
}
/// <summary>
/// ASF will call this method when cards farming module is started on given bot instance. The module is started only when there are valid cards to drop, so this method won't be called when there is nothing to idle.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
void OnBotFarmingStarted(Bot bot);
/// <summary>
/// ASF will call this method when cards farming module is stopped on given bot instance. The stop could be a result of a natural finish, or other situations (e.g. Steam networking issues, user commands).
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
void OnBotFarmingStopped(Bot bot);
}

View File

@@ -24,17 +24,17 @@ using ArchiSteamFarm.Steam;
using ArchiSteamFarm.Storage;
using JetBrains.Annotations;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IBotCommand : IPlugin {
/// <summary>
/// ASF will call this method for unrecognized commands.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="steamID">64-bit long unsigned integer of steamID executing the command.</param>
/// <param name="message">Command message in its raw format, stripped of <see cref="GlobalConfig.CommandPrefix" />.</param>
/// <param name="args">Pre-parsed message using standard ASF delimiters.</param>
/// <returns>Response to the command, or null/empty (as the task value) if the command isn't handled by this plugin.</returns>
Task<string?> OnBotCommand(Bot bot, ulong steamID, string message, string[] args);
}
namespace ArchiSteamFarm.Plugins.Interfaces;
[PublicAPI]
public interface IBotCommand : IPlugin {
/// <summary>
/// ASF will call this method for unrecognized commands.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="steamID">64-bit long unsigned integer of steamID executing the command.</param>
/// <param name="message">Command message in its raw format, stripped of <see cref="GlobalConfig.CommandPrefix" />.</param>
/// <param name="args">Pre-parsed message using standard ASF delimiters.</param>
/// <returns>Response to the command, or null/empty (as the task value) if the command isn't handled by this plugin.</returns>
Task<string?> OnBotCommand(Bot bot, ulong steamID, string message, string[] args);
}

View File

@@ -23,20 +23,20 @@ using ArchiSteamFarm.Steam;
using JetBrains.Annotations;
using SteamKit2;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IBotConnection : IPlugin {
/// <summary>
/// ASF will call this method when bot gets disconnected from Steam network.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="reason">Reason for disconnection, or <see cref="EResult.OK" /> if the disconnection was initiated by ASF (e.g. as a result of a command).</param>
void OnBotDisconnected(Bot bot, EResult reason);
namespace ArchiSteamFarm.Plugins.Interfaces;
/// <summary>
/// ASF will call this method when bot successfully connects to Steam network.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
void OnBotLoggedOn(Bot bot);
}
[PublicAPI]
public interface IBotConnection : IPlugin {
/// <summary>
/// ASF will call this method when bot gets disconnected from Steam network.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="reason">Reason for disconnection, or <see cref="EResult.OK" /> if the disconnection was initiated by ASF (e.g. as a result of a command).</param>
void OnBotDisconnected(Bot bot, EResult reason);
/// <summary>
/// ASF will call this method when bot successfully connects to Steam network.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
void OnBotLoggedOn(Bot bot);
}

View File

@@ -23,15 +23,15 @@ using System.Threading.Tasks;
using ArchiSteamFarm.Steam;
using JetBrains.Annotations;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IBotFriendRequest : IPlugin {
/// <summary>
/// ASF will call this method for unhandled (ignored and rejected) friend requests and Steam group invites received by the bot.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="steamID">64-bit Steam identificator of the user that sent a friend request, or a group that the bot has been invited to.</param>
/// <returns>True if the request should be accepted as part of this plugin, false otherwise.</returns>
Task<bool> OnBotFriendRequest(Bot bot, ulong steamID);
}
namespace ArchiSteamFarm.Plugins.Interfaces;
[PublicAPI]
public interface IBotFriendRequest : IPlugin {
/// <summary>
/// ASF will call this method for unhandled (ignored and rejected) friend requests and Steam group invites received by the bot.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="steamID">64-bit Steam identificator of the user that sent a friend request, or a group that the bot has been invited to.</param>
/// <returns>True if the request should be accepted as part of this plugin, false otherwise.</returns>
Task<bool> OnBotFriendRequest(Bot bot, ulong steamID);
}

View File

@@ -24,16 +24,16 @@ using ArchiSteamFarm.Steam;
using ArchiSteamFarm.Storage;
using JetBrains.Annotations;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IBotMessage : IPlugin {
/// <summary>
/// ASF will call this method for messages that are not commands, so ones that do not start from <see cref="GlobalConfig.CommandPrefix" />.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="steamID">64-bit long unsigned integer of steamID executing the command.</param>
/// <param name="message">Message in its raw format.</param>
/// <returns>Response to the message, or null/empty (as the task value) for silence.</returns>
Task<string?> OnBotMessage(Bot bot, ulong steamID, string message);
}
namespace ArchiSteamFarm.Plugins.Interfaces;
[PublicAPI]
public interface IBotMessage : IPlugin {
/// <summary>
/// ASF will call this method for messages that are not commands, so ones that do not start from <see cref="GlobalConfig.CommandPrefix" />.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="steamID">64-bit long unsigned integer of steamID executing the command.</param>
/// <param name="message">Message in its raw format.</param>
/// <returns>Response to the message, or null/empty (as the task value) for silence.</returns>
Task<string?> OnBotMessage(Bot bot, ulong steamID, string message);
}

View File

@@ -25,14 +25,14 @@ using JetBrains.Annotations;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IBotModules : IPlugin {
/// <summary>
/// ASF will call this method right after bot config initialization.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="additionalConfigProperties">Extra config properties made out of <see cref="JsonExtensionDataAttribute" />. Can be null if no extra properties are found.</param>
void OnBotInitModules(Bot bot, IReadOnlyDictionary<string, JToken>? additionalConfigProperties = null);
}
namespace ArchiSteamFarm.Plugins.Interfaces;
[PublicAPI]
public interface IBotModules : IPlugin {
/// <summary>
/// ASF will call this method right after bot config initialization.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="additionalConfigProperties">Extra config properties made out of <see cref="JsonExtensionDataAttribute" />. Can be null if no extra properties are found.</param>
void OnBotInitModules(Bot bot, IReadOnlyDictionary<string, JToken>? additionalConfigProperties = null);
}

View File

@@ -24,21 +24,21 @@ using ArchiSteamFarm.Steam;
using JetBrains.Annotations;
using SteamKit2;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IBotSteamClient : IPlugin {
/// <summary>
/// ASF will call this method right after custom SK2 client handler initialization in order to allow you listening for callbacks in your own code.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="callbackManager">Callback manager object which can be used for establishing subscriptions to standard and custom callbacks.</param>
void OnBotSteamCallbacksInit(Bot bot, CallbackManager callbackManager);
namespace ArchiSteamFarm.Plugins.Interfaces;
/// <summary>
/// ASF will call this method right after bot initialization in order to allow you hooking custom SK2 client handlers into the SteamClient.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <returns>Collection of custom client handlers that are supposed to be hooked into the SteamClient by ASF. If you do not require any, just return null or empty collection.</returns>
IReadOnlyCollection<ClientMsgHandler>? OnBotSteamHandlersInit(Bot bot);
}
[PublicAPI]
public interface IBotSteamClient : IPlugin {
/// <summary>
/// ASF will call this method right after custom SK2 client handler initialization in order to allow you listening for callbacks in your own code.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="callbackManager">Callback manager object which can be used for establishing subscriptions to standard and custom callbacks.</param>
void OnBotSteamCallbacksInit(Bot bot, CallbackManager callbackManager);
/// <summary>
/// ASF will call this method right after bot initialization in order to allow you hooking custom SK2 client handlers into the SteamClient.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <returns>Collection of custom client handlers that are supposed to be hooked into the SteamClient by ASF. If you do not require any, just return null or empty collection.</returns>
IReadOnlyCollection<ClientMsgHandler>? OnBotSteamHandlersInit(Bot bot);
}

View File

@@ -24,15 +24,15 @@ using ArchiSteamFarm.Steam;
using ArchiSteamFarm.Steam.Data;
using JetBrains.Annotations;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IBotTradeOffer : IPlugin {
/// <summary>
/// ASF will call this method for unhandled (ignored and rejected) trade offers received by the bot.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="tradeOffer">Trade offer related to this callback.</param>
/// <returns>True if the trade offer should be accepted as part of this plugin, false otherwise.</returns>
Task<bool> OnBotTradeOffer(Bot bot, TradeOffer tradeOffer);
}
namespace ArchiSteamFarm.Plugins.Interfaces;
[PublicAPI]
public interface IBotTradeOffer : IPlugin {
/// <summary>
/// ASF will call this method for unhandled (ignored and rejected) trade offers received by the bot.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="tradeOffer">Trade offer related to this callback.</param>
/// <returns>True if the trade offer should be accepted as part of this plugin, false otherwise.</returns>
Task<bool> OnBotTradeOffer(Bot bot, TradeOffer tradeOffer);
}

View File

@@ -24,14 +24,14 @@ using ArchiSteamFarm.Steam;
using ArchiSteamFarm.Steam.Exchange;
using JetBrains.Annotations;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IBotTradeOfferResults : IPlugin {
/// <summary>
/// ASF will call this method for notifying you about the result of each received trade offer being handled. The method is executed for each batch that can contain 1 or more trade offers.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="tradeResults">Trade results related to this callback.</param>
void OnBotTradeOfferResults(Bot bot, IReadOnlyCollection<ParseTradeResult> tradeResults);
}
namespace ArchiSteamFarm.Plugins.Interfaces;
[PublicAPI]
public interface IBotTradeOfferResults : IPlugin {
/// <summary>
/// ASF will call this method for notifying you about the result of each received trade offer being handled. The method is executed for each batch that can contain 1 or more trade offers.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="tradeResults">Trade results related to this callback.</param>
void OnBotTradeOfferResults(Bot bot, IReadOnlyCollection<ParseTradeResult> tradeResults);
}

View File

@@ -24,14 +24,14 @@ using ArchiSteamFarm.Steam;
using ArchiSteamFarm.Steam.Integration.Callbacks;
using JetBrains.Annotations;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IBotUserNotifications : IPlugin {
/// <summary>
/// ASF will call this method when number of notifications for one or more notification types changes.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="newNotifications">Collection containing those notification types that are new (that is, when new count > previous count of that notification type).</param>
void OnBotUserNotifications(Bot bot, IReadOnlyCollection<UserNotificationsCallback.EUserNotification> newNotifications);
}
namespace ArchiSteamFarm.Plugins.Interfaces;
[PublicAPI]
public interface IBotUserNotifications : IPlugin {
/// <summary>
/// ASF will call this method when number of notifications for one or more notification types changes.
/// </summary>
/// <param name="bot">Bot object related to this callback.</param>
/// <param name="newNotifications">Collection containing those notification types that are new (that is, when new count > previous count of that notification type).</param>
void OnBotUserNotifications(Bot bot, IReadOnlyCollection<UserNotificationsCallback.EUserNotification> newNotifications);
}

View File

@@ -22,14 +22,14 @@
using System;
using JetBrains.Annotations;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IBotsComparer : IPlugin {
/// <summary>
/// ASF will use this property for determining the comparer for the bots.
/// Unless you know what you're doing, you should not implement this property yourself and let ASF decide.
/// </summary>
/// <returns>Comparer that will be used for the bots, as well as bot regexes.</returns>
StringComparer BotsComparer { get; }
}
namespace ArchiSteamFarm.Plugins.Interfaces;
[PublicAPI]
public interface IBotsComparer : IPlugin {
/// <summary>
/// ASF will use this property for determining the comparer for the bots.
/// Unless you know what you're doing, you should not implement this property yourself and let ASF decide.
/// </summary>
/// <returns>Comparer that will be used for the bots, as well as bot regexes.</returns>
StringComparer BotsComparer { get; }
}

View File

@@ -23,14 +23,14 @@ using System.Threading.Tasks;
using ArchiSteamFarm.Helpers;
using JetBrains.Annotations;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface ICrossProcessSemaphoreProvider : IPlugin {
/// <summary>
/// ASF will call this method when initializing instance of <see cref="ICrossProcessSemaphore" /> for its internal limiters.
/// </summary>
/// <param name="resourceName">Unique resource name provided by ASF for identification purposes.</param>
/// <returns>Concrete implementation of <see cref="ICrossProcessSemaphore" /> providing required functionality. It's allowed to return null if you want to use ASF's default implementation for specified resource instead.</returns>
Task<ICrossProcessSemaphore?> GetCrossProcessSemaphore(string resourceName);
}
namespace ArchiSteamFarm.Plugins.Interfaces;
[PublicAPI]
public interface ICrossProcessSemaphoreProvider : IPlugin {
/// <summary>
/// ASF will call this method when initializing instance of <see cref="ICrossProcessSemaphore" /> for its internal limiters.
/// </summary>
/// <param name="resourceName">Unique resource name provided by ASF for identification purposes.</param>
/// <returns>Concrete implementation of <see cref="ICrossProcessSemaphore" /> providing required functionality. It's allowed to return null if you want to use ASF's default implementation for specified resource instead.</returns>
Task<ICrossProcessSemaphore?> GetCrossProcessSemaphore(string resourceName);
}

View File

@@ -23,27 +23,27 @@ using System;
using JetBrains.Annotations;
using Newtonsoft.Json;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface IPlugin {
/// <summary>
/// ASF will use this property as general plugin identifier for the user.
/// </summary>
/// <returns>String that will be used as the name of this plugin.</returns>
[JsonProperty]
string Name { get; }
namespace ArchiSteamFarm.Plugins.Interfaces;
/// <summary>
/// ASF will use this property as version indicator of your plugin to the user.
/// You have a freedom in deciding what versioning you want to use, this is for identification purposes only.
/// </summary>
/// <returns>Version that will be shown to the user when plugin is loaded.</returns>
[JsonProperty]
Version Version { get; }
[PublicAPI]
public interface IPlugin {
/// <summary>
/// ASF will use this property as general plugin identifier for the user.
/// </summary>
/// <returns>String that will be used as the name of this plugin.</returns>
[JsonProperty]
string Name { get; }
/// <summary>
/// ASF will call this method right after plugin initialization.
/// </summary>
void OnLoaded();
}
/// <summary>
/// ASF will use this property as version indicator of your plugin to the user.
/// You have a freedom in deciding what versioning you want to use, this is for identification purposes only.
/// </summary>
/// <returns>Version that will be shown to the user when plugin is loaded.</returns>
[JsonProperty]
Version Version { get; }
/// <summary>
/// ASF will call this method right after plugin initialization.
/// </summary>
void OnLoaded();
}

View File

@@ -24,27 +24,27 @@ using System.Threading.Tasks;
using JetBrains.Annotations;
using SteamKit2;
namespace ArchiSteamFarm.Plugins.Interfaces {
[PublicAPI]
public interface ISteamPICSChanges : IPlugin {
/// <summary>
/// ASF uses this method for determining the point in time from which it should keep history going upon a restart. The actual point in time that will be used is calculated as the lowest change number from all loaded plugins, to guarantee that no plugin will miss any changes, while allowing possible duplicates for those plugins that were already synchronized with newer changes. If you don't care about persistent state and just want to receive the ongoing history, you should return 0 (which is equal to "I'm fine with any"). If there won't be any plugin asking for a specific point in time, ASF will start returning entries since the start of the program.
/// </summary>
/// <returns>The most recent change number from which you're fine to receive <see cref="OnPICSChanges" /></returns>
Task<uint> GetPreferredChangeNumberToStartFrom();
namespace ArchiSteamFarm.Plugins.Interfaces;
/// <summary>
/// ASF will call this method upon receiving any app/package PICS changes. The history is guaranteed to be precise and continuous starting from <see cref="GetPreferredChangeNumberToStartFrom" /> until <see cref="OnPICSChangesRestart" /> is called. It's possible for this method to have duplicated calls across different runs, in particular when some other plugin asks for lower <see cref="GetPreferredChangeNumberToStartFrom" />, therefore you should keep that in mind (and refer to change number of standalone apps/packages).
/// </summary>
/// <param name="currentChangeNumber">The change number of current callback.</param>
/// <param name="appChanges">App changes that happened since the previous call of this method. Can be empty.</param>
/// <param name="packageChanges">Package changes that happened since the previous call of this method. Can be empty.</param>
void OnPICSChanges(uint currentChangeNumber, IReadOnlyDictionary<uint, SteamApps.PICSChangesCallback.PICSChangeData> appChanges, IReadOnlyDictionary<uint, SteamApps.PICSChangesCallback.PICSChangeData> packageChanges);
[PublicAPI]
public interface ISteamPICSChanges : IPlugin {
/// <summary>
/// ASF uses this method for determining the point in time from which it should keep history going upon a restart. The actual point in time that will be used is calculated as the lowest change number from all loaded plugins, to guarantee that no plugin will miss any changes, while allowing possible duplicates for those plugins that were already synchronized with newer changes. If you don't care about persistent state and just want to receive the ongoing history, you should return 0 (which is equal to "I'm fine with any"). If there won't be any plugin asking for a specific point in time, ASF will start returning entries since the start of the program.
/// </summary>
/// <returns>The most recent change number from which you're fine to receive <see cref="OnPICSChanges" /></returns>
Task<uint> GetPreferredChangeNumberToStartFrom();
/// <summary>
/// ASF will call this method when it'll be necessary to restart the history of PICS changes. This can happen due to Steam limitation in which we're unable to keep history going if we're too far behind (approx 5k changeNumbers). If you're relying on continuous history of app/package PICS changes sent by <see cref="OnPICSChanges" />, ASF can no longer guarantee that upon calling this method, therefore you should start clean.
/// </summary>
/// <param name="currentChangeNumber">The change number from which we're restarting the PICS history.</param>
void OnPICSChangesRestart(uint currentChangeNumber);
}
/// <summary>
/// ASF will call this method upon receiving any app/package PICS changes. The history is guaranteed to be precise and continuous starting from <see cref="GetPreferredChangeNumberToStartFrom" /> until <see cref="OnPICSChangesRestart" /> is called. It's possible for this method to have duplicated calls across different runs, in particular when some other plugin asks for lower <see cref="GetPreferredChangeNumberToStartFrom" />, therefore you should keep that in mind (and refer to change number of standalone apps/packages).
/// </summary>
/// <param name="currentChangeNumber">The change number of current callback.</param>
/// <param name="appChanges">App changes that happened since the previous call of this method. Can be empty.</param>
/// <param name="packageChanges">Package changes that happened since the previous call of this method. Can be empty.</param>
void OnPICSChanges(uint currentChangeNumber, IReadOnlyDictionary<uint, SteamApps.PICSChangesCallback.PICSChangeData> appChanges, IReadOnlyDictionary<uint, SteamApps.PICSChangesCallback.PICSChangeData> packageChanges);
/// <summary>
/// ASF will call this method when it'll be necessary to restart the history of PICS changes. This can happen due to Steam limitation in which we're unable to keep history going if we're too far behind (approx 5k changeNumbers). If you're relying on continuous history of app/package PICS changes sent by <see cref="OnPICSChanges" />, ASF can no longer guarantee that upon calling this method, therefore you should start clean.
/// </summary>
/// <param name="currentChangeNumber">The change number from which we're restarting the PICS history.</param>
void OnPICSChangesRestart(uint currentChangeNumber);
}

View File

@@ -22,12 +22,12 @@
using System;
using ArchiSteamFarm.Plugins.Interfaces;
namespace ArchiSteamFarm.Plugins {
internal abstract class OfficialPlugin : IPlugin {
public abstract string Name { get; }
public abstract Version Version { get; }
public abstract void OnLoaded();
namespace ArchiSteamFarm.Plugins;
internal bool HasSameVersion() => Version == SharedInfo.Version;
}
internal abstract class OfficialPlugin : IPlugin {
public abstract string Name { get; }
public abstract Version Version { get; }
public abstract void OnLoaded();
internal bool HasSameVersion() => Version == SharedInfo.Version;
}

File diff suppressed because it is too large Load Diff