Skip to content

Commit

Permalink
Block DDCL 1.8.3 (#314)
Browse files Browse the repository at this point in the history
* Block DDCL 1.8.3

* Remove download buttons and announce deprecation

* Keep ddstats-rust integration

* Remove response types

* Fix merge
  • Loading branch information
NoahStolk committed Mar 31, 2023
1 parent ce803d8 commit 0865404
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 81 deletions.
6 changes: 6 additions & 0 deletions src/api/DevilDaggersInfo.Api.DdstatsRust/GetMarker.cs
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; }
}
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,
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@using DevilDaggersInfo.Api.Main.Tools
@using DevilDaggersInfo.Common
<Heading Title="Changelog" Level="2" />

@foreach (GetToolVersion tv in ToolVersions)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<Heading Level="2" Title="How To Submit To A Custom Leaderboard" />

<p class="para">
Simply run <a class="link" href="/tools/custom-leaderboards">Devil Daggers Custom Leaderboards</a> while playing the game.
Run the <a class="link" href="/tools">ddinfo tools</a> and click on the "Custom Leaderboards" button. The app will automatically scan game memory and submit scores.
</p>

<Heading Level="2" Title="FAQ" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ else

<RunInfo />
<SourceInfo Url="https://github.com/NoahStolk/DevilDaggersAssetEditor" />

<Heading Title="Changelog" Level="2" />
<Versions ToolVersions="GetTool.Changelog" />
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
@using DevilDaggersInfo.Api.Main.CustomLeaderboards
@using DevilDaggersInfo.Api.Main.Tools
@using DevilDaggersInfo.Common
@using DevilDaggersInfo.Types.Web
@using DevilDaggersInfo.Web.Client.Components
@using DevilDaggersInfo.Web.Client.Components.Tools
@using DevilDaggersInfo.Web.Client.Enums
@using DevilDaggersInfo.Web.Client.HttpClients
@inject MainApiHttpClient Http

Expand All @@ -17,13 +15,8 @@
}
else
{
<ToolInfo GetTool="GetTool" />

<Heading Title="Distributions" Level="2" />
<Distributions>
<Distribution ToolName="@GetTool.Name" Note="Recommended" PublishMethod="ToolPublishMethod.SelfContained" BuildType="ToolBuildType.WindowsConsole" OperatingSystems="Windows 8+" Recommended=true />
<Distribution ToolName="@GetTool.Name" Note="Use for Windows 7" PublishMethod="ToolPublishMethod.Default" BuildType="ToolBuildType.WindowsConsole" OperatingSystems="Windows 7+" Prerequisites="ToolDistributionPrerequisites.DotNet6Runtime" />
</Distributions>
<Heading Title="IMPORTANT" Level="2" />
<p class="para">This tool has been deprecated in favor of <a class="link" href="/tools">ddinfo tools</a> and can no longer be used.</p>

<img src="/images/tools/ddcl.png" class="object-contain max-h-160 pt-3" alt="Custom Leaderboards" />

Expand All @@ -42,6 +35,12 @@ else

<RunInfo />
<SourceInfo Url="https://github.com/NoahStolk/DevilDaggersCustomLeaderboards" />

<Heading Title="Changelog" Level="2" />
<Heading Title="@($"Deprecated - {new DateTime(2023, 3, 31).ToString(StringFormats.DateFormat)}")" Level="3" />
<ul class="pl-4">
<li class="list-disc">The tool has been deprecated in favor of <a class="link" href="/tools">ddinfo tools</a>.</li>
</ul>
<Versions ToolVersions="GetTool.Changelog" />
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ else
</ul>

<RunInfo />
@* <SourceInfo Url="https://github.com/NoahStolk/DevilDaggersInfo/tree/main/src/razor/DevilDaggersInfo.Razor.ReplayEditor" /> *@

<Heading Title="Changelog" Level="2" />
<Versions ToolVersions="GetTool.Changelog" />
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ else

<RunInfo />
<SourceInfo Url="https://github.com/NoahStolk/DevilDaggersSurvivalEditor" />

<Heading Title="Changelog" Level="2" />
<Versions ToolVersions="GetTool.Changelog" />
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ else
<p class="para">The source code can be found in the <a class="link" href="https://github.com/NoahStolk/DevilDaggersInfo" target="_blank">DevilDaggersInfo monorepo on GitHub</a> in the src/app directory.</p>
<p class="para">The tools run on my own game/UI engine which can also be found on <a class="link" href="https://github.com/NoahStolk/Warp.NET" target="_blank">GitHub</a>.</p>
<Heading Title="Changelog" Level="2" />
<Versions ToolVersions="_appTool.Changelog" />
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<NavDropdown Text="Tools" IconType="pencil">
<NavItem Href="tools" IconType="flash" Text="Unified Tools (NEW)" />
<NavItem Href="tools/survival-editor" IconType="grid-three-up" Text="Survival Editor" />
<NavItem Href="tools/custom-leaderboards" IconType="clock" Text="Custom Leaderboards" />
<NavItem Href="tools/custom-leaderboards" IconType="clock" Text="Custom Leaderboards (Deprecated)" />
<NavItem Href="tools/asset-editor" IconType="brush" Text="Asset Editor" />
<NavItem Href="tools/replay-editor" IconType="media-play" Text="Replay Editor" />
</NavDropdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ public CustomEntriesController(ILogger<CustomEntriesController> logger, CustomEn
// FORBIDDEN: Used by ddstats-rust (currently not working however (2022-05-28)).
[Obsolete("DDCL 1.8.3 will be removed.")]
[HttpPost("/api/custom-entries/submit")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<ActionResult<GetUploadSuccess>> SubmitScoreForDdclObsolete([FromBody] AddUploadRequest uploadRequest)
{
throw new BadRequestException("DDCL 1.8.3 is no longer supported. Go to https://www.devildaggers.info/ and download DDINFO TOOLS to connect to custom leaderboards.");

try
{
UploadResponse response = await _customEntryProcessor.ProcessUploadRequestAsync(uploadRequest.ToDomain());
Expand Down

This file was deleted.

This file was deleted.

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."),
}),
};
}
}

0 comments on commit 0865404

Please sign in to comment.