aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
diff options
context:
space:
mode:
authorlbsa712007-09-25 06:33:18 +0000
committerlbsa712007-09-25 06:33:18 +0000
commiteb8640f368ab43b27395690404e845f09366c652 (patch)
tree736cca5f1e34fddfe1291046797547e4367afdb6 /OpenSim/Region/Communications/Local/LocalBackEndServices.cs
parent* Fixed Culture-variant parsing of config options (diff)
downloadopensim-SC-eb8640f368ab43b27395690404e845f09366c652.zip
opensim-SC-eb8640f368ab43b27395690404e845f09366c652.tar.gz
opensim-SC-eb8640f368ab43b27395690404e845f09366c652.tar.bz2
opensim-SC-eb8640f368ab43b27395690404e845f09366c652.tar.xz
* Now the OGS1GridServices has a LocalBackEndServices that it forwards intra-instance requests to
* Every Scene has a ClientManager (as every dog it's day) since two scenes can have the same circuit as client.
Diffstat (limited to 'OpenSim/Region/Communications/Local/LocalBackEndServices.cs')
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs79
1 files changed, 62 insertions, 17 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index 3e23963..9a6bc82 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -30,14 +30,15 @@ using libsecondlife;
30using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Framework.Communications; 31using OpenSim.Framework.Communications;
32using OpenSim.Framework.Types; 32using OpenSim.Framework.Types;
33using System.Collections;
33 34
34namespace OpenSim.Region.Communications.Local 35namespace OpenSim.Region.Communications.Local
35{ 36{
36 37
37 public class LocalBackEndServices : IGridServices, IInterRegionCommunications 38 public class LocalBackEndServices : IGridServices, IInterRegionCommunications
38 { 39 {
39 protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong, RegionInfo>(); 40 protected Dictionary<ulong, RegionInfo> m_regions = new Dictionary<ulong, RegionInfo>();
40 protected Dictionary<ulong, RegionCommsListener> regionHosts = new Dictionary<ulong, RegionCommsListener>(); 41 protected Dictionary<ulong, RegionCommsListener> m_regionListeners = new Dictionary<ulong, RegionCommsListener>();
41 42
42 public LocalBackEndServices() 43 public LocalBackEndServices()
43 { 44 {
@@ -52,12 +53,13 @@ namespace OpenSim.Region.Communications.Local
52 public RegionCommsListener RegisterRegion(RegionInfo regionInfo) 53 public RegionCommsListener RegisterRegion(RegionInfo regionInfo)
53 { 54 {
54 //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); 55 //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
55 if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) 56 if (!this.m_regions.ContainsKey((uint)regionInfo.RegionHandle))
56 { 57 {
57 //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle ); 58 //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle );
58 this.regions.Add(regionInfo.RegionHandle, regionInfo); 59 this.m_regions.Add(regionInfo.RegionHandle, regionInfo);
60
59 RegionCommsListener regionHost = new RegionCommsListener(); 61 RegionCommsListener regionHost = new RegionCommsListener();
60 this.regionHosts.Add(regionInfo.RegionHandle, regionHost); 62 this.m_regionListeners.Add(regionInfo.RegionHandle, regionHost);
61 63
62 return regionHost; 64 return regionHost;
63 } 65 }
@@ -75,7 +77,7 @@ namespace OpenSim.Region.Communications.Local
75 // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle); 77 // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle);
76 List<RegionInfo> neighbours = new List<RegionInfo>(); 78 List<RegionInfo> neighbours = new List<RegionInfo>();
77 79
78 foreach (RegionInfo reg in this.regions.Values) 80 foreach (RegionInfo reg in this.m_regions.Values)
79 { 81 {
80 // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY); 82 // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY);
81 if (reg.RegionHandle != regionInfo.RegionHandle) 83 if (reg.RegionHandle != regionInfo.RegionHandle)
@@ -100,9 +102,9 @@ namespace OpenSim.Region.Communications.Local
100 /// <returns></returns> 102 /// <returns></returns>
101 public RegionInfo RequestNeighbourInfo(ulong regionHandle) 103 public RegionInfo RequestNeighbourInfo(ulong regionHandle)
102 { 104 {
103 if (this.regions.ContainsKey(regionHandle)) 105 if (this.m_regions.ContainsKey(regionHandle))
104 { 106 {
105 return this.regions[regionHandle]; 107 return this.m_regions[regionHandle];
106 } 108 }
107 return null; 109 return null;
108 } 110 }
@@ -118,7 +120,7 @@ namespace OpenSim.Region.Communications.Local
118 public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) 120 public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
119 { 121 {
120 List<MapBlockData> mapBlocks = new List<MapBlockData>(); 122 List<MapBlockData> mapBlocks = new List<MapBlockData>();
121 foreach(RegionInfo regInfo in this.regions.Values) 123 foreach(RegionInfo regInfo in this.m_regions.Values)
122 { 124 {
123 if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) && ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY))) 125 if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) && ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY)))
124 { 126 {
@@ -145,10 +147,10 @@ namespace OpenSim.Region.Communications.Local
145 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData 147 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
146 { 148 {
147 //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); 149 //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent");
148 if (this.regionHosts.ContainsKey(regionHandle)) 150 if (this.m_regionListeners.ContainsKey(regionHandle))
149 { 151 {
150 // Console.WriteLine("CommsManager- Informing a region to expect child agent"); 152 // Console.WriteLine("CommsManager- Informing a region to expect child agent");
151 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData); 153 this.m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
152 return true; 154 return true;
153 } 155 }
154 return false; 156 return false;
@@ -163,18 +165,18 @@ namespace OpenSim.Region.Communications.Local
163 /// <returns></returns> 165 /// <returns></returns>
164 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) 166 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying)
165 { 167 {
166 if (this.regionHosts.ContainsKey(regionHandle)) 168 if (this.m_regionListeners.ContainsKey(regionHandle))
167 { 169 {
168 // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing"); 170 // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing");
169 this.regionHosts[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying); 171 this.m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying);
170 return true; 172 return true;
171 } 173 }
172 return false; 174 return false;
173 } 175 }
174 176
175 public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentID) 177 public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId)
176 { 178 {
177 if (this.regionHosts.ContainsKey(regionHandle)) 179 if (this.m_regionListeners.ContainsKey(regionHandle))
178 { 180 {
179 return true; 181 return true;
180 } 182 }
@@ -201,11 +203,54 @@ namespace OpenSim.Region.Communications.Local
201 agent.startpos = new LLVector3(128, 128, 70); 203 agent.startpos = new LLVector3(128, 128, 70);
202 agent.CapsPath = loginData.CapsPath; 204 agent.CapsPath = loginData.CapsPath;
203 205
204 if (this.regionHosts.ContainsKey(regionHandle)) 206 TriggerExpectUser(regionHandle, agent);
207 }
208
209 public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent)
210 {
211 if (this.m_regionListeners.ContainsKey(regionHandle))
212 {
213 this.m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent);
214 }
215 }
216
217 public void PingCheckReply(Hashtable respData)
218 {
219 foreach (ulong region in this.m_regions.Keys )
205 { 220 {
206 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent); 221 Hashtable regData = new Hashtable();
222 RegionInfo reg = m_regions[region];
223 regData["status"] = "active";
224 regData["handle"] = region.ToString();
225
226 respData[reg.SimUUID.ToStringHyphenated()] = regData;
207 } 227 }
208 } 228 }
229
230 public bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying)
231 {
232 if ( m_regionListeners.ContainsKey(regionHandle))
233 {
234 return m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position,
235 isFlying);
236 }
237
238 return false;
239 }
240
241 public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData)
242 {
243 if (m_regionListeners.ContainsKey(regionHandle))
244 {
245 TriggerExpectUser(regionHandle, agentData);
246 return true;
247 }
248
249 return false;
250 }
251
252
253
209 } 254 }
210} 255}
211 256