From 29b8c84ceaaeca80bfa9c0bfc8c31e421e39ef71 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 2 May 2008 16:41:08 +0000 Subject: * Commit 2/3 - Please dont attempt to update to this revision until all 3 are in. --- OpenSim/Region/Application/OpenSimMain.cs | 27 ++++++----- OpenSim/Region/Application/OpenSimMainConsole.cs | 60 ++---------------------- 2 files changed, 19 insertions(+), 68 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index c4c0eb4..1f67c6a 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -40,6 +40,7 @@ using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; using OpenSim.Framework.Statistics; using OpenSim.Region.ClientStack; +using OpenSim.Region.ClientStack.LindenUDP; using OpenSim.Region.Communications.Local; using OpenSim.Region.Communications.OGS1; using OpenSim.Region.Environment; @@ -70,7 +71,7 @@ namespace OpenSim protected string m_storageDll; - protected List m_udpServers = new List(); + protected List m_clientServers = new List(); protected List m_regionData = new List(); protected bool m_physicalPrim; @@ -105,9 +106,9 @@ namespace OpenSim get { return m_httpServer; } } - public List UdpServers + public List UdpServers { - get { return m_udpServers; } + get { return m_clientServers; } } public List RegionData @@ -327,7 +328,7 @@ namespace OpenSim // We are done with startup m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}", - m_udpServers.Count.ToString(), m_udpServers.Count > 1 ? "s" : ""); + m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : ""); WorldHasComeToAnEnd.WaitOne(); m_log.Info("[OPENSIM MAIN]: Shutdown complete, goodbye."); Environment.Exit(0); @@ -452,7 +453,7 @@ namespace OpenSim /// /// /// - public UDPServer CreateRegion(RegionInfo regionInfo, bool portadd_flag) + public LLUDPServer CreateRegion(RegionInfo regionInfo, bool portadd_flag) { return CreateRegion(regionInfo, portadd_flag, false); } @@ -463,7 +464,7 @@ namespace OpenSim /// /// /// - public UDPServer CreateRegion(RegionInfo regionInfo) + public LLUDPServer CreateRegion(RegionInfo regionInfo) { return CreateRegion(regionInfo, false, true); } @@ -475,7 +476,7 @@ namespace OpenSim /// /// /// - public UDPServer CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init) + public LLUDPServer CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init) { int port = regionInfo.InternalEndPoint.Port; @@ -495,7 +496,7 @@ namespace OpenSim Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName); } - UDPServer udpServer; + LLUDPServer udpServer; Scene scene = SetupScene(regionInfo, proxyOffset, out udpServer, m_permissions); m_log.Info("[MODULES]: Loading Region's modules"); @@ -548,7 +549,7 @@ namespace OpenSim m_sceneManager.Add(scene); - m_udpServers.Add(udpServer); + m_clientServers.Add(udpServer); m_regionData.Add(regionInfo); udpServer.ServerListener(); @@ -586,9 +587,9 @@ namespace OpenSim bool foundUDPServer = false; int UDPServerElement = 0; - for (int i = 0; i < m_udpServers.Count; i++) + for (int i = 0; i < m_clientServers.Count; i++) { - if (m_udpServers[i].RegionHandle == whichRegion.RegionHandle) + if (m_clientServers[i].HandlesRegion(new Location(whichRegion.RegionHandle))) { UDPServerElement = i; foundUDPServer = true; @@ -598,8 +599,8 @@ namespace OpenSim if (foundUDPServer) { // m_udpServers[UDPServerElement].Server.End - m_udpServers[UDPServerElement].Server.Close(); - m_udpServers.RemoveAt(UDPServerElement); + m_clientServers[UDPServerElement].Server.Close(); + m_clientServers.RemoveAt(UDPServerElement); } //Removing the region from the sim's database of regions.. diff --git a/OpenSim/Region/Application/OpenSimMainConsole.cs b/OpenSim/Region/Application/OpenSimMainConsole.cs index e727d63..586e2cb 100644 --- a/OpenSim/Region/Application/OpenSimMainConsole.cs +++ b/OpenSim/Region/Application/OpenSimMainConsole.cs @@ -32,14 +32,13 @@ using System.IO; using System.Net; using System.Reflection; using System.Threading; -using System.Timers; using libsecondlife; using log4net; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Console; using OpenSim.Framework.Statistics; -using OpenSim.Region.ClientStack; +using OpenSim.Region.ClientStack.LindenUDP; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; using Timer=System.Timers.Timer; @@ -111,8 +110,8 @@ namespace OpenSim { m_scriptTimer = new Timer(); m_scriptTimer.Enabled = true; - m_scriptTimer.Interval = (int)(1200 * 1000); - m_scriptTimer.Elapsed += new ElapsedEventHandler(RunAutoTimerScript); + m_scriptTimer.Interval = 1200 * 1000; + m_scriptTimer.Elapsed += RunAutoTimerScript; } PrintFileToConsole("startuplogo.txt"); } @@ -156,7 +155,7 @@ namespace OpenSim if (File.Exists(fileName)) { StreamReader readFile = File.OpenText(fileName); - string currentCommand = String.Empty; + string currentCommand; while ((currentCommand = readFile.ReadLine()) != null) { if (currentCommand != String.Empty) @@ -177,7 +176,7 @@ namespace OpenSim if (File.Exists(fileName)) { StreamReader readFile = File.OpenText(fileName); - string currentLine = String.Empty; + string currentLine; while ((currentLine = readFile.ReadLine()) != null) { m_log.Info("[!]" + currentLine); @@ -609,55 +608,6 @@ namespace OpenSim m_assetCache.ShowState(); break; - case "users": - IList agents = m_sceneManager.GetCurrentSceneAvatars(); - - m_console.Notice(String.Format("\nAgents connected: {0}\n", agents.Count)); - - m_console.Notice( - String.Format("{0,-16}{1,-16}{2,-37}{3,-16}{4,-22}{5,-16}{6,-15}", "Firstname", "Lastname", - "Agent ID", "Circuit", "IP", "Region", "Status")); - - foreach (ScenePresence presence in agents) - { - RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); - string regionName; - EndPoint ep = null; - - if (regionInfo == null) - { - regionName = "Unresolvable"; - } - else - { - regionName = regionInfo.RegionName; - } - - for (int i = 0; i < m_udpServers.Count; i++) - { - if (m_udpServers[i].RegionHandle == presence.RegionHandle) - { - - m_udpServers[i].clientCircuits_reverse.TryGetValue(presence.ControllingClient.CircuitCode, out ep); - } - } - - m_console.Notice( - String.Format( - "{0,-16}{1,-16}{2,-37}{3,-16}{4,-22}{5,-16}{6,-15}", - presence.Firstname, - presence.Lastname, - presence.UUID, - presence.ControllingClient.CircuitCode, - ep, - regionName, - ((((ClientView)presence.ControllingClient).PacketProcessingEnabled) - ?"Active client":"Standby client"))); - } - - m_console.Notice(""); - - break; case "modules": m_console.Notice("The currently loaded shared modules are:"); foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) -- cgit v1.1