diff options
author | Diva Canto | 2012-02-18 21:59:42 -0800 |
---|---|---|
committer | Diva Canto | 2012-02-18 21:59:42 -0800 |
commit | 2ffc055f7ead4e6b07b82bcc47748295595d350d (patch) | |
tree | 428145bf813a00aa63ba4a2cf9199481c3d33504 /OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-2ffc055f7ead4e6b07b82bcc47748295595d350d.zip opensim-SC_OLD-2ffc055f7ead4e6b07b82bcc47748295595d350d.tar.gz opensim-SC_OLD-2ffc055f7ead4e6b07b82bcc47748295595d350d.tar.bz2 opensim-SC_OLD-2ffc055f7ead4e6b07b82bcc47748295595d350d.tar.xz |
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!
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | 8 |
1 files changed, 7 insertions, 1 deletions
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 | |||
186 | 186 | ||
187 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) | 187 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) |
188 | { | 188 | { |
189 | GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y); | 189 | bool inCache = false; |
190 | GridRegion rinfo = m_RegionInfoCache.Get(scopeID, Util.UIntsToLong((uint)x, (uint)y), out inCache); | ||
191 | if (inCache) | ||
192 | return rinfo; | ||
193 | |||
194 | rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y); | ||
190 | if (rinfo == null) | 195 | if (rinfo == null) |
191 | rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y); | 196 | rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y); |
192 | 197 | ||
198 | m_RegionInfoCache.Cache(rinfo); | ||
193 | return rinfo; | 199 | return rinfo; |
194 | } | 200 | } |
195 | 201 | ||