aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/IInterRegionCommunications.cs1
-rw-r--r--OpenSim/Framework/IRegionCommsListener.cs4
-rw-r--r--OpenSim/Framework/IScene.cs5
-rw-r--r--OpenSim/Framework/RegionCommsListener.cs12
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs2
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs19
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs90
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs26
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs41
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneBase.cs3
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs33
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneManager.cs22
12 files changed, 230 insertions, 28 deletions
diff --git a/OpenSim/Framework/Communications/IInterRegionCommunications.cs b/OpenSim/Framework/Communications/IInterRegionCommunications.cs
index 94e4cf7..c64abb5 100644
--- a/OpenSim/Framework/Communications/IInterRegionCommunications.cs
+++ b/OpenSim/Framework/Communications/IInterRegionCommunications.cs
@@ -33,6 +33,7 @@ namespace OpenSim.Framework.Communications
33 { 33 {
34 bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData); 34 bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData);
35 bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData); 35 bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData);
36 bool RegionUp(RegionInfo region);
36 37
37 bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying); 38 bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying);
38 bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isFlying); 39 bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isFlying);
diff --git a/OpenSim/Framework/IRegionCommsListener.cs b/OpenSim/Framework/IRegionCommsListener.cs
index c9fc525..53d0059 100644
--- a/OpenSim/Framework/IRegionCommsListener.cs
+++ b/OpenSim/Framework/IRegionCommsListener.cs
@@ -46,6 +46,8 @@ namespace OpenSim.Framework
46 46
47 public delegate void CloseAgentConnection(ulong regionHandle, LLUUID agentID); 47 public delegate void CloseAgentConnection(ulong regionHandle, LLUUID agentID);
48 48
49 public delegate bool RegionUp(RegionInfo region);
50
49 51
50 52
51 public interface IRegionCommsListener 53 public interface IRegionCommsListener
@@ -59,5 +61,7 @@ namespace OpenSim.Framework
59 event AcknowledgePrimCross OnAcknowledgePrimCrossed; 61 event AcknowledgePrimCross OnAcknowledgePrimCrossed;
60 event UpdateNeighbours OnNeighboursUpdate; 62 event UpdateNeighbours OnNeighboursUpdate;
61 event CloseAgentConnection OnCloseAgentConnection; 63 event CloseAgentConnection OnCloseAgentConnection;
64 event RegionUp OnRegionUp;
65
62 } 66 }
63} \ No newline at end of file 67} \ No newline at end of file
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs
index 0e4d260..5507500 100644
--- a/OpenSim/Framework/IScene.cs
+++ b/OpenSim/Framework/IScene.cs
@@ -30,7 +30,7 @@ using libsecondlife;
30namespace OpenSim.Framework 30namespace OpenSim.Framework
31{ 31{
32 public delegate void restart( RegionInfo thisRegion ); 32 public delegate void restart( RegionInfo thisRegion );
33 public delegate void regionup ( RegionInfo thisRegion ); 33 //public delegate void regionup ( RegionInfo thisRegion );
34 34
35 public enum RegionStatus : int 35 public enum RegionStatus : int
36 { 36 {
@@ -43,13 +43,12 @@ namespace OpenSim.Framework
43 public interface IScene 43 public interface IScene
44 { 44 {
45 event restart OnRestart; 45 event restart OnRestart;
46 event regionup OnRegionUp;
47 46
48 void AddNewClient(IClientAPI client, bool child); 47 void AddNewClient(IClientAPI client, bool child);
49 void RemoveClient(LLUUID agentID); 48 void RemoveClient(LLUUID agentID);
50 49
51 void Restart(int seconds); 50 void Restart(int seconds);
52 void OtherRegionUp(RegionInfo thisRegion); 51 bool OtherRegionUp(RegionInfo thisRegion);
53 52
54 RegionInfo RegionInfo { get; } 53 RegionInfo RegionInfo { get; }
55 uint NextLocalId { get; } 54 uint NextLocalId { get; }
diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs
index 5dc9b81..449c073 100644
--- a/OpenSim/Framework/RegionCommsListener.cs
+++ b/OpenSim/Framework/RegionCommsListener.cs
@@ -42,6 +42,8 @@ namespace OpenSim.Framework
42 public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed; 42 public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed;
43 public event AcknowledgePrimCross OnAcknowledgePrimCrossed; 43 public event AcknowledgePrimCross OnAcknowledgePrimCrossed;
44 public event CloseAgentConnection OnCloseAgentConnection; 44 public event CloseAgentConnection OnCloseAgentConnection;
45 public event RegionUp OnRegionUp;
46
45 47
46 /// <summary> 48 /// <summary>
47 /// 49 ///
@@ -68,6 +70,16 @@ namespace OpenSim.Framework
68 return false; 70 return false;
69 } 71 }
70 72
73 public virtual bool TriggerRegionUp(RegionInfo region)
74 {
75 if (OnRegionUp != null)
76 {
77 OnRegionUp(region);
78 return true;
79 }
80 return false;
81 }
82
71 public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, 83 public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position,
72 bool isFlying) 84 bool isFlying)
73 { 85 {
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 8edfc6f..1afa74a 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -454,7 +454,7 @@ namespace OpenSim
454 } 454 }
455 UDPServer restartingRegion = CreateRegion(whichRegion); 455 UDPServer restartingRegion = CreateRegion(whichRegion);
456 restartingRegion.ServerListener(); 456 restartingRegion.ServerListener();
457 m_sceneManager.SendSimOnlineNotification(restartingRegion.RegionHandle); 457 //m_sceneManager.SendSimOnlineNotification(restartingRegion.RegionHandle);
458 458
459 } 459 }
460 460
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index 4efaa23..746a19a 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -155,11 +155,28 @@ namespace OpenSim.Region.Communications.Local
155 return mapBlocks; 155 return mapBlocks;
156 } 156 }
157 157
158 /// <summary> 158 /// <summary>
159 /// </summary> 159 /// </summary>
160 /// <param name="regionHandle"></param> 160 /// <param name="regionHandle"></param>
161 /// <param name="agentData"></param> 161 /// <param name="agentData"></param>
162 /// <returns></returns> 162 /// <returns></returns>
163 ///
164 public bool RegionUp(RegionInfo region)
165 {
166 foreach (RegionCommsListener listener in m_regionListeners.Values)
167 {
168 listener.TriggerRegionUp(region);
169 }
170
171 return true;
172 }
173
174 public bool TriggerRegionUp(RegionInfo region)
175 {
176
177 return false;
178 }
179
163 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) 180 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
164 //should change from agentCircuitData 181 //should change from agentCircuitData
165 { 182 {
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 6b2407a..a0d6bd3 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -380,6 +380,7 @@ namespace OpenSim.Region.Communications.OGS1
380 InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent; 380 InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent;
381 InterRegionSingleton.Instance.OnPrimGroupArrival += IncomingPrim; 381 InterRegionSingleton.Instance.OnPrimGroupArrival += IncomingPrim;
382 InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing; 382 InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing;
383 InterRegionSingleton.Instance.OnRegionUp += TriggerRegionUp;
383 384
384 } 385 }
385 386
@@ -465,6 +466,81 @@ namespace OpenSim.Region.Communications.OGS1
465 } 466 }
466 return true; 467 return true;
467 } 468 }
469
470 // UGLY!
471 public bool RegionUp(RegionInfo region)
472 {
473 RegionInfo regInfo = null;
474 try
475 {
476 if (m_localBackend.RegionUp(region))
477 {
478 return true;
479 }
480 foreach (RegionInfo remoteInfo in m_remoteRegionInfoCache.Values)
481 {
482 regInfo = RequestNeighbourInfo(remoteInfo.RegionHandle);
483 if (regInfo != null)
484 {
485 //don't want to be creating a new link to the remote instance every time like we are here
486 bool retValue = false;
487
488
489 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
490 typeof(OGS1InterRegionRemoting),
491 "tcp://" + regInfo.RemotingAddress +
492 ":" + regInfo.RemotingPort +
493 "/InterRegions");
494
495 if (remObject != null)
496 {
497 retValue = remObject.RegionUp(region);
498 }
499 else
500 {
501 Console.WriteLine("remoting object not found");
502 }
503 remObject = null;
504
505 }
506
507 }
508
509
510 return true;
511 }
512 catch (RemotingException e)
513 {
514 MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
515 MainLog.Instance.Debug(e.ToString());
516 return false;
517 }
518 catch (SocketException e)
519 {
520 MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
521 MainLog.Instance.Debug(e.ToString());
522 return false;
523 }
524 catch (InvalidCredentialException e)
525 {
526 MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
527 MainLog.Instance.Debug(e.ToString());
528 return false;
529 }
530 catch (AuthenticationException e)
531 {
532 MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
533 MainLog.Instance.Debug(e.ToString());
534 return false;
535 }
536 catch (Exception e)
537 {
538 MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
539 MainLog.Instance.Debug(e.ToString());
540 return false;
541 }
542 return true;
543 }
468 /// <summary> 544 /// <summary>
469 /// 545 ///
470 /// </summary> 546 /// </summary>
@@ -680,6 +756,20 @@ namespace OpenSim.Region.Communications.OGS1
680 } 756 }
681 } 757 }
682 758
759 public bool TriggerRegionUp(RegionInfo regionData)
760 {
761 try
762 {
763 return m_localBackend.TriggerRegionUp(regionData);
764 }
765
766 catch (RemotingException e)
767 {
768 MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
769 return false;
770 }
771 }
772
683 /// <summary> 773 /// <summary>
684 /// 774 ///
685 /// </summary> 775 /// </summary>
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
index 70018fd..aa6f59a 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
@@ -41,6 +41,8 @@ namespace OpenSim.Region.Communications.OGS1
41 41
42 public delegate bool PrimGroupArrival(ulong regionHandle, LLUUID primID, string objData); 42 public delegate bool PrimGroupArrival(ulong regionHandle, LLUUID primID, string objData);
43 43
44 public delegate bool RegionUP (RegionInfo region);
45
44 public sealed class InterRegionSingleton 46 public sealed class InterRegionSingleton
45 { 47 {
46 private static readonly InterRegionSingleton instance = new InterRegionSingleton(); 48 private static readonly InterRegionSingleton instance = new InterRegionSingleton();
@@ -49,6 +51,8 @@ namespace OpenSim.Region.Communications.OGS1
49 public event ExpectArrival OnArrival; 51 public event ExpectArrival OnArrival;
50 public event InformRegionPrimGroup OnPrimGroupNear; 52 public event InformRegionPrimGroup OnPrimGroupNear;
51 public event PrimGroupArrival OnPrimGroupArrival; 53 public event PrimGroupArrival OnPrimGroupArrival;
54 public event RegionUp OnRegionUp;
55
52 56
53 static InterRegionSingleton() 57 static InterRegionSingleton()
54 { 58 {
@@ -72,6 +76,15 @@ namespace OpenSim.Region.Communications.OGS1
72 return false; 76 return false;
73 } 77 }
74 78
79 public bool RegionUp(RegionInfo region)
80 {
81 if (OnRegionUp != null)
82 {
83 return OnRegionUp(region);
84 }
85 return false;
86 }
87
75 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) 88 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying)
76 { 89 {
77 if (OnArrival != null) 90 if (OnArrival != null)
@@ -116,7 +129,18 @@ namespace OpenSim.Region.Communications.OGS1
116 return false; 129 return false;
117 } 130 }
118 } 131 }
119 132 public bool RegionUp(RegionInfo region)
133 {
134 try
135 {
136 return InterRegionSingleton.Instance.RegionUp(region);
137 }
138 catch (RemotingException e)
139 {
140 Console.WriteLine("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
141 return false;
142 }
143 }
120 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) 144 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying)
121 { 145 {
122 try 146 try
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index fd17d56..a9791ee 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -216,7 +216,7 @@ namespace OpenSim.Region.Environment.Scenes
216 m_regionHandle = m_regInfo.RegionHandle; 216 m_regionHandle = m_regInfo.RegionHandle;
217 m_regionName = m_regInfo.RegionName; 217 m_regionName = m_regInfo.RegionName;
218 m_datastore = m_regInfo.DataStore; 218 m_datastore = m_regInfo.DataStore;
219 RegisterRegionWithComms(); 219
220 m_physicalPrim = physicalPrim; 220 m_physicalPrim = physicalPrim;
221 m_sendTasksToChild = SendTasksToChild; 221 m_sendTasksToChild = SendTasksToChild;
222 222
@@ -244,6 +244,7 @@ namespace OpenSim.Region.Environment.Scenes
244 244
245 httpListener = httpServer; 245 httpListener = httpServer;
246 m_dumpAssetsToFile = dumpAssetsToFile; 246 m_dumpAssetsToFile = dumpAssetsToFile;
247 RegisterRegionWithComms();
247 } 248 }
248 249
249 #endregion 250 #endregion
@@ -257,21 +258,29 @@ namespace OpenSim.Region.Environment.Scenes
257 m_eventManager.OnPermissionError += SendPermissionAlert; 258 m_eventManager.OnPermissionError += SendPermissionAlert;
258 } 259 }
259 260
260 public override void OtherRegionUp(RegionInfo otherRegion) 261 public override bool OtherRegionUp(RegionInfo otherRegion)
261 { 262 {
262 // Another region is up. We have to tell all our ScenePresences about it 263 // Another region is up. We have to tell all our ScenePresences about it
263 // This fails to get the desired effect and needs further work. 264 // This fails to get the desired effect and needs further work.
264 265 try
265 ForEachScenePresence(delegate(ScenePresence agent)
266 { 266 {
267 if (!(agent.IsChildAgent)) 267
268 { 268 ForEachScenePresence(delegate(ScenePresence agent)
269 InformClientOfNeighbor(agent, otherRegion); 269 {
270 this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo()); 270 if (!(agent.IsChildAgent))
271 271 {
272 this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
273 InformClientOfNeighbor(agent, otherRegion);
274 }
272 } 275 }
276
277 );
273 } 278 }
274 ); 279 catch (System.NullReferenceException)
280 {
281 // This means that we're not booted up completely yet.
282 }
283 return true;
275 } 284 }
276 public virtual void Restart(float seconds) 285 public virtual void Restart(float seconds)
277 { 286 {
@@ -1068,9 +1077,13 @@ namespace OpenSim.Region.Environment.Scenes
1068 m_sceneGridService.OnExpectUser += NewUserConnection; 1077 m_sceneGridService.OnExpectUser += NewUserConnection;
1069 m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing; 1078 m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing;
1070 m_sceneGridService.OnCloseAgentConnection += CloseConnection; 1079 m_sceneGridService.OnCloseAgentConnection += CloseConnection;
1080 m_sceneGridService.OnRegionUp += OtherRegionUp;
1081 // Tell Other regions that I'm here.
1082 m_sceneGridService.InformNeighborsThatRegionisUp(RegionInfo);
1071 } 1083 }
1072 public void UnRegisterReginWithComms() 1084 public void UnRegisterReginWithComms()
1073 { 1085 {
1086 m_sceneGridService.OnRegionUp -= OtherRegionUp;
1074 m_sceneGridService.OnExpectUser -= NewUserConnection; 1087 m_sceneGridService.OnExpectUser -= NewUserConnection;
1075 m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing; 1088 m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing;
1076 m_sceneGridService.OnCloseAgentConnection -= CloseConnection; 1089 m_sceneGridService.OnCloseAgentConnection -= CloseConnection;
@@ -1578,9 +1591,13 @@ namespace OpenSim.Region.Environment.Scenes
1578 /// <param name="action"></param> 1591 /// <param name="action"></param>
1579 public void ForEachScenePresence(Action<ScenePresence> action) 1592 public void ForEachScenePresence(Action<ScenePresence> action)
1580 { 1593 {
1581 foreach (ScenePresence presence in m_scenePresences.Values) 1594 // We don't want to try to send messages if there are no avatar.
1595 if (!(m_scenePresences.Equals(null)))
1582 { 1596 {
1583 action(presence); 1597 foreach (ScenePresence presence in m_scenePresences.Values)
1598 {
1599 action(presence);
1600 }
1584 } 1601 }
1585 } 1602 }
1586 1603
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index 4359374..2db3bdc 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -41,7 +41,6 @@ namespace OpenSim.Region.Environment.Scenes
41 #region Events 41 #region Events
42 42
43 public event restart OnRestart; 43 public event restart OnRestart;
44 public event regionup OnRegionUp;
45 44
46 #endregion 45 #endregion
47 46
@@ -160,7 +159,7 @@ namespace OpenSim.Region.Environment.Scenes
160 } 159 }
161 160
162 161
163 public abstract void OtherRegionUp(RegionInfo thisRegion); 162 public abstract bool OtherRegionUp(RegionInfo thisRegion);
164 163
165 164
166 #endregion 165 #endregion
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);
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index 4360d97..c28269e 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -121,17 +121,35 @@ namespace OpenSim.Region.Environment.Scenes
121 121
122 public void SendSimOnlineNotification(ulong regionHandle) 122 public void SendSimOnlineNotification(ulong regionHandle)
123 { 123 {
124 RegionInfo Result = null;
124 125
125 for (int i = 0; i < m_localScenes.Count; i++) 126 for (int i = 0; i < m_localScenes.Count; i++)
126 { 127 {
127 if (m_localScenes[i].RegionInfo.RegionHandle != regionHandle) 128
129 if (m_localScenes[i].RegionInfo.RegionHandle == regionHandle)
128 { 130 {
131
129 // Inform other regions to tell their avatar about me 132 // Inform other regions to tell their avatar about me
130 m_localScenes[i].OtherRegionUp(m_localScenes[i].RegionInfo); 133 Result = m_localScenes[i].RegionInfo;
131 } 134 }
132 } 135 }
136 if (!(Result.Equals(null)))
137 {
138 for (int i = 0; i < m_localScenes.Count; i++)
139 {
133 140
141 if (m_localScenes[i].RegionInfo.RegionHandle != regionHandle)
142 {
134 143
144 // Inform other regions to tell their avatar about me
145 //m_localScenes[i].OtherRegionUp(Result);
146 }
147 }
148 }
149 else
150 {
151 MainLog.Instance.Error("REGION", "Unable to notify Other regions of this Region coming up");
152 }
135 } 153 }
136 public void SaveCurrentSceneToXml(string filename) 154 public void SaveCurrentSceneToXml(string filename)
137 { 155 {