diff options
Diffstat (limited to '')
-rw-r--r-- | Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs (renamed from Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs) | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs index fad2001..774585a 100644 --- a/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs +++ b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs | |||
@@ -1,29 +1,24 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections; | ||
3 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
4 | using System.Text; | 3 | using System.Text; |
5 | using libsecondlife; | 4 | |
6 | using OpenSim.Framework; | 5 | using OpenSim.Framework; |
7 | using OpenSim.Framework.Interfaces; | ||
8 | using OpenSim.Framework.Types; | 6 | using OpenSim.Framework.Types; |
9 | 7 | ||
10 | namespace OpenGrid.Framework.Communications | 8 | using libsecondlife; |
9 | |||
10 | namespace OpenGrid.Framework.Communications.GridServer | ||
11 | { | 11 | { |
12 | public class TestLocalCommsManager : RegionServerCommsManager | 12 | public class GridCommsManagerLocal : GridCommsManagerBase |
13 | { | 13 | { |
14 | protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong,RegionInfo>(); | 14 | protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong, RegionInfo>(); |
15 | protected Dictionary<ulong, RegionCommsHostBase> regionHosts = new Dictionary<ulong, RegionCommsHostBase>(); | 15 | protected Dictionary<ulong, RegionCommsHostBase> regionHosts = new Dictionary<ulong, RegionCommsHostBase>(); |
16 | 16 | ||
17 | public TestLocalCommsManager() | 17 | public GridCommsManagerLocal() |
18 | { | 18 | { |
19 | 19 | ||
20 | } | 20 | } |
21 | 21 | ||
22 | /// <summary> | ||
23 | /// | ||
24 | /// </summary> | ||
25 | /// <param name="regionInfo"></param> | ||
26 | /// <returns></returns> | ||
27 | public override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo) | 22 | public override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo) |
28 | { | 23 | { |
29 | //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); | 24 | //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); |
@@ -32,27 +27,23 @@ namespace OpenGrid.Framework.Communications | |||
32 | //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle ); | 27 | //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle ); |
33 | this.regions.Add(regionInfo.RegionHandle, regionInfo); | 28 | this.regions.Add(regionInfo.RegionHandle, regionInfo); |
34 | RegionCommsHostBase regionHost = new RegionCommsHostBase(); | 29 | RegionCommsHostBase regionHost = new RegionCommsHostBase(); |
35 | this.regionHosts.Add(regionInfo.RegionHandle, regionHost); | 30 | this.regionHosts.Add(regionInfo.RegionHandle, regionHost); |
36 | return regionHost; | 31 | return regionHost; |
37 | } | 32 | } |
38 | 33 | ||
39 | //already in our list of regions so for now lets return null | 34 | //already in our list of regions so for now lets return null |
40 | return null; | 35 | return null; |
41 | } | 36 | } |
42 | 37 | ||
43 | /// <summary> | 38 | |
44 | /// | ||
45 | /// </summary> | ||
46 | /// <param name="regionInfo"></param> | ||
47 | /// <returns></returns> | ||
48 | public override List<RegionInfo> RequestNeighbours(RegionInfo regionInfo) | 39 | public override List<RegionInfo> RequestNeighbours(RegionInfo regionInfo) |
49 | { | 40 | { |
50 | // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle); | 41 | // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle); |
51 | List<RegionInfo> neighbours = new List<RegionInfo>(); | 42 | List<RegionInfo> neighbours = new List<RegionInfo>(); |
52 | 43 | ||
53 | foreach (RegionInfo reg in this.regions.Values) | 44 | foreach (RegionInfo reg in this.regions.Values) |
54 | { | 45 | { |
55 | // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY); | 46 | // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY); |
56 | if (reg.RegionHandle != regionInfo.RegionHandle) | 47 | if (reg.RegionHandle != regionInfo.RegionHandle) |
57 | { | 48 | { |
58 | //Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location"); | 49 | //Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location"); |
@@ -68,16 +59,12 @@ namespace OpenGrid.Framework.Communications | |||
68 | return neighbours; | 59 | return neighbours; |
69 | } | 60 | } |
70 | 61 | ||
71 | /// <summary> | ||
72 | /// | ||
73 | /// </summary> | ||
74 | /// <returns></returns> | ||
75 | public override bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData | 62 | public override bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData |
76 | { | 63 | { |
77 | //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); | 64 | //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); |
78 | if (this.regionHosts.ContainsKey(regionHandle)) | 65 | if (this.regionHosts.ContainsKey(regionHandle)) |
79 | { | 66 | { |
80 | // Console.WriteLine("CommsManager- Informing a region to expect child agent"); | 67 | // Console.WriteLine("CommsManager- Informing a region to expect child agent"); |
81 | this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData); | 68 | this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData); |
82 | return true; | 69 | return true; |
83 | } | 70 | } |
@@ -90,7 +77,7 @@ namespace OpenGrid.Framework.Communications | |||
90 | /// <param name="regionHandle"></param> | 77 | /// <param name="regionHandle"></param> |
91 | /// <param name="loginData"></param> | 78 | /// <param name="loginData"></param> |
92 | /// <returns></returns> | 79 | /// <returns></returns> |
93 | public bool AddNewSession(ulong regionHandle, Login loginData) | 80 | public override bool AddNewSession(ulong regionHandle, Login loginData) |
94 | { | 81 | { |
95 | //Console.WriteLine(" comms manager been told to expect new user"); | 82 | //Console.WriteLine(" comms manager been told to expect new user"); |
96 | AgentCircuitData agent = new AgentCircuitData(); | 83 | AgentCircuitData agent = new AgentCircuitData(); |