From 67bbfadc06f36b5175cd5f7268ba876769667dca Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 2 May 2008 18:26:19 +0000 Subject: * More refactorings of UDPServer. * Removed all references where possible. * Renamed lots of variables from UDPServerXYZ to clientServerXYZ --- OpenSim/Region/Application/OpenSimMain.cs | 39 ++++++++-------------- OpenSim/Region/Application/OpenSimMainConsole.cs | 1 - .../Region/ClientStack/LindenUDP/LLClientView.cs | 2 +- .../Region/ClientStack/RegionApplicationBase.cs | 10 +++--- OpenSim/Region/Environment/Scenes/Scene.cs | 2 -- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 2 +- 6 files changed, 21 insertions(+), 35 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 7924421..5b44813 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -40,7 +40,6 @@ 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; @@ -106,7 +105,7 @@ namespace OpenSim get { return m_httpServer; } } - public List UdpServers + public List ClientServers { get { return m_clientServers; } } @@ -409,12 +408,6 @@ namespace OpenSim plugin.Initialise(this); m_plugins.Add(plugin); } - - // Start UDP servers - //for (int i = 0; i < m_udpServers.Count; i++) - //{ - // m_udpServers[i].ServerListener(); - // } } protected override void Initialize() @@ -496,8 +489,8 @@ namespace OpenSim Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName); } - IClientNetworkServer udpServer; - Scene scene = SetupScene(regionInfo, proxyOffset, out udpServer, m_permissions); + IClientNetworkServer clientServer; + Scene scene = SetupScene(regionInfo, proxyOffset, out clientServer, m_permissions); m_log.Info("[MODULES]: Loading Region's modules"); @@ -549,9 +542,9 @@ namespace OpenSim m_sceneManager.Add(scene); - m_clientServers.Add(udpServer); + m_clientServers.Add(clientServer); m_regionData.Add(regionInfo); - udpServer.Start(); + clientServer.Start(); if (do_post_init) { @@ -561,7 +554,7 @@ namespace OpenSim } } - return udpServer; + return clientServer; } protected override StorageManager CreateStorageManager(string connectionstring) @@ -583,24 +576,23 @@ namespace OpenSim public void handleRestartRegion(RegionInfo whichRegion) { m_log.Error("[OPENSIM MAIN]: Got restart signal from SceneManager"); - // Shutting down the UDP server - bool foundUDPServer = false; - int UDPServerElement = 0; + // Shutting down the client server + bool foundClientServer = false; + int clientServerElement = 0; for (int i = 0; i < m_clientServers.Count; i++) { if (m_clientServers[i].HandlesRegion(new Location(whichRegion.RegionHandle))) { - UDPServerElement = i; - foundUDPServer = true; + clientServerElement = i; + foundClientServer = true; break; } } - if (foundUDPServer) + if (foundClientServer) { - // m_udpServers[UDPServerElement].Server.End - m_clientServers[UDPServerElement].Server.Close(); - m_clientServers.RemoveAt(UDPServerElement); + m_clientServers[clientServerElement].Server.Close(); + m_clientServers.RemoveAt(clientServerElement); } //Removing the region from the sim's database of regions.. @@ -618,9 +610,6 @@ namespace OpenSim } CreateRegion(whichRegion, true); - //UDPServer restartingRegion = CreateRegion(whichRegion); - //restartingRegion.ServerListener(); - //m_sceneManager.SendSimOnlineNotification(restartingRegion.RegionHandle); } # region Setup methods diff --git a/OpenSim/Region/Application/OpenSimMainConsole.cs b/OpenSim/Region/Application/OpenSimMainConsole.cs index 586e2cb..38cae66 100644 --- a/OpenSim/Region/Application/OpenSimMainConsole.cs +++ b/OpenSim/Region/Application/OpenSimMainConsole.cs @@ -38,7 +38,6 @@ using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Console; using OpenSim.Framework.Statistics; -using OpenSim.Region.ClientStack.LindenUDP; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; using Timer=System.Timers.Timer; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 5d45d99..f4dd127 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -4915,7 +4915,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } catch (Exception) { - //MainLog.Instance.Debug("UDPSERVER", e.ToString()); + } m_needAck.Add(key, packet); diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 3fa2371..ba0b9b4 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -107,12 +107,12 @@ namespace OpenSim.Region.ClientStack return physicsPluginManager.GetPhysicsScene(engine, meshEngine); } - protected Scene SetupScene(RegionInfo regionInfo, out IClientNetworkServer udpServer, bool m_permissions) + protected Scene SetupScene(RegionInfo regionInfo, out IClientNetworkServer clientServer, bool m_permissions) { - return SetupScene(regionInfo, 0, out udpServer, m_permissions); + return SetupScene(regionInfo, 0, out clientServer, m_permissions); } - protected Scene SetupScene(RegionInfo regionInfo, int proxyOffset, out IClientNetworkServer udpServer, bool m_permissions) + protected Scene SetupScene(RegionInfo regionInfo, int proxyOffset, out IClientNetworkServer clientServer, bool m_permissions) { AgentCircuitManager circuitManager = new AgentCircuitManager(); IPAddress listenIP = regionInfo.InternalEndPoint.Address; @@ -120,12 +120,12 @@ namespace OpenSim.Region.ClientStack // listenIP = IPAddress.Parse("0.0.0.0"); uint port = (uint) regionInfo.InternalEndPoint.Port; - udpServer = new LLUDPServer(listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, m_assetCache, circuitManager); + clientServer = new LLUDPServer(listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, m_assetCache, circuitManager); regionInfo.InternalEndPoint.Port = (int)port; Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager); - udpServer.AddScene(scene); + clientServer.AddScene(scene); scene.LoadWorldMap(); diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 532d646..7d66bf4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1594,8 +1594,6 @@ namespace OpenSim.Region.Environment.Scenes client.OnMoveInventoryItem += MoveInventoryItem; client.OnRemoveInventoryItem += RemoveInventoryItem; client.OnRemoveInventoryFolder += RemoveInventoryFolder; - // client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest; - // client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer; client.OnRezScript += RezScript; client.OnRequestTaskInventory += RequestTaskInventory; diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 74e9cdc..6a50336 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -224,7 +224,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// This works out to be the ClientView object associated with this avatar, or it's UDP connection manager + /// This works out to be the ClientView object associated with this avatar, or it's client connection manager /// private IClientAPI m_controllingClient; -- cgit v1.1