From 13526097f24b7a8ad63b1d482c44b44397fa055f Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 1 May 2008 16:35:00 +0000 Subject: * Spring cleaning on Region.Environment. * Converted a large number of read-only fields to be actually, readonly. * Reformatted code sections. * Removed redundant code. --- OpenSim/Region/Environment/Scenes/SceneManager.cs | 82 +++++++++++------------ 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/SceneManager.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index 2dfea2a..2325ed4 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs @@ -41,10 +41,13 @@ namespace OpenSim.Region.Environment.Scenes { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - public event RestartSim OnRestartSim; - private readonly List m_localScenes; - private Scene m_currentScene = null; + private Scene m_currentScene; + + public SceneManager() + { + m_localScenes = new List(); + } public List Scenes { @@ -71,10 +74,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public SceneManager() - { - m_localScenes = new List(); - } + public event RestartSim OnRestartSim; public void Close() { @@ -180,7 +180,7 @@ namespace OpenSim.Region.Environment.Scenes [Obsolete("TODO: Remove this warning by 0.7")] public bool RunTerrainCmdOnCurrentScene(string[] cmdparams, ref string result) { - m_log.Warn("DEPRECIATED: The terrain engine has been replaced with a new terrain plugin module. Please type 'plugin terrain help' for new commands."); + m_log.Warn("DEPRECIATED: The terrain engine has been replaced with a new terrain plugin module. Please type 'plugin terrain help' for new commands."); return false; } @@ -252,8 +252,8 @@ namespace OpenSim.Region.Environment.Scenes public bool TrySetCurrentScene(LLUUID regionID) { - Console.WriteLine("Searching for Region: '{0}'", regionID.ToString()); - + Console.WriteLine("Searching for Region: '{0}'", regionID); + foreach (Scene scene in m_localScenes) { if (scene.RegionInfo.RegionID == regionID) @@ -262,7 +262,7 @@ namespace OpenSim.Region.Environment.Scenes return true; } } - + return false; } @@ -313,7 +313,7 @@ namespace OpenSim.Region.Environment.Scenes { foreach (Scene mscene in m_localScenes) { - if((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) && + if ((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) && (mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port)) { scene = mscene; @@ -327,22 +327,22 @@ namespace OpenSim.Region.Environment.Scenes public void SetDebugPacketOnCurrentScene(int newDebug) { ForEachCurrentScene(delegate(Scene scene) - { - List scenePresences = scene.GetScenePresences(); - - foreach (ScenePresence scenePresence in scenePresences) { - if (!scenePresence.IsChildAgent) - { - m_log.ErrorFormat("Packet debug for {0} {1} set to {2}", - scenePresence.Firstname, - scenePresence.Lastname, - newDebug); + List scenePresences = scene.GetScenePresences(); - scenePresence.ControllingClient.SetDebug(newDebug); + foreach (ScenePresence scenePresence in scenePresences) + { + if (!scenePresence.IsChildAgent) + { + m_log.ErrorFormat("Packet debug for {0} {1} set to {2}", + scenePresence.Firstname, + scenePresence.Lastname, + newDebug); + + scenePresence.ControllingClient.SetDebug(newDebug); + } } - } - }); + }); } public List GetCurrentSceneAvatars() @@ -350,17 +350,17 @@ namespace OpenSim.Region.Environment.Scenes List avatars = new List(); ForEachCurrentScene(delegate(Scene scene) - { - List scenePresences = scene.GetScenePresences(); + { + List scenePresences = scene.GetScenePresences(); - foreach (ScenePresence scenePresence in scenePresences) - { - if (!scenePresence.IsChildAgent) - { - avatars.Add(scenePresence); - } - } - }); + foreach (ScenePresence scenePresence in scenePresences) + { + if (!scenePresence.IsChildAgent) + { + avatars.Add(scenePresence); + } + } + }); return avatars; } @@ -381,11 +381,11 @@ namespace OpenSim.Region.Environment.Scenes public void SetCurrentSceneTimePhase(int timePhase) { ForEachCurrentScene(delegate(Scene scene) - { - scene.SetTimePhase( - timePhase) - ; - }); + { + scene.SetTimePhase( + timePhase) + ; + }); } public void ForceCurrentSceneClientUpdate() @@ -453,4 +453,4 @@ namespace OpenSim.Region.Environment.Scenes m_localScenes.ForEach(action); } } -} +} \ No newline at end of file -- cgit v1.1