aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
authorDan Lake2012-02-01 16:25:35 -0800
committerDan Lake2012-02-01 16:25:35 -0800
commitc10193c72b1f029a958f04d2f5d7ee384e693aaa (patch)
tree052ec7e973c15b158310511197affad14eb9c64f /OpenSim/Services/Connectors
parentTrigger event when prims are scheduled for an update. This gives modules earl... (diff)
parentSmall optimization to last commit (diff)
downloadopensim-SC_OLD-c10193c72b1f029a958f04d2f5d7ee384e693aaa.zip
opensim-SC_OLD-c10193c72b1f029a958f04d2f5d7ee384e693aaa.tar.gz
opensim-SC_OLD-c10193c72b1f029a958f04d2f5d7ee384e693aaa.tar.bz2
opensim-SC_OLD-c10193c72b1f029a958f04d2f5d7ee384e693aaa.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs45
-rw-r--r--OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs60
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs4
4 files changed, 67 insertions, 44 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
index d7b2ff8..e4c3eaf 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
@@ -86,11 +86,8 @@ namespace OpenSim.Services.Connectors
86 m_log.Error("[ASSET CONNECTOR]: No Server URI named in section AssetService"); 86 m_log.Error("[ASSET CONNECTOR]: No Server URI named in section AssetService");
87 throw new Exception("Asset connector init error"); 87 throw new Exception("Asset connector init error");
88 } 88 }
89 m_ServerURI = serviceURI;
90 89
91 MainConsole.Instance.Commands.AddCommand("asset", false, "dump asset", 90 m_ServerURI = serviceURI;
92 "dump asset <id> <file>",
93 "dump one cached asset", HandleDumpAsset);
94 } 91 }
95 92
96 protected void SetCache(IImprovedAssetCache cache) 93 protected void SetCache(IImprovedAssetCache cache)
@@ -328,43 +325,5 @@ namespace OpenSim.Services.Connectors
328 } 325 }
329 return false; 326 return false;
330 } 327 }
331
332 private void HandleDumpAsset(string module, string[] args)
333 {
334 if (args.Length != 4)
335 {
336 MainConsole.Instance.Output("Syntax: dump asset <id> <file>");
337 return;
338 }
339
340 UUID assetID;
341
342 if (!UUID.TryParse(args[2], out assetID))
343 {
344 MainConsole.Instance.Output("Invalid asset ID");
345 return;
346 }
347
348 if (m_Cache == null)
349 {
350 MainConsole.Instance.Output("Instance uses no cache");
351 return;
352 }
353
354 AssetBase asset = m_Cache.Get(assetID.ToString());
355
356 if (asset == null)
357 {
358 MainConsole.Instance.Output("Asset not found in cache");
359 return;
360 }
361
362 string fileName = args[3];
363
364 FileStream fs = File.Create(fileName);
365 fs.Write(asset.Data, 0, asset.Data.Length);
366
367 fs.Close();
368 }
369 } 328 }
370} 329} \ No newline at end of file
diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
index 738cc06..aa98b5d 100644
--- a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
+++ b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
@@ -223,5 +223,65 @@ namespace OpenSim.Services.Connectors
223 223
224 } 224 }
225 225
226 public GridUserInfo[] GetGridUserInfo(string[] userIDs)
227 {
228 Dictionary<string, object> sendData = new Dictionary<string, object>();
229 //sendData["SCOPEID"] = scopeID.ToString();
230 sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
231 sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
232 sendData["METHOD"] = "getgriduserinfos";
233
234 sendData["AgentIDs"] = new List<string>(userIDs);
235
236 string reply = string.Empty;
237 string reqString = ServerUtils.BuildQueryString(sendData);
238 //m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString);
239 try
240 {
241 reply = SynchronousRestFormsRequester.MakeRequest("POST",
242 m_ServerURI + "/griduser",
243 reqString);
244 if (reply == null || (reply != null && reply == string.Empty))
245 {
246 m_log.DebugFormat("[GRID USER CONNECTOR]: GetGridUserInfo received null or empty reply");
247 return null;
248 }
249 }
250 catch (Exception e)
251 {
252 m_log.DebugFormat("[GRID USER CONNECTOR]: Exception when contacting grid user server: {0}", e.Message);
253 }
254
255 List<GridUserInfo> rinfos = new List<GridUserInfo>();
256
257 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
258
259 if (replyData != null)
260 {
261 if (replyData.ContainsKey("result") &&
262 (replyData["result"].ToString() == "null" || replyData["result"].ToString() == "Failure"))
263 {
264 return new GridUserInfo[0];
265 }
266
267 Dictionary<string, object>.ValueCollection pinfosList = replyData.Values;
268 //m_log.DebugFormat("[PRESENCE CONNECTOR]: GetAgents returned {0} elements", pinfosList.Count);
269 foreach (object griduser in pinfosList)
270 {
271 if (griduser is Dictionary<string, object>)
272 {
273 GridUserInfo pinfo = new GridUserInfo((Dictionary<string, object>)griduser);
274 rinfos.Add(pinfo);
275 }
276 else
277 m_log.DebugFormat("[GRID USER CONNECTOR]: GetGridUserInfo received invalid response type {0}",
278 griduser.GetType());
279 }
280 }
281 else
282 m_log.DebugFormat("[GRID USER CONNECTOR]: GetGridUserInfo received null response");
283
284 return rinfos.ToArray();
285 }
226 } 286 }
227} 287}
diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs
index c030bca..5c50936 100644
--- a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Services.Connectors
66 m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/"; 66 m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/";
67 } 67 }
68 } 68 }
69 catch (UriFormatException e) 69 catch (UriFormatException)
70 { 70 {
71 m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI); 71 m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI);
72 } 72 }
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
index 678f738..ca1b64f 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
@@ -472,6 +472,10 @@ namespace OpenSim.Services.Connectors.SimianGrid
472 return false; 472 return false;
473 } 473 }
474 474
475 public GridUserInfo[] GetGridUserInfo(string[] userIDs)
476 {
477 return new GridUserInfo[0];
478 }
475 #endregion Helpers 479 #endregion Helpers
476 } 480 }
477} 481}