diff --git a/Controllers/CDLController.cs b/Controllers/CDLController.cs
index 767b934..d578b57 100644
--- a/Controllers/CDLController.cs
+++ b/Controllers/CDLController.cs
@@ -1,4 +1,6 @@
using Microsoft.AspNetCore.Mvc;
+using NotPogo.Core;
+using NotPogo.Core.Rooms;
namespace NotPogo.Controllers
{
@@ -8,18 +10,30 @@ namespace NotPogo.Controllers
[Route("/cdl/cdl-info.jsp")]
public IResult CDLInfo(string lkey)
{
- // this is just to satisfy download clients
- if (string.IsNullOrEmpty(lkey))
- return Results.Empty;
- else
- return Results.Text("error none screenname 'NotPogoUser' site 'pogo' tokens 9999 enti 'oava 1 obad 1'");
+ var acct = Sessions.Find(lkey);
+ if (acct is null)
+ return Results.Text("error notloggedin", "text/plain"); // see note below
+
+ 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()
+ public IResult CDLLogin(string name)
{
+ var lkey = Sessions.Issue(name);
+
// more satisfying
- return Results.Text($"\n{Guid.NewGuid()}", "text/xml");
+ return Results.Text($"\n{lkey}", "text/xml");
}
[HttpGet("/cdl/1/cdl-clientprops")]
diff --git a/Controllers/ConfigAndAssetsController.cs b/Controllers/ConfigAndAssetsController.cs
index 4bc6422..6371cc9 100644
--- a/Controllers/ConfigAndAssetsController.cs
+++ b/Controllers/ConfigAndAssetsController.cs
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
+using NotPogo.Core;
using NotPogo.Model;
using System.IO.Compression;
using System.Net;
@@ -27,6 +28,7 @@ namespace NotPogo.Controllers
string site,
string locale,
string hostedGameClass,
+ string scrn = null!, // user will get a username assigned if screenName is not set
bool isSingleApplet = true)
{
string baseUrl = $"{Request.Scheme}://{Request.Host.Value}";
@@ -40,6 +42,8 @@ namespace NotPogo.Controllers
// stay one 776-wide