mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +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:
@@ -1562,11 +1562,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
assets = doc.GetElementsByTagName("RequiredAsset");
|
||||
foreach (XmlNode asset in assets)
|
||||
{
|
||||
AssetBase rass = new AssetBase();
|
||||
rass.FullID = UUID.Random();
|
||||
rass.Name = GetStringAttribute(asset,"name","");
|
||||
AssetBase rass = new AssetBase(UUID.Random(), GetStringAttribute(asset,"name",""), SByte.Parse(GetStringAttribute(asset,"type","")));
|
||||
rass.Description = GetStringAttribute(asset,"desc","");
|
||||
rass.Type = SByte.Parse(GetStringAttribute(asset,"type",""));
|
||||
rass.Local = Boolean.Parse(GetStringAttribute(asset,"local",""));
|
||||
rass.Temporary = Boolean.Parse(GetStringAttribute(asset,"temporary",""));
|
||||
rass.Data = Convert.FromBase64String(asset.InnerText);
|
||||
|
||||
@@ -261,11 +261,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
modified = (asset != null);
|
||||
created = !modified;
|
||||
|
||||
asset = new AssetBase();
|
||||
asset.FullID = uuid;
|
||||
asset.Name = xml.GetAttribute("name");
|
||||
asset = new AssetBase(uuid, xml.GetAttribute("name"), SByte.Parse(xml.GetAttribute("type")));
|
||||
asset.Description = xml.GetAttribute("desc");
|
||||
asset.Type = SByte.Parse(xml.GetAttribute("type"));
|
||||
asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0;
|
||||
asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0;
|
||||
asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", ""));
|
||||
@@ -341,11 +338,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
modified = (asset != null);
|
||||
created = !modified;
|
||||
|
||||
asset = new AssetBase();
|
||||
asset.FullID = uuid;
|
||||
asset.Name = xml.GetAttribute("name");
|
||||
asset = new AssetBase(uuid, xml.GetAttribute("name"), SByte.Parse(xml.GetAttribute("type")));
|
||||
asset.Description = xml.GetAttribute("desc");
|
||||
asset.Type = SByte.Parse(xml.GetAttribute("type"));
|
||||
asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0;
|
||||
asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0;
|
||||
asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", ""));
|
||||
|
||||
@@ -1869,10 +1869,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
|
||||
// Create AssetBase entity to hold the inlined asset
|
||||
|
||||
asset = new AssetBase(uuid, name);
|
||||
asset = new AssetBase(uuid, name, type);
|
||||
|
||||
asset.Description = desc;
|
||||
asset.Type = type; // type == 0 == texture
|
||||
asset.Local = local;
|
||||
asset.Temporary = temp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user