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


C# IClientAPI.SendAgentCachedTexture方法代码示例

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


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

示例1: AgentCachedTexturesRequest

        /// <summary>
        ///   The client wants to know whether we already have baked textures for the given items
        /// </summary>
        /// <param name = "client"></param>
        /// <param name = "args"></param>
        public void AgentCachedTexturesRequest(IClientAPI client, List<CachedAgentArgs> args)
        {
            List<CachedAgentArgs> resp = (from arg in args let cachedID = UUID.Zero select new CachedAgentArgs {ID = cachedID, TextureIndex = arg.TextureIndex}).ToList();

            //AvatarData ad = m_scene.AvatarService.GetAvatar(client.AgentId);
            //Send all with UUID zero for now so that we don't confuse the client about baked textures...

            client.SendAgentCachedTexture(resp);
        }
开发者ID:EnricoNirvana,项目名称:Aurora-Sim,代码行数:14,代码来源:AvatarFactoryModule.cs

示例2: AgentCachedTexturesRequest

        /// <summary>
        /// The client wants to know whether we already have baked textures for the given items
        /// </summary>
        /// <param name="client"></param>
        /// <param name="args"></param>
        public void AgentCachedTexturesRequest(IClientAPI client, List<CachedAgentArgs> args)
        {
            List<CachedAgentArgs> resp = new List<CachedAgentArgs>();

            //AvatarData ad = m_scene.AvatarService.GetAvatar(client.AgentId);
            //Send all with UUID zero for now so that we don't confuse the client about baked textures...
            foreach (CachedAgentArgs arg in args)
            {
                UUID cachedID = UUID.Zero;
                /*if (ad.Data.ContainsKey("CachedWearables"))
                {
                    OSDArray array = (OSDArray)OSDParser.DeserializeJson(ad.Data["CachedWearables"]);
                    AvatarWearable wearable = new AvatarWearable();
                    wearable.MaxItems = 0; //Unlimited items
                    wearable.Unpack(array);
                    cachedID = wearable.GetAsset(arg.ID);
                }*/
                CachedAgentArgs respArgs = new CachedAgentArgs();
                respArgs.ID = cachedID;
                respArgs.TextureIndex = arg.TextureIndex;
                resp.Add(respArgs);
            }

            client.SendAgentCachedTexture(resp);
        }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:30,代码来源:AvatarFactoryModule.cs

示例3: AgentCachedTexturesRequest

        /// <summary>
        ///     The client wants to know whether we already have baked textures for the given items
        /// </summary>
        /// <param name="client"></param>
        /// <param name="args"></param>
        void AgentCachedTexturesRequest (IClientAPI client, List<CachedAgentArgs> args)
        {
            IScenePresence sp = m_scene.GetScenePresence (client.AgentId);
            IAvatarAppearanceModule app = sp.RequestModuleInterface<IAvatarAppearanceModule> ();
            // Look up hashes to make sure that the request is valid

            List<CachedAgentArgs> resp = new List<CachedAgentArgs> ();
            foreach (CachedAgentArgs arg in args) {
                CachedAgentArgs r = new CachedAgentArgs ();
                r.TextureIndex = arg.TextureIndex;
                //V2 changed to send the actual texture index, and not the baked texture index
                int index = arg.TextureIndex >= 5
                    ? arg.TextureIndex
                    : (int)AppearanceManager.BakeTypeToAgentTextureIndex ((BakeType)arg.TextureIndex);

                r.ID = (
                    app.Appearance.Texture.FaceTextures [index] == null ||
                    app.Appearance.WearableCache.Count == 0 ||
                    !app.Appearance.WearableCache.ContainsKey (index.ToString ()) ||
                    app.Appearance.WearableCache [index.ToString ()] != arg.ID
                        ? UUID.Zero
                        : app.Appearance.Texture.FaceTextures [index].TextureID);

                resp.Add (r);
            }

            client.SendAgentCachedTexture (resp);
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:33,代码来源:AvatarFactoryModule.cs

示例4: AgentCachedTextureRequest

        void AgentCachedTextureRequest(IClientAPI client, List<CachedAgentArgs> args)
        {
            ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
            // Look up hashes to make sure that the request is valid
            AvatarAppearance app = sp.Appearance;
            List<CachedAgentArgs> cachedTextures = m_scene.CommsManager.AvatarService.GetCachedBakedTextures(args);
            if (cachedTextures == null || cachedTextures.Count == 0)
            {
                cachedTextures = new List<CachedAgentArgs>();
                foreach (CachedAgentArgs arg in args)
                    cachedTextures.Add(new CachedAgentArgs() { ID = UUID.Zero, TextureIndex = arg.TextureIndex });
            }
            else if (cachedTextures.Count != args.Count)
            {
                //This happens if we don't have all of the textures in the database, 
                //  so we need to re-add UUID.Zero to tell the client to rebake
                foreach (CachedAgentArgs arg in args)
                {
                    if (cachedTextures.Find((a) => a.TextureIndex == arg.TextureIndex) == null)
                        cachedTextures.Add(new CachedAgentArgs() { ID = UUID.Zero, TextureIndex = arg.TextureIndex });
                }
            }

            client.SendAgentCachedTexture(cachedTextures);
        }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:25,代码来源:AvatarFactoryModule.cs


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