Add LevelTagsController and EnterLevelController

This commit is contained in:
jvyden 2021-10-06 01:03:22 -04:00
parent c20ac6a845
commit 4c6e5e07a5
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
4 changed files with 122 additions and 0 deletions

View file

@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Mvc;
namespace ProjectLighthouse.Controllers {
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/enterLevel")]
// [Produces("text/plain")]
public class EnterLevelController : ControllerBase {
[HttpGet("enterLevel/{id}")]
public IActionResult EnterLevel(string id) {
return this.Ok();
}
}
}

View file

@ -0,0 +1,22 @@
using System;
using Microsoft.AspNetCore.Mvc;
namespace ProjectLighthouse.Controllers {
[ApiController]
[Route("LITTLEBIGPLANETPS3_XML/tags")]
[Produces("text/plain")]
public class LevelTagsController : ControllerBase {
[HttpGet]
public IActionResult Get() {
string[] tags = Enum.GetNames(typeof(LevelTags));
int i = 0;
foreach(string tag in tags) {
tags[i] = $"TAG_{tag.Replace("_", "-")}";
i++;
}
return this.Ok(string.Join(",", tags));
}
}
}

View file

@ -0,0 +1,80 @@
namespace ProjectLighthouse {
public enum LevelTags {
Brilliant,
Beautiful,
Funky,
Points_Fest,
Weird,
Tricky,
Short,
Vehicles,
Easy,
Cute,
Quick,
Fun,
Relaxing,
Great,
Speedy,
Race,
Multi_Path,
Machines,
Complex,
Pretty,
Rubbish,
Toys,
Repetitive,
Machinery,
Satisfying,
Braaains,
Fast,
Simple,
Long,
Slow,
Mad,
Hectic,
Creepy,
Perilous,
Empty,
Ingenious,
Lousy,
Frustrating,
Timing,
Boss,
Springy,
Funny,
Musical,
Good,
Hilarious,
Electric,
Puzzler,
Platformer,
Difficult,
Mechanical,
Horizontal,
Splendid,
Fiery,
Swingy,
Single_Path,
Annoying,
Co_op,
Boring,
Moody,
Bubbly,
Nerve_wracking,
Hoists,
Ugly,
Daft,
Ramps,
Secrets,
Floaty,
Artistic,
Competitive,
Gas,
Varied,
Stickers,
Spikes,
Collectables,
Vertical,
Balancing
}
}

View file

@ -35,6 +35,13 @@ namespace ProjectLighthouse {
app.UseDeveloperExceptionPage();
}
app.Use(async (context, next) => {
await next();
if(context.Response.StatusCode == 404) {
Console.WriteLine($"404: {context.Request.Method} {context.Request.Path}");
}
});
app.UseRouting();
app.UseAuthorization();