From 7e751d5010f56daefe1a5f50d0ccfd9a6732288d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 19 Sep 2016 12:39:22 +0100 Subject: [PATCH 1/4] replace no thread safe code --- OpenSim/Services/Connectors/Grid/GridServicesConnector.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs index 6c6ccf9887..ceb2146d1d 100644 --- a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs +++ b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs @@ -278,10 +278,12 @@ namespace OpenSim.Services.Connectors public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) { + GridRegion rinfo = null; ulong regionHandle = Util.UIntsToLong((uint)x, (uint)y); - if (m_regionCache.Contains(regionHandle)) - return (GridRegion)m_regionCache[regionHandle]; + // this cache includes NULL regions + if (m_regionCache.TryGetValue(regionHandle, out rinfo)) + return rinfo; Dictionary sendData = new Dictionary(); @@ -304,7 +306,6 @@ namespace OpenSim.Services.Connectors return null; } - GridRegion rinfo = null; if (reply != string.Empty) { Dictionary replyData = ServerUtils.ParseXmlResponse(reply); From 1b7327800a78e7b4754b5e97fb02687a83a5565a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 19 Sep 2016 15:41:14 +0100 Subject: [PATCH 2/4] fix GetUserUUI --- .../CoreModules/Framework/UserManagement/UserManagementModule.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index eabeaf1133..72fff2290f 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs @@ -701,6 +701,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement last = parts[1]; } uui = userID + ";" + homeURL + ";" + first + " " + last; + return result; } } From cca01f5cdac9ee70f0795a5ea17a0cdc82b1d7bb Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 19 Sep 2016 16:03:33 +0100 Subject: [PATCH 3/4] change CreatorIdentification set code --- .../Framework/Scenes/SceneObjectPart.cs | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index fcc3463b48..06d767d11e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -537,39 +537,29 @@ namespace OpenSim.Region.Framework.Scenes } set { + CreatorData = string.Empty; if ((value == null) || (value != null && value == string.Empty)) - { - CreatorData = string.Empty; return; - } - if (!value.Contains(";")) // plain UUID + // value is uuid or uuid;homeuri;firstname lastname + string[] parts = value.Split(';'); + if (parts.Length > 0) { + UUID uuid = UUID.Zero; - UUID.TryParse(value, out uuid); + UUID.TryParse(parts[0], out uuid); CreatorID = uuid; - } - else // [;[;name]] - { - string name = "Unknown User"; - string[] parts = value.Split(';'); - if (parts.Length >= 1) - { - UUID uuid = UUID.Zero; - UUID.TryParse(parts[0], out uuid); - CreatorID = uuid; - } - if (parts.Length >= 2) + + if (parts.Length > 1) { CreatorData = parts[1]; if (!CreatorData.EndsWith("/")) CreatorData += "/"; + if (parts.Length > 2) + CreatorData += ';' + parts[2]; + else + CreatorData += ";Unknown User"; } - if (parts.Length >= 3) - name = parts[2]; - - CreatorData += ';' + name; - } } } @@ -4653,6 +4643,12 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. + if(UsePhysics && !SetPhantom && m_localId == ParentGroup.RootPart.LocalId && + m_vehicleParams != null && m_vehicleParams.CameraDecoupled) + AddFlag(PrimFlags.CameraDecoupled); + else + RemFlag(PrimFlags.CameraDecoupled); + if (pa.Building != building) pa.Building = building; } From 874ba6b363895fae6285ce80d958c19fb3282481 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 19 Sep 2016 19:40:13 +0100 Subject: [PATCH 4/4] avoid a null ref --- .../CoreModules/World/Objects/Commands/ObjectCommandsModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index e77f0aa792..e65f860e44 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -768,7 +768,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands else so = m_scene.GetSceneObjectGroup(localId); - if (!so.IsAttachment) + if (so!= null && !so.IsAttachment) deletes.Add(so); // if (deletes.Count == 0)