After nearly a hour of searching for an annoying bug (which turned out to be a new statement one line outside the loop it should have been in)....Multi-Regions in a single instance work, there is no Grid mode communication, so it can only be tested in sandbox mode right now.
All you need to do is put .xml files for each region you want to be ran by the single server inside the "bin\Regions" folder (make sure none of the settings in those .xml files conflict with each other) and then startup the server and login, Any neighbouring regions that are being ran in the instance should show up. (However there is still no movement or anything) Now time to refine the communications interfaces!merge
parent
e92ab35b05
commit
f4448fcd7d
|
@ -26,12 +26,17 @@ namespace OpenGrid.Framework.Communications
|
|||
/// <returns></returns>
|
||||
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
|
|||
/// <returns></returns>
|
||||
public override List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
|
||||
{
|
||||
return null;
|
||||
// Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle);
|
||||
List<RegionInfo> neighbours = new List<RegionInfo>();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -55,6 +79,13 @@ namespace OpenGrid.Framework.Communications
|
|||
/// <returns></returns>
|
||||
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
|
|||
/// <returns></returns>
|
||||
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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -504,16 +504,22 @@ namespace OpenSim.world
|
|||
/// </summary>
|
||||
protected void InformClientOfNeighbours(IClientAPI remoteClient)
|
||||
{
|
||||
// Console.WriteLine("informing client of neighbouring regions");
|
||||
List<RegionInfo> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue