Appearance, fixed a timeout bug, and a bug introduced by incorrectly back porting the wearable asset decoder (skin/clothing layer # was being lost)

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@983 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Michael Cortez
2007-02-15 21:39:59 +00:00
parent 1d8b3fdf67
commit 82cfa01f08
5 changed files with 18 additions and 17 deletions

View File

@@ -89,7 +89,7 @@ namespace libsecondlife.AssetSystem
// Update with specified wearables
foreach (InventoryWearable iw in wearables)
{
byte type = ((AssetWearable)iw.Asset).TypeFromAsset;
byte type = (byte)((AssetWearable)iw.Asset).AppearanceLayer;
AgentWearablesData[type].ItemID = iw.ItemID;
AgentWearablesData[type].AssetID = iw.AssetID;
}
@@ -148,9 +148,13 @@ namespace libsecondlife.AssetSystem
try
{
InventoryWearable iw = (InventoryWearable)ib;
byte type = ((AssetWearable)iw.Asset).TypeFromAsset;
AgentWearablesData[type].ItemID = iw.ItemID;
AgentWearablesData[type].AssetID = iw.AssetID;
Client.Log("Retrieving asset for " + iw.Name + "("+iw.AssetID+")", Helpers.LogLevel.Info);
AssetWearable.AppearanceLayerType AppearanceLayer = ((AssetWearable)iw.Asset).AppearanceLayer;
Client.Log("Adding skin/clothing layer for " + AppearanceLayer, Helpers.LogLevel.Info);
AgentWearablesData[(byte)AppearanceLayer].ItemID = iw.ItemID;
AgentWearablesData[(byte)AppearanceLayer].AssetID = iw.AssetID;
}
catch (Exception e)
{

View File

@@ -83,7 +83,7 @@ namespace libsecondlife.AssetSystem
/// <summary>
/// Time to wait for next packet, during an asset download.
/// </summary>
public readonly static int DefaultTimeout = 3000;
public readonly static int DefaultTimeout = 10000;
/// <summary>
/// Event singaling an asset transfer request has completed.

View File

@@ -123,14 +123,14 @@ namespace libsecondlife.AssetSystem
while (!_Completed.WaitOne(900, false))
{
if (SecondsSinceLastPacket > hardTimeout)
if ((hardTimeout != -1) && (SecondsSinceLastPacket > hardTimeout))
{
_StatusMsg += "Timeout Failure - Hard timeout reached (" + SecondsSinceLastPacket + " > " + hardTimeout + ")";
return RequestStatus.Failure;
}
else
{
if (SecondsSinceLastPacket > softTimeout)
if ((softTimeout != -1) && (SecondsSinceLastPacket > softTimeout))
{
_StatusMsg += "Timeout Failure - Soft Timeout ( " + SecondsSinceLastPacket + " > " + softTimeout + ")";
return RequestStatus.Failure;

View File

@@ -57,13 +57,13 @@ namespace libsecondlife.AssetSystem
}
}
private byte _TypeFromAsset = 0;
public byte TypeFromAsset
private AppearanceLayerType _AppearanceLayer = 0;
public AppearanceLayerType AppearanceLayer
{
get { return _TypeFromAsset; }
get { return _AppearanceLayer; }
set
{
_TypeFromAsset = value;
_AppearanceLayer = value;
UpdateAssetData();
}
}
@@ -245,7 +245,7 @@ namespace libsecondlife.AssetSystem
private int _SalePrice = 0;
private enum _WearableType : byte
public enum AppearanceLayerType : byte
{
/// <summary></summary>
Shape = 0,
@@ -405,7 +405,7 @@ namespace libsecondlife.AssetSystem
}
else if (line.StartsWith("type "))
{
Type = (sbyte)(_WearableType)Int32.Parse(line.Substring(5));
AppearanceLayer = (AppearanceLayerType)Int32.Parse(line.Substring(5));
break;
}
}
@@ -482,7 +482,7 @@ namespace libsecondlife.AssetSystem
data += "\n\t\tsale_type\t" + this._Sale_Type;
data += "\n\t\tsale_price\t" + this._Sale_Price;
data += "\n\t}";
data += "\ntype " + this._TypeFromAsset;
data += "\ntype " + this._AppearanceLayer;
data += "\nparameters " + this._Parameters.Count;
foreach (KeyValuePair<int, float> param in this._Parameters)
{

View File

@@ -138,11 +138,9 @@ namespace libsecondlife.InventorySystem
switch (Type)
{
case (sbyte)Asset.AssetType.Clothing:
Console.WriteLine(">> Clothing");
_Asset = new AssetWearable_Clothing(AssetID, request.GetAssetData());
break;
case (sbyte)Asset.AssetType.Bodypart:
Console.WriteLine(">> Bodypart");
_Asset = new AssetWearable_Body(AssetID, request.GetAssetData());
break;
case (sbyte)Asset.AssetType.LSLText:
@@ -155,7 +153,6 @@ namespace libsecondlife.InventorySystem
_Asset = new AssetImage(AssetID, request.GetAssetData());
break;
default:
Console.WriteLine(">> Bodypart");
_Asset = new Asset(AssetID, Type, request.GetAssetData());
break;
}