From bbd076544d18961af02ee43b5e0b3f2c3e3c1133 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 18 Jul 2008 19:32:05 +0000 Subject: [PATCH] Patch to fix saving of estate managers list loaded during migration. No longer teleports an agent home unless their root agent is being banned. Visual blocking is still in effect. --- OpenSim/Data/MySQL/MySQLEstateData.cs | 3 +++ OpenSim/Data/SQLite/SQLiteEstateData.cs | 3 +++ .../Modules/World/Estate/EstateManagementModule.cs | 3 ++- OpenSim/Region/Environment/Scenes/Scene.cs | 6 ------ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index 17cd6a18a9..c0395a9ce5 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs @@ -158,6 +158,7 @@ namespace OpenSim.Data.MySQL public EstateSettings LoadEstateSettings(LLUUID regionID) { EstateSettings es = new EstateSettings(); + es.OnSave += StoreEstateSettings; string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_map left join estate_settings on estate_map.EstateID = estate_settings.EstateID where estate_settings.EstateID is not null and RegionID = ?RegionID"; @@ -258,6 +259,8 @@ namespace OpenSim.Data.MySQL catch (Exception) { } + + es.Save(); } LoadBanList(es); diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index a8dfb4ead8..dd6145c20d 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs @@ -86,6 +86,7 @@ namespace OpenSim.Data.SQLite public EstateSettings LoadEstateSettings(LLUUID regionID) { EstateSettings es = new EstateSettings(); + es.OnSave += StoreEstateSettings; string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_map left join estate_settings on estate_map.EstateID = estate_settings.EstateID where estate_settings.EstateID is not null and RegionID = @RegionID"; @@ -184,6 +185,8 @@ namespace OpenSim.Data.SQLite catch (Exception) { } + + es.Save(); } LoadBanList(es); diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index f2b6ae0107..ab0adf23ad 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs @@ -245,7 +245,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate ScenePresence s = m_scene.GetScenePresence(user); if (s != null) { - m_scene.TeleportClientHome(user, s.ControllingClient); + if(!s.IsChildAgent) + m_scene.TeleportClientHome(user, s.ControllingClient); } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index bbb028dbdf..aed104e97c 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -269,15 +269,9 @@ namespace OpenSim.Region.Environment.Scenes m_externalChecks = new SceneExternalChecks(this); // Load region settings - // First try database m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); - // Hook up save event - m_regInfo.RegionSettings.OnSave += m_storageManager.DataStore.StoreRegionSettings; if(m_storageManager.EstateDataStore != null) - { m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID); - m_regInfo.EstateSettings.OnSave += m_storageManager.EstateDataStore.StoreEstateSettings; - }