cinderblocks / libremetaverse

An fork of the libopenmetaverse library striving for performance improvements and up-to-date compatibility with SL/OS/Halcyon
BSD 3-Clause "New" or "Revised" License
60 stars 39 forks source link

Unable to Retrieve Offline Messages #92

Open cxtal opened 4 weeks ago

cxtal commented 4 weeks ago

When calling RetrieveInstantMessages, the code in AgentManager.cs seems to fail at obtaining the messages using capabilities and the reply seems bogus, ending up in OfflineMessageHandlerCallback where the error message Failed to retrieve offline messages because the capability returned invalid shiz. is printed out and then the legacy LLUDP RetrieveInstantMessagesLegacy method is invoked that also produces no results.

I have no clue what is causing this because the result observed in OfflineMessageHandlerCallback is just 23 bytes long. Maybe something is wrong with the ReadOfflineMsgs capability serialization?

No clue how to fix this but offline messages cannot be read so leaving this out there.

Madpeterz commented 1 week ago

looks like it is getting offline messages but the code that handles it is outdated. give me a bit and I will have a play.

Madpeterz commented 1 week ago

notes so far: calling RetrieveInstantMessages on sim connected after first login results in the sim cap pool not being filled but waiting for EventQueueRunning to trigger corrects that.

Madpeterz commented 1 week ago

the OSD result seems to be vaild

{[
{"asset_id":"1fd8f39e-f6d1-05ae-177d-6e72f6c9eb53","binary_bucket":[0],"dialog":0,"estate_id":54309,
"from_agent_id":"289c3e36-69b3-40c5-9229-0c6a5d230766","from_agent_name":"Madpeter Zond","from_group":false,"message":"gewrgergerg",
"message_time":"2024-06-28T03:33:28Z","offline":1,"parent_estate_id":1,"position":[136.58900451660156,158.9980010986328,54.926998138427734],
"region_id":"14562916-7915-4fb8-9fbe-739bf16662fd","timestamp":1719545608,"to_agent_id":"3744cda8-9f62-456b-8554-6218abeaec35",
"transaction-id":"00000000-0000-0000-0000-000000000000"}]}
Madpeterz commented 6 days ago

working patch: https://github.com/cinderblocks/libremetaverse/pull/93

cxtal commented 6 days ago

This seems to be able to be chalked up to transient issues. Without even touching the code and just running the same tests again, it seems that now SecondLife sends a valid OSD. As mentioned, the OSD returned would be 23bytes long, before even failing with the Failed to retrieve offline messages because the capability returned invalid shiz.. On the other hand, the patch does help because the code would switch into the second check and would make retrieving messages fail. I can confirm it works - just remember that I was testing during one of SL's "bad days" so it always returned 23bytes. . .