diff options
author | Melanie | 2009-10-06 17:44:59 +0100 |
---|---|---|
committer | Melanie | 2009-10-06 17:44:59 +0100 |
commit | 0374f1b144f3faf35da39e3925e8abd4b2a8bd04 (patch) | |
tree | 456d3d532c70d32564d35fc3cb9bbc81bdf08b2e /OpenSim/Region/CoreModules | |
parent | Make sure that keys exist in arrays before trying to access them. (diff) | |
parent | Corrected words in error message. (diff) | |
download | opensim-SC_OLD-0374f1b144f3faf35da39e3925e8abd4b2a8bd04.zip opensim-SC_OLD-0374f1b144f3faf35da39e3925e8abd4b2a8bd04.tar.gz opensim-SC_OLD-0374f1b144f3faf35da39e3925e8abd4b2a8bd04.tar.bz2 opensim-SC_OLD-0374f1b144f3faf35da39e3925e8abd4b2a8bd04.tar.xz |
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Region/CoreModules')
6 files changed, 37 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs index 5a5ad7e..66ca7c2 100644 --- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs | |||
@@ -178,7 +178,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
178 | { | 178 | { |
179 | if (maximalSize <= 0 || maximalCount <= 0) | 179 | if (maximalSize <= 0 || maximalCount <= 0) |
180 | { | 180 | { |
181 | Log.Info("[ASSET CACHE]: Cenome asset cache is not enabled."); | 181 | //Log.Debug("[ASSET CACHE]: Cenome asset cache is not enabled."); |
182 | m_enabled = false; | 182 | m_enabled = false; |
183 | return; | 183 | return; |
184 | } | 184 | } |
@@ -194,7 +194,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
194 | CnmSynchronizedCache<string, AssetBase>.Synchronized(new CnmMemoryCache<string, AssetBase>( | 194 | CnmSynchronizedCache<string, AssetBase>.Synchronized(new CnmMemoryCache<string, AssetBase>( |
195 | maximalSize, maximalCount, expirationTime)); | 195 | maximalSize, maximalCount, expirationTime)); |
196 | m_enabled = true; | 196 | m_enabled = true; |
197 | Log.InfoFormat( | 197 | Log.DebugFormat( |
198 | "[ASSET CACHE]: Cenome asset cache enabled (MaxSize = {0} bytes, MaxCount = {1}, ExpirationTime = {2})", | 198 | "[ASSET CACHE]: Cenome asset cache enabled (MaxSize = {0} bytes, MaxCount = {1}, ExpirationTime = {2})", |
199 | maximalSize, | 199 | maximalSize, |
200 | maximalCount, | 200 | maximalCount, |
@@ -263,7 +263,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
263 | 263 | ||
264 | if (m_getCount == m_debugEpoch) | 264 | if (m_getCount == m_debugEpoch) |
265 | { | 265 | { |
266 | Log.InfoFormat( | 266 | Log.DebugFormat( |
267 | "[ASSET CACHE]: Cached = {0}, Get = {1}, Hits = {2}%, Size = {3} bytes, Avg. A. Size = {4} bytes", | 267 | "[ASSET CACHE]: Cached = {0}, Get = {1}, Hits = {2}%, Size = {3} bytes, Avg. A. Size = {4} bytes", |
268 | m_cachedCount, | 268 | m_cachedCount, |
269 | m_getCount, | 269 | m_getCount, |
@@ -333,7 +333,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
333 | return; | 333 | return; |
334 | 334 | ||
335 | string name = moduleConfig.GetString("AssetCaching"); | 335 | string name = moduleConfig.GetString("AssetCaching"); |
336 | Log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); | 336 | //Log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); |
337 | 337 | ||
338 | if (name != Name) | 338 | if (name != Name) |
339 | return; | 339 | return; |
@@ -343,14 +343,14 @@ namespace OpenSim.Region.CoreModules.Asset | |||
343 | int maxCount = DefaultMaxCount; | 343 | int maxCount = DefaultMaxCount; |
344 | TimeSpan expirationTime = DefaultExpirationTime; | 344 | TimeSpan expirationTime = DefaultExpirationTime; |
345 | 345 | ||
346 | IConfig assetConfig = source.Configs[ "AssetCache" ]; | 346 | IConfig assetConfig = source.Configs["AssetCache"]; |
347 | if (assetConfig != null) | 347 | if (assetConfig != null) |
348 | { | 348 | { |
349 | // Get optional configurations | 349 | // Get optional configurations |
350 | maxSize = assetConfig.GetLong("MaxSize", DefaultMaxSize); | 350 | maxSize = assetConfig.GetLong("MaxSize", DefaultMaxSize); |
351 | maxCount = assetConfig.GetInt("MaxCount", DefaultMaxCount); | 351 | maxCount = assetConfig.GetInt("MaxCount", DefaultMaxCount); |
352 | expirationTime = | 352 | expirationTime = |
353 | TimeSpan.FromMinutes(assetConfig.GetInt("ExpirationTime", (int) DefaultExpirationTime.TotalMinutes)); | 353 | TimeSpan.FromMinutes(assetConfig.GetInt("ExpirationTime", (int)DefaultExpirationTime.TotalMinutes)); |
354 | 354 | ||
355 | // Debugging purposes only | 355 | // Debugging purposes only |
356 | m_debugEpoch = assetConfig.GetInt("DebugEpoch", 0); | 356 | m_debugEpoch = assetConfig.GetInt("DebugEpoch", 0); |
diff --git a/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs index 2de40d2..0a7e736 100644 --- a/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
66 | if (moduleConfig != null) | 66 | if (moduleConfig != null) |
67 | { | 67 | { |
68 | string name = moduleConfig.GetString("AssetCaching"); | 68 | string name = moduleConfig.GetString("AssetCaching"); |
69 | m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); | 69 | //m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); |
70 | 70 | ||
71 | if (name == Name) | 71 | if (name == Name) |
72 | { | 72 | { |
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index c0bb70c..b81ab41 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -636,11 +636,8 @@ namespace Flotsam.RegionModules.AssetCache | |||
636 | m_log.InfoFormat("[FLOTSAM ASSET CACHE] flotsamcache clearfile - Remove all assets cached on disk"); | 636 | m_log.InfoFormat("[FLOTSAM ASSET CACHE] flotsamcache clearfile - Remove all assets cached on disk"); |
637 | 637 | ||
638 | } | 638 | } |
639 | |||
640 | |||
641 | } | 639 | } |
642 | 640 | ||
643 | #endregion | 641 | #endregion |
644 | |||
645 | } | 642 | } |
646 | } | 643 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs b/OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs index 8d8e0fe..4869f5d 100644 --- a/OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs | |||
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
68 | if (moduleConfig != null) | 68 | if (moduleConfig != null) |
69 | { | 69 | { |
70 | string name = moduleConfig.GetString("AssetCaching"); | 70 | string name = moduleConfig.GetString("AssetCaching"); |
71 | m_log.DebugFormat("[ASSET CACHE] name = {0} (this module's name: {1}). Sync? ", name, Name, m_Cache.IsSynchronized); | 71 | //m_log.DebugFormat("[ASSET CACHE] name = {0} (this module's name: {1}). Sync? ", name, Name, m_Cache.IsSynchronized); |
72 | 72 | ||
73 | if (name == Name) | 73 | if (name == Name) |
74 | { | 74 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index 3ca4882..1c72488 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | |||
@@ -206,6 +206,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
206 | 206 | ||
207 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) | 207 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) |
208 | { | 208 | { |
209 | GridRegion region = null; | ||
210 | |||
211 | // First see if it's a neighbour, even if it isn't on this sim. | ||
212 | // Neighbour data is cached in memory, so this is fast | ||
213 | foreach (RegionCache rcache in m_LocalCache.Values) | ||
214 | { | ||
215 | region = rcache.GetRegionByPosition(x, y); | ||
216 | if (region != null) | ||
217 | { | ||
218 | return region; | ||
219 | } | ||
220 | } | ||
221 | |||
222 | // Then try on this sim (may be a lookup in DB if this is using MySql). | ||
209 | return m_GridService.GetRegionByPosition(scopeID, x, y); | 223 | return m_GridService.GetRegionByPosition(scopeID, x, y); |
210 | } | 224 | } |
211 | 225 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs index 2b336bb..44e850b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs | |||
@@ -29,10 +29,12 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | 31 | ||
32 | using OpenSim.Framework; | ||
32 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
33 | using OpenSim.Services.Interfaces; | 34 | using OpenSim.Services.Interfaces; |
34 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 35 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
35 | 36 | ||
37 | using OpenMetaverse; | ||
36 | using log4net; | 38 | using log4net; |
37 | 39 | ||
38 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | 40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid |
@@ -75,5 +77,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
75 | { | 77 | { |
76 | return new List<GridRegion>(m_neighbours.Values); | 78 | return new List<GridRegion>(m_neighbours.Values); |
77 | } | 79 | } |
80 | |||
81 | public GridRegion GetRegionByPosition(int x, int y) | ||
82 | { | ||
83 | uint xsnap = (uint)(x / Constants.RegionSize) * Constants.RegionSize; | ||
84 | uint ysnap = (uint)(y / Constants.RegionSize) * Constants.RegionSize; | ||
85 | ulong handle = Utils.UIntsToLong(xsnap, ysnap); | ||
86 | |||
87 | if (m_neighbours.ContainsKey(handle)) | ||
88 | return m_neighbours[handle]; | ||
89 | |||
90 | return null; | ||
91 | } | ||
78 | } | 92 | } |
79 | } | 93 | } |