From 4bde56457f574060c1aaaca8effba1f6fe00b6c7 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 6 Dec 2007 01:41:41 +0000 Subject: removed some duplicate hard-coded port numbers. changed ports to uint. --- OpenSim/Region/ClientStack/RegionApplicationBase.cs | 4 ++-- OpenSim/Region/ClientStack/UDPServer.cs | 8 ++++---- OpenSim/Region/Communications/Local/LocalLoginService.cs | 3 +-- OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 6 +++--- OpenSim/Region/Environment/Modules/ChatModule.cs | 6 +++--- OpenSim/Region/Examples/SimpleApp/Program.cs | 2 +- 6 files changed, 14 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 5b43fec..53ed2ab 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.ClientStack protected NetworkServersInfo m_networkServersInfo; protected BaseHttpServer m_httpServer; - protected int m_httpServerPort; + protected uint m_httpServerPort; protected LogBase m_log; protected CommunicationsManager m_commsManager; @@ -106,7 +106,7 @@ namespace OpenSim.Region.ClientStack protected Scene SetupScene(RegionInfo regionInfo, out UDPServer udpServer, bool m_permissions) { AgentCircuitManager circuitManager = new AgentCircuitManager(); - udpServer = new UDPServer(regionInfo.InternalEndPoint.Port, m_assetCache, m_log, circuitManager); + udpServer = new UDPServer((uint) regionInfo.InternalEndPoint.Port, m_assetCache, m_log, circuitManager); Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager); diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index b0586a3..aaf7224 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.ClientStack protected PacketServer m_packetServer; protected ulong m_regionHandle; - protected int listenPort; + protected uint listenPort; protected IScene m_localScene; protected AssetCache m_assetCache; protected LogBase m_log; @@ -83,7 +83,7 @@ namespace OpenSim.Region.ClientStack { } - public UDPServer(int port, AssetCache assetCache, LogBase console, AgentCircuitManager authenticateClass) + public UDPServer(uint port, AssetCache assetCache, LogBase console, AgentCircuitManager authenticateClass) { listenPort = port; m_assetCache = assetCache; @@ -180,9 +180,9 @@ namespace OpenSim.Region.ClientStack public void ServerListener() { - m_log.Verbose("SERVER", "Opening UDP socket on " + listenPort); + m_log.Verbose("SERVER", "Opening UDP socket on " + listenPort.ToString()); - ServerIncoming = new IPEndPoint(IPAddress.Parse("0.0.0.0"), listenPort); + ServerIncoming = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) listenPort); Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); Server.Bind(ServerIncoming); diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index eef6ed4..103c76f 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -121,11 +121,10 @@ namespace OpenSim.Region.Communications.Local theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; string capsPath = Util.GetRandomCapsPath(); response.SimAddress = reg.ExternalEndPoint.Address.ToString(); - response.SimPort = (Int32) reg.ExternalEndPoint.Port; + response.SimPort = (uint) reg.ExternalEndPoint.Port; response.RegionX = reg.RegionLocX; response.RegionY = reg.RegionLocY; - response.SeedCapability = "http://" + reg.ExternalHostName + ":" + serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; // response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/"; diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index b11a91f..353dc28 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -166,7 +166,7 @@ namespace OpenSim.Region.Communications.OGS1 { string simIp = (string) neighbourData["sim_ip"]; - int port = Convert.ToInt32(neighbourData["sim_port"]); + uint port = Convert.ToUInt32(neighbourData["sim_port"]); string externalUri = (string) neighbourData["sim_uri"]; string externalIpStr = Util.GetHostFromDNS(simIp).ToString(); @@ -450,7 +450,7 @@ namespace OpenSim.Region.Communications.OGS1 /// private void StartRemoting() { - TcpChannel ch = new TcpChannel(NetworkServersInfo.RemotingListenerPort); + TcpChannel ch = new TcpChannel((int) NetworkServersInfo.RemotingListenerPort); ChannelServices.RegisterChannel(ch, false); // Disabled security as Mono doesnt support this. WellKnownServiceTypeEntry wellType = @@ -559,7 +559,7 @@ namespace OpenSim.Region.Communications.OGS1 // it's own remoting port! How special. region = new SearializableRegionInfo(RequestNeighbourInfo(region.RegionHandle)); region.RemotingAddress = region.ExternalHostName; - region.RemotingPort = (uint) NetworkServersInfo.RemotingListenerPort; + region.RemotingPort = NetworkServersInfo.RemotingListenerPort; if (m_localBackend.RegionUp(region,regionhandle)) { return true; diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index be38baf..c93804f 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs @@ -265,7 +265,7 @@ namespace OpenSim.Region.Environment.Modules internal class IRCChatModule { private string m_server = null; - private int m_port = 6668; + private uint m_port = 6668; private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot"; private string m_nick = null; private string m_channel = null; @@ -296,7 +296,7 @@ namespace OpenSim.Region.Environment.Modules m_server = config.Configs["IRC"].GetString("server"); m_nick = config.Configs["IRC"].GetString("nick"); m_channel = config.Configs["IRC"].GetString("channel"); - m_port = config.Configs["IRC"].GetInt("port", m_port); + m_port = (uint) config.Configs["IRC"].GetInt("port", (int) m_port); m_user = config.Configs["IRC"].GetString("username", m_user); if (m_server != null && m_nick != null && m_channel != null) { @@ -316,7 +316,7 @@ namespace OpenSim.Region.Environment.Modules { m_scenes = scenes; - m_tcp = new TcpClient(m_server, m_port); + m_tcp = new TcpClient(m_server, (int) m_port); m_log.Verbose("IRC", "Connecting..."); m_stream = m_tcp.GetStream(); m_log.Verbose("IRC", "Connected to " + m_server); diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 9e5ca9b..16dcd7b 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -90,7 +90,7 @@ namespace SimpleApp m_log.Notice(m_log.LineInfo); IPEndPoint internalEndPoint = - new IPEndPoint(IPAddress.Parse("127.0.0.1"), m_networkServersInfo.HttpListenerPort); + new IPEndPoint(IPAddress.Parse("127.0.0.1"), (int) m_networkServersInfo.HttpListenerPort); RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost"); regionInfo.DataStore = "simpleapp_datastore.yap"; -- cgit v1.1