* Added DeadRegionResponse - occurs when connecting to a downed region (was the mysterious "(Done)" error).

zircon^2
Adam Frisby 2007-05-27 09:14:22 +00:00
parent a33f244b58
commit 1b05dde659
1 changed files with 24 additions and 1 deletions

View File

@ -276,6 +276,21 @@ namespace OpenGridServices.UserServer
return response;
}
/// <summary>
/// Creates an error response caused by target region being down
/// </summary>
/// <returns>An XMLRPC Response</returns>
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;
}
/// <summary>
/// Customises the login response and fills in missing values.
/// </summary>
@ -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);