Skip to content

Commit

Permalink
Fix crash in ASF V6.1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Citrinate committed Jan 6, 2025
1 parent 1b76c31 commit 5854e0a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions FreePackages/IPC/Api/FreePackagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
using ArchiSteamFarm.IPC.Responses;
using ArchiSteamFarm.Steam;
using FreePackages.Localization;
// using Microsoft.AspNetCore.Http;
// EndpointSummary lines commented out temporarily to allow plugin to work with generic/non-generic ASF V6.1.2.0 and V6.1.1.3
using Microsoft.AspNetCore.Mvc;
using SteamKit2;
using Swashbuckle.AspNetCore.Annotations;

namespace FreePackages.IPC {
[Route("Api/FreePackages")]
public sealed class FreePackagesController : ArchiController {
[HttpGet("{botNames:required}/GetChangesSince/{changeNumber:required}")]
[SwaggerOperation (Summary = "Request changes for apps and packages since a given change number")]
// [EndpointSummary("Request changes for apps and packages since a given change number")]
[ProducesResponseType(typeof(GenericResponse<SteamApps.PICSChangesCallback>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
public async Task<ActionResult<GenericResponse>> GetChangesSince(string botNames, uint changeNumber, bool showAppChanges = true, bool showPackageChanges = true) {
Expand Down Expand Up @@ -48,7 +49,7 @@ public async Task<ActionResult<GenericResponse>> GetChangesSince(string botNames
}

[HttpGet("{botNames:required}/GetProductInfo")]
[SwaggerOperation (Summary = "Request product information for a list of apps or packages")]
// [EndpointSummary("Request product information for a list of apps or packages")]
[ProducesResponseType(typeof(GenericResponse<IEnumerable<SteamApps.PICSProductInfoCallback>>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(byte[]), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
Expand Down Expand Up @@ -104,7 +105,7 @@ public async Task<ActionResult<GenericResponse>> GetProductInfo(string botNames,
}

[HttpGet("{botName:required}/RequestFreeAppLicense")]
[SwaggerOperation (Summary = "Request a free license for given appids")]
// [EndpointSummary("Request a free license for given appids")]
[ProducesResponseType(typeof(GenericResponse<SteamApps.FreeLicenseCallback>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
public async Task<ActionResult<GenericResponse>> RequestFreeAppLicense(string botName, string appIDs) {
Expand Down Expand Up @@ -147,7 +148,7 @@ public async Task<ActionResult<GenericResponse>> RequestFreeAppLicense(string bo
}

[HttpGet("{botName:required}/RequestFreeSubLicense")]
[SwaggerOperation (Summary = "Request a free license for given subid")]
// [EndpointSummary("Request a free license for given subid")]
[ProducesResponseType(typeof(GenericResponse<FreeSubResponse>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
public async Task<ActionResult<GenericResponse>> RequestFreeSubLicense(string botName, uint subID) {
Expand Down Expand Up @@ -178,7 +179,7 @@ public async Task<ActionResult<GenericResponse>> RequestFreeSubLicense(string bo
}

[HttpGet("{botName:required}/GetOwnedPackages")]
[SwaggerOperation (Summary = "Retrieves all packages owned by the given bot")]
// [EndpointSummary("Retrieves all packages owned by the given bot")]
[ProducesResponseType(typeof(GenericResponse<IEnumerable<uint>>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
public ActionResult<GenericResponse> GetOwnedPackages(string botName) {
Expand All @@ -199,7 +200,7 @@ public ActionResult<GenericResponse> GetOwnedPackages(string botName) {
}

[HttpGet("{botName:required}/GetOwnedApps")]
[SwaggerOperation (Summary = "Retrieves all apps owned by the given bot")]
// [EndpointSummary("Retrieves all apps owned by the given bot")]
[ProducesResponseType(typeof(GenericResponse<IEnumerable<uint>>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse<Dictionary<uint, string>>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
Expand Down Expand Up @@ -244,7 +245,7 @@ public async Task<ActionResult<GenericResponse>> GetOwnedApps(string botName, bo

[Consumes("application/json")]
[HttpPost("{botNames:required}/QueueLicenses")]
[SwaggerOperation (Summary = "Adds the provided appids and subids to the given bot's package queue")]
// [EndpointSummary("Adds the provided appids and subids to the given bot's package queue")]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
public ActionResult<GenericResponse> QueueLicenses(string botNames, [FromBody] QueueLicensesRequest request) {
Expand Down

0 comments on commit 5854e0a

Please sign in to comment.