diff options
author | lbsa71 | 2007-10-30 09:05:31 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-30 09:05:31 +0000 |
commit | 67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch) | |
tree | 20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Region/Communications/Local/LocalBackEndServices.cs | |
parent | * Deleted .user file (diff) | |
download | opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2 opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz |
* Optimized usings
* Shortened type references
* Removed redundant 'this' qualifier
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Communications/Local/LocalBackEndServices.cs | 63 |
1 files changed, 30 insertions, 33 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 99c4bc3..3a0b47f 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs | |||
@@ -25,25 +25,25 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System.Collections; | ||
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using libsecondlife; | 30 | using libsecondlife; |
30 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
31 | using OpenSim.Framework.Communications; | 32 | using OpenSim.Framework.Communications; |
32 | using OpenSim.Framework; | ||
33 | using System.Collections; | ||
34 | 33 | ||
35 | namespace OpenSim.Region.Communications.Local | 34 | namespace OpenSim.Region.Communications.Local |
36 | { | 35 | { |
37 | |||
38 | public class LocalBackEndServices : IGridServices, IInterRegionCommunications | 36 | public class LocalBackEndServices : IGridServices, IInterRegionCommunications |
39 | { | 37 | { |
40 | protected Dictionary<ulong, RegionInfo> m_regions = new Dictionary<ulong, RegionInfo>(); | 38 | protected Dictionary<ulong, RegionInfo> m_regions = new Dictionary<ulong, RegionInfo>(); |
41 | protected Dictionary<ulong, RegionCommsListener> m_regionListeners = new Dictionary<ulong, RegionCommsListener>(); | 39 | |
40 | protected Dictionary<ulong, RegionCommsListener> m_regionListeners = | ||
41 | new Dictionary<ulong, RegionCommsListener>(); | ||
42 | |||
42 | private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>(); | 43 | private Dictionary<ulong, RegionInfo> m_remoteRegionInfoCache = new Dictionary<ulong, RegionInfo>(); |
43 | 44 | ||
44 | public LocalBackEndServices() | 45 | public LocalBackEndServices() |
45 | { | 46 | { |
46 | |||
47 | } | 47 | } |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
@@ -54,13 +54,13 @@ namespace OpenSim.Region.Communications.Local | |||
54 | public RegionCommsListener RegisterRegion(RegionInfo regionInfo) | 54 | public RegionCommsListener RegisterRegion(RegionInfo regionInfo) |
55 | { | 55 | { |
56 | //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); | 56 | //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); |
57 | if (!this.m_regions.ContainsKey((uint)regionInfo.RegionHandle)) | 57 | if (!m_regions.ContainsKey((uint) regionInfo.RegionHandle)) |
58 | { | 58 | { |
59 | //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle ); | 59 | //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle ); |
60 | this.m_regions.Add(regionInfo.RegionHandle, regionInfo); | 60 | m_regions.Add(regionInfo.RegionHandle, regionInfo); |
61 | 61 | ||
62 | RegionCommsListener regionHost = new RegionCommsListener(); | 62 | RegionCommsListener regionHost = new RegionCommsListener(); |
63 | this.m_regionListeners.Add(regionInfo.RegionHandle, regionHost); | 63 | m_regionListeners.Add(regionInfo.RegionHandle, regionHost); |
64 | 64 | ||
65 | return regionHost; | 65 | return regionHost; |
66 | } | 66 | } |
@@ -103,9 +103,9 @@ namespace OpenSim.Region.Communications.Local | |||
103 | /// <returns></returns> | 103 | /// <returns></returns> |
104 | public RegionInfo RequestNeighbourInfo(ulong regionHandle) | 104 | public RegionInfo RequestNeighbourInfo(ulong regionHandle) |
105 | { | 105 | { |
106 | if (this.m_regions.ContainsKey(regionHandle)) | 106 | if (m_regions.ContainsKey(regionHandle)) |
107 | { | 107 | { |
108 | return this.m_regions[regionHandle]; | 108 | return m_regions[regionHandle]; |
109 | } | 109 | } |
110 | return null; | 110 | return null; |
111 | } | 111 | } |
@@ -121,16 +121,18 @@ namespace OpenSim.Region.Communications.Local | |||
121 | public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) | 121 | public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) |
122 | { | 122 | { |
123 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); | 123 | List<MapBlockData> mapBlocks = new List<MapBlockData>(); |
124 | foreach (RegionInfo regInfo in this.m_regions.Values) | 124 | foreach (RegionInfo regInfo in m_regions.Values) |
125 | { | 125 | { |
126 | if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) && ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY))) | 126 | if (((regInfo.RegionLocX >= minX) && (regInfo.RegionLocX <= maxX)) && |
127 | ((regInfo.RegionLocY >= minY) && (regInfo.RegionLocY <= maxY))) | ||
127 | { | 128 | { |
128 | MapBlockData map = new MapBlockData(); | 129 | MapBlockData map = new MapBlockData(); |
129 | map.Name = regInfo.RegionName; | 130 | map.Name = regInfo.RegionName; |
130 | map.X = (ushort)regInfo.RegionLocX; | 131 | map.X = (ushort) regInfo.RegionLocX; |
131 | map.Y = (ushort)regInfo.RegionLocY; | 132 | map.Y = (ushort) regInfo.RegionLocY; |
132 | map.WaterHeight = (byte)regInfo.EstateSettings.waterHeight; | 133 | map.WaterHeight = (byte) regInfo.EstateSettings.waterHeight; |
133 | map.MapImageId = regInfo.EstateSettings.terrainImageID; //new LLUUID("00000000-0000-0000-9999-000000000007"); | 134 | map.MapImageId = regInfo.EstateSettings.terrainImageID; |
135 | //new LLUUID("00000000-0000-0000-9999-000000000007"); | ||
134 | map.Agents = 1; | 136 | map.Agents = 1; |
135 | map.RegionFlags = 72458694; | 137 | map.RegionFlags = 72458694; |
136 | map.Access = 13; | 138 | map.Access = 13; |
@@ -145,13 +147,14 @@ namespace OpenSim.Region.Communications.Local | |||
145 | /// <param name="regionHandle"></param> | 147 | /// <param name="regionHandle"></param> |
146 | /// <param name="agentData"></param> | 148 | /// <param name="agentData"></param> |
147 | /// <returns></returns> | 149 | /// <returns></returns> |
148 | public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData | 150 | public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) |
151 | //should change from agentCircuitData | ||
149 | { | 152 | { |
150 | //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); | 153 | //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); |
151 | if (this.m_regionListeners.ContainsKey(regionHandle)) | 154 | if (m_regionListeners.ContainsKey(regionHandle)) |
152 | { | 155 | { |
153 | // Console.WriteLine("CommsManager- Informing a region to expect child agent"); | 156 | // Console.WriteLine("CommsManager- Informing a region to expect child agent"); |
154 | this.m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData); | 157 | m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData); |
155 | return true; | 158 | return true; |
156 | } | 159 | } |
157 | return false; | 160 | return false; |
@@ -166,10 +169,10 @@ namespace OpenSim.Region.Communications.Local | |||
166 | /// <returns></returns> | 169 | /// <returns></returns> |
167 | public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) | 170 | public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) |
168 | { | 171 | { |
169 | if (this.m_regionListeners.ContainsKey(regionHandle)) | 172 | if (m_regionListeners.ContainsKey(regionHandle)) |
170 | { | 173 | { |
171 | // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing"); | 174 | // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing"); |
172 | this.m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying); | 175 | m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying); |
173 | return true; | 176 | return true; |
174 | } | 177 | } |
175 | return false; | 178 | return false; |
@@ -177,7 +180,7 @@ namespace OpenSim.Region.Communications.Local | |||
177 | 180 | ||
178 | public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId) | 181 | public bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId) |
179 | { | 182 | { |
180 | if (this.m_regionListeners.ContainsKey(regionHandle)) | 183 | if (m_regionListeners.ContainsKey(regionHandle)) |
181 | { | 184 | { |
182 | return true; | 185 | return true; |
183 | } | 186 | } |
@@ -210,15 +213,15 @@ namespace OpenSim.Region.Communications.Local | |||
210 | 213 | ||
211 | public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) | 214 | public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) |
212 | { | 215 | { |
213 | if (this.m_regionListeners.ContainsKey(regionHandle)) | 216 | if (m_regionListeners.ContainsKey(regionHandle)) |
214 | { | 217 | { |
215 | this.m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent); | 218 | m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent); |
216 | } | 219 | } |
217 | } | 220 | } |
218 | 221 | ||
219 | public void PingCheckReply(Hashtable respData) | 222 | public void PingCheckReply(Hashtable respData) |
220 | { | 223 | { |
221 | foreach (ulong region in this.m_regions.Keys) | 224 | foreach (ulong region in m_regions.Keys) |
222 | { | 225 | { |
223 | Hashtable regData = new Hashtable(); | 226 | Hashtable regData = new Hashtable(); |
224 | RegionInfo reg = m_regions[region]; | 227 | RegionInfo reg = m_regions[region]; |
@@ -234,7 +237,7 @@ namespace OpenSim.Region.Communications.Local | |||
234 | if (m_regionListeners.ContainsKey(regionHandle)) | 237 | if (m_regionListeners.ContainsKey(regionHandle)) |
235 | { | 238 | { |
236 | return m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, | 239 | return m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, |
237 | isFlying); | 240 | isFlying); |
238 | } | 241 | } |
239 | 242 | ||
240 | return false; | 243 | return false; |
@@ -250,11 +253,5 @@ namespace OpenSim.Region.Communications.Local | |||
250 | 253 | ||
251 | return false; | 254 | return false; |
252 | } | 255 | } |
253 | |||
254 | |||
255 | |||
256 | } | 256 | } |
257 | } | 257 | } \ No newline at end of file |
258 | |||
259 | |||
260 | |||