diff options
author | Mic Bowman | 2010-11-23 16:08:10 -0800 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-11-27 01:14:36 +0000 |
commit | 541a7660e06206c9a9eb2426dee0449afb554921 (patch) | |
tree | 16a99d09acd76e0c53b37300de069e0a4c6a8163 /OpenSim/Region/CoreModules/Avatar | |
parent | Another attempt at fixing failing test for creator info. (diff) | |
download | opensim-SC-541a7660e06206c9a9eb2426dee0449afb554921.zip opensim-SC-541a7660e06206c9a9eb2426dee0449afb554921.tar.gz opensim-SC-541a7660e06206c9a9eb2426dee0449afb554921.tar.bz2 opensim-SC-541a7660e06206c9a9eb2426dee0449afb554921.tar.xz |
Refactor appearance and avatar data sending code. Paritioning the routines into "one-to-many" and "many-to-one" makes it possible to call the right function on presence creation (both child and root) and when a child agent is promoted to root. This brings the total number of appearance sends down to one or two on login.
Cleaned up the avatar update calls in the groups code. Cleaned up
some commented and debugging code, and a few formating fixes.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 0df4585..ab1c206 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -183,7 +183,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
183 | }); | 183 | }); |
184 | } | 184 | } |
185 | 185 | ||
186 | // m_log.WarnFormat("[AVFACTORY]: Complete texture check for {0}",client.AgentId); | 186 | m_log.WarnFormat("[AVFACTORY]: Complete texture check for {0}",client.AgentId); |
187 | } | 187 | } |
188 | 188 | ||
189 | // Process the visual params, this may change height as well | 189 | // Process the visual params, this may change height as well |
@@ -196,12 +196,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
196 | sp.SetHeight(sp.Appearance.AvatarHeight); | 196 | sp.SetHeight(sp.Appearance.AvatarHeight); |
197 | } | 197 | } |
198 | } | 198 | } |
199 | |||
200 | // Send the appearance back to the avatar, not clear that this is needed | ||
201 | sp.ControllingClient.SendAvatarDataImmediate(sp); | ||
202 | // AvatarAppearance avp = sp.Appearance; | ||
203 | // sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes()); | ||
204 | |||
205 | } | 199 | } |
206 | 200 | ||
207 | 201 | ||
@@ -274,21 +268,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
274 | 268 | ||
275 | // Send the appearance to everyone in the scene | 269 | // Send the appearance to everyone in the scene |
276 | sp.SendAppearanceToAllOtherAgents(); | 270 | sp.SendAppearanceToAllOtherAgents(); |
277 | // sp.ControllingClient.SendAvatarDataImmediate(sp); | ||
278 | |||
279 | // Send the appearance back to the avatar | ||
280 | // AvatarAppearance avp = sp.Appearance; | ||
281 | // sp.ControllingClient.SendAppearance(avp.Owner, avp.VisualParams, avp.Texture.GetBytes()); | ||
282 | |||
283 | /* | ||
284 | // this needs to be fixed, the flag should be on scene presence not the region module | ||
285 | // Start the animations if necessary | ||
286 | if (!m_startAnimationSet) | ||
287 | { | ||
288 | sp.Animator.UpdateMovementAnimations(); | ||
289 | m_startAnimationSet = true; | ||
290 | } | ||
291 | */ | ||
292 | } | 271 | } |
293 | 272 | ||
294 | private void HandleAppearanceSave(UUID agentid) | 273 | private void HandleAppearanceSave(UUID agentid) |
@@ -374,6 +353,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
374 | 353 | ||
375 | // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId); | 354 | // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId); |
376 | 355 | ||
356 | // operate on a copy of the appearance so we don't have to lock anything | ||
377 | AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); | 357 | AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); |
378 | 358 | ||
379 | foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) | 359 | foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) |
@@ -388,9 +368,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
388 | SetAppearanceAssets(sp.UUID, ref avatAppearance); | 368 | SetAppearanceAssets(sp.UUID, ref avatAppearance); |
389 | 369 | ||
390 | // could get fancier with the locks here, but in the spirit of "last write wins" | 370 | // could get fancier with the locks here, but in the spirit of "last write wins" |
391 | // this should work correctly | 371 | // this should work correctly, also, we don't need to send the appearance here |
372 | // since the "iswearing" will trigger a new set of visual param and baked texture changes | ||
373 | // when those complete, the new appearance will be sent | ||
392 | sp.Appearance = avatAppearance; | 374 | sp.Appearance = avatAppearance; |
393 | m_scene.AvatarService.SetAppearance(client.AgentId, sp.Appearance); | 375 | QueueAppearanceSave(client.AgentId); |
394 | } | 376 | } |
395 | 377 | ||
396 | private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) | 378 | private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) |