-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LBP3 Playlists #702
base: main
Are you sure you want to change the base?
LBP3 Playlists #702
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you document here what this extra d
check is for?
Refresh.GameServer/Endpoints/Game/Playlists/PlaylistLbp1Endpoints.cs
Outdated
Show resolved
Hide resolved
Refresh.GameServer/Endpoints/Game/Playlists/PlaylistLbp3Endpoints.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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.