diff options
author | BlueWall | 2012-01-05 17:54:51 -0500 |
---|---|---|
committer | BlueWall | 2012-01-05 17:54:51 -0500 |
commit | f252161941f10e1d303b372b946945fb6b548019 (patch) | |
tree | 6037b7ddcb488dc17258f60cfb52756b86f718d6 /OpenSim/Services/Connectors/Asset | |
parent | Merge branch 'new_modules' (diff) | |
parent | Add a "j2k decode" region console command that allows a manual request for a ... (diff) | |
download | opensim-SC_OLD-f252161941f10e1d303b372b946945fb6b548019.zip opensim-SC_OLD-f252161941f10e1d303b372b946945fb6b548019.tar.gz opensim-SC_OLD-f252161941f10e1d303b372b946945fb6b548019.tar.bz2 opensim-SC_OLD-f252161941f10e1d303b372b946945fb6b548019.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Services/Connectors/Asset')
-rw-r--r-- | OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 45 |
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 |