diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 35c59aa..a0ff151 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -31,7 +31,7 @@ using log4net; | |||
31 | using Nini.Config; | 31 | using Nini.Config; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications.Cache; | 34 | |
35 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Services.Interfaces; | 37 | using OpenSim.Services.Interfaces; |
@@ -46,21 +46,16 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
46 | 46 | ||
47 | public bool TryGetAvatarAppearance(UUID avatarId, out AvatarAppearance appearance) | 47 | public bool TryGetAvatarAppearance(UUID avatarId, out AvatarAppearance appearance) |
48 | { | 48 | { |
49 | CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(avatarId); | 49 | AvatarData avatar = m_scene.AvatarService.GetAvatar(avatarId); |
50 | //if ((profile != null) && (profile.RootFolder != null)) | 50 | //if ((profile != null) && (profile.RootFolder != null)) |
51 | if (profile != null) | 51 | if (avatar != null) |
52 | { | 52 | { |
53 | appearance = m_scene.CommsManager.AvatarService.GetUserAppearance(avatarId); | 53 | appearance = avatar.ToAvatarAppearance(avatarId); |
54 | if (appearance != null) | 54 | return true; |
55 | { | ||
56 | //SetAppearanceAssets(profile, ref appearance); | ||
57 | //m_log.DebugFormat("[APPEARANCE]: Found : {0}", appearance.ToString()); | ||
58 | return true; | ||
59 | } | ||
60 | } | 55 | } |
61 | 56 | ||
62 | appearance = CreateDefault(avatarId); | ||
63 | m_log.ErrorFormat("[APPEARANCE]: Appearance not found for {0}, creating default", avatarId); | 57 | m_log.ErrorFormat("[APPEARANCE]: Appearance not found for {0}, creating default", avatarId); |
58 | appearance = CreateDefault(avatarId); | ||
64 | return false; | 59 | return false; |
65 | } | 60 | } |
66 | 61 | ||
@@ -158,21 +153,23 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
158 | /// <param name="e"></param> | 153 | /// <param name="e"></param> |
159 | public void AvatarIsWearing(Object sender, AvatarWearingArgs e) | 154 | public void AvatarIsWearing(Object sender, AvatarWearingArgs e) |
160 | { | 155 | { |
156 | m_log.DebugFormat("[APPEARANCE]: AvatarIsWearing"); | ||
157 | |||
161 | IClientAPI clientView = (IClientAPI)sender; | 158 | IClientAPI clientView = (IClientAPI)sender; |
162 | ScenePresence avatar = m_scene.GetScenePresence(clientView.AgentId); | 159 | ScenePresence sp = m_scene.GetScenePresence(clientView.AgentId); |
163 | 160 | ||
164 | if (avatar == null) | 161 | if (sp == null) |
165 | { | 162 | { |
166 | m_log.Error("[APPEARANCE]: Avatar is child agent, ignoring AvatarIsWearing event"); | 163 | m_log.Error("[APPEARANCE]: Avatar is child agent, ignoring AvatarIsWearing event"); |
167 | return; | 164 | return; |
168 | } | 165 | } |
169 | 166 | ||
170 | AvatarAppearance avatAppearance = null; | 167 | AvatarAppearance avatAppearance = sp.Appearance; |
171 | if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) | 168 | //if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) |
172 | { | 169 | //{ |
173 | m_log.Warn("[APPEARANCE]: We didn't seem to find the appearance, falling back to ScenePresence"); | 170 | // m_log.Warn("[APPEARANCE]: We didn't seem to find the appearance, falling back to ScenePresence"); |
174 | avatAppearance = avatar.Appearance; | 171 | // avatAppearance = sp.Appearance; |
175 | } | 172 | //} |
176 | 173 | ||
177 | //m_log.DebugFormat("[APPEARANCE]: Received wearables for {0}", clientView.Name); | 174 | //m_log.DebugFormat("[APPEARANCE]: Received wearables for {0}", clientView.Name); |
178 | 175 | ||
@@ -184,10 +181,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
184 | } | 181 | } |
185 | } | 182 | } |
186 | 183 | ||
187 | SetAppearanceAssets(avatar.UUID, ref avatAppearance); | 184 | SetAppearanceAssets(sp.UUID, ref avatAppearance); |
185 | AvatarData adata = new AvatarData(avatAppearance); | ||
186 | m_scene.AvatarService.SetAvatar(clientView.AgentId, adata); | ||
188 | 187 | ||
189 | m_scene.CommsManager.AvatarService.UpdateUserAppearance(clientView.AgentId, avatAppearance); | 188 | sp.Appearance = avatAppearance; |
190 | avatar.Appearance = avatAppearance; | ||
191 | } | 189 | } |
192 | 190 | ||
193 | public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) | 191 | public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) |
@@ -198,7 +196,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
198 | 196 | ||
199 | public void UpdateDatabase(UUID user, AvatarAppearance appearance) | 197 | public void UpdateDatabase(UUID user, AvatarAppearance appearance) |
200 | { | 198 | { |
201 | m_scene.CommsManager.AvatarService.UpdateUserAppearance(user, appearance); | 199 | //m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); |
200 | AvatarData adata = new AvatarData(appearance); | ||
201 | m_scene.AvatarService.SetAvatar(user, adata); | ||
202 | } | 202 | } |
203 | 203 | ||
204 | private static byte[] GetDefaultVisualParams() | 204 | private static byte[] GetDefaultVisualParams() |