diff options
author | Oren Hurvitz | 2011-07-04 17:54:14 +0300 |
---|---|---|
committer | root | 2011-07-21 20:13:32 +0100 |
commit | f97278610c2ab9717b32b9c64bc5865b0b47dd41 (patch) | |
tree | cafa8ef9b324993a0713ea824dc1e5dd7edff328 /OpenSim/Region/CoreModules/Avatar/AvatarFactory | |
parent | Apply the localID to the Physics actor to prevent null calls later (diff) | |
download | opensim-SC-f97278610c2ab9717b32b9c64bc5865b0b47dd41.zip opensim-SC-f97278610c2ab9717b32b9c64bc5865b0b47dd41.tar.gz opensim-SC-f97278610c2ab9717b32b9c64bc5865b0b47dd41.tar.bz2 opensim-SC-f97278610c2ab9717b32b9c64bc5865b0b47dd41.tar.xz |
Fixed updating avatar appearance
Signed-off-by: root <root@grid00001.t-data.com>
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/AvatarFactory')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 75dbeb8..9037c80 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
210 | changed = sp.Appearance.SetVisualParams(visualParams); | 210 | changed = sp.Appearance.SetVisualParams(visualParams); |
211 | if (sp.Appearance.AvatarHeight > 0) | 211 | if (sp.Appearance.AvatarHeight > 0) |
212 | sp.SetHeight(sp.Appearance.AvatarHeight); | 212 | sp.SetHeight(sp.Appearance.AvatarHeight); |
213 | } | 213 | } |
214 | 214 | ||
215 | // Process the baked texture array | 215 | // Process the baked texture array |
216 | if (textureEntry != null) | 216 | if (textureEntry != null) |
@@ -387,11 +387,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
387 | // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId); | 387 | // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId); |
388 | 388 | ||
389 | // we need to clean out the existing textures | 389 | // we need to clean out the existing textures |
390 | sp.Appearance.ResetAppearance(); | 390 | sp.Appearance.ResetAppearance(); |
391 | 391 | ||
392 | // operate on a copy of the appearance so we don't have to lock anything | 392 | // operate on a copy of the appearance so we don't have to lock anything yet |
393 | AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); | 393 | AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); |
394 | 394 | ||
395 | foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) | 395 | foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) |
396 | { | 396 | { |
397 | if (wear.Type < AvatarWearable.MAX_WEARABLES) | 397 | if (wear.Type < AvatarWearable.MAX_WEARABLES) |
@@ -403,12 +403,19 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
403 | // This could take awhile since it needs to pull inventory | 403 | // This could take awhile since it needs to pull inventory |
404 | SetAppearanceAssets(sp.UUID, ref avatAppearance); | 404 | SetAppearanceAssets(sp.UUID, ref avatAppearance); |
405 | 405 | ||
406 | // could get fancier with the locks here, but in the spirit of "last write wins" | 406 | lock (m_setAppearanceLock) |
407 | // this should work correctly, also, we don't need to send the appearance here | 407 | { |
408 | // since the "iswearing" will trigger a new set of visual param and baked texture changes | 408 | // Update only those fields that we have changed. This is important because the viewer |
409 | // when those complete, the new appearance will be sent | 409 | // often sends AvatarIsWearing and SetAppearance packets at once, and AvatarIsWearing |
410 | sp.Appearance = avatAppearance; | 410 | // shouldn't overwrite the changes made in SetAppearance. |
411 | QueueAppearanceSave(client.AgentId); | 411 | sp.Appearance.Wearables = avatAppearance.Wearables; |
412 | sp.Appearance.Texture = avatAppearance.Texture; | ||
413 | |||
414 | // We don't need to send the appearance here since the "iswearing" will trigger a new set | ||
415 | // of visual param and baked texture changes. When those complete, the new appearance will be sent | ||
416 | |||
417 | QueueAppearanceSave(client.AgentId); | ||
418 | } | ||
412 | } | 419 | } |
413 | 420 | ||
414 | private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) | 421 | private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) |