From 94783e937746d64396ad57271e0e6f3c9432a2d5 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 1 Oct 2009 09:17:22 -0700
Subject: Catch and print exceptions in MessagingService, to diagnose
mysterious disappearances of the Messaging server.
---
.../Grid/MessagingServer.Modules/MessageService.cs | 86 +++++++++++++---------
1 file changed, 51 insertions(+), 35 deletions(-)
(limited to 'OpenSim/Grid')
diff --git a/OpenSim/Grid/MessagingServer.Modules/MessageService.cs b/OpenSim/Grid/MessagingServer.Modules/MessageService.cs
index 6f2c1ba..df5eaab 100644
--- a/OpenSim/Grid/MessagingServer.Modules/MessageService.cs
+++ b/OpenSim/Grid/MessagingServer.Modules/MessageService.cs
@@ -324,44 +324,53 @@ namespace OpenSim.Grid.MessagingServer.Modules
///
public XmlRpcResponse UserLoggedOn(XmlRpcRequest request, IPEndPoint remoteClient)
{
- Hashtable requestData = (Hashtable)request.Params[0];
+ try
+ {
+ Hashtable requestData = (Hashtable)request.Params[0];
+
+ AgentCircuitData agentData = new AgentCircuitData();
+ agentData.SessionID = new UUID((string)requestData["sessionid"]);
+ agentData.SecureSessionID = new UUID((string)requestData["secure_session_id"]);
+ agentData.firstname = (string)requestData["firstname"];
+ agentData.lastname = (string)requestData["lastname"];
+ agentData.AgentID = new UUID((string)requestData["agentid"]);
+ agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
+ agentData.CapsPath = (string)requestData["caps_path"];
+
+ if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
+ {
+ agentData.child = true;
+ }
+ else
+ {
+ agentData.startpos =
+ new Vector3(Convert.ToSingle(requestData["positionx"]),
+ Convert.ToSingle(requestData["positiony"]),
+ Convert.ToSingle(requestData["positionz"]));
+ agentData.child = false;
+ }
- AgentCircuitData agentData = new AgentCircuitData();
- agentData.SessionID = new UUID((string)requestData["sessionid"]);
- agentData.SecureSessionID = new UUID((string)requestData["secure_session_id"]);
- agentData.firstname = (string)requestData["firstname"];
- agentData.lastname = (string)requestData["lastname"];
- agentData.AgentID = new UUID((string)requestData["agentid"]);
- agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
- agentData.CapsPath = (string)requestData["caps_path"];
+ ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);
+
+ m_log.InfoFormat("[LOGON]: User {0} {1} logged into region {2} as {3} agent, building indexes for user",
+ agentData.firstname, agentData.lastname, regionHandle, agentData.child ? "child" : "root");
+
+ UserPresenceData up = new UserPresenceData();
+ up.agentData = agentData;
+ up.friendData = GetUserFriendList(agentData.AgentID);
+ up.regionData = m_regionModule.GetRegionInfo(regionHandle);
+ up.OnlineYN = true;
+ up.lookupUserRegionYN = false;
+ ProcessFriendListSubscriptions(up);
- if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
- {
- agentData.child = true;
}
- else
+ catch (Exception e)
{
- agentData.startpos =
- new Vector3(Convert.ToSingle(requestData["positionx"]),
- Convert.ToSingle(requestData["positiony"]),
- Convert.ToSingle(requestData["positionz"]));
- agentData.child = false;
+ m_log.WarnFormat("[LOGIN]: Exception on UserLoggedOn: {0}", e);
}
- ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);
-
- m_log.InfoFormat("[LOGON]: User {0} {1} logged into region {2} as {3} agent, building indexes for user",
- agentData.firstname, agentData.lastname, regionHandle, agentData.child ? "child" : "root");
-
- UserPresenceData up = new UserPresenceData();
- up.agentData = agentData;
- up.friendData = GetUserFriendList(agentData.AgentID);
- up.regionData = m_regionModule.GetRegionInfo(regionHandle);
- up.OnlineYN = true;
- up.lookupUserRegionYN = false;
- ProcessFriendListSubscriptions(up);
-
return new XmlRpcResponse();
+
}
///
@@ -372,11 +381,18 @@ namespace OpenSim.Grid.MessagingServer.Modules
///
public XmlRpcResponse UserLoggedOff(XmlRpcRequest request, IPEndPoint remoteClient)
{
- m_log.Info("[USERLOGOFF]: User logged off called");
- Hashtable requestData = (Hashtable)request.Params[0];
+ try
+ {
+ m_log.Info("[USERLOGOFF]: User logged off called");
+ Hashtable requestData = (Hashtable)request.Params[0];
- UUID AgentID = new UUID((string)requestData["agentid"]);
- ProcessLogOff(AgentID);
+ UUID AgentID = new UUID((string)requestData["agentid"]);
+ ProcessLogOff(AgentID);
+ }
+ catch (Exception e)
+ {
+ m_log.WarnFormat("[USERLOGOFF]: Exception on UserLoggedOff: {0}", e);
+ }
return new XmlRpcResponse();
}
--
cgit v1.1