LittleBigPlanet 3 Adventure Support (#477)

* Baseline LBP3 Adventure slot support
VERY unsafe and hacky to use as of now, this is just testing the waters.

* ADC file type checking

* Refactor & trimming
This might need to be adjusted if any feature is found to be missing

* isAdventure added to API

* Prototype Adventure icons for Website
I am not an artist, please make this more in line with the originals.

* Override border radius for LBP3 Adventures

* Cleaning

* Remove WriteLine and unused property

* Remove unused libraries

* Handle tracking and submitting of Adventure scores

* Check for null instead of 0
Non-adventure slots will report null, not 0

* Score for adventure slot instead of main slot

* Tweaks for PR

* Identify levels for photos by level resource
Verify this doesn't break anything.

* SlotCardPartial merge with main changes

* PR resolution 2

* probably not what was wanted
Use variables for style extension

* Internal slots already properly identified

* Return line breaks to end of Slot.cs

* Remove line break added by Github

thanks

* Github.

* Make this a one-liner

* Reduce to two lines

* This can also be one line

* This can *also* be one line

* Update ProjectLighthouse.Servers.Website/Pages/Partials/SlotCardPartial.cshtml

Co-authored-by: Josh <josh@slendy.pw>

* PR changes

* Update ProjectLighthouse/Migrations/20220916141401_ScoreboardAdvSlot.cs

Co-authored-by: Josh <josh@slendy.pw>

Co-authored-by: Josh <josh@slendy.pw>
This commit is contained in:
Dagg 2022-09-20 14:08:02 -07:00 committed by GitHub
parent 83a905c8a2
commit dfd1d9b748
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 107 additions and 22 deletions

View file

@ -40,7 +40,8 @@ public class PublishController : ControllerBase
GameToken gameToken = userAndToken.Value.Item2;
Slot? slot = await this.getSlotFromBody();
if (slot == null) {
if (slot == null)
{
Logger.Warn("Rejecting level upload, slot is null", LogArea.Publish);
return this.BadRequest(); // if the level cant be parsed then it obviously cant be uploaded
}
@ -135,10 +136,21 @@ public class PublishController : ControllerBase
return this.BadRequest();
}
if (rootLevel.FileType != LbpFileType.Level)
if (!slot.IsAdventurePlanet)
{
Logger.Warn("Rejecting level upload, rootLevel is not a level", LogArea.Publish);
return this.BadRequest();
if (rootLevel.FileType != LbpFileType.Level)
{
Logger.Warn("Rejecting level upload, rootLevel is not a level", LogArea.Publish);
return this.BadRequest();
}
}
else
{
if (rootLevel.FileType != LbpFileType.Adventure)
{
Logger.Warn("Rejecting level upload, rootLevel is not a LBP 3 Adventure", LogArea.Publish);
return this.BadRequest();
}
}
GameVersion slotVersion = FileHelper.ParseLevelVersion(rootLevel);
@ -232,7 +244,7 @@ public class PublishController : ControllerBase
this.database.Slots.Add(slot);
await this.database.SaveChangesAsync();
if (user.LevelVisibility == PrivacyType.All)
{
await WebhookHelper.SendWebhook("New level published!",