diff options
author | meta7 | 2010-08-20 11:01:03 -0700 |
---|---|---|
committer | meta7 | 2010-08-20 11:01:03 -0700 |
commit | 187ccd72f0883480b1dd027fce99fc99c2803eb6 (patch) | |
tree | 654e330ec4c46b5b062bae9350e5d4966a0c6873 /OpenSim/Region | |
parent | Get maturity level from access number. This addresses mantis #269 (diff) | |
parent | Add some maptile options, change maptile generation from OpenSimBase to Scene (diff) | |
download | opensim-SC-187ccd72f0883480b1dd027fce99fc99c2803eb6.zip opensim-SC-187ccd72f0883480b1dd027fce99fc99c2803eb6.tar.gz opensim-SC-187ccd72f0883480b1dd027fce99fc99c2803eb6.tar.bz2 opensim-SC-187ccd72f0883480b1dd027fce99fc99c2803eb6.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 61 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 13 |
4 files changed, 65 insertions, 24 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index c08da18..4ef0b1b 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -390,19 +390,6 @@ namespace OpenSim | |||
390 | // Prims have to be loaded after module configuration since some modules may be invoked during the load | 390 | // Prims have to be loaded after module configuration since some modules may be invoked during the load |
391 | scene.LoadPrimsFromStorage(regionInfo.originRegionID); | 391 | scene.LoadPrimsFromStorage(regionInfo.originRegionID); |
392 | 392 | ||
393 | if (scene.SnmpService != null) | ||
394 | { | ||
395 | scene.SnmpService.BootInfo("Creating region texture", scene); | ||
396 | } | ||
397 | |||
398 | // moved these here as the map texture has to be created after the modules are initialized | ||
399 | // and has to happen before the region is registered with the grid. | ||
400 | IWorldMapModule mapModule = scene.RequestModuleInterface<IWorldMapModule>(); | ||
401 | if (mapModule != null) | ||
402 | mapModule.GenerateMaptile(); | ||
403 | else | ||
404 | m_log.WarnFormat("[STARTUP]: No map module available to generate map tile"); | ||
405 | |||
406 | // TODO : Try setting resource for region xstats here on scene | 393 | // TODO : Try setting resource for region xstats here on scene |
407 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); | 394 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); |
408 | 395 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 18ea865..ab18c93 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -2218,7 +2218,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2218 | 2218 | ||
2219 | if (root == null) | 2219 | if (root == null) |
2220 | { | 2220 | { |
2221 | m_log.DebugFormat("[LINK]: Can't find linkset root prim {0{", parentPrimId); | 2221 | m_log.DebugFormat("[LINK]: Can't find linkset root prim {0}", parentPrimId); |
2222 | return; | 2222 | return; |
2223 | } | 2223 | } |
2224 | 2224 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 73472a9..98c46bd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -411,6 +411,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
411 | private double m_rootReprioritizationDistance = 10.0; | 411 | private double m_rootReprioritizationDistance = 10.0; |
412 | private double m_childReprioritizationDistance = 20.0; | 412 | private double m_childReprioritizationDistance = 20.0; |
413 | 413 | ||
414 | private Timer m_mapGenerationTimer = new Timer(); | ||
415 | bool m_generateMaptiles = false; | ||
416 | |||
414 | #endregion | 417 | #endregion |
415 | 418 | ||
416 | #region Properties | 419 | #region Properties |
@@ -665,6 +668,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
665 | 668 | ||
666 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); | 669 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); |
667 | CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false); | 670 | CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false); |
671 | |||
672 | m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true); | ||
673 | if (m_generateMaptiles) | ||
674 | { | ||
675 | int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0); | ||
676 | if (maptileRefresh != 0) | ||
677 | { | ||
678 | m_mapGenerationTimer.Interval = maptileRefresh * 1000; | ||
679 | m_mapGenerationTimer.Elapsed += RegenerateMaptile; | ||
680 | m_mapGenerationTimer.AutoReset = true; | ||
681 | m_mapGenerationTimer.Start(); | ||
682 | } | ||
683 | } | ||
684 | else | ||
685 | { | ||
686 | string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString()); | ||
687 | UUID tileID; | ||
688 | |||
689 | if (UUID.TryParse(tile, out tileID)) | ||
690 | { | ||
691 | RegionInfo.RegionSettings.TerrainImageID = tileID; | ||
692 | } | ||
693 | } | ||
668 | } | 694 | } |
669 | catch | 695 | catch |
670 | { | 696 | { |
@@ -1694,16 +1720,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1694 | 1720 | ||
1695 | m_sceneGridService.SetScene(this); | 1721 | m_sceneGridService.SetScene(this); |
1696 | 1722 | ||
1697 | // These two 'commands' *must be* next to each other or sim rebooting fails. | 1723 | // If we generate maptiles internally at all, the maptile generator |
1698 | //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); | 1724 | // will register the region. If not, do it here |
1699 | 1725 | if (m_generateMaptiles) | |
1700 | GridRegion region = new GridRegion(RegionInfo); | ||
1701 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); | ||
1702 | if (error != String.Empty) | ||
1703 | { | 1726 | { |
1704 | throw new Exception(error); | 1727 | RegenerateMaptile(null, null); |
1728 | } | ||
1729 | else | ||
1730 | { | ||
1731 | GridRegion region = new GridRegion(RegionInfo); | ||
1732 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); | ||
1733 | if (error != String.Empty) | ||
1734 | { | ||
1735 | throw new Exception(error); | ||
1736 | } | ||
1705 | } | 1737 | } |
1706 | |||
1707 | } | 1738 | } |
1708 | 1739 | ||
1709 | #endregion | 1740 | #endregion |
@@ -4995,5 +5026,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
4995 | 5026 | ||
4996 | return offsets.ToArray(); | 5027 | return offsets.ToArray(); |
4997 | } | 5028 | } |
5029 | |||
5030 | public void RegenerateMaptile(object sender, ElapsedEventArgs e) | ||
5031 | { | ||
5032 | IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>(); | ||
5033 | if (mapModule != null) | ||
5034 | { | ||
5035 | mapModule.GenerateMaptile(); | ||
5036 | |||
5037 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo)); | ||
5038 | |||
5039 | if (error != String.Empty) | ||
5040 | throw new Exception(error); | ||
5041 | } | ||
5042 | } | ||
4998 | } | 5043 | } |
4999 | } | 5044 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 76ade1f..22a81ac 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3780,6 +3780,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3780 | { | 3780 | { |
3781 | m_host.AddScriptLPS(1); | 3781 | m_host.AddScriptLPS(1); |
3782 | UUID invItemID = InventorySelf(); | 3782 | UUID invItemID = InventorySelf(); |
3783 | UUID targetID; | ||
3784 | |||
3785 | if (!UUID.TryParse(target, out targetID)) | ||
3786 | return; | ||
3783 | 3787 | ||
3784 | TaskInventoryItem item; | 3788 | TaskInventoryItem item; |
3785 | m_host.TaskInventory.LockItemsForRead(true); | 3789 | m_host.TaskInventory.LockItemsForRead(true); |
@@ -3798,7 +3802,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3798 | if (sp != null) | 3802 | if (sp != null) |
3799 | client = sp.ControllingClient; | 3803 | client = sp.ControllingClient; |
3800 | 3804 | ||
3801 | SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)target); | 3805 | SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)targetID); |
3802 | 3806 | ||
3803 | if (targetPart.ParentGroup.RootPart.AttachmentPoint != 0) | 3807 | if (targetPart.ParentGroup.RootPart.AttachmentPoint != 0) |
3804 | return; // Fail silently if attached | 3808 | return; // Fail silently if attached |
@@ -9143,7 +9147,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9143 | 9147 | ||
9144 | string reply = String.Empty; | 9148 | string reply = String.Empty; |
9145 | 9149 | ||
9146 | GridRegion info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator); | 9150 | GridRegion info; |
9151 | |||
9152 | if (m_ScriptEngine.World.RegionInfo.RegionName == simulator) | ||
9153 | info = new GridRegion(m_ScriptEngine.World.RegionInfo); | ||
9154 | else | ||
9155 | info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator); | ||
9147 | 9156 | ||
9148 | switch (data) | 9157 | switch (data) |
9149 | { | 9158 | { |