当前位置: 首页>>代码示例>>C#>>正文


C# AvatarWearable.Pack方法代码示例

本文整理汇总了C#中OpenSim.Framework.AvatarWearable.Pack方法的典型用法代码示例。如果您正苦于以下问题:C# AvatarWearable.Pack方法的具体用法?C# AvatarWearable.Pack怎么用?C# AvatarWearable.Pack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenSim.Framework.AvatarWearable的用法示例。


在下文中一共展示了AvatarWearable.Pack方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Pack

        /// <summary>
        /// Create an OSDMap from the appearance data
        /// </summary>
        public OSDMap Pack(EntityTransferContext ctx)
        {
            OSDMap data = new OSDMap();

            data["serial"] = OSD.FromInteger(m_serial);
            data["height"] = OSD.FromReal(m_avatarHeight);

            // Wearables
            //
            // This will send as many or as few wearables as we have, unless a count
            // is given. Used for legacy (pre 0.4) versions.
            int count = ctx.WearablesCount;
            if (ctx.WearablesCount == -1)
                count = m_wearables.Length;
            OSDArray wears = new OSDArray(count);
            for (int i = 0; i < count; i++)
            {
                AvatarWearable dummyWearable = new AvatarWearable();

                if (i < m_wearables.Length)
                    wears.Add(m_wearables[i].Pack());
                else
                    wears.Add(dummyWearable.Pack());
            }
            data["wearables"] = wears;

            // Avatar Textures
            OSDArray textures = new OSDArray(AvatarAppearance.TEXTURE_COUNT);
            for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++)
            {
                if (m_texture.FaceTextures[i] != null)
                    textures.Add(OSD.FromUUID(m_texture.FaceTextures[i].TextureID));
                else
                    textures.Add(OSD.FromUUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE));
            }
            data["textures"] = textures;

            if (m_cacheitems != null)
            {
                OSDArray baked = WearableCacheItem.BakedToOSD(m_cacheitems);
                if (baked != null)
                    data["bakedcache"] = baked;
            }

            // Visual Parameters
            OSDBinary visualparams = new OSDBinary(m_visualparams);
            data["visualparams"] = visualparams;

            lock (m_attachments)
            {
                // Attachments
                OSDArray attachs = new OSDArray(m_attachments.Count);
                foreach (AvatarAttachment attach in GetAttachments())
                    attachs.Add(attach.Pack());
                data["attachments"] = attachs;
            }

            return data;
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:62,代码来源:AvatarAppearance.cs

示例2: CacheWearableData

        public void CacheWearableData(UUID principalID, AvatarWearable cachedWearable)
        {
            Dictionary<string, object> sendData = new Dictionary<string, object>();
            //sendData["SCOPEID"] = scopeID.ToString();
            sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
            sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
            sendData["METHOD"] = "cachewearabledata";

            sendData["WEARABLES"] = OSDParser.SerializeJsonString(cachedWearable.Pack());

            string reqString = WebUtils.BuildQueryString(sendData);
            // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString);
            try
            {
                List<string> serverURIs = m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf("AvatarServerURI");
                foreach (string m_ServerURI in serverURIs)
                {
                    AsynchronousRestObjectRequester.MakeRequest("POST",
                            m_ServerURI,
                            reqString);
                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[AVATAR CONNECTOR]: Exception when contacting avatar server: {0}", e.Message);
            }
        }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:27,代码来源:AvatarServiceConnector.cs


注:本文中的OpenSim.Framework.AvatarWearable.Pack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。