Refactoring:

* Renamed IPListenAddr to CommsIPListenAddr
* Renamed IPListenPort to CommsIPListenPort
New Features:
* Begun OGS/.1 implementation -- created new temporary "GridInfo" class to hold grid settings, needs reworking to wherever settings are stored these days.
Sugilite
Adam Frisby 2007-06-24 17:01:08 +00:00
parent 1b8b75d80a
commit 980a8cc629
8 changed files with 59 additions and 21 deletions

View File

@ -34,9 +34,16 @@ using OpenSim.Framework;
namespace OpenGrid.Framework.Communications namespace OpenGrid.Framework.Communications
{ {
public class GridInfo
{
public string GridServerURI = "http://grid:8001/";
public string GridServerSendKey = "badger";
public string GridServerRecvKey = "badger";
}
public interface IGridServices public interface IGridServices
{ {
RegionCommsListener RegisterRegion(RegionInfo regionInfo); RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo);
List<RegionInfo> RequestNeighbours(RegionInfo regionInfo); List<RegionInfo> RequestNeighbours(RegionInfo regionInfo);
RegionInfo RequestNeighbourInfo(ulong regionHandle); RegionInfo RequestNeighbourInfo(ulong regionHandle);
List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY);

View File

@ -52,8 +52,19 @@ namespace OpenSim.Framework.Types
public string MasterAvatarLastName = ""; public string MasterAvatarLastName = "";
public string MasterAvatarSandboxPassword = ""; public string MasterAvatarSandboxPassword = "";
public int IPListenPort = 0; /// <summary>
public string IPListenAddr = ""; /// Port used for listening (TCP and UDP)
/// </summary>
/// <remarks>Seperate TCP and UDP</remarks>
public int CommsIPListenPort = 0;
/// <summary>
/// Address used for internal listening (default: 0.0.0.0?)
/// </summary>
public string CommsIPListenAddr = "";
/// <summary>
/// Address used for external addressing (DNS or IP)
/// </summary>
public string CommsExternalAddress = "";
public EstateSettings estateSettings; public EstateSettings estateSettings;
@ -142,11 +153,11 @@ namespace OpenSim.Framework.Types
{ {
string port = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("UDP port for client connections", "9000"); string port = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("UDP port for client connections", "9000");
configData.SetAttribute("SimListenPort", port); configData.SetAttribute("SimListenPort", port);
this.IPListenPort = Convert.ToInt32(port); this.CommsIPListenPort = Convert.ToInt32(port);
} }
else else
{ {
this.IPListenPort = Convert.ToInt32(attri); this.CommsIPListenPort = Convert.ToInt32(attri);
} }
//Sim Listen Address //Sim Listen Address
@ -154,8 +165,8 @@ namespace OpenSim.Framework.Types
attri = configData.GetAttribute("SimListenAddress"); attri = configData.GetAttribute("SimListenAddress");
if (attri == "") if (attri == "")
{ {
this.IPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "127.0.0.1"); this.CommsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0");
configData.SetAttribute("SimListenAddress", this.IPListenAddr); configData.SetAttribute("SimListenAddress", this.CommsIPListenAddr);
} }
else else
{ {
@ -166,20 +177,33 @@ namespace OpenSim.Framework.Types
System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname); System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname);
try try
{ {
this.IPListenAddr = ips[0].ToString(); this.CommsIPListenAddr = ips[0].ToString();
} }
catch (Exception e) catch (Exception e)
{ {
e.ToString(); e.ToString();
this.IPListenAddr = "127.0.0.1"; // Use the default if we fail this.CommsIPListenAddr = "0.0.0.0"; // Use the default if we fail
} }
} }
else else
{ {
this.IPListenAddr = attri; this.CommsIPListenAddr = attri;
} }
} }
// Sim External Address
attri = "";
attri = configData.GetAttribute("SimExternalAddress");
if (attri == "")
{
this.CommsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost");
configData.SetAttribute("SimExternalAddress", this.CommsExternalAddress);
}
else
{
this.CommsExternalAddress = attri;
}
attri = ""; attri = "";
attri = configData.GetAttribute("TerrainFile"); attri = configData.GetAttribute("TerrainFile");
if (attri == "") if (attri == "")
@ -263,7 +287,7 @@ namespace OpenSim.Framework.Types
OpenSim.Framework.Console.MainLog.Instance.Verbose( "Name: " + this.RegionName); OpenSim.Framework.Console.MainLog.Instance.Verbose( "Name: " + this.RegionName);
OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]");
OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Handle: " + this.RegionHandle.ToString()); OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Handle: " + this.RegionHandle.ToString());
OpenSim.Framework.Console.MainLog.Instance.Verbose( "Listening on IP: " + this.IPListenAddr + ":" + this.IPListenPort); OpenSim.Framework.Console.MainLog.Instance.Verbose( "Listening on IP: " + this.CommsIPListenAddr + ":" + this.CommsIPListenPort);
OpenSim.Framework.Console.MainLog.Instance.Verbose( "Sandbox Mode? " + isSandbox.ToString()); OpenSim.Framework.Console.MainLog.Instance.Verbose( "Sandbox Mode? " + isSandbox.ToString());
} }

