* Deal with a WebException thrown if a grid server cannot be contacted for region information

0.6.0-stable
Justin Clarke Casey 2008-08-25 21:26:58 +00:00
parent 24456e846c
commit 7402c2d288
3 changed files with 26 additions and 7 deletions

View File

@ -1355,7 +1355,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
/// <summary>
///
/// Inform the client that a teleport attempt has failed
/// </summary>
public void SendTeleportFailed(string reason)
{

View File

@ -282,10 +282,14 @@ namespace OpenSim.Region.Communications.OGS1
}
/// <summary>
///
/// Request information about a region.
/// </summary>
/// <param name="regionHandle"></param>
/// <returns></returns>
/// <returns>
/// null on a failure to contact or get a response from the grid server
/// FIXME: Might be nicer to return a proper exception here since we could inform the client more about the
/// nature of the faiulre.
/// </returns>
public RegionInfo RequestNeighbourInfo(LLUUID Region_UUID)
{
RegionInfo regionInfo;
@ -294,10 +298,23 @@ namespace OpenSim.Region.Communications.OGS1
requestData["authkey"] = serversInfo.GridSendKey;
ArrayList SendParams = new ArrayList();
SendParams.Add(requestData);
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000);
XmlRpcRequest gridReq = new XmlRpcRequest("simulator_data_request", SendParams);
XmlRpcResponse gridResp = null;
try
{
gridResp = gridReq.Send(serversInfo.GridURL, 3000);
}
catch (WebException e)
{
m_log.ErrorFormat(
"[OGS1 GRID SERVICES]: Communication with the grid server at {0} failed, {1}",
serversInfo.GridURL, e);
return null;
}
Hashtable responseData = (Hashtable) GridResp.Value;
Hashtable responseData = (Hashtable)gridResp.Value;
if (responseData.ContainsKey("error"))
{
@ -335,7 +352,7 @@ namespace OpenSim.Region.Communications.OGS1
}
/// <summary>
///
/// Request information about a region.
/// </summary>
/// <param name="regionHandle"></param>
/// <returns></returns>

View File

@ -2897,12 +2897,14 @@ namespace OpenSim.Region.Environment.Scenes
public void RequestTeleportLandmark(IClientAPI remoteClient, LLUUID regionID, LLVector3 position)
{
RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(regionID);
if (info == null)
{
// can't find the region: Tell viewer and abort
remoteClient.SendTeleportFailed("The teleport destination could not be found.");
return;
}
lock (m_scenePresences)
{
if (m_scenePresences.ContainsKey(remoteClient.AgentId))