-
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
LBP1 Playlists #649
LBP1 Playlists #649
Conversation
Sometimes the locations appear at the tail end of the string, right before the `}`, so we need to extract that out.
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.
First half of my review, posting because it's all easy stuff and I neeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed caffeine before I continue.
Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs
Show resolved
Hide resolved
Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs
Outdated
Show resolved
Hide resolved
Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs
Show resolved
Hide resolved
Co-authored-by: jvyden <[email protected]> Signed-off-by: Beyley Thomas <[email protected]>
Refresh.GameServer/Endpoints/Game/Playlists/PlaylistEndpoints.cs
Outdated
Show resolved
Hide resolved
Refresh.GameServer/Endpoints/Game/Playlists/PlaylistEndpoints.cs
Outdated
Show resolved
Hide resolved
Refresh.GameServer/Endpoints/Game/Playlists/PlaylistEndpoints.cs
Outdated
Show resolved
Hide resolved
Refresh.GameServer/Endpoints/Game/Playlists/PlaylistEndpoints.cs
Outdated
Show resolved
Hide resolved
Refresh.GameServer/Endpoints/Game/Playlists/PlaylistEndpoints.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: jvyden <[email protected]> Signed-off-by: Beyley Thomas <[email protected]>
How this was implemented in the past was strange to say the least. Slot ID 0 is invalid anyway, so let's re-use "story id == 0" for "is user level".
Gonna test locally then go from there |
Conversations resolved but I haven't tested locally
Migrations seem to fail:
|
oop, thats strange, im not getting that, must have messed up when i split the changes out from my stashed |
It's probably because I'm migrating from a version without I'll fix it. |
I decided to remove them entirely; they should only apply to you on your development database anyways. |
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.
Sorry for the delay, had some troubles with RPCS3 (I ended up just using PS3)
I see some Realm problems:
[09/05/24 19:35:35] [Info] [Request] Served request to 10.0.0.168:54869: 200 OK on POST '/lbp/createPlaylist?parent_id=1' (77ms)
[09/05/24 19:35:35] [Info] [Request] Served request to 10.0.0.168:54868: 200 OK on GET '/lbp/playlist/1?pageStart=1&pageSize=30' (6ms)
[09/05/24 19:35:38] [Error] [Request] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.NotSupportedException: The lhs of the binary operator 'Parameter' should be a member expression accessing a property on a managed RealmObjectBase.
Unable to process 'p'.
at Realms.RealmResultsVisitor.VisitBinary(BinaryExpression node)
at Realms.RealmResultsVisitor.RecurseToWhereOrRunLambda(MethodCallExpression m)
at Realms.RealmResultsVisitor.VisitMethodCall(MethodCallExpression node)
at Realms.RealmResultsProvider.Execute(Expression expression)
at Realms.RealmResultsProvider.Execute[T](Expression expression)
at Refresh.GameServer.Database.GameDatabaseContext.<>c__DisplayClass211_0.<GetPlaylistsByAuthorContainingPlaylist>b__1(SubPlaylistRelation r) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Database/GameDatabaseContext.Playlists.cs:line 131
at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
at Refresh.GameServer.Endpoints.Game.Playlists.PlaylistEndpoints.PlaylistsContainingSlot(RequestContext context, DataContext dataContext, String slotType, Int32 slotId) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Endpoints/Game/Playlists/PlaylistEndpoints.cs:line 121
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Bunkum.Core.Endpoints.Middlewares.MainMiddleware.InvokeEndpointByRequest(ListenerContext context, Lazy`1 database)
at Bunkum.Core.Endpoints.Middlewares.MainMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next)
at Bunkum.Core.BunkumServer.<>c__DisplayClass22_0.<HandleRequest>b__0()
at Refresh.GameServer.Middlewares.WebsiteMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Middlewares/WebsiteMiddleware.cs:line 53
at Refresh.GameServer.Middlewares.DeflateMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Middlewares/DeflateMiddleware.cs:line 26
at Refresh.GameServer.Middlewares.DigestMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Middlewares/DigestMiddleware.cs:line 100
at Refresh.GameServer.Middlewares.CrossOriginMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Middlewares/CrossOriginMiddleware.cs:line 46
at Refresh.GameServer.Middlewares.PspVersionMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Middlewares/PspVersionMiddleware.cs:line 24
at Refresh.GameServer.Middlewares.LegacyAdapterMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Middlewares/LegacyAdapterMiddleware.cs:line 17
at Bunkum.Core.BunkumServer.HandleRequest(ListenerContext context, Lazy`1 database)
[09/05/24 19:35:38] [Info] [Request] Served request to 10.0.0.168:54867: 500 InternalServerError on GET '/lbp/playlistsContainingSlotByAuthor/playlist/2?author=jvyden420&pageStart=1&pageSize=5' (8ms)
[09/05/24 19:35:38] [Error] [Request] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.NotSupportedException: The lhs of the binary operator 'Parameter' should be a member expression accessing a property on a managed RealmObjectBase.
Unable to process 'p'.
at Realms.RealmResultsVisitor.VisitBinary(BinaryExpression node)
at Realms.RealmResultsVisitor.RecurseToWhereOrRunLambda(MethodCallExpression m)
at Realms.RealmResultsVisitor.VisitMethodCall(MethodCallExpression node)
at Realms.RealmResultsProvider.Execute(Expression expression)
at Realms.RealmResultsProvider.Execute[T](Expression expression)
at Refresh.GameServer.Database.GameDatabaseContext.<>c__DisplayClass210_0.<GetPlaylistsContainingPlaylist>b__1(SubPlaylistRelation r) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Database/GameDatabaseContext.Playlists.cs:line 125
at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
at Refresh.GameServer.Endpoints.Game.Playlists.PlaylistEndpoints.PlaylistsContainingSlot(RequestContext context, DataContext dataContext, String slotType, Int32 slotId) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Endpoints/Game/Playlists/PlaylistEndpoints.cs:line 121
at InvokeStub_PlaylistEndpoints.PlaylistsContainingSlot(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Bunkum.Core.Endpoints.Middlewares.MainMiddleware.InvokeEndpointByRequest(ListenerContext context, Lazy`1 database)
at Bunkum.Core.Endpoints.Middlewares.MainMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next)
at Bunkum.Core.BunkumServer.<>c__DisplayClass22_0.<HandleRequest>b__0()
at Refresh.GameServer.Middlewares.WebsiteMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Middlewares/WebsiteMiddleware.cs:line 53
at Refresh.GameServer.Middlewares.DeflateMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Middlewares/DeflateMiddleware.cs:line 26
at Refresh.GameServer.Middlewares.DigestMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Middlewares/DigestMiddleware.cs:line 100
at Refresh.GameServer.Middlewares.CrossOriginMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Middlewares/CrossOriginMiddleware.cs:line 46
at Refresh.GameServer.Middlewares.PspVersionMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Middlewares/PspVersionMiddleware.cs:line 24
at Refresh.GameServer.Middlewares.LegacyAdapterMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/jvyden/Documents/Refresh/Refresh.GameServer/Middlewares/LegacyAdapterMiddleware.cs:line 17
at Bunkum.Core.BunkumServer.HandleRequest(ListenerContext context, Lazy`1 database)
[09/05/24 19:35:38] [Info] [Request] Served request to 10.0.0.168:54866: 500 InternalServerError on GET '/lbp/playlistsContainingSlot/playlist/2?pageStart=1&pageSize=5' (5ms)
ugh, realm is so weird, it doesnt like |
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.
Seems to work pretty well 👍
This server is responsible for one thing only, which is telling the client to load the slot listing for any user slot you send it. Retail LBP2 and LBP3 both implement this, but both require [special care](https://discord.com/channels/1049223665243389953/1049225857350254632/1280019755482218588) to make it use a separate domain (which is important if you want to protect your main gameserver behind cloudflare!) This is a fairly basic implementation of the server, but should be sufficient for even large amounts of connected players. Marking as draft until #649 is merged and hashed live play now is added, since this branch is based off of that one (didnt wanna deal with merge conflicts on this PR). Thanks to aidan for figuring all this out Example of server in action: https://github.com/user-attachments/assets/d790a570-c291-4005-b3cf-daf6a95a9f51
You can only create playlists in-game when latest retail LBP1 has the memory address
0x0074c2c0
patched to be0x01
instead of0x00
. In the EBOOT this is located at address0x0073c2c0
. Updates to Refresher and the OFW patchers will need to be made to enable this feature. For testing you also need to make sure that the/lbp/network_settings.nws
endpoint is being accessed correctly, since playlists require theAlexDB
option to be set to function.Luckily the game is perfectly happy viewing and playing other's playlists even if you don't have the feature enabled yourself. So there's no worry about un-patched users having issues.
I would like to tackle APIv3 support for playlists in a future PR, but aside from that, this is a complete implementation of the feature for LBP1.
It should be possible to represent this (at least close enough) in LBP3 by just not showing sub-playlists, and showing all playlists by a user, instead of just playlists inside of your root playlist. For LBP2/PSP/Vita we can just display playlists as a slot results override you trigger from the API, or as a special cased
playlist:name
in text search, although we won't be able to display sub-playlists there either.As a basic technical summary of how this is layed out, all players contain a "Root Playlist". In LBP1, when you view your "My Playlists" view, it will create a root playlist for you, if you don't have one. All playlists you create in the future are then considered "sub-playlists" of that root playlist, or of some other playlist.
The game allows you to add any playlist (eg. other's playlists aswell) as a sub-playlist to any of your playlists (except your root playlist). And it also allows you to add any
user
slot to any of your playlists (except your root playlist), as a sub-level of the playlist.The original developer's intention for viewing a user's playlists is that there is a button on the profile labeled "Playlists", and it would show the contents of the root playlist, however I found this to be rather uncreative, so in LBP1 I've injected the contents of your root playlist into your user level list as "sticky" slot results, so it always appears regardless of the page. This seems to work fairly well, and doesn't impact pagination from what I can see.