mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-14 13:52:28 +00:00
Reduce crashing on LBP3 (#468)
* Implement additional lbp3 endpoints * Cleanup lbp3 changes * Update return content types * Fix developer video return type * I forgot how xml works * I need to go to bed
This commit is contained in:
parent
d640c000aa
commit
b1ad4d3218
4 changed files with 33 additions and 5 deletions
|
@ -38,8 +38,8 @@ public class ClientConfigurationController : ControllerBase
|
|||
}
|
||||
|
||||
[HttpGet("t_conf")]
|
||||
[Produces("text/json")]
|
||||
public IActionResult Conf() => this.Ok("[{\"StatusCode\":200}]");
|
||||
[Produces("text/xml")]
|
||||
public IActionResult Conf() => this.Ok("<t_enable>false</t_enable>");
|
||||
|
||||
[HttpGet("farc_hashes")]
|
||||
public IActionResult FarcHashes() => this.Ok();
|
||||
|
|
|
@ -1,11 +1,28 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("LITTLEBIGPLANETPS3_XML/")]
|
||||
[Produces("text/xml")]
|
||||
public class DeveloperController : Controller
|
||||
{
|
||||
|
||||
private readonly Database database;
|
||||
|
||||
public DeveloperController(Database database)
|
||||
{
|
||||
this.database = database;
|
||||
}
|
||||
|
||||
[HttpGet("/developer_videos")]
|
||||
public IActionResult DeveloperVideos() => this.Ok();
|
||||
public async Task<IActionResult> DeveloperVideos()
|
||||
{
|
||||
GameToken? token = await this.database.GameTokenFromRequest(this.Request);
|
||||
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
return this.Ok("<videos></videos>");
|
||||
}
|
||||
}
|
|
@ -25,6 +25,17 @@ public class MatchController : ControllerBase
|
|||
this.database = database;
|
||||
}
|
||||
|
||||
[HttpPost("gameState")]
|
||||
[Produces("text/plain")]
|
||||
public async Task<IActionResult> GameState()
|
||||
{
|
||||
GameToken? token = await this.database.GameTokenFromRequest(this.Request);
|
||||
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
return this.Ok("VALID");
|
||||
}
|
||||
|
||||
[HttpPost("match")]
|
||||
[Produces("text/plain")]
|
||||
public async Task<IActionResult> Match()
|
||||
|
|
|
@ -128,7 +128,7 @@ public class GameServerStartup
|
|||
// The game doesn't start sending digests until after the announcement so if it's not one of those requests
|
||||
// and it doesn't include a digest we need to reject the request
|
||||
else if (!ServerStatics.IsUnitTesting && !strippedPath.Equals("/login") && !strippedPath.Equals("/eula")
|
||||
&& !strippedPath.Equals("/announce") && !strippedPath.Equals("/status"))
|
||||
&& !strippedPath.Equals("/announce") && !strippedPath.Equals("/status") && !strippedPath.Equals("/farc_hashes"))
|
||||
{
|
||||
context.Response.StatusCode = 403;
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue