From fd19601c6ba3b474201e2dde514c7d7c94e74e82 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 26 Apr 2012 16:17:46 +0100 Subject: [PATCH 1/3] Help big boobies to dance (avatar visualParams). May not persist and need more lobe ? --- OpenSim/Framework/AvatarAppearance.cs | 34 +++++++++++++------ .../ClientStack/Linden/UDP/LLClientView.cs | 2 +- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 +- OpenSim/Services/Interfaces/IAvatarService.cs | 22 ++++++++---- 4 files changed, 42 insertions(+), 18 deletions(-) diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 3a0b861ee8..c5d9641da7 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -42,6 +42,8 @@ namespace OpenSim.Framework { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + // this is viewer capabilities and weared things dependent + // should be only used as initial default value ( V1 viewers ) public readonly static int VISUALPARAM_COUNT = 218; public readonly static int TEXTURE_COUNT = 21; @@ -319,19 +321,30 @@ namespace OpenSim.Framework // made. We determine if any of the visual parameters actually // changed to know if the appearance should be saved later bool changed = false; - for (int i = 0; i < AvatarAppearance.VISUALPARAM_COUNT; i++) + + int newsize = visualParams.Length; + + if (newsize != m_visualparams.Length) { - if (visualParams[i] != m_visualparams[i]) + changed = true; + m_visualparams = (byte[])visualParams.Clone(); + } + else + { + + for (int i = 0; i < newsize; i++) { -// DEBUG ON -// m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}", -// i,m_visualparams[i],visualParams[i]); -// DEBUG OFF - m_visualparams[i] = visualParams[i]; - changed = true; + if (visualParams[i] != m_visualparams[i]) + { + // DEBUG ON + // m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}", + // i,m_visualparams[i],visualParams[i]); + // DEBUG OFF + m_visualparams[i] = visualParams[i]; + changed = true; + } } } - // Reset the height if the visual parameters actually changed if (changed) SetHeight(); @@ -389,7 +402,8 @@ namespace OpenSim.Framework } s += "Visual Params: "; - for (uint j = 0; j < AvatarAppearance.VISUALPARAM_COUNT; j++) + // for (uint j = 0; j < AvatarAppearance.VISUALPARAM_COUNT; j++) + for (uint j = 0; j < m_visualparams.Length; j++) s += String.Format("{0},",m_visualparams[j]); s += "\n"; diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 1004be6393..40ebed1ea8 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -3533,7 +3533,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance); // TODO: don't create new blocks if recycling an old packet - avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218]; + avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[visualParams.Length]; avp.ObjectData.TextureEntry = textureEntry; AvatarAppearancePacket.VisualParamBlock avblock = null; diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index b7dc3354c5..d4965ea575 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -354,7 +354,7 @@ namespace OpenSim.Region.Framework.Scenes sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false); sceneObject.Velocity = vel; } - + return true; } diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index cda7113a4f..8412c35db5 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs @@ -162,10 +162,16 @@ namespace OpenSim.Services.Interfaces } // Visual Params - string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT]; - byte[] binary = appearance.VisualParams; + // string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT]; + // byte[] binary = appearance.VisualParams; - for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++) + // for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++) + + + byte[] binary = appearance.VisualParams; + string[] vps = new string[binary.Length]; + + for (int i = 0; i < binary.Length; i++) { vps[i] = binary[i].ToString(); } @@ -265,10 +271,14 @@ namespace OpenSim.Services.Interfaces if (Data.ContainsKey("VisualParams")) { string[] vps = Data["VisualParams"].Split(new char[] {','}); - byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT]; + // byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT]; - for (int i = 0 ; i < vps.Length && i < binary.Length ; i++) - binary[i] = (byte)Convert.ToInt32(vps[i]); + // for (int i = 0 ; i < vps.Length && i < binary.Length ; i++) + byte[] binary = new byte[vps.Length]; + + for (int i = 0; i < vps.Length; i++) + + binary[i] = (byte)Convert.ToInt32(vps[i]); appearance.VisualParams = binary; } From f194c48cd3f403f95752d62206ea8046afff7c10 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 26 Apr 2012 17:42:11 +0100 Subject: [PATCH 2/3] add wearable type PHYSICS --- OpenSim/Framework/AvatarWearable.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs index 8e27596b85..382fc6c457 100644 --- a/OpenSim/Framework/AvatarWearable.cs +++ b/OpenSim/Framework/AvatarWearable.cs @@ -62,10 +62,14 @@ namespace OpenSim.Framework public static readonly int UNDERSHIRT = 10; public static readonly int UNDERPANTS = 11; public static readonly int SKIRT = 12; + + public static readonly int MAX_BASICWEARABLES = 13; + public static readonly int ALPHA = 13; public static readonly int TATTOO = 14; + public static readonly int PHYSICS = 15; - public static readonly int MAX_WEARABLES = 15; + public static readonly int MAX_WEARABLES = 16; public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); public static readonly UUID DEFAULT_BODY_ASSET = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); @@ -219,7 +223,7 @@ namespace OpenSim.Framework { get { - AvatarWearable[] defaultWearables = new AvatarWearable[MAX_WEARABLES]; //should be 15 of these + AvatarWearable[] defaultWearables = new AvatarWearable[MAX_WEARABLES]; for (int i = 0; i < MAX_WEARABLES; i++) { defaultWearables[i] = new AvatarWearable(); @@ -242,10 +246,13 @@ namespace OpenSim.Framework // // Alpha // defaultWearables[ALPHA].Add(DEFAULT_ALPHA_ITEM, DEFAULT_ALPHA_ASSET); - -// // Tattoo -// defaultWearables[TATTOO].Add(DEFAULT_TATTOO_ITEM, DEFAULT_TATTOO_ASSET); - + + // // Tattoo + // defaultWearables[TATTOO].Add(DEFAULT_TATTOO_ITEM, DEFAULT_TATTOO_ASSET); + + // // Physics + // defaultWearables[PHYSICS].Add(DEFAULT_TATTOO_ITEM, DEFAULT_TATTOO_ASSET); + return defaultWearables; } } From fc576df273e41b47ff66b4bb503b9f86ded96cdb Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 26 Apr 2012 18:24:36 +0100 Subject: [PATCH 3/3] revert last add commit --- OpenSim/Framework/AvatarWearable.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs index 382fc6c457..aee295a78a 100644 --- a/OpenSim/Framework/AvatarWearable.cs +++ b/OpenSim/Framework/AvatarWearable.cs @@ -67,9 +67,10 @@ namespace OpenSim.Framework public static readonly int ALPHA = 13; public static readonly int TATTOO = 14; - public static readonly int PHYSICS = 15; +// public static readonly int PHYSICS = 15; - public static readonly int MAX_WEARABLES = 16; + // public static readonly int MAX_WEARABLES = 16; + public static readonly int MAX_WEARABLES = 15; public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); public static readonly UUID DEFAULT_BODY_ASSET = new UUID("66c41e39-38f9-f75a-024e-585989bfab73");