diff --git a/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs b/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs
index 54ca966135..c82c8204a2 100644
--- a/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs
+++ b/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs
@@ -26,12 +26,17 @@ namespace OpenGrid.Framework.Communications
///
public override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
{
+ //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
+
if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
{
+ //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle );
+
this.regions.Add(regionInfo.RegionHandle, regionInfo);
RegionCommsHostBase regionHost = new RegionCommsHostBase();
this.regionHosts.Add(regionInfo.RegionHandle, regionHost);
+
return regionHost;
}
@@ -46,7 +51,26 @@ namespace OpenGrid.Framework.Communications
///
public override List RequestNeighbours(RegionInfo regionInfo)
{
- return null;
+ // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle);
+ List neighbours = new List();
+
+ foreach (RegionInfo reg in this.regions.Values)
+ {
+ // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY);
+ if (reg.RegionHandle != regionInfo.RegionHandle)
+ {
+ //Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location");
+ if ((reg.RegionLocX > (regionInfo.RegionLocX - 2)) && (reg.RegionLocX < (regionInfo.RegionLocX + 2)))
+ {
+ if ((reg.RegionLocY > (regionInfo.RegionLocY - 2)) && (reg.RegionLocY < (regionInfo.RegionLocY + 2)))
+ {
+ neighbours.Add(reg);
+ }
+ }
+ }
+ }
+
+ return neighbours;
}
///
@@ -55,6 +79,13 @@ namespace OpenGrid.Framework.Communications
///
public override bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
{
+ //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent");
+ if (this.regionHosts.ContainsKey(regionHandle))
+ {
+ // Console.WriteLine("CommsManager- Informing a region to expect child agent");
+ this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData);
+ return true;
+ }
return false;
}
@@ -66,7 +97,7 @@ namespace OpenGrid.Framework.Communications
///
public bool AddNewSession(ulong regionHandle, Login loginData)
{
- Console.WriteLine(" comms manager been told to expect new user");
+ //Console.WriteLine(" comms manager been told to expect new user");
AgentCircuitData agent = new AgentCircuitData();
agent.AgentID = loginData.Agent;
agent.firstname = loginData.First;
diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
index 78be30a4d9..810345f31f 100644
--- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
+++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
@@ -84,6 +84,7 @@ namespace OpenSim.Framework.Interfaces
void SendRegionHandshake(RegionInfo regionInfo);
void MoveAgentIntoRegion(RegionInfo regInfo);
void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos);
+ void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort);
AgentCircuitData RequestClientInfo();
}
}
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
index e14b7b7cd6..89c1f61bbe 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
@@ -374,7 +374,7 @@ namespace OpenSim
return objdata;
}
- protected void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort)
+ public void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort)
{
EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
diff --git a/OpenSim/OpenSim.World/World.cs b/OpenSim/OpenSim.World/World.cs
index 2c5971d3a2..1d56ea32a0 100644
--- a/OpenSim/OpenSim.World/World.cs
+++ b/OpenSim/OpenSim.World/World.cs
@@ -504,16 +504,22 @@ namespace OpenSim.world
///
protected void InformClientOfNeighbours(IClientAPI remoteClient)
{
+ // Console.WriteLine("informing client of neighbouring regions");
List neighbours = this.commsManager.RequestNeighbours(this.m_regInfo);
-
- for (int i = 0; i < neighbours.Count; i++)
+ //Console.WriteLine("we have " + neighbours.Count + " neighbouring regions");
+ if (neighbours != null)
{
- AgentCircuitData agent = remoteClient.RequestClientInfo();
- agent.BaseFolder = LLUUID.Zero;
- agent.InventoryFolder = LLUUID.Zero;
- agent.startpos = new LLVector3(128, 128, 70);
- this.commsManager.InformNeighbourOfChildAgent(neighbours[i].RegionHandle, agent);
+ for (int i = 0; i < neighbours.Count; i++)
+ {
+ // Console.WriteLine("sending neighbours data");
+ AgentCircuitData agent = remoteClient.RequestClientInfo();
+ agent.BaseFolder = LLUUID.Zero;
+ agent.InventoryFolder = LLUUID.Zero;
+ agent.startpos = new LLVector3(128, 128, 70);
+ this.commsManager.InformNeighbourOfChildAgent(neighbours[i].RegionHandle, agent);
+ remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, System.Net.IPAddress.Parse(neighbours[i].IPListenAddr), (ushort)neighbours[i].IPListenPort);
+ }
}
}
diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs
index 66aadb0852..7c83dee6b1 100644
--- a/OpenSim/OpenSim/OpenSimMain.cs
+++ b/OpenSim/OpenSim/OpenSimMain.cs
@@ -61,6 +61,7 @@ namespace OpenSim
private CheckSumServer checkServer;
protected RegionServerCommsManager commsManager;
+
public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
{
this.configFileSetup = useConfigFile;
@@ -209,6 +210,7 @@ namespace OpenSim
for (int i = 0; i < configFiles.Length; i++)
{
+ regionDat = new RegionInfo();
if (m_sandbox)
{
AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal();
@@ -259,7 +261,7 @@ namespace OpenSim
protected override void SetupHttpListener()
{
- httpServer = new BaseHttpServer(regionData[0].IPListenPort);
+ httpServer = new BaseHttpServer(9000); //regionData[0].IPListenPort);
if (!this.m_sandbox)
{