Conversation
…differenciate from lbp3 playlist specific and common playlist things
…3 playlists, very minor comment rewording
…evel id fails to get parsed, skip over them instead
…essesary classes & attributes, other very minor improvements
…iation between lbp3 and lbp1 playlists in lbp1
…, more precise random location limits
…the amount of levels in a playlist
Beyley
left a comment
There was a problem hiding this comment.
just an initial run-through, looks quite good aside from minor stuff
| { | ||
| if (!int.TryParse(levelIdStr, out int levelId)) return null; | ||
| if (!int.TryParse(levelIdStr.StartsWith('d') ? levelIdStr[1..] : levelIdStr, out int levelId)) continue; | ||
| GameLevel? level = database.GetLevelById(levelId); |
There was a problem hiding this comment.
Could you document here what this extra d check is for?
Refresh.GameServer/Endpoints/Game/Playlists/PlaylistLbp1Endpoints.cs
Outdated
Show resolved
Hide resolved
| // Setting TokenGame to LBP3 to get the true amount of levels in the playlist | ||
| Index = this.GetTotalLevelsInPlaylistCount(parent, TokenGame.LittleBigPlanet3), |
There was a problem hiding this comment.
Probably worth adding a game-agnostic function to get this count, in-case we ever want to expand the playlist system to LBP Vita
I have ideas of using slot overrides to achieve this.
There was a problem hiding this comment.
game-agnostic as in not game-dependent, one that doesnt take a TokenGame?
| // Only sort by order if needed, to improve performance | ||
| if (game == TokenGame.LittleBigPlanet3) | ||
| relations = relations.OrderBy(r => r.Index); |
There was a problem hiding this comment.
Given theres ideas of using slot overrides to expand this system to other games than LBP1/3, its worth removing this, the amount of time spent ordering is going to be very small (especially after we have Postgres)
| // Only sort by order if needed, to improve performance | |
| if (game == TokenGame.LittleBigPlanet3) | |
| relations = relations.OrderBy(r => r.Index); |
There was a problem hiding this comment.
So you are suggesting to remove custom level ordering as a whole and to just not support that feature, because of potential playlist support in other games using level overrides? I am not understanding the link between the two.
…to write block, add game-independent GetTotalLevelsInPlaylistCount method
…verflow when finding recursive playlists with TraverseParentsRecursively
Implements the ability to create, view, manage etc. playlists in LBP3. They get saved as GamePlaylists in the database, which among some other things allows lbp3 playlists to show up in lbp1 as lbp1 playlists and vice versa. This PR also adds the ability to heart playlists in LBP3 with FavouritePlaylistRelations, aswell as an index number in LevelPlaylistRelations to also support setting custom level orders inside playlists in LBP3. Also implements actually assigning creation and last updated dates to playlists when creating them in general.
Edit: This now also lets the endpoint for adding a slot to a playlist in lbp1 catch and block more ways of creating recursive playlists, and it also prevents TraverseParentsRecursively in GamePlaylistExtensions from causing an overflow once it gets stuck in a loop in the tree it's supposed to traverse.