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!)
parent
19ed64b114
commit
bafdac7874
|
@ -237,10 +237,23 @@ namespace OpenSim.Framework.Communications.Cache
|
||||||
SaveAssetToFile(filename, Asset.Data);
|
SaveAssetToFile(filename, Asset.Data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
///Left this in and commented in case there are unforseen issues
|
||||||
|
//private void SaveAssetToFile(string filename, byte[] data)
|
||||||
|
//{
|
||||||
|
// FileStream fs = File.Create(filename);
|
||||||
|
// BinaryWriter bw = new BinaryWriter(fs);
|
||||||
|
// bw.Write(data);
|
||||||
|
// bw.Close();
|
||||||
|
// fs.Close();
|
||||||
|
//}
|
||||||
private void SaveAssetToFile(string filename, byte[] data)
|
private void SaveAssetToFile(string filename, byte[] data)
|
||||||
{
|
{
|
||||||
FileStream fs = File.Create(filename);
|
string assetPath = "UserAssets";
|
||||||
|
if (!Directory.Exists(assetPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(assetPath);
|
||||||
|
}
|
||||||
|
FileStream fs = File.Create(Path.Combine(assetPath, filename));
|
||||||
BinaryWriter bw = new BinaryWriter(fs);
|
BinaryWriter bw = new BinaryWriter(fs);
|
||||||
bw.Write(data);
|
bw.Write(data);
|
||||||
bw.Close();
|
bw.Close();
|
||||||
|
@ -428,4 +441,4 @@ namespace OpenSim.Framework.Communications.Cache
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -536,10 +536,23 @@ namespace OpenSim.Region.Capabilities
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
///Left this in and commented in case there are unforseen issues
|
||||||
|
//private void SaveAssetToFile(string filename, byte[] data)
|
||||||
|
//{
|
||||||
|
// FileStream fs = File.Create(filename);
|
||||||
|
// BinaryWriter bw = new BinaryWriter(fs);
|
||||||
|
// bw.Write(data);
|
||||||
|
// bw.Close();
|
||||||
|
// fs.Close();
|
||||||
|
//}
|
||||||
private void SaveAssetToFile(string filename, byte[] data)
|
private void SaveAssetToFile(string filename, byte[] data)
|
||||||
{
|
{
|
||||||
FileStream fs = File.Create(filename);
|
string assetPath = "UserAssets";
|
||||||
|
if (!Directory.Exists(assetPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(assetPath);
|
||||||
|
}
|
||||||
|
FileStream fs = File.Create(Path.Combine(assetPath, filename));
|
||||||
BinaryWriter bw = new BinaryWriter(fs);
|
BinaryWriter bw = new BinaryWriter(fs);
|
||||||
bw.Write(data);
|
bw.Write(data);
|
||||||
bw.Close();
|
bw.Close();
|
||||||
|
@ -603,10 +616,23 @@ namespace OpenSim.Region.Capabilities
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
///Left this in and commented in case there are unforseen issues
|
||||||
|
//private void SaveAssetToFile(string filename, byte[] data)
|
||||||
|
//{
|
||||||
|
// FileStream fs = File.Create(filename);
|
||||||
|
// BinaryWriter bw = new BinaryWriter(fs);
|
||||||
|
// bw.Write(data);
|
||||||
|
// bw.Close();
|
||||||
|
// fs.Close();
|
||||||
|
//}
|
||||||
private void SaveAssetToFile(string filename, byte[] data)
|
private void SaveAssetToFile(string filename, byte[] data)
|
||||||
{
|
{
|
||||||
FileStream fs = File.Create(filename);
|
string assetPath = "UserAssets";
|
||||||
|
if (!Directory.Exists(assetPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(assetPath);
|
||||||
|
}
|
||||||
|
FileStream fs = File.Create(Path.Combine(assetPath, filename));
|
||||||
BinaryWriter bw = new BinaryWriter(fs);
|
BinaryWriter bw = new BinaryWriter(fs);
|
||||||
bw.Write(data);
|
bw.Write(data);
|
||||||
bw.Close();
|
bw.Close();
|
||||||
|
@ -693,10 +719,23 @@ namespace OpenSim.Region.Capabilities
|
||||||
// XXX Maybe this should be some meaningful error packet
|
// XXX Maybe this should be some meaningful error packet
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
///Left this in and commented in case there are unforseen issues
|
||||||
|
//private void SaveAssetToFile(string filename, byte[] data)
|
||||||
|
//{
|
||||||
|
// FileStream fs = File.Create(filename);
|
||||||
|
// BinaryWriter bw = new BinaryWriter(fs);
|
||||||
|
// bw.Write(data);
|
||||||
|
// bw.Close();
|
||||||
|
// fs.Close();
|
||||||
|
//}
|
||||||
private void SaveAssetToFile(string filename, byte[] data)
|
private void SaveAssetToFile(string filename, byte[] data)
|
||||||
{
|
{
|
||||||
FileStream fs = File.Create(filename);
|
string assetPath = "UserAssets";
|
||||||
|
if (!Directory.Exists(assetPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(assetPath);
|
||||||
|
}
|
||||||
|
FileStream fs = File.Create(Path.Combine(assetPath, filename));
|
||||||
BinaryWriter bw = new BinaryWriter(fs);
|
BinaryWriter bw = new BinaryWriter(fs);
|
||||||
bw.Write(data);
|
bw.Write(data);
|
||||||
bw.Close();
|
bw.Close();
|
||||||
|
@ -704,4 +743,4 @@ namespace OpenSim.Region.Capabilities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue