aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs33
1 files changed, 27 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 9a10c51..ae44acb 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -21,6 +21,7 @@ namespace OpenSim.Region.Environment.Scenes
21 public event ExpectUserDelegate OnExpectUser; 21 public event ExpectUserDelegate OnExpectUser;
22 public event CloseAgentConnection OnCloseAgentConnection; 22 public event CloseAgentConnection OnCloseAgentConnection;
23 public event PrimCrossing OnPrimCrossingIntoRegion; 23 public event PrimCrossing OnPrimCrossingIntoRegion;
24 public event RegionUp OnRegionUp;
24 25
25 26
26 public SceneCommunicationService(CommunicationsManager commsMan) 27 public SceneCommunicationService(CommunicationsManager commsMan)
@@ -38,6 +39,7 @@ namespace OpenSim.Region.Environment.Scenes
38 regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; 39 regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing;
39 regionCommsHost.OnPrimCrossingIntoRegion += PrimCrossing; 40 regionCommsHost.OnPrimCrossingIntoRegion += PrimCrossing;
40 regionCommsHost.OnCloseAgentConnection += CloseConnection; 41 regionCommsHost.OnCloseAgentConnection += CloseConnection;
42 regionCommsHost.OnRegionUp += newRegionUp;
41 43
42 44
43 } 45 }
@@ -45,12 +47,16 @@ namespace OpenSim.Region.Environment.Scenes
45 47
46 public void Close() 48 public void Close()
47 { 49 {
48 regionCommsHost.OnExpectUser -= NewUserConnection; 50 if (regionCommsHost != null)
49 regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing; 51 {
50 regionCommsHost.OnPrimCrossingIntoRegion -= PrimCrossing; 52 regionCommsHost.OnRegionUp -= newRegionUp;
51 regionCommsHost.OnCloseAgentConnection -= CloseConnection; 53 regionCommsHost.OnExpectUser -= NewUserConnection;
52 m_commsProvider.GridService.DeregisterRegion(m_regionInfo); 54 regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing;
53 regionCommsHost = null; 55 regionCommsHost.OnPrimCrossingIntoRegion -= PrimCrossing;
56 regionCommsHost.OnCloseAgentConnection -= CloseConnection;
57 m_commsProvider.GridService.DeregisterRegion(m_regionInfo);
58 regionCommsHost = null;
59 }
54 } 60 }
55 61
56 #region CommsManager Event handlers 62 #region CommsManager Event handlers
@@ -59,6 +65,7 @@ namespace OpenSim.Region.Environment.Scenes
59 /// </summary> 65 /// </summary>
60 /// <param name="regionHandle"></param> 66 /// <param name="regionHandle"></param>
61 /// <param name="agent"></param> 67 /// <param name="agent"></param>
68 ///
62 protected void NewUserConnection(ulong regionHandle, AgentCircuitData agent) 69 protected void NewUserConnection(ulong regionHandle, AgentCircuitData agent)
63 { 70 {
64 if (OnExpectUser != null) 71 if (OnExpectUser != null)
@@ -67,6 +74,15 @@ namespace OpenSim.Region.Environment.Scenes
67 } 74 }
68 } 75 }
69 76
77 protected bool newRegionUp(RegionInfo region)
78 {
79 if (OnRegionUp != null)
80 {
81 OnRegionUp(region);
82 }
83 return true;
84 }
85
70 protected void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) 86 protected void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying)
71 { 87 {
72 if (OnAvatarCrossingIntoRegion != null) 88 if (OnAvatarCrossingIntoRegion != null)
@@ -249,6 +265,11 @@ namespace OpenSim.Region.Environment.Scenes
249 return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying); 265 return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying);
250 } 266 }
251 267
268 public void InformNeighborsThatRegionisUp(RegionInfo region)
269 {
270 bool val = m_commsProvider.InterRegion.RegionUp(region);
271 }
272
252 public bool PrimCrossToNeighboringRegion(ulong regionhandle, LLUUID primID, LLVector3 position, bool isPhysical) 273 public bool PrimCrossToNeighboringRegion(ulong regionhandle, LLUUID primID, LLVector3 position, bool isPhysical)
253 { 274 {
254 return m_commsProvider.InterRegion.ExpectPrimCrossing(regionhandle, primID, position, isPhysical); 275 return m_commsProvider.InterRegion.ExpectPrimCrossing(regionhandle, primID, position, isPhysical);