diff options
author | Mic Bowman | 2012-05-10 09:08:40 -0700 |
---|---|---|
committer | Mic Bowman | 2012-05-10 09:08:40 -0700 |
commit | de44734fe9a0b31cd8cb78c0f58e61a35fe2a259 (patch) | |
tree | 6b6b50a0a4cdf493ec4c5b46ceaef8c01fe64dba /OpenSim/Region | |
parent | Where necessary, rename OpenSim/Services/Connectors/*.cs files to reflect the... (diff) | |
download | opensim-SC-de44734fe9a0b31cd8cb78c0f58e61a35fe2a259.zip opensim-SC-de44734fe9a0b31cd8cb78c0f58e61a35fe2a259.tar.gz opensim-SC-de44734fe9a0b31cd8cb78c0f58e61a35fe2a259.tar.bz2 opensim-SC-de44734fe9a0b31cd8cb78c0f58e61a35fe2a259.tar.xz |
Saving estate state is really slow (relatively) and it gets
completely rewritten every time a region starts up. This
makes the data write only when the data was not already
read from the database.
There is a still a major race condition whenever two regions
share the same estate data, but at least it won't be triggered
on startup.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 12 |
2 files changed, 10 insertions, 7 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 4ec64ee..6796f2b 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -618,10 +618,11 @@ namespace OpenSim | |||
618 | return; | 618 | return; |
619 | } | 619 | } |
620 | 620 | ||
621 | PopulateRegionEstateInfo(regInfo); | 621 | bool changed = PopulateRegionEstateInfo(regInfo); |
622 | IScene scene; | 622 | IScene scene; |
623 | CreateRegion(regInfo, true, out scene); | 623 | CreateRegion(regInfo, true, out scene); |
624 | regInfo.EstateSettings.Save(); | 624 | if (changed) |
625 | regInfo.EstateSettings.Save(); | ||
625 | } | 626 | } |
626 | 627 | ||
627 | /// <summary> | 628 | /// <summary> |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 79259d8..045e8d2 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -977,13 +977,13 @@ namespace OpenSim | |||
977 | /// Load the estate information for the provided RegionInfo object. | 977 | /// Load the estate information for the provided RegionInfo object. |
978 | /// </summary> | 978 | /// </summary> |
979 | /// <param name="regInfo"></param> | 979 | /// <param name="regInfo"></param> |
980 | public void PopulateRegionEstateInfo(RegionInfo regInfo) | 980 | public bool PopulateRegionEstateInfo(RegionInfo regInfo) |
981 | { | 981 | { |
982 | if (EstateDataService != null) | 982 | if (EstateDataService != null) |
983 | regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false); | 983 | regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false); |
984 | 984 | ||
985 | if (regInfo.EstateSettings.EstateID != 0) | 985 | if (regInfo.EstateSettings.EstateID != 0) |
986 | return; | 986 | return false; // estate info in the database did not change |
987 | 987 | ||
988 | m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName); | 988 | m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName); |
989 | 989 | ||
@@ -1018,7 +1018,7 @@ namespace OpenSim | |||
1018 | } | 1018 | } |
1019 | 1019 | ||
1020 | if (defaultEstateJoined) | 1020 | if (defaultEstateJoined) |
1021 | return; | 1021 | return true; // need to update the database |
1022 | else | 1022 | else |
1023 | m_log.ErrorFormat( | 1023 | m_log.ErrorFormat( |
1024 | "[OPENSIM BASE]: Joining default estate {0} failed", defaultEstateName); | 1024 | "[OPENSIM BASE]: Joining default estate {0} failed", defaultEstateName); |
@@ -1080,8 +1080,10 @@ namespace OpenSim | |||
1080 | MainConsole.Instance.Output("Joining the estate failed. Please try again."); | 1080 | MainConsole.Instance.Output("Joining the estate failed. Please try again."); |
1081 | } | 1081 | } |
1082 | } | 1082 | } |
1083 | } | 1083 | } |
1084 | } | 1084 | |
1085 | return true; // need to update the database | ||
1086 | } | ||
1085 | } | 1087 | } |
1086 | 1088 | ||
1087 | public class OpenSimConfigSource | 1089 | public class OpenSimConfigSource |