public void SaveAsset(AssetWearable asset) { if (asset != null) { try { if (asset.Decode()) { File.WriteAllBytes(Path.Combine(saveDir, String.Format("{1}.{0}", asset.AssetType.ToString().ToLower(), asset.WearableType)), asset.AssetData); } else { m_log.WarnFormat("Failed to decode {0} asset {1}", asset.AssetType, asset.AssetID); } } catch (Exception e) { m_log.ErrorFormat("Exception: {0}{1}", e.Message, e.StackTrace); } } }
public void SaveAsset(AssetWearable asset) { if (asset != null) { try { if (asset.Decode()) { File.WriteAllBytes(Path.Combine(saveDir, String.Format("{1}.{0}", asset.AssetType.ToString().ToLower(), asset.WearableType)), asset.AssetData); } else { MainConsole.Instance.Output(String.Format("Failed to decode {0} asset {1}", asset.AssetType, asset.AssetID)); } } catch (Exception e) { MainConsole.Instance.Output(String.Format("Exception: {0}", e.ToString())); } } }
/// <summary> /// Updates the TextureEntry and Appearance Param structures with the data from an asset wearable. /// Called once for each weable asset. /// </summary> /// <param name="wearableAsset"></param> protected void UpdateAgentTextureEntryAndAppearanceParams(AssetWearable wearableAsset) { try { foreach (KeyValuePair<uint, LLUUID> texture in wearableAsset.Textures) { AgentTextureEntry.CreateFace(texture.Key).TextureID = texture.Value; } lock (AgentAppearanceParams) { foreach (KeyValuePair<int, float> kvp in wearableAsset.Parameters) { AgentAppearanceParams[kvp.Key] = kvp.Value; } } } catch (Exception e) { Client.Log(e.ToString() + Environment.NewLine + wearableAsset.AssetDataToString(), Helpers.LogLevel.Error); } }
public void SaveAsset(AssetWearable asset) { if (asset != null) { try { if (asset.Decode()) { File.WriteAllBytes(Path.Combine(saveDir, String.Format("{1}.{0}", asset.AssetType.ToString().ToLower(), asset.WearableType)), asset.AssetData); } else { MainConsole.Instance.Output(String.Format("Failed to decode {0} asset {1}", asset.AssetType, asset.AssetID)); } } catch (Exception e) { MainConsole.Instance.Output(String.Format("Exception: {0}",e.ToString())); } } }