aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common/OpenGrid.Framework.Communications/GridServer
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs50
-rw-r--r--Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs (renamed from Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs)41
-rw-r--r--Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerOGS.cs36
3 files changed, 100 insertions, 27 deletions
diff --git a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs
new file mode 100644
index 0000000..11b5ea7
--- /dev/null
+++ b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs
@@ -0,0 +1,50 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Framework.Types;
5using OpenSim.Framework;
6
7namespace OpenGrid.Framework.Communications.GridServer
8{
9 public class GridCommsManagerBase
10 {
11 public GridCommsManagerBase()
12 {
13 }
14 /// <summary>
15 ///
16 /// </summary>
17 /// <param name="regionInfo"></param>
18 /// <returns></returns>
19 public virtual RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
20 {
21 return null;
22 }
23
24 /// <summary>
25 ///
26 /// </summary>
27 /// <param name="regionInfo"></param>
28 /// <returns></returns>
29 public virtual List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
30 {
31 return null;
32 }
33
34 /// <summary>
35 ///
36 /// </summary>
37 /// <returns></returns>
38 public virtual bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
39 {
40 return false;
41 }
42
43 public virtual bool AddNewSession(ulong regionHandle, Login loginData)
44 {
45 return false;
46 }
47
48
49 }
50}
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 @@
1using System; 1using System;
2using System.Collections;
3using System.Collections.Generic; 2using System.Collections.Generic;
4using System.Text; 3using System.Text;
5using libsecondlife; 4
6using OpenSim.Framework; 5using OpenSim.Framework;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Types; 6using OpenSim.Framework.Types;
9 7
10namespace OpenGrid.Framework.Communications 8using libsecondlife;
9
10namespace 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();
diff --git a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerOGS.cs b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerOGS.cs
new file mode 100644
index 0000000..415c1d8
--- /dev/null
+++ b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerOGS.cs
@@ -0,0 +1,36 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5using OpenSim.Framework;
6using OpenSim.Framework.Types;
7
8namespace OpenGrid.Framework.Communications.GridServer
9{
10 public class GridCommsManagerOGS : GridCommsManagerBase
11 {
12 public GridCommsManagerOGS()
13 {
14 }
15
16 public override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
17 {
18 return null;
19 }
20
21 public override List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
22 {
23 return null;
24 }
25
26 public override bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
27 {
28 return false;
29 }
30
31 public override bool AddNewSession(ulong regionHandle, Login loginData)
32 {
33 return false;
34 }
35 }
36}