From 4a9ee9f870b53abbc5ba8814c35d694c3fd186a1 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 15 May 2008 20:25:42 +0000 Subject: testing avatar appearance as a user service --- OpenSim/Region/Environment/Scenes/Scene.cs | 22 ++++++++++++---------- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 7 +++++++ 2 files changed, 19 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 51f2942..1964ef4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1797,16 +1797,18 @@ namespace OpenSim.Region.Environment.Scenes protected void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) { - if (m_AvatarFactory == null || - !m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) - { - //not found Appearance - m_log.Warn("[AVATAR DEBUGGING]: Couldn't fetch avatar appearance from factory, please report this to the opensim mantis"); - byte[] visualParams; - AvatarWearable[] wearables; - GetDefaultAvatarAppearance(out wearables, out visualParams); - appearance = new AvatarAppearance(client.AgentId, wearables, visualParams); - } + appearance = CommsManager.UserService.GetUserAppearance(client.AgentId); + + // if (m_AvatarFactory == null || + // !m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) + // { + // //not found Appearance + // m_log.Warn("[AVATAR DEBUGGING]: Couldn't fetch avatar appearance from factory, please report this to the opensim mantis"); + // byte[] visualParams; + // AvatarWearable[] wearables; + // GetDefaultAvatarAppearance(out wearables, out visualParams); + // appearance = new AvatarAppearance(client.AgentId, wearables, visualParams); + // } } /// diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 3815dfb..f8f96a0 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -405,6 +405,8 @@ namespace OpenSim.Region.Environment.Scenes RegisterToEvents(); SetDirectionVectors(); + m_appearance = m_scene.CommsManager.UserService.GetUserAppearance(client.AgentId); + try { m_scene.LandChannel.SendLandUpdate(this, true); @@ -1465,6 +1467,7 @@ namespace OpenSim.Region.Environment.Scenes public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable) { m_appearance.SetWearable(wearableId, wearable); + m_scene.CommsManager.UserService.UpdateUserAppearance(client.AgentId, m_appearance); client.SendWearables(m_appearance.Wearables, m_appearance.Serial++); } @@ -1506,6 +1509,7 @@ namespace OpenSim.Region.Environment.Scenes public void SetAppearance(byte[] texture, List visualParam) { m_appearance.SetAppearance(texture, visualParam); + m_scene.CommsManager.UserService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); SetHeight(m_appearance.AvatarHeight); SendAppearanceToAllOtherAgents(); @@ -1804,6 +1808,7 @@ namespace OpenSim.Region.Environment.Scenes static ScenePresence() { + LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); DefaultTexture = textu.ToBytes(); } @@ -2030,6 +2035,8 @@ namespace OpenSim.Region.Environment.Scenes m_controllingClient = client; m_regionInfo = region; m_scene = scene; + m_appearance = m_scene.CommsManager.UserService.GetUserAppearance(client.AgentId); + RegisterToEvents(); /* -- cgit v1.1