diff options
author | Brian McBee | 2008-01-09 03:57:53 +0000 |
---|---|---|
committer | Brian McBee | 2008-01-09 03:57:53 +0000 |
commit | bafdac787408dcffb4ba28be159d44896cfe33b6 (patch) | |
tree | 219f4509761ca57c9b9a44b2ffd0b0a0e083f6f9 /OpenSim/Framework | |
parent | Third part of CharlieO's library rework. We now have library organization! Th... (diff) | |
download | opensim-SC_OLD-bafdac787408dcffb4ba28be159d44896cfe33b6.zip opensim-SC_OLD-bafdac787408dcffb4ba28be159d44896cfe33b6.tar.gz opensim-SC_OLD-bafdac787408dcffb4ba28be159d44896cfe33b6.tar.bz2 opensim-SC_OLD-bafdac787408dcffb4ba28be159d44896cfe33b6.tar.xz |
dump_assets_to_file=true will now cause the asset to go into a UserAssets subdirectory of bin instead of cluttering up your bin directory (Thanks CharlieO!)
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetTransactions.cs | 19 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Capabilities/Caps.cs | 53 |
2 files changed, 62 insertions, 10 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs index 8aa567c..dd1f8ba 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs | |||
@@ -237,10 +237,23 @@ namespace OpenSim.Framework.Communications.Cache | |||
237 | SaveAssetToFile(filename, Asset.Data); | 237 | SaveAssetToFile(filename, Asset.Data); |
238 | } | 238 | } |
239 | } | 239 | } |
240 | 240 | ///Left this in and commented in case there are unforseen issues | |
241 | //private void SaveAssetToFile(string filename, byte[] data) | ||
242 | //{ | ||
243 | // FileStream fs = File.Create(filename); | ||
244 | // BinaryWriter bw = new BinaryWriter(fs); | ||
245 | // bw.Write(data); | ||
246 | // bw.Close(); | ||
247 | // fs.Close(); | ||
248 | //} | ||
241 | private void SaveAssetToFile(string filename, byte[] data) | 249 | private void SaveAssetToFile(string filename, byte[] data) |
242 | { | 250 | { |
243 | FileStream fs = File.Create(filename); | 251 | string assetPath = "UserAssets"; |
252 | if (!Directory.Exists(assetPath)) | ||
253 | { | ||
254 | Directory.CreateDirectory(assetPath); | ||
255 | } | ||
256 | FileStream fs = File.Create(Path.Combine(assetPath, filename)); | ||
244 | BinaryWriter bw = new BinaryWriter(fs); | 257 | BinaryWriter bw = new BinaryWriter(fs); |
245 | bw.Write(data); | 258 | bw.Write(data); |
246 | bw.Close(); | 259 | bw.Close(); |
@@ -428,4 +441,4 @@ namespace OpenSim.Framework.Communications.Cache | |||
428 | 441 | ||
429 | #endregion | 442 | #endregion |
430 | } | 443 | } |
431 | } \ No newline at end of file | 444 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 4b42046..74d8125 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs | |||
@@ -536,10 +536,23 @@ namespace OpenSim.Region.Capabilities | |||
536 | 536 | ||
537 | return res; | 537 | return res; |
538 | } | 538 | } |
539 | 539 | ///Left this in and commented in case there are unforseen issues | |
540 | //private void SaveAssetToFile(string filename, byte[] data) | ||
541 | //{ | ||
542 | // FileStream fs = File.Create(filename); | ||
543 | // BinaryWriter bw = new BinaryWriter(fs); | ||
544 | // bw.Write(data); | ||
545 | // bw.Close(); | ||
546 | // fs.Close(); | ||
547 | //} | ||
540 | private void SaveAssetToFile(string filename, byte[] data) | 548 | private void SaveAssetToFile(string filename, byte[] data) |
541 | { | 549 | { |
542 | FileStream fs = File.Create(filename); | 550 | string assetPath = "UserAssets"; |
551 | if (!Directory.Exists(assetPath)) | ||
552 | { | ||
553 | Directory.CreateDirectory(assetPath); | ||
554 | } | ||
555 | FileStream fs = File.Create(Path.Combine(assetPath, filename)); | ||
543 | BinaryWriter bw = new BinaryWriter(fs); | 556 | BinaryWriter bw = new BinaryWriter(fs); |
544 | bw.Write(data); | 557 | bw.Write(data); |
545 | bw.Close(); | 558 | bw.Close(); |
@@ -603,10 +616,23 @@ namespace OpenSim.Region.Capabilities | |||
603 | 616 | ||
604 | return res; | 617 | return res; |
605 | } | 618 | } |
606 | 619 | ///Left this in and commented in case there are unforseen issues | |
620 | //private void SaveAssetToFile(string filename, byte[] data) | ||
621 | //{ | ||
622 | // FileStream fs = File.Create(filename); | ||
623 | // BinaryWriter bw = new BinaryWriter(fs); | ||
624 | // bw.Write(data); | ||
625 | // bw.Close(); | ||
626 | // fs.Close(); | ||
627 | //} | ||
607 | private void SaveAssetToFile(string filename, byte[] data) | 628 | private void SaveAssetToFile(string filename, byte[] data) |
608 | { | 629 | { |
609 | FileStream fs = File.Create(filename); | 630 | string assetPath = "UserAssets"; |
631 | if (!Directory.Exists(assetPath)) | ||
632 | { | ||
633 | Directory.CreateDirectory(assetPath); | ||
634 | } | ||
635 | FileStream fs = File.Create(Path.Combine(assetPath, filename)); | ||
610 | BinaryWriter bw = new BinaryWriter(fs); | 636 | BinaryWriter bw = new BinaryWriter(fs); |
611 | bw.Write(data); | 637 | bw.Write(data); |
612 | bw.Close(); | 638 | bw.Close(); |
@@ -693,10 +719,23 @@ namespace OpenSim.Region.Capabilities | |||
693 | // XXX Maybe this should be some meaningful error packet | 719 | // XXX Maybe this should be some meaningful error packet |
694 | return null; | 720 | return null; |
695 | } | 721 | } |
696 | 722 | ///Left this in and commented in case there are unforseen issues | |
723 | //private void SaveAssetToFile(string filename, byte[] data) | ||
724 | //{ | ||
725 | // FileStream fs = File.Create(filename); | ||
726 | // BinaryWriter bw = new BinaryWriter(fs); | ||
727 | // bw.Write(data); | ||
728 | // bw.Close(); | ||
729 | // fs.Close(); | ||
730 | //} | ||
697 | private void SaveAssetToFile(string filename, byte[] data) | 731 | private void SaveAssetToFile(string filename, byte[] data) |
698 | { | 732 | { |
699 | FileStream fs = File.Create(filename); | 733 | string assetPath = "UserAssets"; |
734 | if (!Directory.Exists(assetPath)) | ||
735 | { | ||
736 | Directory.CreateDirectory(assetPath); | ||
737 | } | ||
738 | FileStream fs = File.Create(Path.Combine(assetPath, filename)); | ||
700 | BinaryWriter bw = new BinaryWriter(fs); | 739 | BinaryWriter bw = new BinaryWriter(fs); |
701 | bw.Write(data); | 740 | bw.Write(data); |
702 | bw.Close(); | 741 | bw.Close(); |
@@ -704,4 +743,4 @@ namespace OpenSim.Region.Capabilities | |||
704 | } | 743 | } |
705 | } | 744 | } |
706 | } | 745 | } |
707 | } \ No newline at end of file | 746 | } |