From 14569992e149b4c6ee097d88e3f5034edd653645 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 6 Mar 2014 00:11:13 +0000 Subject: Prevent adding a land object if it overlaps any existing objects that have not had their bitmaps adjusted. This is to prevent an immediate problem in http://opensimulator.org/mantis/view.php?id=7035 where a development code bug occasionally overlays all the existing parcels with a blank parcel owned by the estate manager and to gather more data. My guess is that this parcel is being created by the new code in LandManagementModule.GetLandObject(), probably some race between threads since this only happens occasionally. Adds regression tests for this case and for parcel subdivide. --- .../Avatar/UserProfiles/UserProfileModule.cs | 32 ++++++++++++++-------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar/UserProfiles') diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index f3e757a..bb2a258 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -657,9 +657,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles /// Enabled. /// public void PickInfoUpdate(IClientAPI remoteClient, UUID pickID, UUID creatorID, bool topPick, string name, string desc, UUID snapshotID, int sortOrder, bool enabled) - { - + { m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString()); + UserProfilePick pick = new UserProfilePick(); string serverURI = string.Empty; GetUserProfileServerURI(remoteClient.AgentId, out serverURI); @@ -672,19 +672,29 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles avaPos.Z); string landOwnerName = string.Empty; - ILandObject land = p.Scene.LandChannel.GetLandObject(avaPos.X, avaPos.Y); - if(land.LandData.IsGroupOwned) + ILandObject land = p.Scene.LandChannel.GetLandObject(avaPos.X, avaPos.Y); + + if (land != null) { - IGroupsModule groupMod = p.Scene.RequestModuleInterface(); - UUID groupId = land.LandData.GroupID; - GroupRecord groupRecord = groupMod.GetGroupRecord(groupId); - landOwnerName = groupRecord.GroupName; + if (land.LandData.IsGroupOwned) + { + IGroupsModule groupMod = p.Scene.RequestModuleInterface(); + UUID groupId = land.LandData.GroupID; + GroupRecord groupRecord = groupMod.GetGroupRecord(groupId); + landOwnerName = groupRecord.GroupName; + } + else + { + IUserAccountService accounts = p.Scene.RequestModuleInterface(); + UserAccount user = accounts.GetUserAccount(p.Scene.RegionInfo.ScopeID, land.LandData.OwnerID); + landOwnerName = user.Name; + } } else { - IUserAccountService accounts = p.Scene.RequestModuleInterface(); - UserAccount user = accounts.GetUserAccount(p.Scene.RegionInfo.ScopeID, land.LandData.OwnerID); - landOwnerName = user.Name; + m_log.WarnFormat( + "[PROFILES]: PickInfoUpdate found no parcel info at {0},{1} in {2}", + avaPos.X, avaPos.Y, p.Scene.Name); } pick.PickId = pickID; -- cgit v1.1