diff options
author | Diva Canto | 2014-06-01 10:06:26 -0700 |
---|---|---|
committer | Diva Canto | 2014-06-01 10:06:26 -0700 |
commit | 2ff9ea3f8038653135c284cc0c93d88690db9a22 (patch) | |
tree | 34448f055a3577311e147503536260337a8d4719 /OpenSim/Region | |
parent | Fix a bug where estate not found would result in a dummy estate record with e... (diff) | |
download | opensim-SC_OLD-2ff9ea3f8038653135c284cc0c93d88690db9a22.zip opensim-SC_OLD-2ff9ea3f8038653135c284cc0c93d88690db9a22.tar.gz opensim-SC_OLD-2ff9ea3f8038653135c284cc0c93d88690db9a22.tar.bz2 opensim-SC_OLD-2ff9ea3f8038653135c284cc0c93d88690db9a22.tar.xz |
Fixed a few things pertaining to interfacing with the estate service. Specifically, StoreEstateSettings was not being used anywhere; instead EstatSetting.Save was being called, but that method is a trigger to the DB-layer code directly, which, besides being wrong, was making it impossible to replace the service with a remote connector.
Also added more packing/unpacking code.
Diffstat (limited to '')
4 files changed, 34 insertions, 33 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 59b4614..9e4671f 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -730,7 +730,7 @@ namespace OpenSim | |||
730 | CreateRegion(regInfo, true, out scene); | 730 | CreateRegion(regInfo, true, out scene); |
731 | 731 | ||
732 | if (changed) | 732 | if (changed) |
733 | regInfo.EstateSettings.Save(); | 733 | m_estateDataService.StoreEstateSettings(regInfo.EstateSettings); |
734 | } | 734 | } |
735 | 735 | ||
736 | /// <summary> | 736 | /// <summary> |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index feb3cf8..4c1914a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -232,13 +232,9 @@ namespace OpenSim | |||
232 | module)); | 232 | module)); |
233 | 233 | ||
234 | // Load the estate data service | 234 | // Load the estate data service |
235 | IConfig estateDataConfig = Config.Configs["EstateDataStore"]; | 235 | module = Util.GetConfigVarFromSections<string>(Config, "LocalServiceModule", new string[]{"EstateDataStore", "EstateService"}, String.Empty); |
236 | if (estateDataConfig == null) | ||
237 | throw new Exception("Configuration file is missing the [EstateDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?"); | ||
238 | |||
239 | module = estateDataConfig.GetString("LocalServiceModule", String.Empty); | ||
240 | if (String.IsNullOrEmpty(module)) | 236 | if (String.IsNullOrEmpty(module)) |
241 | throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section"); | 237 | throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] or [EstateService] section"); |
242 | 238 | ||
243 | m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { Config }); | 239 | m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { Config }); |
244 | if (m_estateDataService == null) | 240 | if (m_estateDataService == null) |
@@ -555,7 +551,7 @@ namespace OpenSim | |||
555 | else | 551 | else |
556 | { | 552 | { |
557 | regionInfo.EstateSettings.EstateOwner = account.PrincipalID; | 553 | regionInfo.EstateSettings.EstateOwner = account.PrincipalID; |
558 | regionInfo.EstateSettings.Save(); | 554 | m_estateDataService.StoreEstateSettings(regionInfo.EstateSettings); |
559 | } | 555 | } |
560 | } | 556 | } |
561 | 557 | ||
@@ -950,7 +946,7 @@ namespace OpenSim | |||
950 | // back to the default. The reloading of estate settings by scene could be eliminated if it | 946 | // back to the default. The reloading of estate settings by scene could be eliminated if it |
951 | // knows that the passed in settings in RegionInfo are already valid. Also, it might be | 947 | // knows that the passed in settings in RegionInfo are already valid. Also, it might be |
952 | // possible to eliminate some additional later saves made by callers of this method. | 948 | // possible to eliminate some additional later saves made by callers of this method. |
953 | regInfo.EstateSettings.Save(); | 949 | EstateDataService.StoreEstateSettings(regInfo.EstateSettings); |
954 | 950 | ||
955 | return true; | 951 | return true; |
956 | } | 952 | } |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index eecc478..9fac9ff 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -244,7 +244,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
244 | else | 244 | else |
245 | { | 245 | { |
246 | dbSettings.EstateOwner = account.PrincipalID; | 246 | dbSettings.EstateOwner = account.PrincipalID; |
247 | dbSettings.Save(); | 247 | Scene.EstateDataService.StoreEstateSettings(dbSettings); |
248 | response = String.Empty; | 248 | response = String.Empty; |
249 | 249 | ||
250 | // make sure there's a log entry to document the change | 250 | // make sure there's a log entry to document the change |
@@ -292,7 +292,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
292 | { | 292 | { |
293 | string oldName = dbSettings.EstateName; | 293 | string oldName = dbSettings.EstateName; |
294 | dbSettings.EstateName = newName; | 294 | dbSettings.EstateName = newName; |
295 | dbSettings.Save(); | 295 | Scene.EstateDataService.StoreEstateSettings(dbSettings); |
296 | response = String.Empty; | 296 | response = String.Empty; |
297 | 297 | ||
298 | // make sure there's a log entry to document the change | 298 | // make sure there's a log entry to document the change |
@@ -367,10 +367,15 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
367 | else | 367 | else |
368 | { | 368 | { |
369 | EstateSettings settings = Scene.EstateDataService.CreateNewEstate(); | 369 | EstateSettings settings = Scene.EstateDataService.CreateNewEstate(); |
370 | settings.EstateOwner = ownerID; | 370 | if (settings == null) |
371 | settings.EstateName = estateName; | 371 | response = String.Format("Unable to create estate \"{0}\" at this simulator", estateName); |
372 | settings.Save(); | 372 | else |
373 | response = String.Empty; | 373 | { |
374 | settings.EstateOwner = ownerID; | ||
375 | settings.EstateName = estateName; | ||
376 | Scene.EstateDataService.StoreEstateSettings(settings); | ||
377 | response = String.Empty; | ||
378 | } | ||
374 | } | 379 | } |
375 | } | 380 | } |
376 | return response; | 381 | return response; |
@@ -636,13 +641,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
636 | { | 641 | { |
637 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); | 642 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); |
638 | estateSettings.AddEstateUser(user); | 643 | estateSettings.AddEstateUser(user); |
639 | estateSettings.Save(); | 644 | Scene.EstateDataService.StoreEstateSettings(estateSettings); |
640 | } | 645 | } |
641 | } | 646 | } |
642 | } | 647 | } |
643 | 648 | ||
644 | Scene.RegionInfo.EstateSettings.AddEstateUser(user); | 649 | Scene.RegionInfo.EstateSettings.AddEstateUser(user); |
645 | Scene.RegionInfo.EstateSettings.Save(); | 650 | Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings); |
646 | 651 | ||
647 | TriggerEstateInfoChange(); | 652 | TriggerEstateInfoChange(); |
648 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID); | 653 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID); |
@@ -669,13 +674,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
669 | { | 674 | { |
670 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); | 675 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); |
671 | estateSettings.RemoveEstateUser(user); | 676 | estateSettings.RemoveEstateUser(user); |
672 | estateSettings.Save(); | 677 | Scene.EstateDataService.StoreEstateSettings(estateSettings); |
673 | } | 678 | } |
674 | } | 679 | } |
675 | } | 680 | } |
676 | 681 | ||
677 | Scene.RegionInfo.EstateSettings.RemoveEstateUser(user); | 682 | Scene.RegionInfo.EstateSettings.RemoveEstateUser(user); |
678 | Scene.RegionInfo.EstateSettings.Save(); | 683 | Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings); |
679 | 684 | ||
680 | TriggerEstateInfoChange(); | 685 | TriggerEstateInfoChange(); |
681 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID); | 686 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID); |
@@ -701,13 +706,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
701 | { | 706 | { |
702 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); | 707 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); |
703 | estateSettings.AddEstateGroup(user); | 708 | estateSettings.AddEstateGroup(user); |
704 | estateSettings.Save(); | 709 | Scene.EstateDataService.StoreEstateSettings(estateSettings); |
705 | } | 710 | } |
706 | } | 711 | } |
707 | } | 712 | } |
708 | 713 | ||
709 | Scene.RegionInfo.EstateSettings.AddEstateGroup(user); | 714 | Scene.RegionInfo.EstateSettings.AddEstateGroup(user); |
710 | Scene.RegionInfo.EstateSettings.Save(); | 715 | Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings); |
711 | 716 | ||
712 | TriggerEstateInfoChange(); | 717 | TriggerEstateInfoChange(); |
713 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID); | 718 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID); |
@@ -733,13 +738,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
733 | { | 738 | { |
734 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); | 739 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); |
735 | estateSettings.RemoveEstateGroup(user); | 740 | estateSettings.RemoveEstateGroup(user); |
736 | estateSettings.Save(); | 741 | Scene.EstateDataService.StoreEstateSettings(estateSettings); |
737 | } | 742 | } |
738 | } | 743 | } |
739 | } | 744 | } |
740 | 745 | ||
741 | Scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); | 746 | Scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); |
742 | Scene.RegionInfo.EstateSettings.Save(); | 747 | Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings); |
743 | 748 | ||
744 | TriggerEstateInfoChange(); | 749 | TriggerEstateInfoChange(); |
745 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID); | 750 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID); |
@@ -788,7 +793,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
788 | 793 | ||
789 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); | 794 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); |
790 | estateSettings.AddBan(bitem); | 795 | estateSettings.AddBan(bitem); |
791 | estateSettings.Save(); | 796 | Scene.EstateDataService.StoreEstateSettings(estateSettings); |
792 | } | 797 | } |
793 | } | 798 | } |
794 | } | 799 | } |
@@ -801,7 +806,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
801 | item.BannedHostIPMask = "0.0.0.0"; | 806 | item.BannedHostIPMask = "0.0.0.0"; |
802 | 807 | ||
803 | Scene.RegionInfo.EstateSettings.AddBan(item); | 808 | Scene.RegionInfo.EstateSettings.AddBan(item); |
804 | Scene.RegionInfo.EstateSettings.Save(); | 809 | Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings); |
805 | 810 | ||
806 | TriggerEstateInfoChange(); | 811 | TriggerEstateInfoChange(); |
807 | 812 | ||
@@ -864,13 +869,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
864 | { | 869 | { |
865 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); | 870 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); |
866 | estateSettings.RemoveBan(user); | 871 | estateSettings.RemoveBan(user); |
867 | estateSettings.Save(); | 872 | Scene.EstateDataService.StoreEstateSettings(estateSettings); |
868 | } | 873 | } |
869 | } | 874 | } |
870 | } | 875 | } |
871 | 876 | ||
872 | Scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); | 877 | Scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); |
873 | Scene.RegionInfo.EstateSettings.Save(); | 878 | Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings); |
874 | 879 | ||
875 | TriggerEstateInfoChange(); | 880 | TriggerEstateInfoChange(); |
876 | } | 881 | } |
@@ -903,13 +908,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
903 | { | 908 | { |
904 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); | 909 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); |
905 | estateSettings.AddEstateManager(user); | 910 | estateSettings.AddEstateManager(user); |
906 | estateSettings.Save(); | 911 | Scene.EstateDataService.StoreEstateSettings(estateSettings); |
907 | } | 912 | } |
908 | } | 913 | } |
909 | } | 914 | } |
910 | 915 | ||
911 | Scene.RegionInfo.EstateSettings.AddEstateManager(user); | 916 | Scene.RegionInfo.EstateSettings.AddEstateManager(user); |
912 | Scene.RegionInfo.EstateSettings.Save(); | 917 | Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings); |
913 | 918 | ||
914 | TriggerEstateInfoChange(); | 919 | TriggerEstateInfoChange(); |
915 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID); | 920 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID); |
@@ -935,13 +940,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
935 | { | 940 | { |
936 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); | 941 | estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID); |
937 | estateSettings.RemoveEstateManager(user); | 942 | estateSettings.RemoveEstateManager(user); |
938 | estateSettings.Save(); | 943 | Scene.EstateDataService.StoreEstateSettings(estateSettings); |
939 | } | 944 | } |
940 | } | 945 | } |
941 | } | 946 | } |
942 | 947 | ||
943 | Scene.RegionInfo.EstateSettings.RemoveEstateManager(user); | 948 | Scene.RegionInfo.EstateSettings.RemoveEstateManager(user); |
944 | Scene.RegionInfo.EstateSettings.Save(); | 949 | Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings); |
945 | 950 | ||
946 | TriggerEstateInfoChange(); | 951 | TriggerEstateInfoChange(); |
947 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID); | 952 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID); |
@@ -1415,7 +1420,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1415 | else | 1420 | else |
1416 | Scene.RegionInfo.EstateSettings.DenyMinors = false; | 1421 | Scene.RegionInfo.EstateSettings.DenyMinors = false; |
1417 | 1422 | ||
1418 | Scene.RegionInfo.EstateSettings.Save(); | 1423 | Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings); |
1419 | TriggerEstateInfoChange(); | 1424 | TriggerEstateInfoChange(); |
1420 | 1425 | ||
1421 | Scene.TriggerEstateSunUpdate(); | 1426 | Scene.TriggerEstateSunUpdate(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index de2c3f7..4a24980 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1246,7 +1246,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1246 | World.RegionInfo.EstateSettings.UseGlobalTime = !sunFixed; | 1246 | World.RegionInfo.EstateSettings.UseGlobalTime = !sunFixed; |
1247 | World.RegionInfo.EstateSettings.SunPosition = sunHour; | 1247 | World.RegionInfo.EstateSettings.SunPosition = sunHour; |
1248 | World.RegionInfo.EstateSettings.FixedSun = sunFixed; | 1248 | World.RegionInfo.EstateSettings.FixedSun = sunFixed; |
1249 | World.RegionInfo.EstateSettings.Save(); | 1249 | World.EstateDataService.StoreEstateSettings(World.RegionInfo.EstateSettings); |
1250 | 1250 | ||
1251 | World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle); | 1251 | World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle); |
1252 | } | 1252 | } |