コード例 #1
0
 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);
         }
     }
 }
コード例 #2
0
 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()));
         }
     }
 }
コード例 #3
0
        /// <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);
            }
        }
コード例 #4
0
ファイル: Bot.cs プロジェクト: CassieEllen/opensim
 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);
         }
     }
 }
コード例 #5
0
ファイル: PhysicsBot.cs プロジェクト: intari/OpenSimMirror
 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()));
         }
     }
 }