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
---
.../Region/Communications/OGS1/OGS1UserServices.cs | 16 +++++++--------
OpenSim/Region/Environment/Scenes/Scene.cs | 23 +++++++++++++++++++---
2 files changed, 27 insertions(+), 12 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index a31570e..0ffc4b2 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -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;
}
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