diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 75 |
1 files changed, 61 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 9a3b0c9..e80dff7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -149,6 +149,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
149 | 149 | ||
150 | public IXfer XferManager; | 150 | public IXfer XferManager; |
151 | 151 | ||
152 | protected ISnmpModule m_snmpService = null; | ||
153 | public ISnmpModule SnmpService | ||
154 | { | ||
155 | get | ||
156 | { | ||
157 | if (m_snmpService == null) | ||
158 | { | ||
159 | m_snmpService = RequestModuleInterface<ISnmpModule>(); | ||
160 | } | ||
161 | |||
162 | return m_snmpService; | ||
163 | } | ||
164 | } | ||
165 | |||
152 | protected IAssetService m_AssetService; | 166 | protected IAssetService m_AssetService; |
153 | protected IAuthorizationService m_AuthorizationService; | 167 | protected IAuthorizationService m_AuthorizationService; |
154 | 168 | ||
@@ -609,6 +623,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
609 | 623 | ||
610 | // Load region settings | 624 | // Load region settings |
611 | m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); | 625 | m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); |
626 | m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(m_regInfo.RegionID); | ||
627 | |||
612 | if (m_storageManager.EstateDataStore != null) | 628 | if (m_storageManager.EstateDataStore != null) |
613 | { | 629 | { |
614 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); | 630 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); |
@@ -711,7 +727,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
711 | m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); | 727 | m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); |
712 | // TODO: Change default to true once the feature is supported | 728 | // TODO: Change default to true once the feature is supported |
713 | m_usePreJump = startupConfig.GetBoolean("enableprejump", false); | 729 | m_usePreJump = startupConfig.GetBoolean("enableprejump", false); |
714 | 730 | m_usePreJump = true; // Above line fails!? | |
715 | m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); | 731 | m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); |
716 | if (RegionInfo.NonphysPrimMax > 0) | 732 | if (RegionInfo.NonphysPrimMax > 0) |
717 | { | 733 | { |
@@ -1031,6 +1047,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
1031 | /// <param name="seconds">float indicating duration before restart.</param> | 1047 | /// <param name="seconds">float indicating duration before restart.</param> |
1032 | public virtual void Restart(float seconds) | 1048 | public virtual void Restart(float seconds) |
1033 | { | 1049 | { |
1050 | Restart(seconds, true); | ||
1051 | } | ||
1052 | |||
1053 | /// <summary> | ||
1054 | /// Given float seconds, this will restart the region. showDialog will optionally alert the users. | ||
1055 | /// </summary> | ||
1056 | /// <param name="seconds">float indicating duration before restart.</param> | ||
1057 | public virtual void Restart(float seconds, bool showDialog) | ||
1058 | { | ||
1034 | // notifications are done in 15 second increments | 1059 | // notifications are done in 15 second increments |
1035 | // so .. if the number of seconds is less then 15 seconds, it's not really a restart request | 1060 | // so .. if the number of seconds is less then 15 seconds, it's not really a restart request |
1036 | // It's a 'Cancel restart' request. | 1061 | // It's a 'Cancel restart' request. |
@@ -1051,8 +1076,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1051 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); | 1076 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); |
1052 | m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); | 1077 | m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); |
1053 | m_restartTimer.Start(); | 1078 | m_restartTimer.Start(); |
1054 | m_dialogModule.SendNotificationToUsersInRegion( | 1079 | if (showDialog) |
1080 | { | ||
1081 | m_dialogModule.SendNotificationToUsersInRegion( | ||
1055 | UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0))); | 1082 | UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0))); |
1083 | } | ||
1056 | } | 1084 | } |
1057 | } | 1085 | } |
1058 | 1086 | ||
@@ -1408,16 +1436,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1408 | // Check if any objects have reached their targets | 1436 | // Check if any objects have reached their targets |
1409 | CheckAtTargets(); | 1437 | CheckAtTargets(); |
1410 | 1438 | ||
1411 | // Update SceneObjectGroups that have scheduled themselves for updates | ||
1412 | // Objects queue their updates onto all scene presences | ||
1413 | if (m_frame % m_update_objects == 0) | ||
1414 | m_sceneGraph.UpdateObjectGroups(); | ||
1415 | |||
1416 | // Run through all ScenePresences looking for updates | 1439 | // Run through all ScenePresences looking for updates |
1417 | // Presence updates and queued object updates for each presence are sent to clients | 1440 | // Presence updates and queued object updates for each presence are sent to clients |
1418 | if (m_frame % m_update_presences == 0) | 1441 | if (m_frame % m_update_presences == 0) |
1419 | m_sceneGraph.UpdatePresences(); | 1442 | m_sceneGraph.UpdatePresences(); |
1420 | 1443 | ||
1444 | // Update SceneObjectGroups that have scheduled themselves for updates | ||
1445 | // Objects queue their updates onto all scene presences | ||
1446 | if (m_frame % m_update_objects == 0) | ||
1447 | m_sceneGraph.UpdateObjectGroups(); | ||
1448 | |||
1421 | if (m_frame % m_update_coarse_locations == 0) | 1449 | if (m_frame % m_update_coarse_locations == 0) |
1422 | { | 1450 | { |
1423 | List<Vector3> coarseLocations; | 1451 | List<Vector3> coarseLocations; |
@@ -2157,7 +2185,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2157 | public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) | 2185 | public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) |
2158 | { | 2186 | { |
2159 | return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates); | 2187 | return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates); |
2160 | } | 2188 | } |
2161 | 2189 | ||
2162 | /// <summary> | 2190 | /// <summary> |
2163 | /// Delete every object from the scene. This does not include attachments worn by avatars. | 2191 | /// Delete every object from the scene. This does not include attachments worn by avatars. |
@@ -3498,12 +3526,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
3498 | { | 3526 | { |
3499 | // We have a zombie from a crashed session. Kill it. | 3527 | // We have a zombie from a crashed session. Kill it. |
3500 | m_log.DebugFormat("[SCENE]: Zombie scene presence detected for {0} in {1}", agent.AgentID, RegionInfo.RegionName); | 3528 | m_log.DebugFormat("[SCENE]: Zombie scene presence detected for {0} in {1}", agent.AgentID, RegionInfo.RegionName); |
3501 | sp.ControllingClient.Close(); | 3529 | sp.ControllingClient.Close(false); |
3502 | } | 3530 | } |
3503 | } | 3531 | } |
3504 | 3532 | ||
3505 | CapsModule.AddCapsHandler(agent.AgentID); | 3533 | CapsModule.AddCapsHandler(agent.AgentID); |
3506 | 3534 | ||
3535 | if ((teleportFlags & ((uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.ViaLocation | (uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.Default)) != 0) | ||
3536 | System.Threading.Thread.Sleep(2000); | ||
3537 | |||
3507 | if (!agent.child) | 3538 | if (!agent.child) |
3508 | { | 3539 | { |
3509 | if (TestBorderCross(agent.startpos,Cardinals.E)) | 3540 | if (TestBorderCross(agent.startpos,Cardinals.E)) |
@@ -3562,6 +3593,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3562 | } | 3593 | } |
3563 | } | 3594 | } |
3564 | // Honor parcel landing type and position. | 3595 | // Honor parcel landing type and position. |
3596 | /* | ||
3597 | ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); | ||
3565 | if (land != null) | 3598 | if (land != null) |
3566 | { | 3599 | { |
3567 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) | 3600 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) |
@@ -3569,6 +3602,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3569 | agent.startpos = land.LandData.UserLocation; | 3602 | agent.startpos = land.LandData.UserLocation; |
3570 | } | 3603 | } |
3571 | } | 3604 | } |
3605 | */// This is now handled properly in ScenePresence.MakeRootAgent | ||
3572 | } | 3606 | } |
3573 | 3607 | ||
3574 | agent.teleportFlags = teleportFlags; | 3608 | agent.teleportFlags = teleportFlags; |
@@ -3917,12 +3951,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
3917 | return false; | 3951 | return false; |
3918 | } | 3952 | } |
3919 | 3953 | ||
3954 | public bool IncomingCloseAgent(UUID agentID) | ||
3955 | { | ||
3956 | return IncomingCloseAgent(agentID, false); | ||
3957 | } | ||
3958 | |||
3959 | public bool IncomingCloseChildAgent(UUID agentID) | ||
3960 | { | ||
3961 | return IncomingCloseAgent(agentID, true); | ||
3962 | } | ||
3963 | |||
3920 | /// <summary> | 3964 | /// <summary> |
3921 | /// Tell a single agent to disconnect from the region. | 3965 | /// Tell a single agent to disconnect from the region. |
3922 | /// </summary> | 3966 | /// </summary> |
3923 | /// <param name="regionHandle"></param> | ||
3924 | /// <param name="agentID"></param> | 3967 | /// <param name="agentID"></param> |
3925 | public bool IncomingCloseAgent(UUID agentID) | 3968 | /// <param name="childOnly"></param> |
3969 | public bool IncomingCloseAgent(UUID agentID, bool childOnly) | ||
3926 | { | 3970 | { |
3927 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); | 3971 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); |
3928 | 3972 | ||
@@ -3934,7 +3978,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3934 | { | 3978 | { |
3935 | m_sceneGraph.removeUserCount(false); | 3979 | m_sceneGraph.removeUserCount(false); |
3936 | } | 3980 | } |
3937 | else | 3981 | else if (!childOnly) |
3938 | { | 3982 | { |
3939 | m_sceneGraph.removeUserCount(true); | 3983 | m_sceneGraph.removeUserCount(true); |
3940 | } | 3984 | } |
@@ -3950,9 +3994,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3950 | } | 3994 | } |
3951 | else | 3995 | else |
3952 | presence.ControllingClient.SendShutdownConnectionNotice(); | 3996 | presence.ControllingClient.SendShutdownConnectionNotice(); |
3997 | presence.ControllingClient.Close(false); | ||
3998 | } | ||
3999 | else if (!childOnly) | ||
4000 | { | ||
4001 | presence.ControllingClient.Close(true); | ||
3953 | } | 4002 | } |
3954 | |||
3955 | presence.ControllingClient.Close(); | ||
3956 | return true; | 4003 | return true; |
3957 | } | 4004 | } |
3958 | 4005 | ||