Skip to content

Commit

Permalink
Misc, documentation day!
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Apr 22, 2024
1 parent b332d57 commit 30c27f9
Show file tree
Hide file tree
Showing 22 changed files with 93 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IASF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to easily register your own data structures upon ASF initialization. This is especially useful if you want to register those based on the ASF's global config.
/// </summary>
/// <remarks>If your logic doesn't require ASF settings, you can consider using core <see cref="IPlugin.OnLoaded" /> method instead. Implementing this interface might still make sense, since it happens later during ASF initialization and provides more available data structures.</remarks>
[PublicAPI]
public interface IASF : IPlugin {
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to register core settings-independent structures on per-bot basis.
/// </summary>
/// <remarks>If your logic requires bot's settings, consider implementing <see cref="IBotModules" /> instead. Implementing this interface might still make sense, e.g. for disposal of the structures upon <see cref="OnBotDestroy" />.</remarks>
[PublicAPI]
public interface IBot : IPlugin {
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBotCardsFarmerInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@

using System.Threading.Tasks;
using ArchiSteamFarm.Steam;
using ArchiSteamFarm.Steam.Cards;
using JetBrains.Annotations;

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to receive updates in regards to ASF's <see cref="CardsFarmer" /> module, in particular events related to its state.
/// </summary>
[PublicAPI]
public interface IBotCardsFarmerInfo : IPlugin {
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBotCommand2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to react to each command received by ASF, in particular, implementing your own custom commands.
/// </summary>
/// <remarks>This is used for commands, irrelevant of their origin (IPC, console, Steam). If you want to grab non-command Steam messages, check <see cref="IBotMessage" /> interface instead.</remarks>
[PublicAPI]
public interface IBotCommand2 : IPlugin {
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBotConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to monitor Bot's connection with the Steam network, in particular when it goes online and offline.
/// </summary>
[PublicAPI]
public interface IBotConnection : IPlugin {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to provide low-level machine info provider that will be used for providing core information during Steam login procedure.
/// </summary>
[PublicAPI]
public interface IBotCustomMachineInfoProvider : IPlugin {
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBotFriendRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to handle friend requests on the Steam platform.
/// </summary>
[PublicAPI]
public interface IBotFriendRequest : IPlugin {
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBotIdentity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to discover core properties of your bot's identity, upon logging in to the Steam network.
/// </summary>
[PublicAPI]
public interface IBotIdentity : IPlugin {
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBotMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to react to each message received on the Steam platform.
/// </summary>
/// <remarks>This is used for Steam messages exclusively, that are not ASF commands. If you want to grab the commands, check <see cref="IBotCommand2" /> interface instead.</remarks>
[PublicAPI]
public interface IBotMessage : IPlugin {
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBotModules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to easily register your own custom modules on per-bot basis. This is especially useful if you want to register those based on the bot's config.
/// </summary>
/// <remarks>If your modules do not depend on bot's settings, you can consider implementing <see cref="IBot" /> interface instead. Even without that requirement, implementing that interface might still make sense, e.g. for disposal of the structures in <see cref="IBot.OnBotDestroy" />.</remarks>
[PublicAPI]
public interface IBotModules : IPlugin {
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBotSteamClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to register your own SteamKit2 message handlers, which means controlling the traffic that comes from the Steam network.
/// </summary>
[PublicAPI]
public interface IBotSteamClient : IPlugin {
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBotTradeOffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows your plugin to implement custom logic for accepting trades that ASF isn't willing to handle itself.
/// </summary>
[PublicAPI]
public interface IBotTradeOffer : IPlugin {
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBotTradeOfferResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to receive information about all processed trades, in particular if you want to fire some logic based on trade offers being handled.
/// </summary>
[PublicAPI]
public interface IBotTradeOfferResults : IPlugin {
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBotUserNotifications.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to receive Steam notifications transmitted over the network.
/// </summary>
[PublicAPI]
public interface IBotUserNotifications : IPlugin {
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IBotsComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to change the default string comparers used across ASF.
/// </summary>
[PublicAPI]
public interface IBotsComparer : IPlugin {
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to provide custom cross-process semaphore, which is used for synchronizing multiple ASF instances with their limiters.
/// Custom cross-process semaphore might be useful if you wanted to extend cross-process semaphore offered by ASF, e.g. by utilizing remote-oriented tools like redis and allowing ASF instances over several different machines to synchronize with each other.
/// </summary>
[PublicAPI]
public interface ICrossProcessSemaphoreProvider : IPlugin {
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <summary>
/// Implementing this interface allows you to register your plugin in ASF, in turn providing you a way to implement your own custom logic.
/// </summary>
[PublicAPI]
public interface IPlugin {
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IPluginUpdates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to provide custom logic for updating your plugin to newer version.
/// Plugin updates are happening on usual basis per configuration of auto-updates from ASF, as well as other triggers such as update command.
Expand Down
4 changes: 4 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/ISteamPICSChanges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to be notified about PICS changes, which is Steam mechanism for broadcasting app and package updates.
/// </summary>
[PublicAPI]
public interface ISteamPICSChanges : IPlugin {
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions ArchiSteamFarm/Plugins/Interfaces/IUpdateAware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to be aware of ASF updates and execute appropriate logic that you need to happen before/after such update happens.
/// </summary>
[PublicAPI]
public interface IUpdateAware : IPlugin {
/// <summary>
Expand Down
7 changes: 6 additions & 1 deletion ArchiSteamFarm/Plugins/Interfaces/IWebInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,23 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to provide your own (custom) web interface files that will be exposed by standard ASF's IPC interface. In order to achieve that, you must include a directory with your web interface (html, css, js) files together with your plugin's DLL assembly, then specify path to it in <see cref="PhysicalPath" /> and finally the path under which you want to host those files in <see cref="WebPath" />.
/// </summary>
public interface IWebInterface : IPlugin {
/// <summary>
/// Specifies physical path to static WWW files provided by the plugin. Can be either relative to plugin's assembly location, or absolute. Default value of "www" assumes that you ship "www" directory together with your plugin's main DLL assembly, similar to ASF.
/// </summary>
/// <example>www</example>
/// <remarks>You'll need to ship this folder together with your plugin for the interface to work.</remarks>
string PhysicalPath => "www";

/// <summary>
/// Specifies web path (address) under which ASF should host your static WWW files in <see cref="PhysicalPath" /> directory. Default value of "/" allows you to override default ASF files and gives you full flexibility in your <see cref="PhysicalPath" /> directory. However, you can instead host your files under some other fixed location specified here, such as "/MyPlugin".
/// Specifies web path (address) under which ASF should host your static WWW files in <see cref="PhysicalPath" /> directory. Default value of "/" allows you to override default ASF files and gives you full flexibility in your <see cref="PhysicalPath" /> directory. However, you can instead host your files under some other fixed location specified here, such as "/MyPlugin", which is especially useful if you want to have your own default index.html in addition to the one provided by us (ASF-ui).
/// </summary>
/// <example>/MyPlugin</example>
/// <remarks>If you're using path other than default, ensure it does NOT end with a slash.</remarks>
[JsonInclude]
string WebPath => "/";
}
7 changes: 4 additions & 3 deletions ArchiSteamFarm/Plugins/Interfaces/IWebServiceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,20 @@

namespace ArchiSteamFarm.Plugins.Interfaces;

/// <inheritdoc />
/// <summary>
/// Implementing this interface allows you to provide your own additional services and middlewares for IPC endpoints - Use with caution!
/// </summary>
[PublicAPI]
public interface IWebServiceProvider {
public interface IWebServiceProvider : IPlugin {
/// <summary>
/// ASF will call this method during configuration of the IPC endpoints
/// ASF will call this method during configuration of the IPC endpoints.
/// </summary>
/// <param name="app">Application builder related to this callback.</param>
void OnConfiguringEndpoints(IApplicationBuilder app);

/// <summary>
/// ASF will call this method during configuration of the IPC services
/// ASF will call this method during configuration of the IPC services.
/// </summary>
/// <param name="services">Service collection related to this callback.</param>
void OnConfiguringServices(IServiceCollection services);
Expand Down

0 comments on commit 30c27f9

Please sign in to comment.