aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorUbitUmarov2018-01-27 04:32:03 +0000
committerUbitUmarov2018-01-27 04:32:03 +0000
commit13b4ce81991736cf424f598233fc43a5103cc939 (patch)
tree51966348c41505aa88363f18712421b706288654 /OpenSim/Region/ClientStack
parentLet MrOpenSim have simple hardcoded profile (diff)
downloadopensim-SC-13b4ce81991736cf424f598233fc43a5103cc939.zip
opensim-SC-13b4ce81991736cf424f598233fc43a5103cc939.tar.gz
opensim-SC-13b4ce81991736cf424f598233fc43a5103cc939.tar.bz2
opensim-SC-13b4ce81991736cf424f598233fc43a5103cc939.tar.xz
add Cap_FetchLib2 note that this is still local to regions, not using grid as it possible should, but this needs more work, and issue with HG older grids/regions
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs6
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs35
2 files changed, 36 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index bbfe68c..b8d423f 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -1381,7 +1381,7 @@ namespace OpenSim.Region.ClientStack.Linden
1381 StringBuilder lsl = LLSDxmlEncode.Start(); 1381 StringBuilder lsl = LLSDxmlEncode.Start();
1382 1382
1383 if(object_ids.Count == 0) 1383 if(object_ids.Count == 0)
1384 LLSDxmlEncode.AddEmpyMap(lsl); 1384 LLSDxmlEncode.AddEmptyMap(lsl);
1385 else 1385 else
1386 { 1386 {
1387 LLSDxmlEncode.AddMap(lsl); 1387 LLSDxmlEncode.AddMap(lsl);
@@ -1419,7 +1419,7 @@ namespace OpenSim.Region.ClientStack.Linden
1419 StringBuilder lsl = LLSDxmlEncode.Start(512); 1419 StringBuilder lsl = LLSDxmlEncode.Start(512);
1420 1420
1421 if(object_ids.Count == 0) 1421 if(object_ids.Count == 0)
1422 LLSDxmlEncode.AddEmpyMap(lsl); 1422 LLSDxmlEncode.AddEmptyMap(lsl);
1423 else 1423 else
1424 { 1424 {
1425 bool haveone = false; 1425 bool haveone = false;
@@ -1854,7 +1854,7 @@ namespace OpenSim.Region.ClientStack.Linden
1854 StringBuilder lsl = LLSDxmlEncode.Start(names.Count * 256 + 256); 1854 StringBuilder lsl = LLSDxmlEncode.Start(names.Count * 256 + 256);
1855 LLSDxmlEncode.AddMap(lsl); 1855 LLSDxmlEncode.AddMap(lsl);
1856 if(names.Count == 0) 1856 if(names.Count == 0)
1857 LLSDxmlEncode.AddEmpyArray("agents", lsl); 1857 LLSDxmlEncode.AddEmptyArray("agents", lsl);
1858 else 1858 else
1859 { 1859 {
1860 LLSDxmlEncode.AddArray("agents", lsl); 1860 LLSDxmlEncode.AddArray("agents", lsl);
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs b/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs
index e0a11cc..c5cad8e 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/FetchInventory2Module.cs
@@ -51,8 +51,9 @@ namespace OpenSim.Region.ClientStack.Linden
51 private Scene m_scene; 51 private Scene m_scene;
52 52
53 private IInventoryService m_inventoryService; 53 private IInventoryService m_inventoryService;
54 54 private ILibraryService m_LibraryService;
55 private string m_fetchInventory2Url; 55 private string m_fetchInventory2Url;
56 private string m_fetchLib2Url;
56 57
57 #region ISharedRegionModule Members 58 #region ISharedRegionModule Members
58 59
@@ -63,6 +64,7 @@ namespace OpenSim.Region.ClientStack.Linden
63 return; 64 return;
64 65
65 m_fetchInventory2Url = config.GetString("Cap_FetchInventory2", string.Empty); 66 m_fetchInventory2Url = config.GetString("Cap_FetchInventory2", string.Empty);
67 m_fetchLib2Url = config.GetString("Cap_FetchLib2", "localhost");
66 68
67 if (m_fetchInventory2Url != string.Empty) 69 if (m_fetchInventory2Url != string.Empty)
68 Enabled = true; 70 Enabled = true;
@@ -91,7 +93,7 @@ namespace OpenSim.Region.ClientStack.Linden
91 return; 93 return;
92 94
93 m_inventoryService = m_scene.InventoryService; 95 m_inventoryService = m_scene.InventoryService;
94 96 m_LibraryService = m_scene.LibraryService;
95 m_scene.EventManager.OnRegisterCaps += RegisterCaps; 97 m_scene.EventManager.OnRegisterCaps += RegisterCaps;
96 } 98 }
97 99
@@ -111,6 +113,7 @@ namespace OpenSim.Region.ClientStack.Linden
111 private void RegisterCaps(UUID agentID, Caps caps) 113 private void RegisterCaps(UUID agentID, Caps caps)
112 { 114 {
113 RegisterFetchCap(agentID, caps, "FetchInventory2", m_fetchInventory2Url); 115 RegisterFetchCap(agentID, caps, "FetchInventory2", m_fetchInventory2Url);
116 RegisterFetchLibCap(agentID, caps, "FetchLib2", m_fetchLib2Url);
114 } 117 }
115 118
116 private void RegisterFetchCap(UUID agentID, Caps caps, string capName, string url) 119 private void RegisterFetchCap(UUID agentID, Caps caps, string capName, string url)
@@ -140,5 +143,33 @@ namespace OpenSim.Region.ClientStack.Linden
140// "[FETCH INVENTORY2 MODULE]: Registered capability {0} at {1} in region {2} for {3}", 143// "[FETCH INVENTORY2 MODULE]: Registered capability {0} at {1} in region {2} for {3}",
141// capName, capUrl, m_scene.RegionInfo.RegionName, agentID); 144// capName, capUrl, m_scene.RegionInfo.RegionName, agentID);
142 } 145 }
146
147 private void RegisterFetchLibCap(UUID agentID, Caps caps, string capName, string url)
148 {
149 string capUrl;
150
151 if (url == "localhost")
152 {
153 capUrl = "/CAPS/" + UUID.Random();
154
155 FetchLib2Handler fetchHandler = new FetchLib2Handler(m_inventoryService, m_LibraryService, agentID);
156
157 IRequestHandler reqHandler
158 = new RestStreamHandler(
159 "POST", capUrl, fetchHandler.FetchLibRequest, capName, agentID.ToString());
160
161 caps.RegisterHandler(capName, reqHandler);
162 }
163 else
164 {
165 capUrl = url;
166
167 caps.RegisterHandler(capName, capUrl);
168 }
169
170// m_log.DebugFormat(
171// "[FETCH INVENTORY2 MODULE]: Registered capability {0} at {1} in region {2} for {3}",
172// capName, capUrl, m_scene.RegionInfo.RegionName, agentID);
173 }
143 } 174 }
144} 175}