diff options
author | Tom | 2011-09-14 19:11:32 -0700 |
---|---|---|
committer | Tom | 2011-09-14 19:11:32 -0700 |
commit | 5484c9b585a2a6289456e9492ac2989d489b555c (patch) | |
tree | c9b79199722fe09c993c237dce40febf731264e3 /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Merge fixes, and fix the build (diff) | |
parent | Don't try and delete attachments for child agent close (diff) | |
download | opensim-SC_OLD-5484c9b585a2a6289456e9492ac2989d489b555c.zip opensim-SC_OLD-5484c9b585a2a6289456e9492ac2989d489b555c.tar.gz opensim-SC_OLD-5484c9b585a2a6289456e9492ac2989d489b555c.tar.bz2 opensim-SC_OLD-5484c9b585a2a6289456e9492ac2989d489b555c.tar.xz |
Bring us up to date.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 65 |
1 files changed, 51 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a661ab8..c5bb2b2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -610,9 +610,42 @@ namespace OpenSim.Region.Framework.Scenes | |||
610 | #region Region Settings | 610 | #region Region Settings |
611 | 611 | ||
612 | // Load region settings | 612 | // Load region settings |
613 | m_regInfo.WindlightSettings = SimulationDataService.LoadRegionWindlightSettings(m_regInfo.RegionID); | 613 | // LoadRegionSettings creates new region settings in persistence if they don't already exist for this region. |
614 | // However, in this case, the default textures are not set in memory properly, so we need to do it here and | ||
615 | // resave. | ||
616 | // FIXME: It shouldn't be up to the database plugins to create this data - we should do it when a new | ||
617 | // region is set up and avoid these gyrations. | ||
618 | RegionSettings rs = simDataService.LoadRegionSettings(m_regInfo.RegionID); | ||
619 | bool updatedTerrainTextures = false; | ||
620 | if (rs.TerrainTexture1 == UUID.Zero) | ||
621 | { | ||
622 | rs.TerrainTexture1 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_1; | ||
623 | updatedTerrainTextures = true; | ||
624 | } | ||
625 | |||
626 | if (rs.TerrainTexture2 == UUID.Zero) | ||
627 | { | ||
628 | rs.TerrainTexture2 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_2; | ||
629 | updatedTerrainTextures = true; | ||
630 | } | ||
631 | |||
632 | if (rs.TerrainTexture3 == UUID.Zero) | ||
633 | { | ||
634 | rs.TerrainTexture3 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_3; | ||
635 | updatedTerrainTextures = true; | ||
636 | } | ||
637 | |||
638 | if (rs.TerrainTexture4 == UUID.Zero) | ||
639 | { | ||
640 | rs.TerrainTexture4 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_4; | ||
641 | updatedTerrainTextures = true; | ||
642 | } | ||
643 | |||
644 | if (updatedTerrainTextures) | ||
645 | rs.Save(); | ||
646 | |||
647 | m_regInfo.RegionSettings = rs; | ||
614 | 648 | ||
615 | m_regInfo.RegionSettings = simDataService.LoadRegionSettings(m_regInfo.RegionID); | ||
616 | if (estateDataService != null) | 649 | if (estateDataService != null) |
617 | m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false); | 650 | m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false); |
618 | 651 | ||
@@ -645,7 +678,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
645 | EventManager.OnLandObjectRemoved += | 678 | EventManager.OnLandObjectRemoved += |
646 | new EventManager.LandObjectRemoved(simDataService.RemoveLandObject); | 679 | new EventManager.LandObjectRemoved(simDataService.RemoveLandObject); |
647 | 680 | ||
648 | m_sceneGraph = new SceneGraph(this, m_regInfo); | 681 | m_sceneGraph = new SceneGraph(this); |
649 | 682 | ||
650 | // If the scene graph has an Unrecoverable error, restart this sim. | 683 | // If the scene graph has an Unrecoverable error, restart this sim. |
651 | // Currently the only thing that causes it to happen is two kinds of specific | 684 | // Currently the only thing that causes it to happen is two kinds of specific |
@@ -1575,7 +1608,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1575 | msg.ParentEstateID = RegionInfo.EstateSettings.ParentEstateID; | 1608 | msg.ParentEstateID = RegionInfo.EstateSettings.ParentEstateID; |
1576 | msg.Position = Vector3.Zero; | 1609 | msg.Position = Vector3.Zero; |
1577 | msg.RegionID = RegionInfo.RegionID.Guid; | 1610 | msg.RegionID = RegionInfo.RegionID.Guid; |
1578 | msg.binaryBucket = new byte[0]; | 1611 | |
1612 | // We must fill in a null-terminated 'empty' string here since bytes[0] will crash viewer 3. | ||
1613 | msg.binaryBucket = Util.StringToBytes256("\0"); | ||
1579 | if (ret.Value.count > 1) | 1614 | if (ret.Value.count > 1) |
1580 | msg.message = string.Format("Your {0} objects were returned from {1} in region {2} due to {3}", ret.Value.count, ret.Value.location.ToString(), RegionInfo.RegionName, ret.Value.reason); | 1615 | msg.message = string.Format("Your {0} objects were returned from {1} in region {2} due to {3}", ret.Value.count, ret.Value.location.ToString(), RegionInfo.RegionName, ret.Value.reason); |
1581 | else | 1616 | else |
@@ -2492,14 +2527,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2492 | /// <returns>False</returns> | 2527 | /// <returns>False</returns> |
2493 | public virtual bool IncomingCreateObject(UUID userID, UUID itemID) | 2528 | public virtual bool IncomingCreateObject(UUID userID, UUID itemID) |
2494 | { | 2529 | { |
2495 | //m_log.DebugFormat(" >>> IncomingCreateObject(userID, itemID) <<< {0} {1}", userID, itemID); | 2530 | m_log.DebugFormat(" >>> IncomingCreateObject(userID, itemID) <<< {0} {1}", userID, itemID); |
2496 | 2531 | ||
2497 | ScenePresence sp = GetScenePresence(userID); | 2532 | // Commented out since this is as yet unused and is arguably not the appropriate place to do this, as |
2498 | if (sp != null && AttachmentsModule != null) | 2533 | // attachments are being rezzed elsewhere in AddNewClient() |
2499 | { | 2534 | // ScenePresence sp = GetScenePresence(userID); |
2500 | uint attPt = (uint)sp.Appearance.GetAttachpoint(itemID); | 2535 | // if (sp != null && AttachmentsModule != null) |
2501 | AttachmentsModule.RezSingleAttachmentFromInventory(sp.ControllingClient, itemID, attPt); | 2536 | // { |
2502 | } | 2537 | // uint attPt = (uint)sp.Appearance.GetAttachpoint(itemID); |
2538 | // AttachmentsModule.RezSingleAttachmentFromInventory(sp.ControllingClient, itemID, attPt); | ||
2539 | // } | ||
2503 | 2540 | ||
2504 | return false; | 2541 | return false; |
2505 | } | 2542 | } |
@@ -3272,8 +3309,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3272 | if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) | 3309 | if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) |
3273 | AttachmentsModule.SaveChangedAttachments(avatar); | 3310 | AttachmentsModule.SaveChangedAttachments(avatar); |
3274 | 3311 | ||
3275 | if (avatar != null && (!avatar.IsChildAgent)) | 3312 | if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) |
3276 | avatar.SaveChangedAttachments(); | 3313 | AttachmentsModule.SaveChangedAttachments(avatar); |
3277 | 3314 | ||
3278 | ForEachClient( | 3315 | ForEachClient( |
3279 | delegate(IClientAPI client) | 3316 | delegate(IClientAPI client) |