View File

@ -50,6 +50,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleApp", "OpenSim\Exampl
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLRPC", "Common\XmlRpcCS\XMLRPC.csproj", "{8E81D43C-0000-0000-0000-000000000000}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLRPC", "Common\XmlRpcCS\XMLRPC.csproj", "{8E81D43C-0000-0000-0000-000000000000}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Framework.Communications.OGS1", "Common\OpenGrid.Framework.Communications.OGS1\OpenGrid.Framework.Communications.OGS1.csproj", "{C1F40DD4-A68B-4233-9142-CE236775A3CE}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -156,6 +158,10 @@ Global
{8E81D43C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU {8E81D43C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU {8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU {8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
{C1F40DD4-A68B-4233-9142-CE236775A3CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C1F40DD4-A68B-4233-9142-CE236775A3CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C1F40DD4-A68B-4233-9142-CE236775A3CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C1F40DD4-A68B-4233-9142-CE236775A3CE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -51,7 +51,7 @@ namespace OpenSim.LocalCommunications
/// </summary> /// </summary>
/// <param name="regionInfo"></param> /// <param name="regionInfo"></param>
/// <returns></returns> /// <returns></returns>
public RegionCommsListener RegisterRegion(RegionInfo regionInfo) public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo)
{ {
//Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))

View File

@ -87,11 +87,11 @@ namespace OpenSim.LocalCommunications
"'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
"'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
string capsPath = Util.GetRandomCapsPath(); string capsPath = Util.GetRandomCapsPath();
response.SimAddress = reg.IPListenAddr; response.SimAddress = reg.CommsIPListenAddr;
response.SimPort = (Int32)reg.IPListenPort; response.SimPort = (Int32)reg.CommsIPListenPort;
response.RegionX = reg.RegionLocX ; response.RegionX = reg.RegionLocX ;
response.RegionY = reg.RegionLocY ; response.RegionY = reg.RegionLocY ;
response.SeedCapability = "http://" + reg.IPListenAddr + ":" + "9000" + "/CAPS/"+capsPath +"0000/"; response.SeedCapability = "http://" + reg.CommsIPListenAddr + ":" + "9000" + "/CAPS/" + capsPath + "0000/";
theUser.currentAgent.currentRegion = reg.SimUUID; theUser.currentAgent.currentRegion = reg.SimUUID;
theUser.currentAgent.currentHandle = reg.RegionHandle; theUser.currentAgent.currentHandle = reg.RegionHandle;

View File

@ -704,7 +704,8 @@ namespace OpenSim.Region.Scenes
/// </summary> /// </summary>
public void RegisterRegionWithComms() public void RegisterRegionWithComms()
{ {
this.regionCommsHost = this.commsManager.GridServer.RegisterRegion(this.m_regInfo); GridInfo gridSettings = new GridInfo();
this.regionCommsHost = this.commsManager.GridServer.RegisterRegion(this.m_regInfo,gridSettings);
if (this.regionCommsHost != null) if (this.regionCommsHost != null)
{ {
this.regionCommsHost.OnExpectUser += new ExpectUserDelegate(this.NewUserConnection); this.regionCommsHost.OnExpectUser += new ExpectUserDelegate(this.NewUserConnection);
@ -726,7 +727,7 @@ namespace OpenSim.Region.Scenes
if (agent.CapsPath != "") if (agent.CapsPath != "")
{ {
//Console.WriteLine("new user, so creating caps handler for it"); //Console.WriteLine("new user, so creating caps handler for it");
Caps cap = new Caps(this.assetCache, httpListener, this.m_regInfo.IPListenAddr, 9000, agent.CapsPath, agent.AgentID); Caps cap = new Caps(this.assetCache, httpListener, this.m_regInfo.CommsIPListenAddr, 9000, agent.CapsPath, agent.AgentID);
cap.RegisterHandlers(); cap.RegisterHandlers();
this.capsHandlers.Add(cap); this.capsHandlers.Add(cap);
} }
@ -765,7 +766,7 @@ namespace OpenSim.Region.Scenes
agent.startpos = new LLVector3(128, 128, 70); agent.startpos = new LLVector3(128, 128, 70);
agent.child = true; agent.child = true;
this.commsManager.InterRegion.InformRegionOfChildAgent(neighbours[i].RegionHandle, agent); this.commsManager.InterRegion.InformRegionOfChildAgent(neighbours[i].RegionHandle, agent);
remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, System.Net.IPAddress.Parse(neighbours[i].IPListenAddr), (ushort)neighbours[i].IPListenPort); remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr), (ushort)neighbours[i].CommsIPListenPort);
} }
} }
} }
@ -826,7 +827,7 @@ namespace OpenSim.Region.Scenes
agent.child = true; agent.child = true;
this.commsManager.InterRegion.InformRegionOfChildAgent(regionHandle, agent); this.commsManager.InterRegion.InformRegionOfChildAgent(regionHandle, agent);
this.commsManager.InterRegion.ExpectAvatarCrossing(regionHandle, remoteClient.AgentId, position); this.commsManager.InterRegion.ExpectAvatarCrossing(regionHandle, remoteClient.AgentId, position);
remoteClient.SendRegionTeleport(regionHandle, 13, reg.IPListenAddr, (ushort)reg.IPListenPort, 4, (1 << 4)); remoteClient.SendRegionTeleport(regionHandle, 13, reg.CommsIPListenAddr, (ushort)reg.CommsIPListenPort, 4, (1 << 4));
} }
//remoteClient.SendTeleportCancel(); //remoteClient.SendTeleportCancel();
} }

View File

@ -444,7 +444,7 @@ namespace OpenSim.Region.Scenes
if (res) if (res)
{ {
this.MakeChildAgent(); this.MakeChildAgent();
this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, System.Net.IPAddress.Parse(neighbourRegion.IPListenAddr), (ushort)neighbourRegion.IPListenPort); this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, System.Net.IPAddress.Parse(neighbourRegion.CommsIPListenAddr), (ushort)neighbourRegion.CommsIPListenPort);
} }
} }
} }

View File

@ -233,7 +233,7 @@ namespace OpenSim
regionDat.InitConfig(this.m_sandbox, regionConfig); regionDat.InitConfig(this.m_sandbox, regionConfig);
regionConfig.Close(); regionConfig.Close();
udpServer = new UDPServer(regionDat.IPListenPort, this.AssetCache, this.InventoryCache, this.m_log, authenBase); udpServer = new UDPServer(regionDat.CommsIPListenPort, this.AssetCache, this.InventoryCache, this.m_log, authenBase);
m_udpServer.Add(udpServer); m_udpServer.Add(udpServer);
this.regionData.Add(regionDat); this.regionData.Add(regionDat);