Cemu
Cemu copied to clipboard
nn_fp: Implement GetMyComment and UpdateCommentAsync
- When starting a friend session, myComment (nexComment) will be stored in the session (NexFriends) variable
- Using GetMyComment will then get session->myComment and convert the commentString to UTF16
- Implemented nexComment.writeData
- UpdateCommentAsync and UpdatePreferenceAsync are incredibly similiar to each other, so most of the code is copied over from that in order to make it work
I'll have to convert this as a draft for now, still seems to have a few issues and I opened this PR a bit too soon.
Something I have noticed, this does not work too well without nn_fp.rpl placed in cafeLibs/, GetMyComment doesn't get called (meaning you can't read your own comment) and UpdateCommentAsync seems to corrupt myPresence->GameKey on the client (comment still updates for other friends and the title remains untouched serverside), I'm not exactly sure on what to do about this.
There seem to be some out of bounds reads but no bad writes (unless MY_COMMENT_LENGTH is wrong or we are using it in the wrong places?) So not sure what could be causing the corruption. The call to GetMyComment probably depends on some other state from the friend lib that we provide incorrectly/differently.
The call to
GetMyCommentprobably depends on some other state from the friend lib that we provide incorrectly/differently.
Is there a clear indicator to find where that state is?
Not much progress has been done lately, however, GetMyComment wasn't being called because it wasn't defined in nn_fp.cpp, also, the last 2 commits seems to have broken UpdateCommentAsync further by giving out an error when it gets called (both without nn_fp.rpl), so there needs to be more work done.
Another note, the GameKey corruption seems to come from UpdatePresenceAsync and not from UpdateCommentAsync, not sure what part exactly.
I know it has been a really long time since I last pushed a commit, I'd say the PR is almost finished, the only problem I have seen is that the comment doesn't update for the client in Friend List (it still updates for every other friend and if you restart the app the comment does change), I have a feeling this has something to do with the graphics and not the nn_fp library itself, I even tried patching out some friend list functions on real hardware to see where the text gets updated but I wasn't able to find anything. Also the latest and second latest commit were supposed to be one single commit, but they got separated somehow, I don't know why.
Is this ready to be merged or is more work being done? Asking since it's still marked as draft.