diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs | |
parent | Add a build script. (diff) | |
download | opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs b/OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs index 5f76ac2..abe9b23 100644 --- a/OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs | |||
@@ -41,7 +41,7 @@ using OpenSim.Services.Interfaces; | |||
41 | namespace OpenSim.Region.CoreModules.Asset | 41 | namespace OpenSim.Region.CoreModules.Asset |
42 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GlynnTuckerAssetCache")] | 43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GlynnTuckerAssetCache")] |
44 | public class GlynnTuckerAssetCache : ISharedRegionModule, IImprovedAssetCache | 44 | public class GlynnTuckerAssetCache : ISharedRegionModule, IAssetCache |
45 | { | 45 | { |
46 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | 47 | LogManager.GetLogger( |
@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
55 | // Instrumentation | 55 | // Instrumentation |
56 | private uint m_DebugRate; | 56 | private uint m_DebugRate; |
57 | 57 | ||
58 | public Type ReplaceableInterface | 58 | public Type ReplaceableInterface |
59 | { | 59 | { |
60 | get { return null; } | 60 | get { return null; } |
61 | } | 61 | } |
@@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
100 | public void AddRegion(Scene scene) | 100 | public void AddRegion(Scene scene) |
101 | { | 101 | { |
102 | if (m_Enabled) | 102 | if (m_Enabled) |
103 | scene.RegisterModuleInterface<IImprovedAssetCache>(this); | 103 | scene.RegisterModuleInterface<IAssetCache>(this); |
104 | } | 104 | } |
105 | 105 | ||
106 | public void RemoveRegion(Scene scene) | 106 | public void RemoveRegion(Scene scene) |
@@ -112,7 +112,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
112 | } | 112 | } |
113 | 113 | ||
114 | //////////////////////////////////////////////////////////// | 114 | //////////////////////////////////////////////////////////// |
115 | // IImprovedAssetCache | 115 | // IAssetCache |
116 | // | 116 | // |
117 | 117 | ||
118 | public bool Check(string id) | 118 | public bool Check(string id) |
@@ -126,14 +126,20 @@ namespace OpenSim.Region.CoreModules.Asset | |||
126 | m_Cache.AddOrUpdate(asset.ID, asset); | 126 | m_Cache.AddOrUpdate(asset.ID, asset); |
127 | } | 127 | } |
128 | 128 | ||
129 | public AssetBase Get(string id) | 129 | public void CacheNegative(string id) |
130 | { | 130 | { |
131 | Object asset = null; | 131 | // We don't do negative caching |
132 | m_Cache.TryGet(id, out asset); | 132 | } |
133 | |||
134 | public bool Get(string id, out AssetBase asset) | ||
135 | { | ||
136 | Object a = null; | ||
137 | m_Cache.TryGet(id, out a); | ||
133 | 138 | ||
134 | Debug(asset); | 139 | Debug(a); |
135 | 140 | ||
136 | return (AssetBase)asset; | 141 | asset = (AssetBase)a; |
142 | return true; | ||
137 | } | 143 | } |
138 | 144 | ||
139 | public void Expire(string id) | 145 | public void Expire(string id) |