-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Block DDCL 1.8.3 * Remove download buttons and announce deprecation * Keep ddstats-rust integration * Remove response types * Fix merge
- Loading branch information
Showing
14 changed files
with
82 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace DevilDaggersInfo.Api.DdstatsRust; | ||
|
||
public record GetMarker | ||
{ | ||
public required long Value { get; init; } | ||
} |
7 changes: 7 additions & 0 deletions
7
src/api/DevilDaggersInfo.Api.DdstatsRust/SupportedOperatingSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace DevilDaggersInfo.Api.DdstatsRust; | ||
|
||
public enum SupportedOperatingSystem | ||
{ | ||
Windows = 1, | ||
Linux = 2, | ||
} |
1 change: 0 additions & 1 deletion
1
src/web-client/DevilDaggersInfo.Web.Client/Components/Tools/Versions.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
src/web-server/DevilDaggersInfo.Web.Server/Controllers/Ddcl/ProcessMemoryController.cs
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
src/web-server/DevilDaggersInfo.Web.Server/Controllers/DdstatsRust/AccessController.cs
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
src/web-server/DevilDaggersInfo.Web.Server/Controllers/DdstatsRust/DdstatsRustController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using DevilDaggersInfo.Api.DdstatsRust; | ||
using DevilDaggersInfo.Web.Server.Domain.Entities; | ||
using DevilDaggersInfo.Web.Server.Domain.Exceptions; | ||
using DevilDaggersInfo.Web.Server.Domain.Repositories; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.EntityFrameworkCore; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace DevilDaggersInfo.Web.Server.Controllers.DdstatsRust; | ||
|
||
[ApiController] | ||
public class DdstatsRustController : ControllerBase | ||
{ | ||
private readonly ApplicationDbContext _dbContext; | ||
private readonly MarkerRepository _markerRepository; | ||
|
||
public DdstatsRustController(ApplicationDbContext dbContext, MarkerRepository markerRepository) | ||
{ | ||
_dbContext = dbContext; | ||
_markerRepository = markerRepository; | ||
} | ||
|
||
[HttpGet("/api/integrations/ddstats-rust")] | ||
[ProducesResponseType(StatusCodes.Status200OK)] | ||
public ActionResult<DdstatsRustAccessInfo> GetIntegration() | ||
{ | ||
ToolEntity? ddstatsRust = _dbContext.Tools.AsNoTracking().FirstOrDefault(t => t.Name == "ddstats-rust"); | ||
if (ddstatsRust == null) | ||
throw new("ddstats-rust not found in database."); | ||
|
||
return new DdstatsRustAccessInfo { RequiredVersion = ddstatsRust.RequiredVersionNumber }; | ||
} | ||
|
||
// Used by DDCL 1.8.3. | ||
[HttpGet("/api/process-memory/marker")] | ||
[ProducesResponseType(StatusCodes.Status200OK)] | ||
[ProducesResponseType(StatusCodes.Status400BadRequest)] | ||
public async Task<ActionResult<GetMarker>> GetMarker([Required] SupportedOperatingSystem operatingSystem) | ||
{ | ||
return new GetMarker | ||
{ | ||
Value = await _markerRepository.GetMarkerAsync(operatingSystem switch | ||
{ | ||
SupportedOperatingSystem.Windows => "WindowsSteam", | ||
SupportedOperatingSystem.Linux => "LinuxSteam", | ||
_ => throw new UnsupportedOperatingSystemException($"Operating system '{operatingSystem}' is not supported."), | ||
}), | ||
}; | ||
} | ||
} |