From 2ffc055f7ead4e6b07b82bcc47748295595d350d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 18 Feb 2012 21:59:42 -0800 Subject: This should smooth movement in heteregeneous networks by a lot: cache the region by position instead of looking it up all the time -- this was being done during the main update loop! --- .../ServiceConnectorsOut/Grid/RegionInfoCache.cs | 34 +++++++++++++++++++++- .../Grid/RemoteGridServiceConnector.cs | 8 ++++- 2 files changed, 40 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs index 786e0b5..be8a9a2 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs @@ -65,13 +65,26 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid } } + internal struct ScopedRegionPosition + { + public UUID m_scopeID; + public ulong m_regionHandle; + public ScopedRegionPosition(UUID scopeID, ulong handle) + { + m_scopeID = scopeID; + m_regionHandle = handle; + } + } + private ExpiringCache m_UUIDCache; private ExpiringCache m_NameCache; + private ExpiringCache m_PositionCache; public RegionInfoCache() { m_UUIDCache = new ExpiringCache(); - m_NameCache = new ExpiringCache(); + m_NameCache = new ExpiringCache(); + m_PositionCache = new ExpiringCache(); } public void Cache(GridRegion rinfo) @@ -96,6 +109,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid { ScopedRegionName name = new ScopedRegionName(scopeID,rinfo.RegionName); m_NameCache.AddOrUpdate(name, id, CACHE_EXPIRATION_SECONDS); + + ScopedRegionPosition pos = new ScopedRegionPosition(scopeID, rinfo.RegionHandle); + m_PositionCache.AddOrUpdate(pos, rinfo, CACHE_EXPIRATION_SECONDS); } } @@ -114,6 +130,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid return null; } + public GridRegion Get(UUID scopeID, ulong handle, out bool inCache) + { + inCache = false; + + GridRegion rinfo = null; + ScopedRegionPosition pos = new ScopedRegionPosition(scopeID, handle); + if (m_PositionCache.TryGetValue(pos, out rinfo)) + { + inCache = true; + return rinfo; + } + + return null; + } + + public GridRegion Get(UUID scopeID, string name, out bool inCache) { inCache = false; diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index 6f364ae..e6c89d7 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs @@ -186,10 +186,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) { - GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y); + bool inCache = false; + GridRegion rinfo = m_RegionInfoCache.Get(scopeID, Util.UIntsToLong((uint)x, (uint)y), out inCache); + if (inCache) + return rinfo; + + rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y); if (rinfo == null) rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y); + m_RegionInfoCache.Cache(rinfo); return rinfo; } -- cgit v1.1 From a114367b9b24496bdaaeeeb037e99885ec6f511b Mon Sep 17 00:00:00 2001 From: PixelTomsen Date: Sun, 19 Feb 2012 08:51:40 +0100 Subject: Fix:OmegaX, OmegaY and OmegaZ not saved for child prims http://opensimulator.org/mantis/view.php?id=5893 Signed-off-by: nebadon --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b130bf7..65905a0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1556,9 +1556,9 @@ namespace OpenSim.Region.Framework.Scenes dupe.GroupPosition = GroupPosition; dupe.OffsetPosition = OffsetPosition; dupe.RotationOffset = RotationOffset; - dupe.Velocity = new Vector3(0, 0, 0); - dupe.Acceleration = new Vector3(0, 0, 0); - dupe.AngularVelocity = new Vector3(0, 0, 0); + dupe.Velocity = Velocity; + dupe.Acceleration = Acceleration; + dupe.AngularVelocity = AngularVelocity; dupe.Flags = Flags; dupe.OwnershipCost = OwnershipCost; -- cgit v1.1 From d22715126c05307ce5f91816ea5754b7884ff11d Mon Sep 17 00:00:00 2001 From: PixelTomsen Date: Sun, 19 Feb 2012 09:53:50 +0100 Subject: Fix:Fly setting for Parcel dosen't work http://opensimulator.org/mantis/view.php?id=5887 Signed-off-by: nebadon --- OpenSim/Region/CoreModules/World/Land/LandObject.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index d146901..cc42f7f 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -272,7 +272,8 @@ namespace OpenSim.Region.CoreModules.World.Land ParcelFlags.AllowGroupScripts | ParcelFlags.CreateGroupObjects | ParcelFlags.AllowAPrimitiveEntry | - ParcelFlags.AllowGroupObjectEntry); + ParcelFlags.AllowGroupObjectEntry | + ParcelFlags.AllowFly); } if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale)) -- cgit v1.1