diff options
author | Teravus Ovares | 2008-01-21 23:04:42 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-01-21 23:04:42 +0000 |
commit | 3fe6b2280d0b335ef8d9f2b0dc3406a47e6c0b53 (patch) | |
tree | bb8cbf0b5918448c92f6b0f42fec5013450d7e25 /OpenSim/Region/Communications | |
parent | Another attempt to squash the animation bug. Wish I could get this to fail at... (diff) | |
download | opensim-SC-3fe6b2280d0b335ef8d9f2b0dc3406a47e6c0b53.zip opensim-SC-3fe6b2280d0b335ef8d9f2b0dc3406a47e6c0b53.tar.gz opensim-SC-3fe6b2280d0b335ef8d9f2b0dc3406a47e6c0b53.tar.bz2 opensim-SC-3fe6b2280d0b335ef8d9f2b0dc3406a47e6c0b53.tar.xz |
* Shutting down child agents properly in neighbor regions.
Diffstat (limited to 'OpenSim/Region/Communications')
3 files changed, 107 insertions, 10 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 5b16e5a..25452c1 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs | |||
@@ -203,7 +203,14 @@ namespace OpenSim.Region.Communications.Local | |||
203 | } | 203 | } |
204 | return mapBlocks; | 204 | return mapBlocks; |
205 | } | 205 | } |
206 | 206 | public bool TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) | |
207 | { | ||
208 | if (m_regionListeners.ContainsKey(regionHandle)) | ||
209 | { | ||
210 | return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(regionHandle, agentID); | ||
211 | } | ||
212 | return false; | ||
213 | } | ||
207 | 214 | ||
208 | public virtual bool RegionUp(SearializableRegionInfo sregion, ulong regionhandle) | 215 | public virtual bool RegionUp(SearializableRegionInfo sregion, ulong regionhandle) |
209 | { | 216 | { |
@@ -267,6 +274,14 @@ namespace OpenSim.Region.Communications.Local | |||
267 | return false; | 274 | return false; |
268 | } | 275 | } |
269 | 276 | ||
277 | public bool TriggerTellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) | ||
278 | { | ||
279 | if (m_regionListeners.ContainsKey(regionHandle)) | ||
280 | { | ||
281 | return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(regionHandle, agentID); | ||
282 | } | ||
283 | return false; | ||
284 | } | ||
270 | /// <summary> | 285 | /// <summary> |
271 | /// </summary> | 286 | /// </summary> |
272 | /// <param name="regionHandle"></param> | 287 | /// <param name="regionHandle"></param> |
@@ -328,13 +343,7 @@ namespace OpenSim.Region.Communications.Local | |||
328 | return false; | 343 | return false; |
329 | } | 344 | } |
330 | 345 | ||
331 | public void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) | 346 | |
332 | { | ||
333 | if (m_regionListeners.ContainsKey(regionHandle)) | ||
334 | { | ||
335 | m_regionListeners[regionHandle].TriggerCloseAgentConnection(regionHandle, agentID); | ||
336 | } | ||
337 | } | ||
338 | 347 | ||
339 | public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId) | 348 | public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId) |
340 | { | 349 | { |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 2ca9022..683fbfb 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -491,7 +491,8 @@ namespace OpenSim.Region.Communications.OGS1 | |||
491 | InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing; | 491 | InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing; |
492 | InterRegionSingleton.Instance.OnRegionUp += TriggerRegionUp; | 492 | InterRegionSingleton.Instance.OnRegionUp += TriggerRegionUp; |
493 | InterRegionSingleton.Instance.OnChildAgentUpdate += TriggerChildAgentUpdate; | 493 | InterRegionSingleton.Instance.OnChildAgentUpdate += TriggerChildAgentUpdate; |
494 | //InterRegionSingleton.Instance.OnRegionUp += RegionUp; | 494 | InterRegionSingleton.Instance.OnTellRegionToCloseChildConnection += TriggerTellRegionToCloseChildConnection; |
495 | |||
495 | } | 496 | } |
496 | 497 | ||
497 | #region Methods called by regions in this instance | 498 | #region Methods called by regions in this instance |
@@ -959,8 +960,53 @@ namespace OpenSim.Region.Communications.OGS1 | |||
959 | } | 960 | } |
960 | } | 961 | } |
961 | 962 | ||
962 | public void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) | 963 | public bool TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) |
963 | { | 964 | { |
965 | RegionInfo regInfo = null; | ||
966 | try | ||
967 | { | ||
968 | if (m_localBackend.TriggerTellRegionToCloseChildConnection(regionHandle, agentID)) | ||
969 | { | ||
970 | return true; | ||
971 | } | ||
972 | |||
973 | regInfo = RequestNeighbourInfo(regionHandle); | ||
974 | if (regInfo != null) | ||
975 | { | ||
976 | bool retValue = false; | ||
977 | OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( | ||
978 | typeof(OGS1InterRegionRemoting), | ||
979 | "tcp://" + regInfo.RemotingAddress + | ||
980 | ":" + regInfo.RemotingPort + | ||
981 | "/InterRegions"); | ||
982 | if (remObject != null) | ||
983 | { | ||
984 | retValue = | ||
985 | remObject.TellRegionToCloseChildConnection(regionHandle, agentID.UUID); | ||
986 | } | ||
987 | else | ||
988 | { | ||
989 | Console.WriteLine("remoting object not found"); | ||
990 | } | ||
991 | remObject = null; | ||
992 | |||
993 | return true; | ||
994 | } | ||
995 | //TODO need to see if we know about where this region is and use .net remoting | ||
996 | // to inform it. | ||
997 | return false; | ||
998 | } | ||
999 | catch (RemotingException e) | ||
1000 | { | ||
1001 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region to tell it to close child agents: " + regInfo.RegionName + | ||
1002 | " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
1003 | //MainLog.Instance.Debug(e.ToString()); | ||
1004 | return false; | ||
1005 | } | ||
1006 | catch | ||
1007 | { | ||
1008 | return false; | ||
1009 | } | ||
964 | } | 1010 | } |
965 | 1011 | ||
966 | public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId) | 1012 | public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId) |
@@ -1086,6 +1132,20 @@ namespace OpenSim.Region.Communications.OGS1 | |||
1086 | } | 1132 | } |
1087 | } | 1133 | } |
1088 | 1134 | ||
1135 | public bool TriggerTellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) | ||
1136 | { | ||
1137 | try | ||
1138 | { | ||
1139 | return m_localBackend.TriggerTellRegionToCloseChildConnection(regionHandle, agentID); | ||
1140 | } | ||
1141 | catch (RemotingException) | ||
1142 | { | ||
1143 | MainLog.Instance.Verbose("INTERREGION", "Remoting Error: Unable to connect to neighbour to tell it to close a child connection"); | ||
1144 | return false; | ||
1145 | } | ||
1146 | |||
1147 | } | ||
1148 | |||
1089 | #endregion | 1149 | #endregion |
1090 | 1150 | ||
1091 | #endregion | 1151 | #endregion |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs index a0da07e..b39e0b7 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs | |||
@@ -45,6 +45,8 @@ namespace OpenSim.Region.Communications.OGS1 | |||
45 | 45 | ||
46 | public delegate bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate childUpdate); | 46 | public delegate bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate childUpdate); |
47 | 47 | ||
48 | public delegate bool TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID); | ||
49 | |||
48 | public sealed class InterRegionSingleton | 50 | public sealed class InterRegionSingleton |
49 | { | 51 | { |
50 | private static readonly InterRegionSingleton instance = new InterRegionSingleton(); | 52 | private static readonly InterRegionSingleton instance = new InterRegionSingleton(); |
@@ -55,6 +57,8 @@ namespace OpenSim.Region.Communications.OGS1 | |||
55 | public event PrimGroupArrival OnPrimGroupArrival; | 57 | public event PrimGroupArrival OnPrimGroupArrival; |
56 | public event RegionUp OnRegionUp; | 58 | public event RegionUp OnRegionUp; |
57 | public event ChildAgentUpdate OnChildAgentUpdate; | 59 | public event ChildAgentUpdate OnChildAgentUpdate; |
60 | public event TellRegionToCloseChildConnection OnTellRegionToCloseChildConnection; | ||
61 | |||
58 | 62 | ||
59 | 63 | ||
60 | static InterRegionSingleton() | 64 | static InterRegionSingleton() |
@@ -123,6 +127,16 @@ namespace OpenSim.Region.Communications.OGS1 | |||
123 | } | 127 | } |
124 | return false; | 128 | return false; |
125 | } | 129 | } |
130 | |||
131 | public bool TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) | ||
132 | { | ||
133 | if (OnTellRegionToCloseChildConnection != null) | ||
134 | { | ||
135 | |||
136 | return OnTellRegionToCloseChildConnection(regionHandle, agentID); | ||
137 | } | ||
138 | return false; | ||
139 | } | ||
126 | } | 140 | } |
127 | 141 | ||
128 | public class OGS1InterRegionRemoting : MarshalByRefObject | 142 | public class OGS1InterRegionRemoting : MarshalByRefObject |
@@ -171,6 +185,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
171 | } | 185 | } |
172 | } | 186 | } |
173 | 187 | ||
188 | |||
174 | public bool ExpectAvatarCrossing(ulong regionHandle, Guid agentID, sLLVector3 position, bool isFlying) | 189 | public bool ExpectAvatarCrossing(ulong regionHandle, Guid agentID, sLLVector3 position, bool isFlying) |
175 | { | 190 | { |
176 | try | 191 | try |
@@ -215,5 +230,18 @@ namespace OpenSim.Region.Communications.OGS1 | |||
215 | return false; | 230 | return false; |
216 | } | 231 | } |
217 | } | 232 | } |
233 | public bool TellRegionToCloseChildConnection(ulong regionHandle, Guid agentID) | ||
234 | { | ||
235 | try | ||
236 | { | ||
237 | return InterRegionSingleton.Instance.TellRegionToCloseChildConnection(regionHandle, new LLUUID(agentID)); | ||
238 | |||
239 | } | ||
240 | catch (RemotingException) | ||
241 | { | ||
242 | OpenSim.Framework.Console.MainLog.Instance.Verbose("INTERREGION", "Remoting Error: Unable to connect to remote region: " + regionHandle.ToString()); | ||
243 | return false; | ||
244 | } | ||
245 | } | ||
218 | } | 246 | } |
219 | } \ No newline at end of file | 247 | } \ No newline at end of file |