* 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

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

View File

@ -2131,13 +2131,30 @@ namespace OpenSim.Region.Environment.Scenes
return avatar; 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) public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance)
{ {
appearance = null; // VS needs this line, mono doesn't appearance = null; // VS needs this line, mono doesn't
try
{
if (m_AvatarFactory == null || if (m_AvatarFactory == null ||
!m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) !m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance))
{ {
m_log.Warn("[APPEARANCE]: Appearance not found, creating default"); 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();
} }
} }