Skip to content
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

prevent erroneous edit of wrong parcel #3129

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

AndrewMeadows
Copy link
Contributor

This PR fixes jira-archive-internal/issues/70771

https://github.com/secondlife/jira-archive-internal/issues/70771

The problem was the update for the selected parcel was being sent to the wrong region, because the viewer logic for finding the corresponding region was flawed.

Fixes jira-archive-internal/issues/70771
[SL-20409] Erroneous Local Parcel Twins -
Parcel Updates Across Region Borders -
unrequested updateDatabaseParcel changes
@@ -1332,7 +1332,7 @@ void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_ag
if(!parcel)
return;

LLViewerRegion *region = use_agent_region ? gAgent.getRegion() : LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth );
LLViewerRegion *region = LLWorld::getInstance()->getRegionFromID(parcel->getRegionID());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the bug lived. The region pointer was being found based on (a) whether the agent was in the region or (b) a cached value of mWestSouth which was supposed to be the global-position of the region's origin corner, but could sometimes be from the wrong region.

The fix is to cache the region_id in each parcel so it can be used to find the region in this context.

@AndrewMeadows
Copy link
Contributor Author

I think the repro recipe goes something like this:

(1) Find two adjacent regions A and B, each with only one parcel (to make things easy)
(2) While on regionA sidle up to the boundary with regionB, but don't cross over.
(3) Select parcelA on regionA and open About Land floater (just to make it visible)
(4) On regionA terrain right-click the terrain and select Edit Terrain
(5) Left-click parcelB on regionB --> notice the parcel info populates the previously openened About Land floater
(6) Change the Name of parcelB
(7) Select parcelA in regionA --> notice its name has changed to what you tried to change on parcelB

Why does this work? Because there is a way to cache the LLViewerParcelMgr::mWestSouth corner of regionA and then change to a parcel in regionB without updating that cached value. When the old viewer would try to apply a parcel properties change it would use the cached value of mWestSouth to figure out which region to send it to. I'm not 100% sure that is the exact repro recipe above, but it is something like that. The operation of opening the About Land floater up will, for most cases, correctly cache mWestSouth for the appropriate region, so you need to find that path that caches the corner and then later updates the About Land parcel selection without recomputing it.

@AndrewMeadows AndrewMeadows merged commit e3fbcaa into develop Nov 25, 2024
14 checks passed
@AndrewMeadows AndrewMeadows deleted the leviathan/anti-parcel-damage branch November 25, 2024 18:37
@github-actions github-actions bot locked and limited conversation to collaborators Nov 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants