diff options
author | Melanie Thielker | 2010-05-04 20:57:31 +0200 |
---|---|---|
committer | Melanie | 2010-05-04 18:36:45 +0100 |
commit | d997fc7b765d425bd34adf5bc839b80fd9fad37c (patch) | |
tree | c242d80e29c925229a806312727a7bb37d6441f2 /OpenSim/Region/CoreModules | |
parent | Add "reload estate" command to sims (diff) | |
download | opensim-SC_OLD-d997fc7b765d425bd34adf5bc839b80fd9fad37c.zip opensim-SC_OLD-d997fc7b765d425bd34adf5bc839b80fd9fad37c.tar.gz opensim-SC_OLD-d997fc7b765d425bd34adf5bc839b80fd9fad37c.tar.bz2 opensim-SC_OLD-d997fc7b765d425bd34adf5bc839b80fd9fad37c.tar.xz |
Add events to the estate interface to let interested modules know of
changes to estate settings
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 77068b0..92e9eed 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -48,6 +48,9 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
48 | 48 | ||
49 | private EstateTerrainXferHandler TerrainUploader; | 49 | private EstateTerrainXferHandler TerrainUploader; |
50 | 50 | ||
51 | public event ChangeDelegate OnRegionInfoChange; | ||
52 | public event ChangeDelegate OnEstateInfoChange; | ||
53 | |||
51 | #region Packet Data Responders | 54 | #region Packet Data Responders |
52 | 55 | ||
53 | private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice) | 56 | private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice) |
@@ -137,6 +140,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
137 | m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide = false; | 140 | m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide = false; |
138 | 141 | ||
139 | m_scene.RegionInfo.RegionSettings.Save(); | 142 | m_scene.RegionInfo.RegionSettings.Save(); |
143 | TriggerRegionInfoChange(); | ||
140 | 144 | ||
141 | sendRegionInfoPacketToAll(); | 145 | sendRegionInfoPacketToAll(); |
142 | } | 146 | } |
@@ -162,6 +166,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
162 | break; | 166 | break; |
163 | } | 167 | } |
164 | m_scene.RegionInfo.RegionSettings.Save(); | 168 | m_scene.RegionInfo.RegionSettings.Save(); |
169 | TriggerRegionInfoChange(); | ||
165 | sendRegionInfoPacketToAll(); | 170 | sendRegionInfoPacketToAll(); |
166 | } | 171 | } |
167 | 172 | ||
@@ -187,6 +192,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
187 | break; | 192 | break; |
188 | } | 193 | } |
189 | m_scene.RegionInfo.RegionSettings.Save(); | 194 | m_scene.RegionInfo.RegionSettings.Save(); |
195 | TriggerRegionInfoChange(); | ||
190 | sendRegionInfoPacketToAll(); | 196 | sendRegionInfoPacketToAll(); |
191 | } | 197 | } |
192 | 198 | ||
@@ -219,6 +225,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
219 | 225 | ||
220 | sendRegionInfoPacketToAll(); | 226 | sendRegionInfoPacketToAll(); |
221 | m_scene.RegionInfo.RegionSettings.Save(); | 227 | m_scene.RegionInfo.RegionSettings.Save(); |
228 | TriggerRegionInfoChange(); | ||
222 | } | 229 | } |
223 | 230 | ||
224 | private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds) | 231 | private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds) |
@@ -230,6 +237,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
230 | { | 237 | { |
231 | m_scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; | 238 | m_scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; |
232 | m_scene.RegionInfo.RegionSettings.Save(); | 239 | m_scene.RegionInfo.RegionSettings.Save(); |
240 | TriggerRegionInfoChange(); | ||
233 | } | 241 | } |
234 | 242 | ||
235 | private void handleEstateAccessDeltaRequest(IClientAPI remote_client, UUID invoice, int estateAccessType, UUID user) | 243 | private void handleEstateAccessDeltaRequest(IClientAPI remote_client, UUID invoice, int estateAccessType, UUID user) |
@@ -245,6 +253,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
245 | { | 253 | { |
246 | m_scene.RegionInfo.EstateSettings.AddEstateUser(user); | 254 | m_scene.RegionInfo.EstateSettings.AddEstateUser(user); |
247 | m_scene.RegionInfo.EstateSettings.Save(); | 255 | m_scene.RegionInfo.EstateSettings.Save(); |
256 | TriggerEstateInfoChange(); | ||
248 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); | 257 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); |
249 | } | 258 | } |
250 | else | 259 | else |
@@ -259,6 +268,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
259 | { | 268 | { |
260 | m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user); | 269 | m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user); |
261 | m_scene.RegionInfo.EstateSettings.Save(); | 270 | m_scene.RegionInfo.EstateSettings.Save(); |
271 | TriggerEstateInfoChange(); | ||
262 | 272 | ||
263 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); | 273 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); |
264 | } | 274 | } |
@@ -273,6 +283,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
273 | { | 283 | { |
274 | m_scene.RegionInfo.EstateSettings.AddEstateGroup(user); | 284 | m_scene.RegionInfo.EstateSettings.AddEstateGroup(user); |
275 | m_scene.RegionInfo.EstateSettings.Save(); | 285 | m_scene.RegionInfo.EstateSettings.Save(); |
286 | TriggerEstateInfoChange(); | ||
276 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); | 287 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); |
277 | } | 288 | } |
278 | else | 289 | else |
@@ -286,6 +297,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
286 | { | 297 | { |
287 | m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); | 298 | m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); |
288 | m_scene.RegionInfo.EstateSettings.Save(); | 299 | m_scene.RegionInfo.EstateSettings.Save(); |
300 | TriggerEstateInfoChange(); | ||
289 | 301 | ||
290 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); | 302 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); |
291 | } | 303 | } |
@@ -323,6 +335,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
323 | 335 | ||
324 | m_scene.RegionInfo.EstateSettings.AddBan(item); | 336 | m_scene.RegionInfo.EstateSettings.AddBan(item); |
325 | m_scene.RegionInfo.EstateSettings.Save(); | 337 | m_scene.RegionInfo.EstateSettings.Save(); |
338 | TriggerEstateInfoChange(); | ||
326 | 339 | ||
327 | ScenePresence s = m_scene.GetScenePresence(user); | 340 | ScenePresence s = m_scene.GetScenePresence(user); |
328 | if (s != null) | 341 | if (s != null) |
@@ -370,6 +383,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
370 | { | 383 | { |
371 | m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); | 384 | m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); |
372 | m_scene.RegionInfo.EstateSettings.Save(); | 385 | m_scene.RegionInfo.EstateSettings.Save(); |
386 | TriggerEstateInfoChange(); | ||
373 | } | 387 | } |
374 | else | 388 | else |
375 | { | 389 | { |
@@ -389,6 +403,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
389 | { | 403 | { |
390 | m_scene.RegionInfo.EstateSettings.AddEstateManager(user); | 404 | m_scene.RegionInfo.EstateSettings.AddEstateManager(user); |
391 | m_scene.RegionInfo.EstateSettings.Save(); | 405 | m_scene.RegionInfo.EstateSettings.Save(); |
406 | TriggerEstateInfoChange(); | ||
392 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | 407 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); |
393 | } | 408 | } |
394 | else | 409 | else |
@@ -402,6 +417,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
402 | { | 417 | { |
403 | m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); | 418 | m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); |
404 | m_scene.RegionInfo.EstateSettings.Save(); | 419 | m_scene.RegionInfo.EstateSettings.Save(); |
420 | TriggerEstateInfoChange(); | ||
405 | 421 | ||
406 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | 422 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); |
407 | } | 423 | } |
@@ -449,6 +465,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
449 | 465 | ||
450 | 466 | ||
451 | m_scene.RegionInfo.RegionSettings.Save(); | 467 | m_scene.RegionInfo.RegionSettings.Save(); |
468 | TriggerRegionInfoChange(); | ||
452 | 469 | ||
453 | m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics); | 470 | m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics); |
454 | } | 471 | } |
@@ -860,6 +877,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
860 | m_scene.RegionInfo.EstateSettings.DenyMinors = false; | 877 | m_scene.RegionInfo.EstateSettings.DenyMinors = false; |
861 | 878 | ||
862 | m_scene.RegionInfo.EstateSettings.Save(); | 879 | m_scene.RegionInfo.EstateSettings.Save(); |
880 | TriggerEstateInfoChange(); | ||
863 | 881 | ||
864 | m_scene.TriggerEstateSunUpdate(); | 882 | m_scene.TriggerEstateSunUpdate(); |
865 | 883 | ||
@@ -927,6 +945,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
927 | break; | 945 | break; |
928 | } | 946 | } |
929 | m_scene.RegionInfo.RegionSettings.Save(); | 947 | m_scene.RegionInfo.RegionSettings.Save(); |
948 | TriggerRegionInfoChange(); | ||
930 | sendRegionInfoPacketToAll(); | 949 | sendRegionInfoPacketToAll(); |
931 | 950 | ||
932 | } | 951 | } |
@@ -972,6 +991,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
972 | break; | 991 | break; |
973 | } | 992 | } |
974 | m_scene.RegionInfo.RegionSettings.Save(); | 993 | m_scene.RegionInfo.RegionSettings.Save(); |
994 | TriggerRegionInfoChange(); | ||
975 | sendRegionHandshakeToAll(); | 995 | sendRegionHandshakeToAll(); |
976 | } | 996 | } |
977 | } | 997 | } |
@@ -1141,5 +1161,21 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1141 | 1161 | ||
1142 | return false; | 1162 | return false; |
1143 | } | 1163 | } |
1164 | |||
1165 | protected void TriggerRegionInfoChange() | ||
1166 | { | ||
1167 | ChangeDelegate change = OnRegionInfoChange; | ||
1168 | |||
1169 | if (change != null) | ||
1170 | change(); | ||
1171 | } | ||
1172 | |||
1173 | protected void TriggerEstateInfoChange() | ||
1174 | { | ||
1175 | ChangeDelegate change = OnEstateInfoChange; | ||
1176 | |||
1177 | if (change != null) | ||
1178 | change(); | ||
1179 | } | ||
1144 | } | 1180 | } |
1145 | } | 1181 | } |