aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-05 20:51:49 +0000
committerJustin Clark-Casey (justincc)2012-01-05 20:51:49 +0000
commit7319ba62dd1791a3dade5b5453e369d955de48a2 (patch)
tree5acaf68647385bc8d3b8318b3a5bfb51ea657d7a /OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
parentMove asset commands from AssetService to AssetServerConnector so that we can ... (diff)
downloadopensim-SC_OLD-7319ba62dd1791a3dade5b5453e369d955de48a2.zip
opensim-SC_OLD-7319ba62dd1791a3dade5b5453e369d955de48a2.tar.gz
opensim-SC_OLD-7319ba62dd1791a3dade5b5453e369d955de48a2.tar.bz2
opensim-SC_OLD-7319ba62dd1791a3dade5b5453e369d955de48a2.tar.xz
Move simulator asset info commands to an optional module from the connector. Make them conform with service side commands.
This stops them appearing twice when Hypergrid is enabled.
Diffstat (limited to 'OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs')
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs45
1 files changed, 2 insertions, 43 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