aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs17
-rw-r--r--Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs79
-rw-r--r--Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerOGS.cs12
-rw-r--r--Common/OpenGrid.Framework.Communications/RegionServerCommsLocal.cs107
-rw-r--r--Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs15
-rw-r--r--Common/OpenGrid.Framework.Communications/RegionServerCommsOGS.cs32
-rw-r--r--OpenSim/OpenSim.World/World.cs22
-rw-r--r--OpenSim/OpenSim/OpenSimMain.cs3
8 files changed, 177 insertions, 110 deletions
diff --git a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs
index 11b5ea7..eab7bac 100644
--- a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs
+++ b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerBase.cs
@@ -16,7 +16,7 @@ namespace OpenGrid.Framework.Communications.GridServer
16 /// </summary> 16 /// </summary>
17 /// <param name="regionInfo"></param> 17 /// <param name="regionInfo"></param>
18 /// <returns></returns> 18 /// <returns></returns>
19 public virtual RegionCommsHostBase RegisterRegion(RegionInfo regionInfo) 19 internal virtual RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
20 { 20 {
21 return null; 21 return null;
22 } 22 }
@@ -30,21 +30,6 @@ namespace OpenGrid.Framework.Communications.GridServer
30 { 30 {
31 return null; 31 return null;
32 } 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 33
49 } 34 }
50} 35}
diff --git a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs
index 774585a..9e7f1e5 100644
--- a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs
+++ b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerLocal.cs
@@ -11,94 +11,19 @@ namespace OpenGrid.Framework.Communications.GridServer
11{ 11{
12 public class GridCommsManagerLocal : GridCommsManagerBase 12 public class GridCommsManagerLocal : GridCommsManagerBase
13 { 13 {
14 protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong, RegionInfo>();
15 protected Dictionary<ulong, RegionCommsHostBase> regionHosts = new Dictionary<ulong, RegionCommsHostBase>();
16
17 public GridCommsManagerLocal() 14 public GridCommsManagerLocal()
18 { 15 {
19 16
20 } 17 }
21 18
22 public override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo) 19 internal override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
23 { 20 {
24 //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
25 if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
26 {
27 //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle );
28 this.regions.Add(regionInfo.RegionHandle, regionInfo);
29 RegionCommsHostBase regionHost = new RegionCommsHostBase();
30 this.regionHosts.Add(regionInfo.RegionHandle, regionHost);
31 return regionHost;
32 }
33
34 //already in our list of regions so for now lets return null
35 return null; 21 return null;
36 } 22 }
37 23
38
39 public override List<RegionInfo> RequestNeighbours(RegionInfo regionInfo) 24 public override List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
40 { 25 {
41 // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle); 26 return null;
42 List<RegionInfo> neighbours = new List<RegionInfo>();
43
44 foreach (RegionInfo reg in this.regions.Values)
45 {
46 // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY);
47 if (reg.RegionHandle != regionInfo.RegionHandle)
48 {
49 //Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location");
50 if ((reg.RegionLocX > (regionInfo.RegionLocX - 2)) && (reg.RegionLocX < (regionInfo.RegionLocX + 2)))
51 {
52 if ((reg.RegionLocY > (regionInfo.RegionLocY - 2)) && (reg.RegionLocY < (regionInfo.RegionLocY + 2)))
53 {
54 neighbours.Add(reg);
55 }
56 }
57 }
58 }
59 return neighbours;
60 }
61
62 public override bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
63 {
64 //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent");
65 if (this.regionHosts.ContainsKey(regionHandle))
66 {
67 // Console.WriteLine("CommsManager- Informing a region to expect child agent");
68 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData);
69 return true;
70 }
71 return false;
72 }
73
74 /// <summary>
75 /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session
76 /// </summary>
77 /// <param name="regionHandle"></param>
78 /// <param name="loginData"></param>
79 /// <returns></returns>
80 public override bool AddNewSession(ulong regionHandle, Login loginData)
81 {
82 //Console.WriteLine(" comms manager been told to expect new user");
83 AgentCircuitData agent = new AgentCircuitData();
84 agent.AgentID = loginData.Agent;
85 agent.firstname = loginData.First;
86 agent.lastname = loginData.Last;
87 agent.SessionID = loginData.Session;
88 agent.SecureSessionID = loginData.SecureSession;
89 agent.circuitcode = loginData.CircuitCode;
90 agent.BaseFolder = loginData.BaseFolder;
91 agent.InventoryFolder = loginData.InventoryFolder;
92 agent.startpos = new LLVector3(128, 128, 70);
93
94 if (this.regionHosts.ContainsKey(regionHandle))
95 {
96 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent);
97 return true;
98 }
99
100 // region not found
101 return false;
102 } 27 }
103 } 28 }
104} 29}
diff --git a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerOGS.cs b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerOGS.cs
index 415c1d8..1788873 100644
--- a/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerOGS.cs
+++ b/Common/OpenGrid.Framework.Communications/GridServer/GridCommsManagerOGS.cs
@@ -13,7 +13,7 @@ namespace OpenGrid.Framework.Communications.GridServer
13 { 13 {
14 } 14 }
15 15
16 public override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo) 16 internal override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
17 { 17 {
18 return null; 18 return null;
19 } 19 }
@@ -22,15 +22,5 @@ namespace OpenGrid.Framework.Communications.GridServer
22 { 22 {
23 return null; 23 return null;
24 } 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 } 25 }
36} 26}
diff --git a/Common/OpenGrid.Framework.Communications/RegionServerCommsLocal.cs b/Common/OpenGrid.Framework.Communications/RegionServerCommsLocal.cs
index 0743cbf..fcccb49 100644
--- a/Common/OpenGrid.Framework.Communications/RegionServerCommsLocal.cs
+++ b/Common/OpenGrid.Framework.Communications/RegionServerCommsLocal.cs
@@ -11,10 +11,117 @@ namespace OpenGrid.Framework.Communications
11{ 11{
12 public class RegionServerCommsLocal : RegionServerCommsManager 12 public class RegionServerCommsLocal : RegionServerCommsManager
13 { 13 {
14 protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong, RegionInfo>();
15 protected Dictionary<ulong, RegionCommsHostBase> regionHosts = new Dictionary<ulong, RegionCommsHostBase>();
16
14 public RegionServerCommsLocal() 17 public RegionServerCommsLocal()
15 { 18 {
16 userServer = new UserServer.UserCommsManagerLocal(); //Local User Server 19 userServer = new UserServer.UserCommsManagerLocal(); //Local User Server
17 gridServer = new GridServer.GridCommsManagerLocal(); //Locl Grid Server 20 gridServer = new GridServer.GridCommsManagerLocal(); //Locl Grid Server
18 } 21 }
22
23 /// <summary>
24 /// Main Register a region method with the CommsManager.
25 /// Should do anything that is needed and also call the RegisterRegion method in the gridserver class
26 /// to inform the grid server (in grid mode).
27 /// </summary>
28 /// <param name="regionInfo"></param>
29 /// <returns></returns>
30 public override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
31 {
32 //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
33 if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
34 {
35 //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle );
36 this.regions.Add(regionInfo.RegionHandle, regionInfo);
37 RegionCommsHostBase regionHost = new RegionCommsHostBase();
38 this.regionHosts.Add(regionInfo.RegionHandle, regionHost);
39
40 return regionHost;
41 }
42
43 //already in our list of regions so for now lets return null
44 return null;
45 }
46
47 /// <summary>
48 /// In the current class structure this shouldn't be here as it should only be in the gridserver class
49 /// but having it there in sandbox mode makes things very difficult, so for now until something is sorted out
50 /// it will have to be here as well
51 /// </summary>
52 /// <param name="regionInfo"></param>
53 /// <returns></returns>
54 public override List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
55 {
56 // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle);
57 List<RegionInfo> neighbours = new List<RegionInfo>();
58
59 foreach (RegionInfo reg in this.regions.Values)
60 {
61 // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY);
62 if (reg.RegionHandle != regionInfo.RegionHandle)
63 {
64 //Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location");
65 if ((reg.RegionLocX > (regionInfo.RegionLocX - 2)) && (reg.RegionLocX < (regionInfo.RegionLocX + 2)))
66 {
67 if ((reg.RegionLocY > (regionInfo.RegionLocY - 2)) && (reg.RegionLocY < (regionInfo.RegionLocY + 2)))
68 {
69 neighbours.Add(reg);
70 }
71 }
72 }
73 }
74 return neighbours;
75 }
76
77 /// <summary>
78 /// informs a neighbouring sim to expect a child agent
79 /// I guess if we are going to stick with the current class structure then we need a intersim class
80 /// but think we need to really rethink the class structure as currently it makes things very messy for sandbox mode
81 /// </summary>
82 /// <param name="regionHandle"></param>
83 /// <param name="agentData"></param>
84 /// <returns></returns>
85 public override bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
86 {
87 //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent");
88 if (this.regionHosts.ContainsKey(regionHandle))
89 {
90 // Console.WriteLine("CommsManager- Informing a region to expect child agent");
91 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData);
92 return true;
93 }
94 return false;
95 }
96
97 /// <summary>
98 /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session
99 /// </summary>
100 /// <param name="regionHandle"></param>
101 /// <param name="loginData"></param>
102 /// <returns></returns>
103 public bool AddNewSession(ulong regionHandle, Login loginData)
104 {
105 //Console.WriteLine(" comms manager been told to expect new user");
106 AgentCircuitData agent = new AgentCircuitData();
107 agent.AgentID = loginData.Agent;
108 agent.firstname = loginData.First;
109 agent.lastname = loginData.Last;
110 agent.SessionID = loginData.Session;
111 agent.SecureSessionID = loginData.SecureSession;
112 agent.circuitcode = loginData.CircuitCode;
113 agent.BaseFolder = loginData.BaseFolder;
114 agent.InventoryFolder = loginData.InventoryFolder;
115 agent.startpos = new LLVector3(128, 128, 70);
116
117 if (this.regionHosts.ContainsKey(regionHandle))
118 {
119 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent);
120 return true;
121 }
122
123 // region not found
124 return false;
125 }
19 } 126 }
20} 127}
diff --git a/Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs b/Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs
index 38bce42..b3a4a8f 100644
--- a/Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs
+++ b/Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs
@@ -19,5 +19,20 @@ namespace OpenGrid.Framework.Communications
19 { 19 {
20 20
21 } 21 }
22
23 public virtual RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
24 {
25 return null;
26 }
27
28 public virtual List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
29 {
30 return null;
31 }
32
33 public virtual bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
34 {
35 return false;
36 }
22 } 37 }
23} 38}
diff --git a/Common/OpenGrid.Framework.Communications/RegionServerCommsOGS.cs b/Common/OpenGrid.Framework.Communications/RegionServerCommsOGS.cs
index b0db473..b746f92 100644
--- a/Common/OpenGrid.Framework.Communications/RegionServerCommsOGS.cs
+++ b/Common/OpenGrid.Framework.Communications/RegionServerCommsOGS.cs
@@ -1,6 +1,8 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using OpenSim.Framework;
5using OpenSim.Framework.Types;
4 6
5namespace OpenGrid.Framework.Communications 7namespace OpenGrid.Framework.Communications
6{ 8{
@@ -11,5 +13,35 @@ namespace OpenGrid.Framework.Communications
11 userServer = new UserServer.UserCommsManagerOGS(); //Remote User Server 13 userServer = new UserServer.UserCommsManagerOGS(); //Remote User Server
12 gridServer = new GridServer.GridCommsManagerOGS(); //Remote Grid Server 14 gridServer = new GridServer.GridCommsManagerOGS(); //Remote Grid Server
13 } 15 }
16
17 public override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
18 {
19 return gridServer.RegisterRegion(regionInfo);
20 }
21
22 /// <summary>
23 /// In the current class structure this shouldn't be here as it should only be in the gridserver class
24 /// but having it there in sandbox mode makes things very difficult, so for now until something is sorted out
25 /// it will have to be here as well
26 /// </summary>
27 /// <param name="regionInfo"></param>
28 /// <returns></returns>
29 public override List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
30 {
31 return gridServer.RequestNeighbours(regionInfo);
32 }
33
34 /// <summary>
35 /// informs a neighbouring sim to expect a child agent
36 /// I guess if we are going to stick with the current class structure then we need a intersim class
37 /// but think we need to really rethink the class structure as currently it makes things very messy for sandbox mode
38 /// </summary>
39 /// <param name="regionHandle"></param>
40 /// <param name="agentData"></param>
41 /// <returns></returns>
42 public override bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
43 {
44 return false;
45 }
14 } 46 }
15} 47}
diff --git a/OpenSim/OpenSim.World/World.cs b/OpenSim/OpenSim.World/World.cs
index 7ef06e2..cc2b04e 100644
--- a/OpenSim/OpenSim.World/World.cs
+++ b/OpenSim/OpenSim.World/World.cs
@@ -523,7 +523,7 @@ namespace OpenSim.world
523 protected void InformClientOfNeighbours(IClientAPI remoteClient) 523 protected void InformClientOfNeighbours(IClientAPI remoteClient)
524 { 524 {
525 // Console.WriteLine("informing client of neighbouring regions"); 525 // Console.WriteLine("informing client of neighbouring regions");
526 List<RegionInfo> neighbours = this.commsManager.gridServer.RequestNeighbours(this.m_regInfo); 526 List<RegionInfo> neighbours = this.commsManager.RequestNeighbours(this.m_regInfo);
527 527
528 //Console.WriteLine("we have " + neighbours.Count + " neighbouring regions"); 528 //Console.WriteLine("we have " + neighbours.Count + " neighbouring regions");
529 if (neighbours != null) 529 if (neighbours != null)
@@ -535,7 +535,7 @@ namespace OpenSim.world
535 agent.BaseFolder = LLUUID.Zero; 535 agent.BaseFolder = LLUUID.Zero;
536 agent.InventoryFolder = LLUUID.Zero; 536 agent.InventoryFolder = LLUUID.Zero;
537 agent.startpos = new LLVector3(128, 128, 70); 537 agent.startpos = new LLVector3(128, 128, 70);
538 this.commsManager.gridServer.InformNeighbourOfChildAgent(neighbours[i].RegionHandle, agent); 538 this.commsManager.InformNeighbourOfChildAgent(neighbours[i].RegionHandle, agent);
539 remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, System.Net.IPAddress.Parse(neighbours[i].IPListenAddr), (ushort)neighbours[i].IPListenPort); 539 remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, System.Net.IPAddress.Parse(neighbours[i].IPListenAddr), (ushort)neighbours[i].IPListenPort);
540 } 540 }
541 } 541 }
@@ -591,18 +591,26 @@ namespace OpenSim.world
591 591
592 #region RegionCommsHost 592 #region RegionCommsHost
593 593
594 /// <summary>
595 ///
596 /// </summary>
594 public void RegisterRegionWithComms() 597 public void RegisterRegionWithComms()
595 { 598 {
596 this.regionCommsHost = this.commsManager.gridServer.RegisterRegion(this.m_regInfo); 599 this.regionCommsHost = this.commsManager.RegisterRegion(this.m_regInfo);
597 if (this.regionCommsHost != null) 600 if (this.regionCommsHost != null)
598 { 601 {
599 this.regionCommsHost.OnExpectUser += new ExpectUserDelegate(this.NewUserConnection); 602 this.regionCommsHost.OnExpectUser += new ExpectUserDelegate(this.NewUserConnection);
600 } 603 }
601 } 604 }
602 605
606 /// <summary>
607 ///
608 /// </summary>
609 /// <param name="regionHandle"></param>
610 /// <param name="agent"></param>
603 public void NewUserConnection(ulong regionHandle, AgentCircuitData agent) 611 public void NewUserConnection(ulong regionHandle, AgentCircuitData agent)
604 { 612 {
605 Console.WriteLine("World.cs - add new user connection"); 613 // Console.WriteLine("World.cs - add new user connection");
606 //should just check that its meant for this region 614 //should just check that its meant for this region
607 if (regionHandle == this.m_regInfo.RegionHandle) 615 if (regionHandle == this.m_regInfo.RegionHandle)
608 { 616 {
@@ -612,6 +620,12 @@ namespace OpenSim.world
612 620
613 #endregion 621 #endregion
614 622
623 /// <summary>
624 ///
625 /// </summary>
626 /// <param name="px"></param>
627 /// <param name="py"></param>
628 /// <param name="RemoteClient"></param>
615 public override void SendLayerData(int px, int py, IClientAPI RemoteClient) 629 public override void SendLayerData(int px, int py, IClientAPI RemoteClient)
616 { 630 {
617 RemoteClient.SendLayerData( Terrain.getHeights1D() ); 631 RemoteClient.SendLayerData( Terrain.getHeights1D() );
diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs
index 53adce9..a90e14b 100644
--- a/OpenSim/OpenSim/OpenSimMain.cs
+++ b/OpenSim/OpenSim/OpenSimMain.cs
@@ -104,7 +104,6 @@ namespace OpenSim
104 this.checkServer = new CheckSumServer(12036); 104 this.checkServer = new CheckSumServer(12036);
105 this.checkServer.ServerListener(); 105 this.checkServer.ServerListener();
106 this.commsManager = new RegionServerCommsLocal(); 106 this.commsManager = new RegionServerCommsLocal();
107 new RegionServerCommsOGS();
108 } 107 }
109 else 108 else
110 { 109 {
@@ -132,7 +131,7 @@ namespace OpenSim
132 loginServer = new LoginServer(regionData[0].IPListenAddr, regionData[0].IPListenPort, regionData[0].RegionLocX, regionData[0].RegionLocY, false); 131 loginServer = new LoginServer(regionData[0].IPListenAddr, regionData[0].IPListenPort, regionData[0].RegionLocX, regionData[0].RegionLocY, false);
133 loginServer.Startup(); 132 loginServer.Startup();
134 //loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler[0]).AddNewSession); 133 //loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler[0]).AddNewSession);
135 loginServer.SetSessionHandler(((RegionServerCommsManager)this.commsManager).gridServer.AddNewSession); 134 loginServer.SetSessionHandler(((RegionServerCommsLocal)this.commsManager).AddNewSession);
136 //sandbox mode with loginserver not using accounts 135 //sandbox mode with loginserver not using accounts
137 httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod); 136 httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod);
138 } 137 }