diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/AvatarFactory')
-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 144c8d1..22c8937 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 | ||
@@ -160,21 +155,23 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
160 | /// <param name="e"></param> | 155 | /// <param name="e"></param> |
161 | public void AvatarIsWearing(Object sender, AvatarWearingArgs e) | 156 | public void AvatarIsWearing(Object sender, AvatarWearingArgs e) |
162 | { | 157 | { |
158 | m_log.DebugFormat("[APPEARANCE]: AvatarIsWearing"); | ||
159 | |||
163 | IClientAPI clientView = (IClientAPI)sender; | 160 | IClientAPI clientView = (IClientAPI)sender; |
164 | ScenePresence avatar = m_scene.GetScenePresence(clientView.AgentId); | 161 | ScenePresence sp = m_scene.GetScenePresence(clientView.AgentId); |
165 | 162 | ||
166 | if (avatar == null) | 163 | if (sp == null) |
167 | { | 164 | { |
168 | m_log.Error("[APPEARANCE]: Avatar is child agent, ignoring AvatarIsWearing event"); | 165 | m_log.Error("[APPEARANCE]: Avatar is child agent, ignoring AvatarIsWearing event"); |
169 | return; | 166 | return; |
170 | } | 167 | } |
171 | 168 | ||
172 | AvatarAppearance avatAppearance = null; | 169 | AvatarAppearance avatAppearance = sp.Appearance; |
173 | if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) | 170 | //if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) |
174 | { | 171 | //{ |
175 | m_log.Warn("[APPEARANCE]: We didn't seem to find the appearance, falling back to ScenePresence"); | 172 | // m_log.Warn("[APPEARANCE]: We didn't seem to find the appearance, falling back to ScenePresence"); |
176 | avatAppearance = avatar.Appearance; | 173 | // avatAppearance = sp.Appearance; |
177 | } | 174 | //} |
178 | 175 | ||
179 | //m_log.DebugFormat("[APPEARANCE]: Received wearables for {0}", clientView.Name); | 176 | //m_log.DebugFormat("[APPEARANCE]: Received wearables for {0}", clientView.Name); |
180 | 177 | ||
@@ -186,10 +183,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
186 | } | 183 | } |
187 | } | 184 | } |
188 | 185 | ||
189 | SetAppearanceAssets(avatar.UUID, ref avatAppearance); | 186 | SetAppearanceAssets(sp.UUID, ref avatAppearance); |
187 | AvatarData adata = new AvatarData(avatAppearance); | ||
188 | m_scene.AvatarService.SetAvatar(clientView.AgentId, adata); | ||
190 | 189 | ||
191 | m_scene.CommsManager.AvatarService.UpdateUserAppearance(clientView.AgentId, avatAppearance); | 190 | sp.Appearance = avatAppearance; |
192 | avatar.Appearance = avatAppearance; | ||
193 | } | 191 | } |
194 | 192 | ||
195 | public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) | 193 | public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) |
@@ -200,7 +198,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
200 | 198 | ||
201 | public void UpdateDatabase(UUID user, AvatarAppearance appearance) | 199 | public void UpdateDatabase(UUID user, AvatarAppearance appearance) |
202 | { | 200 | { |
203 | m_scene.CommsManager.AvatarService.UpdateUserAppearance(user, appearance); | 201 | //m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); |
202 | AvatarData adata = new AvatarData(appearance); | ||
203 | m_scene.AvatarService.SetAvatar(user, adata); | ||
204 | } | 204 | } |
205 | 205 | ||
206 | private static byte[] GetDefaultVisualParams() | 206 | private static byte[] GetDefaultVisualParams() |