aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-09-21 16:58:14 +0000
committerJustin Clarke Casey2008-09-21 16:58:14 +0000
commit1a71a3a56776bc1d91f9da031a295fd4a0023e87 (patch)
tree2ba99a3fa223499313d3cc9c199c042859af148d /OpenSim/Region
parentDon't attach attachements to child agents. This coincidentially fixes a race (diff)
downloadopensim-SC_OLD-1a71a3a56776bc1d91f9da031a295fd4a0023e87.zip
opensim-SC_OLD-1a71a3a56776bc1d91f9da031a295fd4a0023e87.tar.gz
opensim-SC_OLD-1a71a3a56776bc1d91f9da031a295fd4a0023e87.tar.bz2
opensim-SC_OLD-1a71a3a56776bc1d91f9da031a295fd4a0023e87.tar.xz
* Fix http://opensimulator.org/mantis/view.php?id=2189
* Allow a grid mode region simulator to properly shutdown even if the grid service is offline
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs2
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs30
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs13
3 files changed, 39 insertions, 6 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
index eddee10..d885e3b 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs
@@ -96,6 +96,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
96 // A list of the packets we haven't acked yet 96 // A list of the packets we haven't acked yet
97 // 97 //
98 private Dictionary<uint,uint> m_PendingAcks = new Dictionary<uint,uint>(); 98 private Dictionary<uint,uint> m_PendingAcks = new Dictionary<uint,uint>();
99
99 // Dictionary of the packets that need acks from the client. 100 // Dictionary of the packets that need acks from the client.
100 // 101 //
101 private class AckData 102 private class AckData
@@ -109,6 +110,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
109 public Packet Packet; 110 public Packet Packet;
110 public Object Identifier; 111 public Object Identifier;
111 } 112 }
113
112 private Dictionary<uint, AckData> m_NeedAck = 114 private Dictionary<uint, AckData> m_NeedAck =
113 new Dictionary<uint, AckData>(); 115 new Dictionary<uint, AckData>();
114 116
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 45d0931..537947b 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -141,11 +141,11 @@ namespace OpenSim.Region.Communications.OGS1
141 SendParams.Add(GridParams); 141 SendParams.Add(GridParams);
142 142
143 // Send Request 143 // Send Request
144 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
144 XmlRpcResponse GridResp; 145 XmlRpcResponse GridResp;
146
145 try 147 try
146 { 148 {
147 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
148
149 // The timeout should always be significantly larger than the timeout for the grid server to request 149 // The timeout should always be significantly larger than the timeout for the grid server to request
150 // the initial status of the region before confirming registration. 150 // the initial status of the region before confirming registration.
151 GridResp = GridReq.Send(serversInfo.GridURL, 90000); 151 GridResp = GridReq.Send(serversInfo.GridURL, 90000);
@@ -154,7 +154,9 @@ namespace OpenSim.Region.Communications.OGS1
154 { 154 {
155 Exception e2 155 Exception e2
156 = new Exception( 156 = new Exception(
157 String.Format("Unable to connect to grid at {0}. Grid service not running?", serversInfo.GridURL), 157 String.Format(
158 "Unable to register region with grid at {0}. Grid service not running?",
159 serversInfo.GridURL),
158 e); 160 e);
159 161
160 throw(e2); 162 throw(e2);
@@ -193,6 +195,7 @@ namespace OpenSim.Region.Communications.OGS1
193 return m_localBackend.RegisterRegion(regionInfo); 195 return m_localBackend.RegisterRegion(regionInfo);
194 } 196 }
195 197
198 // see IGridServices
196 public bool DeregisterRegion(RegionInfo regionInfo) 199 public bool DeregisterRegion(RegionInfo regionInfo)
197 { 200 {
198 Hashtable GridParams = new Hashtable(); 201 Hashtable GridParams = new Hashtable();
@@ -205,7 +208,24 @@ namespace OpenSim.Region.Communications.OGS1
205 208
206 // Send Request 209 // Send Request
207 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_after_region_moved", SendParams); 210 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_after_region_moved", SendParams);
208 XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 10000); 211 XmlRpcResponse GridResp = null;
212
213 try
214 {
215 GridResp = GridReq.Send(serversInfo.GridURL, 10000);
216 }
217 catch (Exception e)
218 {
219 Exception e2
220 = new Exception(
221 String.Format(
222 "Unable to deregister region with grid at {0}. Grid service not running?",
223 serversInfo.GridURL),
224 e);
225
226 throw(e2);
227 }
228
209 Hashtable GridRespData = (Hashtable) GridResp.Value; 229 Hashtable GridRespData = (Hashtable) GridResp.Value;
210 230
211 // Hashtable griddatahash = GridRespData; 231 // Hashtable griddatahash = GridRespData;
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 887a8da..c95068b 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -135,7 +135,18 @@ namespace OpenSim.Region.Environment.Scenes
135 regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing; 135 regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing;
136 regionCommsHost.OnCloseAgentConnection -= CloseConnection; 136 regionCommsHost.OnCloseAgentConnection -= CloseConnection;
137 regionCommsHost.OnGetLandData -= FetchLandData; 137 regionCommsHost.OnGetLandData -= FetchLandData;
138 m_commsProvider.GridService.DeregisterRegion(m_regionInfo); 138
139 try
140 {
141 m_commsProvider.GridService.DeregisterRegion(m_regionInfo);
142 }
143 catch (Exception e)
144 {
145 m_log.ErrorFormat(
146 "[GRID]: Deregistration of region {0} from the grid failed - {1}. Continuing",
147 m_regionInfo.RegionName, e);
148 }
149
139 regionCommsHost = null; 150 regionCommsHost = null;
140 } 151 }
141 } 152 }