aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorJohn Hurliman2009-11-05 13:10:58 -0800
committerJohn Hurliman2009-11-05 13:10:58 -0800
commitafef1ac191d32e9c1514c294b17e404b1d4ae217 (patch)
treec390ef81c9c30922c2e95e32844832919884fd9c /OpenSim/Region/Framework/Scenes
parentApplying #4332, optional packet statistics logging (diff)
downloadopensim-SC_OLD-afef1ac191d32e9c1514c294b17e404b1d4ae217.zip
opensim-SC_OLD-afef1ac191d32e9c1514c294b17e404b1d4ae217.tar.gz
opensim-SC_OLD-afef1ac191d32e9c1514c294b17e404b1d4ae217.tar.bz2
opensim-SC_OLD-afef1ac191d32e9c1514c294b17e404b1d4ae217.tar.xz
Changing the AssetBase constructors to avoid initializing assets with an unknown asset type, and log an error if it ever does happen
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs6
3 files changed, 3 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
index 7a66d23..ec50598 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
118 // HGAssetService dispatches it to the remote grid. 118 // HGAssetService dispatches it to the remote grid.
119 // It's not pretty, but the best that can be done while 119 // It's not pretty, but the best that can be done while
120 // not having a global naming infrastructure 120 // not having a global naming infrastructure
121 AssetBase asset1 = new AssetBase(); 121 AssetBase asset1 = new AssetBase(asset.FullID, asset.Name, asset.Type);
122 Copy(asset, asset1); 122 Copy(asset, asset1);
123 try 123 try
124 { 124 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 00743fc..6b2c7d3 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -627,11 +627,8 @@ namespace OpenSim.Region.Framework.Scenes
627 /// <returns></returns> 627 /// <returns></returns>
628 private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data) 628 private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data)
629 { 629 {
630 AssetBase asset = new AssetBase(); 630 AssetBase asset = new AssetBase(UUID.Random(), name, assetType);
631 asset.Name = name;
632 asset.Description = description; 631 asset.Description = description;
633 asset.Type = assetType;
634 asset.FullID = UUID.Random();
635 asset.Data = (data == null) ? new byte[1] : data; 632 asset.Data = (data == null) ? new byte[1] : data;
636 633
637 return asset; 634 return asset;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 1e9201e..17026e5 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1918,14 +1918,10 @@ namespace OpenSim.Region.Framework.Scenes
1918 } 1918 }
1919 1919
1920 1920
1921 AssetBase Animasset = new AssetBase(); 1921 AssetBase Animasset = new AssetBase(UUID.Random(), "Random Animation", (sbyte)AssetType.Animation);
1922 Animasset.Data = anim.ToBytes(); 1922 Animasset.Data = anim.ToBytes();
1923 Animasset.Temporary = true; 1923 Animasset.Temporary = true;
1924 Animasset.Local = true; 1924 Animasset.Local = true;
1925 Animasset.FullID = UUID.Random();
1926 Animasset.ID = Animasset.FullID.ToString();
1927 Animasset.Name = "Random Animation";
1928 Animasset.Type = (sbyte)AssetType.Animation;
1929 Animasset.Description = "dance"; 1925 Animasset.Description = "dance";
1930 //BinBVHAnimation bbvhanim = new BinBVHAnimation(Animasset.Data); 1926 //BinBVHAnimation bbvhanim = new BinBVHAnimation(Animasset.Data);
1931 1927