cemu-project / Cemu

Cemu - Wii U emulator
https://cemu.info
Mozilla Public License 2.0
6.61k stars 505 forks source link

nn_fp: Implement GetMyComment and UpdateCommentAsync #1173

Open squelchiee opened 2 months ago

squelchiee commented 2 months ago
squelchiee commented 2 months ago

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.

squelchiee commented 2 months ago

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.

Exzap commented 2 months ago

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.

squelchiee commented 2 months ago

The call to GetMyComment probably 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?

squelchiee commented 2 months ago

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.

squelchiee commented 2 months ago

Another note, the GameKey corruption seems to come from UpdatePresenceAsync and not from UpdateCommentAsync, not sure what part exactly.