From 395903d58fceb98d467daa49aaa277f54ea3f230 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 14 Aug 2014 02:36:50 +0100 Subject: [PATCH] *DANGER* dont send baked textures assets to Neighbours. Possible we could send a lot less --- OpenSim/Framework/AvatarAppearance.cs | 13 ++++++++++--- .../EntityTransfer/EntityTransferModule.cs | 8 ++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 25ae0ecd22..3874c47147 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -183,11 +183,16 @@ namespace OpenSim.Framework m_attachments = new Dictionary>(); } - public AvatarAppearance(AvatarAppearance appearance): this(appearance, true) + public AvatarAppearance(AvatarAppearance appearance): this(appearance, true,true) { } public AvatarAppearance(AvatarAppearance appearance, bool copyWearables) + : this(appearance, copyWearables, true) + { + } + + public AvatarAppearance(AvatarAppearance appearance, bool copyWearables, bool copyBaked) { // m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance"); @@ -221,8 +226,10 @@ namespace OpenSim.Framework { byte[] tbytes = appearance.Texture.GetBytes(); m_texture = new Primitive.TextureEntry(tbytes,0,tbytes.Length); - if (appearance.m_cacheitems != null) - m_cacheitems = (WearableCacheItem[]) appearance.m_cacheitems.Clone(); + if (copyBaked && appearance.m_cacheitems != null) + m_cacheitems = (WearableCacheItem[])appearance.m_cacheitems.Clone(); + else + m_cacheitems = null; } m_visualparams = null; diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index af269987fb..71148eaeaa 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1832,7 +1832,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer agent.InventoryFolder = UUID.Zero; agent.startpos = new Vector3(128, 128, 70); agent.child = true; - agent.Appearance = sp.Appearance; + + //agent.Appearance = sp.Appearance; + agent.Appearance = new AvatarAppearance(sp.Appearance, true, false); // guess this should be a lot less + agent.CapsPath = CapsUtil.GetRandomCapsObjectPath(); agent.ChildrenCapSeeds = new Dictionary(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID)); @@ -1947,7 +1950,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer agent.InventoryFolder = UUID.Zero; agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour); agent.child = true; - agent.Appearance = sp.Appearance; + // agent.Appearance = sp.Appearance; + agent.Appearance = new AvatarAppearance(sp.Appearance, true, false); // guess this should be a lot less if (currentAgentCircuit != null) { agent.ServiceURLs = currentAgentCircuit.ServiceURLs;