diff options
author | Justin Clarke Casey | 2008-04-11 15:00:41 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-04-11 15:00:41 +0000 |
commit | b3892096f3bbdb3310abd9feb341b3a040bbf081 (patch) | |
tree | 37a829ab7b6d87b8b0aa4130be0adfc0ae9dc4a3 /OpenSim/Region/Environment/Scenes/SceneManager.cs | |
parent | From: Kurt Taylor <krtaylor@us.ibm.com> (diff) | |
download | opensim-SC-b3892096f3bbdb3310abd9feb341b3a040bbf081.zip opensim-SC-b3892096f3bbdb3310abd9feb341b3a040bbf081.tar.gz opensim-SC-b3892096f3bbdb3310abd9feb341b3a040bbf081.tar.bz2 opensim-SC-b3892096f3bbdb3310abd9feb341b3a040bbf081.tar.xz |
* From: Dr Scofield <hud@zurich.ibm.com>
* 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
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneManager.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneManager.cs | 32 |
1 files changed, 32 insertions, 0 deletions
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 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Net; | ||
31 | using System.Net.Sockets; | ||
30 | using libsecondlife; | 32 | using libsecondlife; |
31 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
32 | using OpenSim.Framework.Console; | 34 | using OpenSim.Framework.Console; |
@@ -276,6 +278,36 @@ namespace OpenSim.Region.Environment.Scenes | |||
276 | return false; | 278 | return false; |
277 | } | 279 | } |
278 | 280 | ||
281 | public bool TryGetScene(uint locX, uint locY, out Scene scene) | ||
282 | { | ||
283 | foreach (Scene mscene in m_localScenes) | ||
284 | { | ||
285 | if (mscene.RegionInfo.RegionLocX == locX && | ||
286 | mscene.RegionInfo.RegionLocY == locY) | ||
287 | { | ||
288 | scene = mscene; | ||
289 | return true; | ||
290 | } | ||
291 | } | ||
292 | scene = null; | ||
293 | return false; | ||
294 | } | ||
295 | |||
296 | public bool TryGetScene(IPEndPoint ipEndPoint, out Scene scene) | ||
297 | { | ||
298 | foreach (Scene mscene in m_localScenes) | ||
299 | { | ||
300 | if (mscene.RegionInfo.InternalEndPoint.Address == ipEndPoint.Address && | ||
301 | mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port) | ||
302 | { | ||
303 | scene = mscene; | ||
304 | return true; | ||
305 | } | ||
306 | } | ||
307 | scene = null; | ||
308 | return false; | ||
309 | } | ||
310 | |||
279 | public void SetDebugPacketOnCurrentScene(int newDebug) | 311 | public void SetDebugPacketOnCurrentScene(int newDebug) |
280 | { | 312 | { |
281 | ForEachCurrentScene(delegate(Scene scene) | 313 | ForEachCurrentScene(delegate(Scene scene) |