aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps
diff options
context:
space:
mode:
authorDiva Canto2011-05-02 08:48:55 -0700
committerDiva Canto2011-05-02 08:48:55 -0700
commit10180760b741edf22cec23db0ec490669407425f (patch)
tree66f52dc38657213e03470aab161a0d2ffa3fffe6 /OpenSim/Region/ClientStack/Linden/Caps
parentStart to drill down on GetTexture. Read the config and do different things. (diff)
downloadopensim-SC_OLD-10180760b741edf22cec23db0ec490669407425f.zip
opensim-SC_OLD-10180760b741edf22cec23db0ec490669407425f.tar.gz
opensim-SC_OLD-10180760b741edf22cec23db0ec490669407425f.tar.bz2
opensim-SC_OLD-10180760b741edf22cec23db0ec490669407425f.tar.xz
Works!
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs11
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs4
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs27
4 files changed, 34 insertions, 10 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 7a7964e..7945d5e 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -78,7 +78,7 @@ namespace OpenSim.Region.ClientStack.Linden
78 public GetClientDelegate GetClient = null; 78 public GetClientDelegate GetClient = null;
79 79
80 private bool m_persistBakedTextures = false; 80 private bool m_persistBakedTextures = false;
81 private IAssetService m_assetCache; 81 private IAssetService m_assetService;
82 private bool m_dumpAssetsToFile; 82 private bool m_dumpAssetsToFile;
83 private string m_regionName; 83 private string m_regionName;
84 private object m_fetchLock = new Object(); 84 private object m_fetchLock = new Object();
@@ -95,6 +95,9 @@ namespace OpenSim.Region.ClientStack.Linden
95 m_persistBakedTextures = sconfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures); 95 m_persistBakedTextures = sconfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
96 } 96 }
97 97
98 m_assetService = m_Scene.AssetService;
99 m_regionName = m_Scene.RegionInfo.RegionName;
100
98 RegisterHandlers(); 101 RegisterHandlers();
99 102
100 AddNewInventoryItem = m_Scene.AddUploadedInventoryItem; 103 AddNewInventoryItem = m_Scene.AddUploadedInventoryItem;
@@ -347,7 +350,7 @@ namespace OpenSim.Region.ClientStack.Linden
347 asset.Data = data; 350 asset.Data = data;
348 asset.Temporary = true; 351 asset.Temporary = true;
349 asset.Local = !m_persistBakedTextures; // Local assets aren't persisted, non-local are 352 asset.Local = !m_persistBakedTextures; // Local assets aren't persisted, non-local are
350 m_assetCache.Store(asset); 353 m_assetService.Store(asset);
351 } 354 }
352 355
353 /// <summary> 356 /// <summary>
@@ -476,8 +479,8 @@ namespace OpenSim.Region.ClientStack.Linden
476 asset.Data = data; 479 asset.Data = data;
477 if (AddNewAsset != null) 480 if (AddNewAsset != null)
478 AddNewAsset(asset); 481 AddNewAsset(asset);
479 else if (m_assetCache != null) 482 else if (m_assetService != null)
480 m_assetCache.Store(asset); 483 m_assetService.Store(asset);
481 484
482 InventoryItemBase item = new InventoryItemBase(); 485 InventoryItemBase item = new InventoryItemBase();
483 item.Owner = m_HostCapsObj.AgentID; 486 item.Owner = m_HostCapsObj.AgentID;
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs
index 4436d4c..14160ae 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs
@@ -32,6 +32,7 @@ using System.Reflection;
32using log4net; 32using log4net;
33using Nini.Config; 33using Nini.Config;
34using OpenMetaverse; 34using OpenMetaverse;
35using Mono.Addins;
35 36
36using OpenSim.Framework; 37using OpenSim.Framework;
37using OpenSim.Region.Framework; 38using OpenSim.Region.Framework;
@@ -39,9 +40,12 @@ using OpenSim.Region.Framework.Interfaces;
39using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
40using Caps = OpenSim.Framework.Capabilities.Caps; 41using Caps = OpenSim.Framework.Capabilities.Caps;
41 42
43[assembly: Addin("LindenCaps", "0.1")]
44[assembly: AddinDependency("OpenSim", "0.5")]
42namespace OpenSim.Region.ClientStack.Linden 45namespace OpenSim.Region.ClientStack.Linden
43{ 46{
44 47
48 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
45 public class BunchOfCapsModule : INonSharedRegionModule 49 public class BunchOfCapsModule : INonSharedRegionModule
46 { 50 {
47 private static readonly ILog m_log = 51 private static readonly ILog m_log =
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index 4920347..4a8bb53 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ClientStack.Linden
54 public OSDMap body; 54 public OSDMap body;
55 } 55 }
56 56
57 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 57 //[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
58 public class EventQueueGetModule : IEventQueue, IRegionModule 58 public class EventQueueGetModule : IEventQueue, IRegionModule
59 { 59 {
60 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 60 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
index 21041ec..d697f5e 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
@@ -52,13 +52,15 @@ namespace OpenSim.Region.ClientStack.Linden
52{ 52{
53 53
54 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 54 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
55 public class GetTextureModule : ISharedRegionModule 55 public class GetTextureModule : INonSharedRegionModule
56 { 56 {
57 private static readonly ILog m_log = 57 private static readonly ILog m_log =
58 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 58 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
59 private Scene m_scene; 59 private Scene m_scene;
60 private IAssetService m_assetService; 60 private IAssetService m_assetService;
61 61
62 private bool m_Enabled = false;
63
62 // TODO: Change this to a config option 64 // TODO: Change this to a config option
63 const string REDIRECT_URL = null; 65 const string REDIRECT_URL = null;
64 66
@@ -72,11 +74,18 @@ namespace OpenSim.Region.ClientStack.Linden
72 if (config == null) 74 if (config == null)
73 return; 75 return;
74 76
75 m_URL = config.GetString("Cap_GetTexture", "localhost"); 77 m_URL = config.GetString("Cap_GetTexture", string.Empty);
78 // Cap doesn't exist
79 if (m_URL != string.Empty)
80 m_Enabled = true;
76 } 81 }
77 82
78 public void AddRegion(Scene s) 83 public void AddRegion(Scene s)
79 { 84 {
85 if (!m_Enabled)
86 return;
87
88 m_scene = s;
80 } 89 }
81 90
82 public void RemoveRegion(Scene s) 91 public void RemoveRegion(Scene s)
@@ -85,12 +94,15 @@ namespace OpenSim.Region.ClientStack.Linden
85 94
86 public void RegionLoaded(Scene s) 95 public void RegionLoaded(Scene s)
87 { 96 {
97 if (!m_Enabled)
98 return;
99
100 m_assetService = m_scene.RequestModuleInterface<IAssetService>();
101 m_scene.EventManager.OnRegisterCaps += RegisterCaps;
88 } 102 }
89 103
90 public void PostInitialise() 104 public void PostInitialise()
91 { 105 {
92 m_assetService = m_scene.RequestModuleInterface<IAssetService>();
93 m_scene.EventManager.OnRegisterCaps += RegisterCaps;
94 } 106 }
95 107
96 public void Close() { } 108 public void Close() { }
@@ -108,12 +120,17 @@ namespace OpenSim.Region.ClientStack.Linden
108 { 120 {
109 UUID capID = UUID.Random(); 121 UUID capID = UUID.Random();
110 122
111 // m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
112 //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); 123 //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
113 if (m_URL == "localhost") 124 if (m_URL == "localhost")
125 {
126 m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
114 caps.RegisterHandler("GetTexture", new GetTextureHandler("/CAPS/" + capID + "/", m_assetService)); 127 caps.RegisterHandler("GetTexture", new GetTextureHandler("/CAPS/" + capID + "/", m_assetService));
128 }
115 else 129 else
130 {
131 m_log.InfoFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
116 caps.RegisterHandler("GetTexture", m_URL); 132 caps.RegisterHandler("GetTexture", m_URL);
133 }
117 } 134 }
118 135
119 } 136 }