aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/Local
diff options
context:
space:
mode:
authorTeravus Ovares2007-11-27 13:46:52 +0000
committerTeravus Ovares2007-11-27 13:46:52 +0000
commit082f2baebe300e1313a34444c42dcc0a20c44baf (patch)
tree71616106c7a7dc1a3e21ea14c2f4b6d09fc642a5 /OpenSim/Region/Communications/Local
parentMainMap workaround. Map still does not fill in automatically, but one click o... (diff)
downloadopensim-SC_OLD-082f2baebe300e1313a34444c42dcc0a20c44baf.zip
opensim-SC_OLD-082f2baebe300e1313a34444c42dcc0a20c44baf.tar.gz
opensim-SC_OLD-082f2baebe300e1313a34444c42dcc0a20c44baf.tar.bz2
opensim-SC_OLD-082f2baebe300e1313a34444c42dcc0a20c44baf.tar.xz
Fixed an event in the events chain in inter-region communications.
As a consequence, restarting sims in the same process instance now shows them when they come back up in grid mode and standalone mode.
Diffstat (limited to 'OpenSim/Region/Communications/Local')
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs58
1 files changed, 55 insertions, 3 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index 746a19a..6e807ec 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -42,6 +42,28 @@ namespace OpenSim.Region.Communications.Local
42 42
43 private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>(); 43 private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>();
44 44
45 public string _gdebugRegionName = "";
46
47 public string gdebugRegionName
48 {
49 get { return _gdebugRegionName; }
50 set
51 {
52 _gdebugRegionName = value;
53
54 }
55 }
56 public string _rdebugRegionName = "";
57
58 public string rdebugRegionName
59 {
60 get { return _rdebugRegionName; }
61 set
62 {
63 _rdebugRegionName = value;
64
65 }
66 }
45 public LocalBackEndServices() 67 public LocalBackEndServices()
46 { 68 {
47 } 69 }
@@ -54,18 +76,36 @@ namespace OpenSim.Region.Communications.Local
54 public RegionCommsListener RegisterRegion(RegionInfo regionInfo) 76 public RegionCommsListener RegisterRegion(RegionInfo regionInfo)
55 { 77 {
56 //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); 78 //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
57 if (!m_regions.ContainsKey( regionInfo.RegionHandle)) 79 if (!m_regions.ContainsKey(regionInfo.RegionHandle))
58 { 80 {
59 //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle ); 81 //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle );
60 m_regions.Add(regionInfo.RegionHandle, regionInfo); 82 m_regions.Add(regionInfo.RegionHandle, regionInfo);
61 83
62 RegionCommsListener regionHost = new RegionCommsListener(); 84 RegionCommsListener regionHost = new RegionCommsListener();
85 if (m_regionListeners.ContainsKey(regionInfo.RegionHandle))
86 {
87 OpenSim.Framework.Console.MainLog.Instance.Error("INTERREGION", "Error:Region registered twice as an Events listener for Interregion Communications but not as a listed region. In Standalone mode this will cause BIG issues. In grid mode, it means a region went down and came back up.");
88 m_regionListeners.Remove(regionInfo.RegionHandle);
89 }
63 m_regionListeners.Add(regionInfo.RegionHandle, regionHost); 90 m_regionListeners.Add(regionInfo.RegionHandle, regionHost);
64 91
65 return regionHost; 92 return regionHost;
66 } 93 }
94 else
95 {
96 // Already in our list, so the region went dead and restarted.
97 m_regions.Remove(regionInfo.RegionHandle);
98 OpenSim.Framework.Console.MainLog.Instance.Warn("INTERREGION", "Region registered twice. Region went down and came back up.");
67 99
68 //already in our list of regions so for now lets return null 100 RegionCommsListener regionHost = new RegionCommsListener();
101 if (m_regionListeners.ContainsKey(regionInfo.RegionHandle))
102 {
103 m_regionListeners.Remove(regionInfo.RegionHandle);
104 }
105 m_regionListeners.Add(regionInfo.RegionHandle, regionHost);
106
107 return regionHost;
108 }
69 return null; 109 return null;
70 } 110 }
71 111
@@ -168,7 +208,7 @@ namespace OpenSim.Region.Communications.Local
168 listener.TriggerRegionUp(region); 208 listener.TriggerRegionUp(region);
169 } 209 }
170 210
171 return true; 211 return false;
172 } 212 }
173 213
174 public bool TriggerRegionUp(RegionInfo region) 214 public bool TriggerRegionUp(RegionInfo region)
@@ -181,10 +221,14 @@ namespace OpenSim.Region.Communications.Local
181 //should change from agentCircuitData 221 //should change from agentCircuitData
182 { 222 {
183 //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); 223 //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent");
224 //OpenSim.Framework.Console.MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Trying to inform region of child agent: " + agentData.firstname + " " + agentData.lastname);
225
184 if (m_regionListeners.ContainsKey(regionHandle)) 226 if (m_regionListeners.ContainsKey(regionHandle))
185 { 227 {
186 // Console.WriteLine("CommsManager- Informing a region to expect child agent"); 228 // Console.WriteLine("CommsManager- Informing a region to expect child agent");
187 m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData); 229 m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
230 //OpenSim.Framework.Console.MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
231
188 return true; 232 return true;
189 } 233 }
190 return false; 234 return false;
@@ -277,8 +321,12 @@ namespace OpenSim.Region.Communications.Local
277 321
278 public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) 322 public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent)
279 { 323 {
324 //OpenSim.Framework.Console.MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Other region is sending child agent our way: " + agent.firstname + " " + agent.lastname);
325
280 if (m_regionListeners.ContainsKey(regionHandle)) 326 if (m_regionListeners.ContainsKey(regionHandle))
281 { 327 {
328 //OpenSim.Framework.Console.MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname);
329
282 m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent); 330 m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent);
283 } 331 }
284 } 332 }
@@ -327,8 +375,12 @@ namespace OpenSim.Region.Communications.Local
327 375
328 public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData) 376 public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData)
329 { 377 {
378 // OpenSim.Framework.Console.MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Other local region is sending child agent our way: " + agentData.firstname + " " + agentData.lastname);
379
330 if (m_regionListeners.ContainsKey(regionHandle)) 380 if (m_regionListeners.ContainsKey(regionHandle))
331 { 381 {
382 //OpenSim.Framework.Console.MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: found local region to trigger event on: " + agentData.firstname + " " + agentData.lastname);
383
332 TriggerExpectUser(regionHandle, agentData); 384 TriggerExpectUser(regionHandle, agentData);
333 return true; 385 return true;
334 } 386 }