diff options
author | Justin Clarke Casey | 2008-09-12 21:32:45 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-09-12 21:32:45 +0000 |
commit | 9cdd9e215ccb250992b82e229a9930c2648f827c (patch) | |
tree | 64ca8b6035a26ccee4e3bdf92878ebefb95d4a1d /OpenSim | |
parent | * minor: spelling mistake and message tidying on Migration messages (diff) | |
download | opensim-SC_OLD-9cdd9e215ccb250992b82e229a9930c2648f827c.zip opensim-SC_OLD-9cdd9e215ccb250992b82e229a9930c2648f827c.tar.gz opensim-SC_OLD-9cdd9e215ccb250992b82e229a9930c2648f827c.tar.bz2 opensim-SC_OLD-9cdd9e215ccb250992b82e229a9930c2648f827c.tar.xz |
* Patch http://opensimulator.org/mantis/view.php?id=2172
* Patch attached that adds the check for uninitialized appearance when inventory items are received and processed. Also attempts to ensure that appearance is initialized even
when the profile cache has not been built.
* This will not fix the race condition, but should at least remove the unhandled exception that is being reported in Mantis 0002126.
* Thanks cmickeyb
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 17 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 22 |
2 files changed, 26 insertions, 13 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 5b58804..da76ab8 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2382,24 +2382,23 @@ namespace OpenSim.Region.Environment.Scenes | |||
2382 | /// <param name="appearance"></param> | 2382 | /// <param name="appearance"></param> |
2383 | public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) | 2383 | public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) |
2384 | { | 2384 | { |
2385 | appearance = null; // VS needs this line, mono doesn't | 2385 | appearance = new AvatarAppearance(); |
2386 | 2386 | ||
2387 | try | 2387 | try |
2388 | { | 2388 | { |
2389 | if (m_AvatarFactory == null || | 2389 | if (m_AvatarFactory != null) |
2390 | !m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) | ||
2391 | { | 2390 | { |
2392 | m_log.Warn("[APPEARANCE]: Appearance not found, creating default"); | 2391 | if (m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) |
2393 | appearance = new AvatarAppearance(); | 2392 | return; |
2394 | } | 2393 | } |
2395 | } | 2394 | } |
2396 | catch (Exception e) | 2395 | catch (Exception e) |
2397 | { | 2396 | { |
2398 | m_log.ErrorFormat( | 2397 | m_log.ErrorFormat("[APPEARANCE]: Problem fetching appearance for avatar {0}, {1}, {2}", |
2399 | "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", | 2398 | client.Name, client.AgentId, e.ToString()); |
2400 | client.Name, client.AgentId, e); | ||
2401 | appearance = new AvatarAppearance(); | ||
2402 | } | 2399 | } |
2400 | m_log.Warn("[APPEARANCE]: Appearance not found, returning default"); | ||
2401 | |||
2403 | } | 2402 | } |
2404 | 2403 | ||
2405 | /// <summary> | 2404 | /// <summary> |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index abda63e..ff043fb 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -2911,19 +2911,33 @@ namespace OpenSim.Region.Environment.Scenes | |||
2911 | 2911 | ||
2912 | private void ItemReceived(UUID itemID) | 2912 | private void ItemReceived(UUID itemID) |
2913 | { | 2913 | { |
2914 | if (null == m_appearance) | ||
2915 | { | ||
2916 | m_log.Warn("[ATTACHMENT] Appearance has not been initialized"); | ||
2917 | return; | ||
2918 | } | ||
2919 | |||
2914 | int attachpoint = m_appearance.GetAttachpoint(itemID); | 2920 | int attachpoint = m_appearance.GetAttachpoint(itemID); |
2915 | if (attachpoint == 0) | 2921 | if (attachpoint == 0) |
2916 | return; | 2922 | return; |
2917 | 2923 | ||
2918 | UUID asset = m_appearance.GetAttachedAsset(attachpoint); | 2924 | UUID asset = m_appearance.GetAttachedAsset(attachpoint); |
2919 | if (asset == UUID.Zero) // We have just logged in | 2925 | if (UUID.Zero == asset) // We have just logged in |
2920 | { | 2926 | { |
2921 | m_log.InfoFormat("[ATTACHMENT] Rez attachment {0}", | 2927 | m_log.InfoFormat("[ATTACHMENT] Rez attachment {0}", |
2922 | itemID.ToString()); | 2928 | itemID.ToString()); |
2923 | 2929 | ||
2924 | // Rez from inventory | 2930 | try |
2925 | m_scene.RezSingleAttachment(ControllingClient, itemID, | 2931 | { |
2926 | (uint)attachpoint, 0, 0); | 2932 | // Rez from inventory |
2933 | m_scene.RezSingleAttachment(ControllingClient, itemID, | ||
2934 | (uint)attachpoint, 0, 0); | ||
2935 | } | ||
2936 | catch (Exception e) | ||
2937 | { | ||
2938 | m_log.ErrorFormat("[ATTACHMENT] Unable to rez attachment: {0}", e.ToString()); | ||
2939 | } | ||
2940 | |||
2927 | return; | 2941 | return; |
2928 | } | 2942 | } |
2929 | 2943 | ||