Deprecate get-jar To Serve Jars From Public Assets
Implement Basic Lottso Express Support
This commit is contained in:
parent
d49cce8404
commit
574bceafec
@ -30,7 +30,6 @@ namespace NotPogo.Controllers
|
|||||||
bool isSingleApplet = true)
|
bool isSingleApplet = true)
|
||||||
{
|
{
|
||||||
string baseUrl = $"{Request.Scheme}://{Request.Host.Value}";
|
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
|
// Games like waterwheel/bowling ship with isSingleApplet=true: the compiled game
|
||||||
// code draws its own chat panel as a CHILD COMPONENT of GameHostApplet -- confirmed
|
// code draws its own chat panel as a CHILD COMPONENT of GameHostApplet -- confirmed
|
||||||
@ -46,7 +45,7 @@ namespace NotPogo.Controllers
|
|||||||
Name = "game",
|
Name = "game",
|
||||||
Code = appletClass,
|
Code = appletClass,
|
||||||
Codebase = baseUrl,
|
Codebase = baseUrl,
|
||||||
Archive = jarUrl,
|
Archive = $"{baseUrl}/v/19.1.0.25/applet/{game}/{game}-en_US.jar",
|
||||||
Width = gameWidth,
|
Width = gameWidth,
|
||||||
Height = 506,
|
Height = 506,
|
||||||
Parameters = new()
|
Parameters = new()
|
||||||
@ -67,7 +66,7 @@ namespace NotPogo.Controllers
|
|||||||
{ "cnid", "" },
|
{ "cnid", "" },
|
||||||
{ "isSingleApplet", isSingleApplet ? "true" : "false" },
|
{ "isSingleApplet", isSingleApplet ? "true" : "false" },
|
||||||
{ "browserInfo", "" },
|
{ "browserInfo", "" },
|
||||||
{ "debug", "true" },
|
{ "debug", "false" },
|
||||||
{ "fullscreen.enabled", "false" },
|
{ "fullscreen.enabled", "false" },
|
||||||
{ "fullscreen.supported", "false" }
|
{ "fullscreen.supported", "false" }
|
||||||
}
|
}
|
||||||
@ -89,7 +88,7 @@ namespace NotPogo.Controllers
|
|||||||
Name = "chat",
|
Name = "chat",
|
||||||
Code = "com.pogo.game.client2.shell.ShellApplet",
|
Code = "com.pogo.game.client2.shell.ShellApplet",
|
||||||
Codebase = baseUrl,
|
Codebase = baseUrl,
|
||||||
Archive = jarUrl,
|
Archive = $"{baseUrl}/v/19.1.0.25/applet/{game}/{game}-en_US.jar",
|
||||||
Width = 212,
|
Width = 212,
|
||||||
Height = 506,
|
Height = 506,
|
||||||
Parameters = new()
|
Parameters = new()
|
||||||
@ -112,20 +111,6 @@ namespace NotPogo.Controllers
|
|||||||
return View(gamePage);
|
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]
|
[HttpGet]
|
||||||
[Route("/blank.html")]
|
[Route("/blank.html")]
|
||||||
public IActionResult GetEmptyPage() => Ok();
|
public IActionResult GetEmptyPage() => Ok();
|
||||||
|
|||||||
@ -62,7 +62,7 @@ namespace NotPogo
|
|||||||
await SendAsync(stream, ("msg.op", "logn"), ("flags", "65535"), ("time", DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString()));
|
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", "init"), ("mxpl", "70"), ("plid", "1"), ("mxtb", "70"), ("mxst", "4"), ("cnid", "1623"));
|
||||||
await SendAsync(stream, ("msg.op", "load"), ("rmst", "start"));
|
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", ""));
|
("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"),
|
await SendAsync(stream, ("msg.op", "gm.crea"), ("launch", "y"), ("live", "0"), ("port", "0"), ("iali", "86400000"), ("gins", "NotPogoTempRoom"),
|
||||||
("dead", "0"), ("iaid", "15000"), ("shut", ""), ("gmid", "0"));
|
("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", "tick"), ("scrn", "NotPogoUser"), ("text", "Welcome to Not Pogo!"));
|
||||||
await SendAsync(stream, ("msg.op", "cnfg"), ("impd", "40"));
|
await SendAsync(stream, ("msg.op", "cnfg"), ("impd", "40"));
|
||||||
await SendAsync(stream, ("msg.op", "ext.pref"), ("pref", ""));
|
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)");
|
_logger.LogInformation("Sent 'gm.join' Response Sequence (Launches Game)");
|
||||||
}
|
}
|
||||||
else if (op == "ext.over")
|
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
|
// 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;
|
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,
|
await SendAsync(stream,
|
||||||
("msg.op", "ext.rslt"),
|
("msg.op", "ext.rslt"),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user