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 de8ecc2..377abe3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -156,6 +156,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
156 | 156 | ||
157 | public IXfer XferManager; | 157 | public IXfer XferManager; |
158 | 158 | ||
159 | protected ISnmpModule m_snmpService = null; | ||
160 | public ISnmpModule SnmpService | ||
161 | { | ||
162 | get | ||
163 | { | ||
164 | if (m_snmpService == null) | ||
165 | { | ||
166 | m_snmpService = RequestModuleInterface<ISnmpModule>(); | ||
167 | } | ||
168 | |||
169 | return m_snmpService; | ||
170 | } | ||
171 | } | ||
172 | |||
159 | protected IAssetService m_AssetService; | 173 | protected IAssetService m_AssetService; |
160 | protected IAuthorizationService m_AuthorizationService; | 174 | protected IAuthorizationService m_AuthorizationService; |
161 | 175 | ||
@@ -613,6 +627,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
613 | 627 | ||
614 | // Load region settings | 628 | // Load region settings |
615 | m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); | 629 | m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); |
630 | m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(m_regInfo.RegionID); | ||
631 | |||
616 | if (m_storageManager.EstateDataStore != null) | 632 | if (m_storageManager.EstateDataStore != null) |
617 | { | 633 | { |
618 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); | 634 | 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 | int tmpPhysicsMS2 = Util.EnvironmentTickCount(); | 1449 | int tmpPhysicsMS2 = Util.EnvironmentTickCount(); |
1422 | if ((m_frame % m_update_physics == 0) && m_physics_enabled) | 1450 | if ((m_frame % m_update_physics == 0) && m_physics_enabled) |
1423 | m_sceneGraph.UpdatePreparePhysics(); | 1451 | m_sceneGraph.UpdatePreparePhysics(); |
@@ -2119,7 +2147,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2119 | public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) | 2147 | public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) |
2120 | { | 2148 | { |
2121 | return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates); | 2149 | return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates); |
2122 | } | 2150 | } |
2123 | 2151 | ||
2124 | /// <summary> | 2152 | /// <summary> |
2125 | /// Delete every object from the scene | 2153 | /// Delete every object from the scene |
@@ -3461,12 +3489,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
3461 | { | 3489 | { |
3462 | // We have a zombie from a crashed session. Kill it. | 3490 | // We have a zombie from a crashed session. Kill it. |
3463 | m_log.DebugFormat("[SCENE]: Zombie scene presence detected for {0} in {1}", agent.AgentID, RegionInfo.RegionName); | 3491 | m_log.DebugFormat("[SCENE]: Zombie scene presence detected for {0} in {1}", agent.AgentID, RegionInfo.RegionName); |
3464 | sp.ControllingClient.Close(); | 3492 | sp.ControllingClient.Close(false); |
3465 | } | 3493 | } |
3466 | } | 3494 | } |
3467 | 3495 | ||
3468 | CapsModule.AddCapsHandler(agent.AgentID); | 3496 | CapsModule.AddCapsHandler(agent.AgentID); |
3469 | 3497 | ||
3498 | if ((teleportFlags & ((uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.ViaLocation | (uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.Default)) != 0) | ||
3499 | System.Threading.Thread.Sleep(2000); | ||
3500 | |||
3470 | if (!agent.child) | 3501 | if (!agent.child) |
3471 | { | 3502 | { |
3472 | if (TestBorderCross(agent.startpos,Cardinals.E)) | 3503 | if (TestBorderCross(agent.startpos,Cardinals.E)) |
@@ -3525,6 +3556,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3525 | } | 3556 | } |
3526 | } | 3557 | } |
3527 | // Honor parcel landing type and position. | 3558 | // Honor parcel landing type and position. |
3559 | /* | ||
3560 | ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); | ||
3528 | if (land != null) | 3561 | if (land != null) |
3529 | { | 3562 | { |
3530 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) | 3563 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) |
@@ -3532,6 +3565,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3532 | agent.startpos = land.LandData.UserLocation; | 3565 | agent.startpos = land.LandData.UserLocation; |
3533 | } | 3566 | } |
3534 | } | 3567 | } |
3568 | */// This is now handled properly in ScenePresence.MakeRootAgent | ||
3535 | } | 3569 | } |
3536 | 3570 | ||
3537 | agent.teleportFlags = teleportFlags; | 3571 | agent.teleportFlags = teleportFlags; |
@@ -3880,12 +3914,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
3880 | return false; | 3914 | return false; |
3881 | } | 3915 | } |
3882 | 3916 | ||
3917 | public bool IncomingCloseAgent(UUID agentID) | ||
3918 | { | ||
3919 | return IncomingCloseAgent(agentID, false); | ||
3920 | } | ||
3921 | |||
3922 | public bool IncomingCloseChildAgent(UUID agentID) | ||
3923 | { | ||
3924 | return IncomingCloseAgent(agentID, true); | ||
3925 | } | ||
3926 | |||
3883 | /// <summary> | 3927 | /// <summary> |
3884 | /// Tell a single agent to disconnect from the region. | 3928 | /// Tell a single agent to disconnect from the region. |
3885 | /// </summary> | 3929 | /// </summary> |
3886 | /// <param name="regionHandle"></param> | ||
3887 | /// <param name="agentID"></param> | 3930 | /// <param name="agentID"></param> |
3888 | public bool IncomingCloseAgent(UUID agentID) | 3931 | /// <param name="childOnly"></param> |
3932 | public bool IncomingCloseAgent(UUID agentID, bool childOnly) | ||
3889 | { | 3933 | { |
3890 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); | 3934 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); |
3891 | 3935 | ||
@@ -3897,7 +3941,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3897 | { | 3941 | { |
3898 | m_sceneGraph.removeUserCount(false); | 3942 | m_sceneGraph.removeUserCount(false); |
3899 | } | 3943 | } |
3900 | else | 3944 | else if (!childOnly) |
3901 | { | 3945 | { |
3902 | m_sceneGraph.removeUserCount(true); | 3946 | m_sceneGraph.removeUserCount(true); |
3903 | } | 3947 | } |
@@ -3913,9 +3957,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3913 | } | 3957 | } |
3914 | else | 3958 | else |
3915 | presence.ControllingClient.SendShutdownConnectionNotice(); | 3959 | presence.ControllingClient.SendShutdownConnectionNotice(); |
3960 | presence.ControllingClient.Close(false); | ||
3961 | } | ||
3962 | else if (!childOnly) | ||
3963 | { | ||
3964 | presence.ControllingClient.Close(true); | ||
3916 | } | 3965 | } |
3917 | |||
3918 | presence.ControllingClient.Close(); | ||
3919 | return true; | 3966 | return true; |
3920 | } | 3967 | } |
3921 | 3968 | ||