Import december-2020-12-18 from private repo (scrubbed 2026-05-27)

Targets Rec Room 2020.12.18 client.

Re-import after adding:
- DorkNet.ClientMod/dorknet-clientmod.json.template — config schema
  the launcher's manifest-driven patcher renders into UserData/.
- tools/build-patcher-zip.ps1 — produces the dorknet-clientpatch-{key}.zip
  Release asset the launcher fetches.
- .github/workflows/release.yml — auto-publishes both Release assets
  on v1-december-* tag push.

Scrubbed via maintainer-side scrub-for-public.ps1: same drop rules as
the prior import, plus build-patcher-zip.ps1 added to the tools/
allow-list so it survives the scrub.
This commit is contained in:
Alexa
2026-05-27 01:04:12 +03:00
commit 4edf25b2d5
375 changed files with 201291 additions and 0 deletions
@@ -0,0 +1,40 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using DorkNet.Server.Auth;
using DorkNet.Server.Data;
namespace DorkNet.Server.Controllers.API.Cards;
/// <summary>
/// api.{rec.net,localhost}/api/cards/v1/all — home-screen card panel
/// (announcements, promos, daily-bonus tiles). Returns global cards
/// PLUS any cards targeted at the caller, sorted by Priority then
/// CreatedAt. Expired cards filtered out server-side.
/// </summary>
[ApiController]
public class CardsController(DorkNetDbContext db) : ControllerBase
{
[HttpGet("api/cards/v1/all")]
public async Task<IActionResult> All()
{
var pid = this.CurrentPlayerId();
var now = DateTime.UtcNow;
var rows = await db.Cards
.Where(c => (c.PlayerId == null || c.PlayerId == pid) &&
(c.ExpiresAt == null || c.ExpiresAt > now))
.OrderByDescending(c => c.Priority).ThenByDescending(c => c.CreatedAt)
.Take(50)
.Select(c => new
{
c.Id,
c.Title,
c.Body,
c.ImageName,
c.ActionUrl,
c.Category,
c.CreatedAt,
})
.ToListAsync();
return Ok(rows);
}
}