From b3892096f3bbdb3310abd9feb341b3a040bbf081 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 11 Apr 2008 15:00:41 +0000 Subject: * From: Dr Scofield * This patch adds support for saving a dynamically generated region to the filesystem (as a region xml file) * Also adds some error checknig to make sure the dynamically generated region name, id or location are not already taken. * Thanks Dr Scofield --- OpenSim/Region/Environment/Scenes/SceneManager.cs | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index 62994df..fbaf655 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs @@ -27,6 +27,8 @@ using System; using System.Collections.Generic; +using System.Net; +using System.Net.Sockets; using libsecondlife; using OpenSim.Framework; using OpenSim.Framework.Console; @@ -276,6 +278,36 @@ namespace OpenSim.Region.Environment.Scenes return false; } + public bool TryGetScene(uint locX, uint locY, out Scene scene) + { + foreach (Scene mscene in m_localScenes) + { + if (mscene.RegionInfo.RegionLocX == locX && + mscene.RegionInfo.RegionLocY == locY) + { + scene = mscene; + return true; + } + } + scene = null; + return false; + } + + public bool TryGetScene(IPEndPoint ipEndPoint, out Scene scene) + { + foreach (Scene mscene in m_localScenes) + { + if (mscene.RegionInfo.InternalEndPoint.Address == ipEndPoint.Address && + mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port) + { + scene = mscene; + return true; + } + } + scene = null; + return false; + } + public void SetDebugPacketOnCurrentScene(int newDebug) { ForEachCurrentScene(delegate(Scene scene) -- cgit v1.1