aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs61
1 files changed, 46 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs
index 9af0f66..712a12b 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs
@@ -36,7 +36,7 @@ using OpenSim.Region.Framework.Scenes;
36 36
37namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion 37namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
38{ 38{
39 public class LocalInterregionComms : IRegionModule, IInterregionCommsOut, IInterregionCommsIn 39 public class LocalInterregionComms : ISharedRegionModule, IInterregionCommsOut, IInterregionCommsIn
40 { 40 {
41 private bool m_enabled = false; 41 private bool m_enabled = false;
42 42
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
50 50
51 #region IRegionModule 51 #region IRegionModule
52 52
53 public void Initialise(Scene scene, IConfigSource config) 53 public void Initialise(IConfigSource config)
54 { 54 {
55 if (m_sceneList.Count == 0) 55 if (m_sceneList.Count == 0)
56 { 56 {
@@ -62,30 +62,61 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
62 m_enabled = true; 62 m_enabled = true;
63 } 63 }
64 } 64 }
65 }
65 66
66 if (!m_enabled) 67 public void PostInitialise()
67 return; 68 {
69 }
68 70
69 Init(scene); 71 public void AddRegion(Scene scene)
72 {
70 } 73 }
71 74
72 public void PostInitialise() 75 public void RemoveRegion(Scene scene)
73 { 76 {
77 if (m_enabled)
78 {
79 RemoveScene(scene);
80 }
81 }
82
83 public void RegionLoaded(Scene scene)
84 {
85 if (m_enabled)
86 {
87 Init(scene);
88 }
74 } 89 }
75 90
76 public void Close() 91 public void Close()
77 { 92 {
78 } 93 }
79 94
95 public Type ReplacableInterface
96 {
97 get { return null; }
98 }
99
80 public string Name 100 public string Name
81 { 101 {
82 get { return "LocalInterregionCommsModule"; } 102 get { return "LocalInterregionCommsModule"; }
83 } 103 }
84 104
85 public bool IsSharedModule 105 /// <summary>
106 /// Can be called from other modules.
107 /// </summary>
108 /// <param name="scene"></param>
109 public void RemoveScene(Scene scene)
86 { 110 {
87 get { return true; } 111 lock (m_sceneList)
112 {
113 if (m_sceneList.Contains(scene))
114 {
115 m_sceneList.Remove(scene);
116 }
117 }
88 } 118 }
119
89 /// <summary> 120 /// <summary>
90 /// Can be called from other modules. 121 /// Can be called from other modules.
91 /// </summary> 122 /// </summary>
@@ -110,21 +141,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
110 #region IInterregionComms 141 #region IInterregionComms
111 142
112 /** 143 /**
113 * Agent-related communications 144 * Agent-related communications
114 */ 145 */
115 146
116 public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit, out string reason) 147 public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit, out string reason)
117 { 148 {
118 149
119 foreach (Scene s in m_sceneList) 150 foreach (Scene s in m_sceneList)
120 { 151 {
121 if (s.RegionInfo.RegionHandle == regionHandle) 152 if (s.RegionInfo.RegionHandle == regionHandle)
122 { 153 {
123// m_log.DebugFormat("[LOCAL COMMS]: Found region {0} to send SendCreateChildAgent", regionHandle); 154// m_log.DebugFormat("[LOCAL COMMS]: Found region {0} to send SendCreateChildAgent", regionHandle);
124 return s.NewUserConnection(aCircuit, out reason); 155 return s.NewUserConnection(aCircuit, out reason);
125 } 156 }
126 } 157 }
127 158
128// m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for SendCreateChildAgent", regionHandle); 159// m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for SendCreateChildAgent", regionHandle);
129 reason = "Did not find region."; 160 reason = "Did not find region.";
130 return false; 161 return false;
@@ -137,14 +168,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
137 if (s.RegionInfo.RegionHandle == regionHandle) 168 if (s.RegionInfo.RegionHandle == regionHandle)
138 { 169 {
139 //m_log.DebugFormat( 170 //m_log.DebugFormat(
140 // "[LOCAL COMMS]: Found region {0} {1} to send ChildAgentUpdate", 171 // "[LOCAL COMMS]: Found region {0} {1} to send ChildAgentUpdate",
141 // s.RegionInfo.RegionName, regionHandle); 172 // s.RegionInfo.RegionName, regionHandle);
142 173
143 s.IncomingChildAgentDataUpdate(cAgentData); 174 s.IncomingChildAgentDataUpdate(cAgentData);
144 return true; 175 return true;
145 } 176 }
146 } 177 }
147 178
148// m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for ChildAgentUpdate", regionHandle); 179// m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for ChildAgentUpdate", regionHandle);
149 return false; 180 return false;
150 } 181 }
@@ -218,7 +249,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
218 } 249 }
219 250
220 /** 251 /**
221 * Object-related communications 252 * Object-related communications
222 */ 253 */
223 254
224 public bool SendCreateObject(ulong regionHandle, SceneObjectGroup sog, bool isLocalCall) 255 public bool SendCreateObject(ulong regionHandle, SceneObjectGroup sog, bool isLocalCall)