* 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

This commit is contained in:
Justin Clarke Casey
2008-06-19 17:03:59 +00:00
parent 40f32a9271
commit f69f696181
2 changed files with 27 additions and 12 deletions

View File

@@ -2131,14 +2131,31 @@ namespace OpenSim.Region.Environment.Scenes
return avatar;
}
/// <summary>
/// Get the avatar apperance for the given client.
/// </summary>
/// <param name="client"></param>
/// <param name="appearance"></param>
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();
}
}
/// <summary>