ReboundEmulator/Controllers/CDLController.cs
Moonbase f6e304929f Implement Stubbed CDL Endpoints
Listen On All Addreses Port 80 Alongside 8080 (remove if you cannot launch the emulator)
2026-10-05 13:20:50 -07:00

37 lines
1.3 KiB
C#

using Microsoft.AspNetCore.Mvc;
namespace NotPogo.Controllers
{
public class CDLController : Controller
{
[HttpGet]
[Route("/cdl/cdl-info.jsp")]
public IResult CDLInfo(string lkey)
{
// this is just to satisfy download clients
if (string.IsNullOrEmpty(lkey))
return Results.Text("");
else
return Results.Text("error none screenname 'NotPogoUser' site 'pogo' tokens 9999 enti 'oava 1 obad 1'");
}
[HttpGet("/cdl/1/login")]
public IResult CDLLogin()
{
// more satisfying
return Results.Text($"<LoginResponse error=\"none\">\n<LoginSessionKey>{Guid.NewGuid()}</LoginSessionKey></LoginResponse>", "text/xml");
}
[HttpGet("/cdl/1/cdl-clientprops")]
public IActionResult CDLClientProps(string game)
{
string pathToProps = Path.Combine(AppContext.BaseDirectory, "StaticFiles", "Configs", "CDL", $"{game}.properties");
if (System.IO.File.Exists(pathToProps))
return Ok(System.IO.File.ReadAllText(pathToProps));
else
return Ok(); // don't send anything since we don't have the config for it on the server yet
}
}
}