mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
Changing the AssetBase constructors to avoid initializing assets with an unknown asset type, and log an error if it ever does happen
This commit is contained in:
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
|
||||
// HGAssetService dispatches it to the remote grid.
|
||||
// It's not pretty, but the best that can be done while
|
||||
// not having a global naming infrastructure
|
||||
AssetBase asset1 = new AssetBase();
|
||||
AssetBase asset1 = new AssetBase(asset.FullID, asset.Name, asset.Type);
|
||||
Copy(asset, asset1);
|
||||
try
|
||||
{
|
||||
|
||||
@@ -627,11 +627,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns></returns>
|
||||
private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data)
|
||||
{
|
||||
AssetBase asset = new AssetBase();
|
||||
asset.Name = name;
|
||||
AssetBase asset = new AssetBase(UUID.Random(), name, assetType);
|
||||
asset.Description = description;
|
||||
asset.Type = assetType;
|
||||
asset.FullID = UUID.Random();
|
||||
asset.Data = (data == null) ? new byte[1] : data;
|
||||
|
||||
return asset;
|
||||
|
||||
@@ -1918,14 +1918,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
|
||||
AssetBase Animasset = new AssetBase();
|
||||
AssetBase Animasset = new AssetBase(UUID.Random(), "Random Animation", (sbyte)AssetType.Animation);
|
||||
Animasset.Data = anim.ToBytes();
|
||||
Animasset.Temporary = true;
|
||||
Animasset.Local = true;
|
||||
Animasset.FullID = UUID.Random();
|
||||
Animasset.ID = Animasset.FullID.ToString();
|
||||
Animasset.Name = "Random Animation";
|
||||
Animasset.Type = (sbyte)AssetType.Animation;
|
||||
Animasset.Description = "dance";
|
||||
//BinBVHAnimation bbvhanim = new BinBVHAnimation(Animasset.Data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user