From 980a8cc629fe1228d450fa705fec3bacc3a84d98 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 24 Jun 2007 17:01:08 +0000 Subject: 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. --- .../IGridServices.cs | 9 ++++- Common/OpenSim.Framework/Types/RegionInfo.cs | 44 +++++++++++++++++----- 2 files changed, 42 insertions(+), 11 deletions(-) (limited to 'Common') diff --git a/Common/OpenGrid.Framework.Communications/IGridServices.cs b/Common/OpenGrid.Framework.Communications/IGridServices.cs index b4bc3b6..469cf80 100644 --- a/Common/OpenGrid.Framework.Communications/IGridServices.cs +++ b/Common/OpenGrid.Framework.Communications/IGridServices.cs @@ -34,9 +34,16 @@ using OpenSim.Framework; namespace OpenGrid.Framework.Communications { + public class GridInfo + { + public string GridServerURI = "http://grid:8001/"; + public string GridServerSendKey = "badger"; + public string GridServerRecvKey = "badger"; + } + public interface IGridServices { - RegionCommsListener RegisterRegion(RegionInfo regionInfo); + RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo); List RequestNeighbours(RegionInfo regionInfo); RegionInfo RequestNeighbourInfo(ulong regionHandle); List RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); diff --git a/Common/OpenSim.Framework/Types/RegionInfo.cs b/Common/OpenSim.Framework/Types/RegionInfo.cs index 651cd5b..3776c03 100644 --- a/Common/OpenSim.Framework/Types/RegionInfo.cs +++ b/Common/OpenSim.Framework/Types/RegionInfo.cs @@ -52,8 +52,19 @@ namespace OpenSim.Framework.Types public string MasterAvatarLastName = ""; public string MasterAvatarSandboxPassword = ""; - public int IPListenPort = 0; - public string IPListenAddr = ""; + /// + /// Port used for listening (TCP and UDP) + /// + /// Seperate TCP and UDP + public int CommsIPListenPort = 0; + /// + /// Address used for internal listening (default: 0.0.0.0?) + /// + public string CommsIPListenAddr = ""; + /// + /// Address used for external addressing (DNS or IP) + /// + public string CommsExternalAddress = ""; 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"); configData.SetAttribute("SimListenPort", port); - this.IPListenPort = Convert.ToInt32(port); + this.CommsIPListenPort = Convert.ToInt32(port); } else { - this.IPListenPort = Convert.ToInt32(attri); + this.CommsIPListenPort = Convert.ToInt32(attri); } //Sim Listen Address @@ -154,8 +165,8 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("SimListenAddress"); if (attri == "") { - this.IPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "127.0.0.1"); - configData.SetAttribute("SimListenAddress", this.IPListenAddr); + this.CommsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0"); + configData.SetAttribute("SimListenAddress", this.CommsIPListenAddr); } else { @@ -166,20 +177,33 @@ namespace OpenSim.Framework.Types System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname); try { - this.IPListenAddr = ips[0].ToString(); + this.CommsIPListenAddr = ips[0].ToString(); } catch (Exception e) { 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 { - 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 = configData.GetAttribute("TerrainFile"); 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( "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); 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()); } -- cgit v1.1