* 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

@@ -232,17 +232,17 @@ namespace OpenSim.Region.Communications.OGS1
IList parameters = new ArrayList();
parameters.Add(param);
XmlRpcRequest req = new XmlRpcRequest("logout_of_simulator", parameters);
try
{
XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000);
req.Send(m_parent.NetworkServersInfo.UserURL, 3000);
}
catch (WebException)
{
m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff");
}
}
public UserProfileData GetUserProfile(string firstName, string lastName)
{
return GetUserProfile(firstName + " " + lastName);
@@ -556,7 +556,6 @@ namespace OpenSim.Region.Communications.OGS1
param["ownerID"] = friendlistowner.UUID.ToString();
param["friendID"] = friend.UUID.ToString();
IList parameters = new ArrayList();
parameters.Add(param);
@@ -682,10 +681,10 @@ namespace OpenSim.Region.Communications.OGS1
#endregion
/// Appearance
/// TODO: stubs for now to get us to a compiling state gently
public AvatarAppearance GetUserAppearance(LLUUID user)
{
AvatarAppearance appearance = null;
try
{
Hashtable param = new Hashtable();
@@ -696,15 +695,14 @@ namespace OpenSim.Region.Communications.OGS1
XmlRpcRequest req = new XmlRpcRequest("get_avatar_appearance", parameters);
XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 8000);
Hashtable respData = (Hashtable) resp.Value;
return ConvertXMLRPCDataToAvatarAppearance(respData);
}
catch (WebException e)
{
m_log.Warn("[OGS1 USER SERVICES]: Error when trying to fetch Avatar's appearance: " +
e.Message);
// Return Empty list (no friends)
m_log.ErrorFormat("[OGS1 USER SERVICES]: Network problems when trying to fetch appearance for avatar {0}, {1}", user, e.Message);
}
return appearance;
}

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>