diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 79 |
1 files changed, 68 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index eb06fcc..267332d 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, |
@@ -318,6 +331,16 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
318 | IRestartModule restartModule = Scene.RequestModuleInterface<IRestartModule>(); | 331 | IRestartModule restartModule = Scene.RequestModuleInterface<IRestartModule>(); |
319 | if (restartModule != null) | 332 | if (restartModule != null) |
320 | { | 333 | { |
334 | if (timeInSeconds == -1) | ||
335 | { | ||
336 | m_delayCount++; | ||
337 | if (m_delayCount > 3) | ||
338 | return; | ||
339 | |||
340 | restartModule.DelayRestart(3600, "Restart delayed by region manager"); | ||
341 | return; | ||
342 | } | ||
343 | |||
321 | List<int> times = new List<int>(); | 344 | List<int> times = new List<int>(); |
322 | while (timeInSeconds > 0) | 345 | while (timeInSeconds > 0) |
323 | { | 346 | { |
@@ -330,7 +353,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
330 | timeInSeconds -= 15; | 353 | timeInSeconds -= 15; |
331 | } | 354 | } |
332 | 355 | ||
333 | restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), true); | 356 | restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), false); |
334 | 357 | ||
335 | m_log.InfoFormat( | 358 | m_log.InfoFormat( |
336 | "User {0} requested restart of region {1} in {2} seconds", | 359 | "User {0} requested restart of region {1} in {2} seconds", |
@@ -546,7 +569,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
546 | { | 569 | { |
547 | if (!s.IsChildAgent) | 570 | if (!s.IsChildAgent) |
548 | { | 571 | { |
549 | Scene.TeleportClientHome(user, s.ControllingClient); | 572 | if (!Scene.TeleportClientHome(user, s.ControllingClient)) |
573 | { | ||
574 | s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out."); | ||
575 | s.ControllingClient.Close(); | ||
576 | } | ||
550 | } | 577 | } |
551 | } | 578 | } |
552 | 579 | ||
@@ -555,7 +582,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
555 | { | 582 | { |
556 | remote_client.SendAlertMessage("User is already on the region ban list"); | 583 | remote_client.SendAlertMessage("User is already on the region ban list"); |
557 | } | 584 | } |
558 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | 585 | //Scene.RegionInfo.regionBanlist.Add(Manager(user); |
559 | remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID); | 586 | remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID); |
560 | } | 587 | } |
561 | else | 588 | else |
@@ -611,7 +638,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
611 | remote_client.SendAlertMessage("User is not on the region ban list"); | 638 | remote_client.SendAlertMessage("User is not on the region ban list"); |
612 | } | 639 | } |
613 | 640 | ||
614 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | 641 | //Scene.RegionInfo.regionBanlist.Add(Manager(user); |
615 | remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID); | 642 | remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID); |
616 | } | 643 | } |
617 | else | 644 | else |
@@ -772,7 +799,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
772 | ScenePresence s = Scene.GetScenePresence(prey); | 799 | ScenePresence s = Scene.GetScenePresence(prey); |
773 | if (s != null) | 800 | if (s != null) |
774 | { | 801 | { |
775 | Scene.TeleportClientHome(prey, s.ControllingClient); | 802 | if (!Scene.TeleportClientHome(prey, s.ControllingClient)) |
803 | { | ||
804 | s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out."); | ||
805 | s.ControllingClient.Close(); | ||
806 | } | ||
776 | } | 807 | } |
777 | } | 808 | } |
778 | } | 809 | } |
@@ -790,7 +821,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
790 | // Also make sure they are actually in the region | 821 | // Also make sure they are actually in the region |
791 | ScenePresence p; | 822 | ScenePresence p; |
792 | if(Scene.TryGetScenePresence(client.AgentId, out p)) | 823 | if(Scene.TryGetScenePresence(client.AgentId, out p)) |
793 | Scene.TeleportClientHome(p.UUID, p.ControllingClient); | 824 | { |
825 | if (!Scene.TeleportClientHome(p.UUID, p.ControllingClient)) | ||
826 | { | ||
827 | p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out."); | ||
828 | p.ControllingClient.Close(); | ||
829 | } | ||
830 | } | ||
794 | } | 831 | } |
795 | }); | 832 | }); |
796 | } | 833 | } |
@@ -1164,7 +1201,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1164 | 1201 | ||
1165 | private void EventManager_OnNewClient(IClientAPI client) | 1202 | private void EventManager_OnNewClient(IClientAPI client) |
1166 | { | 1203 | { |
1167 | client.OnDetailedEstateDataRequest += sendDetailedEstateData; | 1204 | client.OnDetailedEstateDataRequest += clientSendDetailedEstateData; |
1168 | client.OnSetEstateFlagsRequest += estateSetRegionInfoHandler; | 1205 | client.OnSetEstateFlagsRequest += estateSetRegionInfoHandler; |
1169 | // client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture; | 1206 | // client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture; |
1170 | client.OnSetEstateTerrainDetailTexture += setEstateTerrainBaseTexture; | 1207 | client.OnSetEstateTerrainDetailTexture += setEstateTerrainBaseTexture; |
@@ -1216,6 +1253,10 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1216 | flags |= RegionFlags.AllowParcelChanges; | 1253 | flags |= RegionFlags.AllowParcelChanges; |
1217 | if (Scene.RegionInfo.RegionSettings.BlockShowInSearch) | 1254 | if (Scene.RegionInfo.RegionSettings.BlockShowInSearch) |
1218 | flags |= RegionFlags.BlockParcelSearch; | 1255 | flags |= RegionFlags.BlockParcelSearch; |
1256 | if (Scene.RegionInfo.RegionSettings.GodBlockSearch) | ||
1257 | flags |= (RegionFlags)(1 << 11); | ||
1258 | if (Scene.RegionInfo.RegionSettings.Casino) | ||
1259 | flags |= (RegionFlags)(1 << 10); | ||
1219 | 1260 | ||
1220 | if (Scene.RegionInfo.RegionSettings.FixedSun) | 1261 | if (Scene.RegionInfo.RegionSettings.FixedSun) |
1221 | flags |= RegionFlags.SunFixed; | 1262 | flags |= RegionFlags.SunFixed; |
@@ -1223,11 +1264,15 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1223 | flags |= RegionFlags.Sandbox; | 1264 | flags |= RegionFlags.Sandbox; |
1224 | if (Scene.RegionInfo.EstateSettings.AllowVoice) | 1265 | if (Scene.RegionInfo.EstateSettings.AllowVoice) |
1225 | flags |= RegionFlags.AllowVoice; | 1266 | flags |= RegionFlags.AllowVoice; |
1267 | if (Scene.RegionInfo.EstateSettings.AllowLandmark) | ||
1268 | flags |= RegionFlags.AllowLandmark; | ||
1269 | if (Scene.RegionInfo.EstateSettings.AllowSetHome) | ||
1270 | flags |= RegionFlags.AllowSetHome; | ||
1271 | if (Scene.RegionInfo.EstateSettings.BlockDwell) | ||
1272 | flags |= RegionFlags.BlockDwell; | ||
1273 | if (Scene.RegionInfo.EstateSettings.ResetHomeOnTeleport) | ||
1274 | flags |= RegionFlags.ResetHomeOnTeleport; | ||
1226 | 1275 | ||
1227 | // Fudge these to always on, so the menu options activate | ||
1228 | // | ||
1229 | flags |= RegionFlags.AllowLandmark; | ||
1230 | flags |= RegionFlags.AllowSetHome; | ||
1231 | 1276 | ||
1232 | // TODO: SkipUpdateInterestList | 1277 | // TODO: SkipUpdateInterestList |
1233 | 1278 | ||
@@ -1268,6 +1313,12 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1268 | flags |= RegionFlags.ResetHomeOnTeleport; | 1313 | flags |= RegionFlags.ResetHomeOnTeleport; |
1269 | if (Scene.RegionInfo.EstateSettings.TaxFree) | 1314 | if (Scene.RegionInfo.EstateSettings.TaxFree) |
1270 | flags |= RegionFlags.TaxFree; | 1315 | flags |= RegionFlags.TaxFree; |
1316 | if (Scene.RegionInfo.EstateSettings.AllowLandmark) | ||
1317 | flags |= RegionFlags.AllowLandmark; | ||
1318 | if (Scene.RegionInfo.EstateSettings.AllowParcelChanges) | ||
1319 | flags |= RegionFlags.AllowParcelChanges; | ||
1320 | if (Scene.RegionInfo.EstateSettings.AllowSetHome) | ||
1321 | flags |= RegionFlags.AllowSetHome; | ||
1271 | if (Scene.RegionInfo.EstateSettings.DenyMinors) | 1322 | if (Scene.RegionInfo.EstateSettings.DenyMinors) |
1272 | flags |= (RegionFlags)(1 << 30); | 1323 | flags |= (RegionFlags)(1 << 30); |
1273 | 1324 | ||
@@ -1288,6 +1339,12 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1288 | 1339 | ||
1289 | public void TriggerRegionInfoChange() | 1340 | public void TriggerRegionInfoChange() |
1290 | { | 1341 | { |
1342 | m_regionChangeTimer.Stop(); | ||
1343 | m_regionChangeTimer.Start(); | ||
1344 | } | ||
1345 | |||
1346 | protected void RaiseRegionInfoChange(object sender, ElapsedEventArgs e) | ||
1347 | { | ||
1291 | ChangeDelegate change = OnRegionInfoChange; | 1348 | ChangeDelegate change = OnRegionInfoChange; |
1292 | 1349 | ||
1293 | if (change != null) | 1350 | if (change != null) |