SaladDais / Hippolyzer

Intercepting proxy + analysis toolkit for Second Life compatible virtual worlds
GNU Lesser General Public License v3.0
13 stars 5 forks source link

Better handling of objects not known to the proxy due to viewer object cache hits #11

Closed SaladDais closed 3 years ago

SaladDais commented 3 years ago

Whenever the viewer enters a sim, the sim will send cache probes with ObjectUpdateCached containing a LocalID and CRC. If the LocalID isn't cached or there's a CRC mismatch the viewer will request it with RequestMultipleObjects. Right now the proxy doesn't know about any objects that the viewer didn't request due to them being present in its own viewer object cache.

Right now we hack around this in a few places by always requesting missing objects when they're referenced in an ObjectSelect packet, but it can cause problems if you're trying to look at avatar positions and the avatar sits on an object the proxy doesn't know about. Object positions are always relative to their parent, so not knowing the parent's position makes it hard to determine the avatar's position.

Possible approaches:

SaladDais commented 3 years ago

9 would help with approach 2 since the viewer object cache is just a bunch of ObjectUpdateCompressed Data sections in files keyed on region coordinates.

VOCache is only written when leaving a region, so mapping across all viewers' VOCaches and looking for a (region_handle, local_id, crc) match would work fine for our purposes with relatively unlikely race conditions.