From 574bceafecc4f929b7fa99a2f26c63ead4121298 Mon Sep 17 00:00:00 2001 From: Moonbase Date: Tue, 29 Sep 2026 11:58:29 -0700 Subject: [PATCH] Deprecate get-jar To Serve Jars From Public Assets Implement Basic Lottso Express Support --- Controllers/ConfigAndAssetsController.cs | 21 +++------------------ TCPGameServer.cs | 21 +++++++++++++++++++-- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Controllers/ConfigAndAssetsController.cs b/Controllers/ConfigAndAssetsController.cs index b2a6705..4bc6422 100644 --- a/Controllers/ConfigAndAssetsController.cs +++ b/Controllers/ConfigAndAssetsController.cs @@ -30,7 +30,6 @@ namespace NotPogo.Controllers bool isSingleApplet = true) { string baseUrl = $"{Request.Scheme}://{Request.Host.Value}"; - string jarUrl = $"{baseUrl}/get-jar?game={game}&patchName=" + (!string.IsNullOrEmpty(patchName) ? patchName : ""); // Games like waterwheel/bowling ship with isSingleApplet=true: the compiled game // code draws its own chat panel as a CHILD COMPONENT of GameHostApplet -- confirmed @@ -46,7 +45,7 @@ namespace NotPogo.Controllers Name = "game", Code = appletClass, Codebase = baseUrl, - Archive = jarUrl, + Archive = $"{baseUrl}/v/19.1.0.25/applet/{game}/{game}-en_US.jar", Width = gameWidth, Height = 506, Parameters = new() @@ -67,7 +66,7 @@ namespace NotPogo.Controllers { "cnid", "" }, { "isSingleApplet", isSingleApplet ? "true" : "false" }, { "browserInfo", "" }, - { "debug", "true" }, + { "debug", "false" }, { "fullscreen.enabled", "false" }, { "fullscreen.supported", "false" } } @@ -89,7 +88,7 @@ namespace NotPogo.Controllers Name = "chat", Code = "com.pogo.game.client2.shell.ShellApplet", Codebase = baseUrl, - Archive = jarUrl, + Archive = $"{baseUrl}/v/19.1.0.25/applet/{game}/{game}-en_US.jar", Width = 212, Height = 506, Parameters = new() @@ -112,20 +111,6 @@ namespace NotPogo.Controllers return View(gamePage); } - - [HttpGet] - [Route("/get-jar")] - public IActionResult GetAppletCode(string game, string patchName) - { - string jarName = game + "-en_US" + ((!string.IsNullOrEmpty(patchName)) ? "-" + patchName : "") + ".jar"; - _logger.LogInformation("Serving Jar - {JarName}", jarName); - var path = Path.Combine(AppContext.BaseDirectory, "StaticFiles", "JARs", jarName); - if (!System.IO.File.Exists(path)) - return NotFound("Applet Not Found"); - else - return File(System.IO.File.ReadAllBytes(path), "application/x-java-archive", fileDownloadName: $"{game}.jar"); - } - [HttpGet] [Route("/blank.html")] public IActionResult GetEmptyPage() => Ok(); diff --git a/TCPGameServer.cs b/TCPGameServer.cs index 8353adf..ce42f38 100644 --- a/TCPGameServer.cs +++ b/TCPGameServer.cs @@ -62,7 +62,7 @@ namespace NotPogo await SendAsync(stream, ("msg.op", "logn"), ("flags", "65535"), ("time", DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString())); await SendAsync(stream, ("msg.op", "init"), ("mxpl", "70"), ("plid", "1"), ("mxtb", "70"), ("mxst", "4"), ("cnid", "1623")); await SendAsync(stream, ("msg.op", "load"), ("rmst", "start")); - await SendAsync(stream, ("msg.op", "rm.join"), ("scrn", "NotPogoUser"), ("pfid", "1000000000"), ("plid", "1"), ("entl", "ictsebpaulovfFmMrRG"), + await SendAsync(stream, ("msg.op", "rm.join"), ("scrn", "NotPogoUser"), ("pfid", "1000000000"), ("plid", "1"), ("entl", "ictsebaulovfFmMrRG"), ("snme", "NotPogoUser"), ("priv", "0"), ("aepc", ""), ("acvw", ""), ("agvs", ""), ("alrc", "")); await SendAsync(stream, ("msg.op", "gm.crea"), ("launch", "y"), ("live", "0"), ("port", "0"), ("iali", "86400000"), ("gins", "NotPogoTempRoom"), ("dead", "0"), ("iaid", "15000"), ("shut", ""), ("gmid", "0")); @@ -85,6 +85,23 @@ namespace NotPogo await SendAsync(stream, ("msg.op", "tick"), ("scrn", "NotPogoUser"), ("text", "Welcome to Not Pogo!")); await SendAsync(stream, ("msg.op", "cnfg"), ("impd", "40")); await SendAsync(stream, ("msg.op", "ext.pref"), ("pref", "")); + + // send lottso config, more than likely will be ignored by other clients + // this is mostly to get lottso express to work + await SendAsync(stream, + ("msg.op", "lb.cfg"), + ("lb.cmn.rack.ballnum", "6"), + ("lb.cmn.ball.range", "1,75"), + ("lb.cmn.ball.starting", "30"), + ("lb.cmn.ball.extra", "1"), + ("lb.cmn.jackpot.goal", "50"), + ("lb.cmn.score.to.token", "100"), + ("lb.cmn.rank.points", "10"), + ("lb.cmn.scoring.goal", "100,200,300,400,500"), + ("lb.cmn.cheat", "false"), + ("rank.maxOrd", "10") + ); + _logger.LogInformation("Sent 'gm.join' Response Sequence (Launches Game)"); } else if (op == "ext.over") @@ -92,7 +109,7 @@ namespace NotPogo // because we aren't actually keeping track of anything going on in the games, we can just send the correct placeholders bool isJackpot = (received["gm.won"] == "true") ? true : false; - int tokensWon = Random.Shared.Next(0, 999); + int tokensWon = isJackpot ? Random.Shared.Next(0, 999) : 0; await SendAsync(stream, ("msg.op", "ext.rslt"),