using Microsoft.AspNetCore.Mvc; using ReboundEmulator.Core; namespace ReboundEmulator.Controllers { public class CDLController : Controller { [HttpGet] [Route("/cdl/cdl-info.jsp")] public IResult CDLInfo(string lkey) { var acct = Sessions.Find(lkey); if (acct is null) return Results.Text("error notloggedin", "text/plain"); var enti = $"oava {(acct.OwnsPremiumAvatar ? 1 : 0)} obad {(acct.OwnsBadges ? 1 : 0)}"; var body = string.Join(" ", "error", "none", "screenname", Q(acct.ScreenName), "site", Q(acct.Site), "tokens", acct.Tokens.ToString(), "enti", Q(enti), "avatar", Q(acct.Avatar)); return Results.Text(body, "text/plain"); } static string Q(string s) => "'" + s.Replace("\\", "\\\\").Replace("'", "\\'") + "'"; [HttpGet("/cdl/1/login")] public IResult CDLLogin(string name) { var lkey = Sessions.Issue(name); return Results.Text($"\n{lkey}", "text/xml"); } [HttpGet("/cdl/1/cdl-clientprops")] public IActionResult CDLClientProps() { return Ok(); } // CDL games don't really need the client props to be present on the server, // it was there so Pogo could update assets for CDL games on the fly } }