From f69f6961815c3916df8e30fbfdb2faa4906cf025 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 19 Jun 2008 17:03:59 +0000 Subject: * Temporary workaround for mantis 1568. If the avatar apperance factory now throws any exception, we will carry on with the default appearance rather than terminating the client login --- OpenSim/Region/Environment/Scenes/Scene.cs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 7e3937c..cfebd14 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2131,14 +2131,31 @@ namespace OpenSim.Region.Environment.Scenes return avatar; } + /// + /// Get the avatar apperance for the given client. + /// + /// + /// public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) { appearance = null; // VS needs this line, mono doesn't - if (m_AvatarFactory == null || - !m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) + + try { - m_log.Warn("[APPEARANCE]: Appearance not found, creating default"); + if (m_AvatarFactory == null || + !m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) + { + m_log.Warn("[APPEARANCE]: Appearance not found, creating default"); + appearance = new AvatarAppearance(); + } } + catch (Exception e) + { + m_log.ErrorFormat( + "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", + client.Name, client.AgentId, e); + appearance = new AvatarAppearance(); + } } /// -- cgit v1.1