From 1b05dde65971e60001cda527f9840eec756c8102 Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Sun, 27 May 2007 09:14:22 +0000
Subject: * Added DeadRegionResponse - occurs when connecting to a downed
region (was the mysterious "(Done)" error).
---
.../OpenGridServices.UserServer/UserManager.cs | 25 +++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
(limited to 'OpenGridServices')
diff --git a/OpenGridServices/OpenGridServices.UserServer/UserManager.cs b/OpenGridServices/OpenGridServices.UserServer/UserManager.cs
index fdda63b..eb98783 100644
--- a/OpenGridServices/OpenGridServices.UserServer/UserManager.cs
+++ b/OpenGridServices/OpenGridServices.UserServer/UserManager.cs
@@ -277,6 +277,21 @@ namespace OpenGridServices.UserServer
}
///
+ /// Creates an error response caused by target region being down
+ ///
+ /// An XMLRPC Response
+ private static XmlRpcResponse CreateDeadRegionResponse()
+ {
+ XmlRpcResponse response = new XmlRpcResponse();
+ Hashtable PresenceErrorRespData = new Hashtable();
+ PresenceErrorRespData["reason"] = "key";
+ PresenceErrorRespData["message"] = "The region you are attempting to log into is not responding. Please select another region and try again.";
+ PresenceErrorRespData["login"] = "false";
+ response.Value = PresenceErrorRespData;
+ return response;
+ }
+
+ ///
/// Customises the login response and fills in missing values.
///
/// The existing response
@@ -560,7 +575,15 @@ namespace OpenGridServices.UserServer
responseData["session_id"] = TheUser.currentAgent.sessionID.ToStringHyphenated();
responseData["login"] = "true";
- this.CustomiseResponse(ref responseData, ref TheUser);
+ try
+ {
+ this.CustomiseResponse(ref responseData, ref TheUser);
+ }
+ catch (Exception e)
+ {
+ return CreateDeadRegionResponse();
+ Console.WriteLine(e.ToString());
+ }
CommitAgent(ref TheUser);
--
cgit v1.1