From e98d8d500f5c0dda6e9ef8b9a0e1bddec8510d1d Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 30 Oct 2010 19:06:47 +0100 Subject: Fix logins and avatar appearance. Contains a Migration. May contain nuts. This will cause visual params to be persisted along with worn items. With this, alpha and tattoo laters will be saved. Multiple layers MAY work, but not tested because I don't use Viewer 2. --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 1 + .../Avatar/AvatarFactory/AvatarFactoryModule.cs | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index d7458b7..4aa19d1 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -5734,6 +5734,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AvatarWearingArgs wearingArgs = new AvatarWearingArgs(); for (int i = 0; i < nowWearing.WearableData.Length; i++) { + m_log.DebugFormat("[XXX]: Wearable type {0} item {1}", nowWearing.WearableData[i].WearableType, nowWearing.WearableData[i].ItemID); AvatarWearingArgs.Wearable wearable = new AvatarWearingArgs.Wearable(nowWearing.WearableData[i].ItemID, nowWearing.WearableData[i].WearableType); diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 6cbd8bd..7f482cb 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -356,17 +356,16 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // m_log.WarnFormat("[AVATAR FACTORY MODULE]: AvatarIsWearing called for {0}",client.AgentId); - AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance); + AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) { if (wear.Type < AvatarWearable.MAX_WEARABLES) - { - AvatarWearable newWearable = new AvatarWearable(wear.ItemID,UUID.Zero); - avatAppearance.SetWearable(wear.Type, newWearable); - } + avatAppearance.Wearables[wear.Type].Add(wear.ItemID,UUID.Zero); } + avatAppearance.GetAssetsFrom(sp.Appearance); + // This could take awhile since it needs to pull inventory SetAppearanceAssets(sp.UUID, ref avatAppearance); @@ -384,6 +383,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { for (int j = 0 ; j < appearance.Wearables[j].Count ; j ++ ) { + if (appearance.Wearables[i][j].ItemID == UUID.Zero) + continue; + + // Ignore ruth's assets + if (appearance.Wearables[i][j].ItemID == AvatarWearable.DefaultWearables[i][0].ItemID) + continue; InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID); baseItem = invService.GetItem(baseItem); -- cgit v1.1 From 623cee1ffc2f2362982242593652904691e80fce Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 30 Oct 2010 19:17:52 +0100 Subject: Move physics actor creation to after SetHeight to try and prevent bowlegginess. Didn't work but is better this way anyway. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 52e7462..8defe68 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -858,17 +858,6 @@ namespace OpenSim.Region.Framework.Scenes } AbsolutePosition = pos; - AddToPhysicalScene(isFlying); - - if (m_forceFly) - { - m_physicsActor.Flying = true; - } - else if (m_flyDisabled) - { - m_physicsActor.Flying = false; - } - if (m_appearance != null) { if (m_appearance.AvatarHeight > 0) @@ -881,6 +870,17 @@ namespace OpenSim.Region.Framework.Scenes m_appearance = new AvatarAppearance(UUID); } + AddToPhysicalScene(isFlying); + + if (m_forceFly) + { + m_physicsActor.Flying = true; + } + else if (m_flyDisabled) + { + m_physicsActor.Flying = false; + } + // Don't send an animation pack here, since on a region crossing this will sometimes cause a flying // avatar to return to the standing position in mid-air. On login it looks like this is being sent // elsewhere anyway -- cgit v1.1