diff options
author | Melanie | 2013-05-07 00:31:11 +0100 |
---|---|---|
committer | Melanie | 2013-05-07 00:31:11 +0100 |
commit | 4c83b5e719ad288b1250fbed3f74698fa34eff21 (patch) | |
tree | 31eb880c4cf00b0697b07fd7f392ad374a11d1db /OpenSim/Region/CoreModules/World/Estate | |
parent | BulletSim: apply linear and angular friction in vehicle coordinates (diff) | |
download | opensim-SC-4c83b5e719ad288b1250fbed3f74698fa34eff21.zip opensim-SC-4c83b5e719ad288b1250fbed3f74698fa34eff21.tar.gz opensim-SC-4c83b5e719ad288b1250fbed3f74698fa34eff21.tar.bz2 opensim-SC-4c83b5e719ad288b1250fbed3f74698fa34eff21.tar.xz |
Step one of estate settings sharing - port the Avination Estate module (complete module) as changes are too extensive to apply manually
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Estate')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 57 |
1 files changed, 44 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 60f6739..91f6501 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -32,6 +32,7 @@ using System.IO; | |||
32 | using System.Linq; | 32 | using System.Linq; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using System.Security; | 34 | using System.Security; |
35 | using System.Timers; | ||
35 | using log4net; | 36 | using log4net; |
36 | using Mono.Addins; | 37 | using Mono.Addins; |
37 | using Nini.Config; | 38 | using Nini.Config; |
@@ -48,6 +49,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
48 | { | 49 | { |
49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 51 | ||
52 | private Timer m_regionChangeTimer = new Timer(); | ||
51 | public Scene Scene { get; private set; } | 53 | public Scene Scene { get; private set; } |
52 | public IUserManagement UserManager { get; private set; } | 54 | public IUserManagement UserManager { get; private set; } |
53 | 55 | ||
@@ -65,6 +67,8 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
65 | public event ChangeDelegate OnEstateInfoChange; | 67 | public event ChangeDelegate OnEstateInfoChange; |
66 | public event MessageDelegate OnEstateMessage; | 68 | public event MessageDelegate OnEstateMessage; |
67 | 69 | ||
70 | private int m_delayCount = 0; | ||
71 | |||
68 | #region Region Module interface | 72 | #region Region Module interface |
69 | 73 | ||
70 | public string Name { get { return "EstateManagementModule"; } } | 74 | public string Name { get { return "EstateManagementModule"; } } |
@@ -114,6 +118,12 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
114 | 118 | ||
115 | #region Packet Data Responders | 119 | #region Packet Data Responders |
116 | 120 | ||
121 | private void clientSendDetailedEstateData(IClientAPI remote_client, UUID invoice) | ||
122 | { | ||
123 | sendDetailedEstateData(remote_client, invoice); | ||
124 | sendEstateLists(remote_client, invoice); | ||
125 | } | ||
126 | |||
117 | private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice) | 127 | private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice) |
118 | { | 128 | { |
119 | uint sun = 0; | 129 | uint sun = 0; |
@@ -136,7 +146,10 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
136 | (uint) Scene.RegionInfo.RegionSettings.CovenantChangedDateTime, | 146 | (uint) Scene.RegionInfo.RegionSettings.CovenantChangedDateTime, |
137 | Scene.RegionInfo.EstateSettings.AbuseEmail, | 147 | Scene.RegionInfo.EstateSettings.AbuseEmail, |
138 | estateOwner); | 148 | estateOwner); |
149 | } | ||
139 | 150 | ||
151 | private void sendEstateLists(IClientAPI remote_client, UUID invoice) | ||
152 | { | ||
140 | remote_client.SendEstateList(invoice, | 153 | remote_client.SendEstateList(invoice, |
141 | (int)Constants.EstateAccessCodex.EstateManagers, | 154 | (int)Constants.EstateAccessCodex.EstateManagers, |
142 | Scene.RegionInfo.EstateSettings.EstateManagers, | 155 | Scene.RegionInfo.EstateSettings.EstateManagers, |
@@ -330,7 +343,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
330 | timeInSeconds -= 15; | 343 | timeInSeconds -= 15; |
331 | } | 344 | } |
332 | 345 | ||
333 | restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), true); | 346 | restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), false); |
334 | 347 | ||
335 | m_log.InfoFormat( | 348 | m_log.InfoFormat( |
336 | "User {0} requested restart of region {1} in {2} seconds", | 349 | "User {0} requested restart of region {1} in {2} seconds", |
@@ -546,7 +559,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
546 | { | 559 | { |
547 | if (!s.IsChildAgent) | 560 | if (!s.IsChildAgent) |
548 | { | 561 | { |
549 | Scene.TeleportClientHome(user, s.ControllingClient); | 562 | if (!Scene.TeleportClientHome(user, s.ControllingClient)) |
563 | { | ||
564 | s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out."); | ||
565 | s.ControllingClient.Close(); | ||
566 | } | ||
550 | } | 567 | } |
551 | } | 568 | } |
552 | 569 | ||
@@ -555,7 +572,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
555 | { | 572 | { |
556 | remote_client.SendAlertMessage("User is already on the region ban list"); | 573 | remote_client.SendAlertMessage("User is already on the region ban list"); |
557 | } | 574 | } |
558 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | 575 | //Scene.RegionInfo.regionBanlist.Add(Manager(user); |
559 | remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID); | 576 | remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID); |
560 | } | 577 | } |
561 | else | 578 | else |
@@ -611,7 +628,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
611 | remote_client.SendAlertMessage("User is not on the region ban list"); | 628 | remote_client.SendAlertMessage("User is not on the region ban list"); |
612 | } | 629 | } |
613 | 630 | ||
614 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | 631 | //Scene.RegionInfo.regionBanlist.Add(Manager(user); |
615 | remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID); | 632 | remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID); |
616 | } | 633 | } |
617 | else | 634 | else |
@@ -777,7 +794,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
777 | ScenePresence s = Scene.GetScenePresence(prey); | 794 | ScenePresence s = Scene.GetScenePresence(prey); |
778 | if (s != null) | 795 | if (s != null) |
779 | { | 796 | { |
780 | Scene.TeleportClientHome(prey, s.ControllingClient); | 797 | if (!Scene.TeleportClientHome(prey, s.ControllingClient)) |
798 | { | ||
799 | s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out."); | ||
800 | s.ControllingClient.Close(); | ||
801 | } | ||
781 | } | 802 | } |
782 | } | 803 | } |
783 | } | 804 | } |
@@ -795,7 +816,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
795 | // Also make sure they are actually in the region | 816 | // Also make sure they are actually in the region |
796 | ScenePresence p; | 817 | ScenePresence p; |
797 | if(Scene.TryGetScenePresence(client.AgentId, out p)) | 818 | if(Scene.TryGetScenePresence(client.AgentId, out p)) |
798 | Scene.TeleportClientHome(p.UUID, p.ControllingClient); | 819 | { |
820 | if (!Scene.TeleportClientHome(p.UUID, p.ControllingClient)) | ||
821 | { | ||
822 | p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out."); | ||
823 | p.ControllingClient.Close(); | ||
824 | } | ||
825 | } | ||
799 | } | 826 | } |
800 | }); | 827 | }); |
801 | } | 828 | } |
@@ -1170,7 +1197,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1170 | 1197 | ||
1171 | private void EventManager_OnNewClient(IClientAPI client) | 1198 | private void EventManager_OnNewClient(IClientAPI client) |
1172 | { | 1199 | { |
1173 | client.OnDetailedEstateDataRequest += sendDetailedEstateData; | 1200 | client.OnDetailedEstateDataRequest += clientSendDetailedEstateData; |
1174 | client.OnSetEstateFlagsRequest += estateSetRegionInfoHandler; | 1201 | client.OnSetEstateFlagsRequest += estateSetRegionInfoHandler; |
1175 | // client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture; | 1202 | // client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture; |
1176 | client.OnSetEstateTerrainDetailTexture += setEstateTerrainBaseTexture; | 1203 | client.OnSetEstateTerrainDetailTexture += setEstateTerrainBaseTexture; |
@@ -1218,8 +1245,6 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1218 | flags |= RegionFlags.NoFly; | 1245 | flags |= RegionFlags.NoFly; |
1219 | if (Scene.RegionInfo.RegionSettings.RestrictPushing) | 1246 | if (Scene.RegionInfo.RegionSettings.RestrictPushing) |
1220 | flags |= RegionFlags.RestrictPushObject; | 1247 | flags |= RegionFlags.RestrictPushObject; |
1221 | if (Scene.RegionInfo.RegionSettings.AllowLandJoinDivide) | ||
1222 | flags |= RegionFlags.AllowParcelChanges; | ||
1223 | if (Scene.RegionInfo.RegionSettings.BlockShowInSearch) | 1248 | if (Scene.RegionInfo.RegionSettings.BlockShowInSearch) |
1224 | flags |= RegionFlags.BlockParcelSearch; | 1249 | flags |= RegionFlags.BlockParcelSearch; |
1225 | 1250 | ||
@@ -1229,11 +1254,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1229 | flags |= RegionFlags.Sandbox; | 1254 | flags |= RegionFlags.Sandbox; |
1230 | if (Scene.RegionInfo.EstateSettings.AllowVoice) | 1255 | if (Scene.RegionInfo.EstateSettings.AllowVoice) |
1231 | flags |= RegionFlags.AllowVoice; | 1256 | flags |= RegionFlags.AllowVoice; |
1257 | if (Scene.RegionInfo.EstateSettings.BlockDwell) | ||
1258 | flags |= RegionFlags.BlockDwell; | ||
1259 | if (Scene.RegionInfo.EstateSettings.ResetHomeOnTeleport) | ||
1260 | flags |= RegionFlags.ResetHomeOnTeleport; | ||
1232 | 1261 | ||
1233 | // Fudge these to always on, so the menu options activate | ||
1234 | // | ||
1235 | flags |= RegionFlags.AllowLandmark; | ||
1236 | flags |= RegionFlags.AllowSetHome; | ||
1237 | 1262 | ||
1238 | // TODO: SkipUpdateInterestList | 1263 | // TODO: SkipUpdateInterestList |
1239 | 1264 | ||
@@ -1294,6 +1319,12 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1294 | 1319 | ||
1295 | public void TriggerRegionInfoChange() | 1320 | public void TriggerRegionInfoChange() |
1296 | { | 1321 | { |
1322 | m_regionChangeTimer.Stop(); | ||
1323 | m_regionChangeTimer.Start(); | ||
1324 | } | ||
1325 | |||
1326 | protected void RaiseRegionInfoChange(object sender, ElapsedEventArgs e) | ||
1327 | { | ||
1297 | ChangeDelegate change = OnRegionInfoChange; | 1328 | ChangeDelegate change = OnRegionInfoChange; |
1298 | 1329 | ||
1299 | if (change != null) | 1330 | if (change != null) |