mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 07:28:45 -07:00
70980bf3b6
- Implemented ProgressionEventsController to handle progression event retrieval and active events. - Created RoomConsumablesController for listing and purchasing room consumables. - Developed RoomCurrenciesController for managing room currencies, including creation, updates, and balance retrieval. - Added RoomEarningsDistributionsController to fetch earnings distribution data for rooms. - Introduced ScreenShareReportsController for reporting screen share incidents. - Established SubscriptionSeasonsController to provide current subscription season details and rewards. - Launched UgcPurchasablesController for managing user-generated content purchasables, including bulk operations. - Added new data entities for customization and room economy, including custom avatar items, room currencies, and UGC purchasables.
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using System.Security.Cryptography;
|
|
using DorkNet.Server.Auth;
|
|
using DorkNet.Server.Data;
|
|
using DorkNet.Server.Data.Entities;
|
|
|
|
namespace DorkNet.Server.Controllers.API.AgeVerification;
|
|
|
|
[ApiController]
|
|
[Route("api/ageverification")]
|
|
[Authorize]
|
|
public class AgeVerificationController(DorkNetDbContext db) : ControllerBase
|
|
{
|
|
[HttpPost("generateCode")]
|
|
[HttpGet("generateCode")]
|
|
public async Task<IActionResult> GenerateCode()
|
|
{
|
|
var pid = this.RequireCurrentPlayerId();
|
|
var code = RandomNumberGenerator.GetInt32(100000, 999999).ToString();
|
|
db.PlayerSettings.Add(new PlayerSettingEntity
|
|
{
|
|
PlayerId = pid,
|
|
Key = $"ageverification:{DateTime.UtcNow:yyyyMMddHHmmss}",
|
|
Value = code,
|
|
});
|
|
await db.SaveChangesAsync();
|
|
return Ok(new { Code = code, VerificationCode = code, ExpiresAt = DateTime.UtcNow.AddMinutes(15) });
|
|
}
|
|
}
|