aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs66
1 files changed, 60 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 637ebff..0556166 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -158,6 +158,20 @@ namespace OpenSim.Region.Framework.Scenes
158 158
159 public IXfer XferManager; 159 public IXfer XferManager;
160 160
161 protected ISnmpModule m_snmpService = null;
162 public ISnmpModule SnmpService
163 {
164 get
165 {
166 if (m_snmpService == null)
167 {
168 m_snmpService = RequestModuleInterface<ISnmpModule>();
169 }
170
171 return m_snmpService;
172 }
173 }
174
161 protected IAssetService m_AssetService; 175 protected IAssetService m_AssetService;
162 protected IAuthorizationService m_AuthorizationService; 176 protected IAuthorizationService m_AuthorizationService;
163 177
@@ -539,6 +553,8 @@ namespace OpenSim.Region.Framework.Scenes
539 553
540 // Load region settings 554 // Load region settings
541 m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); 555 m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);
556 m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(m_regInfo.RegionID);
557
542 if (m_storageManager.EstateDataStore != null) 558 if (m_storageManager.EstateDataStore != null)
543 { 559 {
544 m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID); 560 m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID);
@@ -886,6 +902,15 @@ namespace OpenSim.Region.Framework.Scenes
886 /// <param name="seconds">float indicating duration before restart.</param> 902 /// <param name="seconds">float indicating duration before restart.</param>
887 public virtual void Restart(float seconds) 903 public virtual void Restart(float seconds)
888 { 904 {
905 Restart(seconds, true);
906 }
907
908 /// <summary>
909 /// Given float seconds, this will restart the region. showDialog will optionally alert the users.
910 /// </summary>
911 /// <param name="seconds">float indicating duration before restart.</param>
912 public virtual void Restart(float seconds, bool showDialog)
913 {
889 // notifications are done in 15 second increments 914 // notifications are done in 15 second increments
890 // so .. if the number of seconds is less then 15 seconds, it's not really a restart request 915 // so .. if the number of seconds is less then 15 seconds, it's not really a restart request
891 // It's a 'Cancel restart' request. 916 // It's a 'Cancel restart' request.
@@ -906,8 +931,11 @@ namespace OpenSim.Region.Framework.Scenes
906 m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); 931 m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
907 m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); 932 m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
908 m_restartTimer.Start(); 933 m_restartTimer.Start();
909 m_dialogModule.SendNotificationToUsersInRegion( 934 if (showDialog)
935 {
936 m_dialogModule.SendNotificationToUsersInRegion(
910 UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0))); 937 UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0)));
938 }
911 } 939 }
912 } 940 }
913 941
@@ -1189,16 +1217,16 @@ namespace OpenSim.Region.Framework.Scenes
1189 // Check if any objects have reached their targets 1217 // Check if any objects have reached their targets
1190 CheckAtTargets(); 1218 CheckAtTargets();
1191 1219
1192 // Update SceneObjectGroups that have scheduled themselves for updates
1193 // Objects queue their updates onto all scene presences
1194 if (m_frame % m_update_objects == 0)
1195 m_sceneGraph.UpdateObjectGroups();
1196
1197 // Run through all ScenePresences looking for updates 1220 // Run through all ScenePresences looking for updates
1198 // Presence updates and queued object updates for each presence are sent to clients 1221 // Presence updates and queued object updates for each presence are sent to clients
1199 if (m_frame % m_update_presences == 0) 1222 if (m_frame % m_update_presences == 0)
1200 m_sceneGraph.UpdatePresences(); 1223 m_sceneGraph.UpdatePresences();
1201 1224
1225 // Update SceneObjectGroups that have scheduled themselves for updates
1226 // Objects queue their updates onto all scene presences
1227 if (m_frame % m_update_objects == 0)
1228 m_sceneGraph.UpdateObjectGroups();
1229
1202 int tmpPhysicsMS2 = Util.EnvironmentTickCount(); 1230 int tmpPhysicsMS2 = Util.EnvironmentTickCount();
1203 if ((m_frame % m_update_physics == 0) && m_physics_enabled) 1231 if ((m_frame % m_update_physics == 0) && m_physics_enabled)
1204 m_sceneGraph.UpdatePreparePhysics(); 1232 m_sceneGraph.UpdatePreparePhysics();
@@ -1511,6 +1539,19 @@ namespace OpenSim.Region.Framework.Scenes
1511 m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); 1539 m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
1512 } 1540 }
1513 1541
1542 public void StoreWindlightProfile(RegionMeta7WindlightData wl)
1543 {
1544 m_regInfo.WindlightSettings = wl;
1545 m_storageManager.DataStore.StoreRegionWindlightSettings(wl);
1546 m_eventManager.TriggerOnSaveNewWindlightProfile();
1547 }
1548
1549 public void LoadWindlightProfile()
1550 {
1551 m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(RegionInfo.RegionID);
1552 m_eventManager.TriggerOnSaveNewWindlightProfile();
1553 }
1554
1514 /// <summary> 1555 /// <summary>
1515 /// Loads the World heightmap 1556 /// Loads the World heightmap
1516 /// </summary> 1557 /// </summary>
@@ -3450,6 +3491,9 @@ namespace OpenSim.Region.Framework.Scenes
3450 3491
3451 CapsModule.AddCapsHandler(agent.AgentID); 3492 CapsModule.AddCapsHandler(agent.AgentID);
3452 3493
3494 if ((teleportFlags & ((uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.ViaLocation | (uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.Default)) != 0)
3495 System.Threading.Thread.Sleep(2000);
3496
3453 if (!agent.child) 3497 if (!agent.child)
3454 { 3498 {
3455 if (TestBorderCross(agent.startpos,Cardinals.E)) 3499 if (TestBorderCross(agent.startpos,Cardinals.E))
@@ -3508,6 +3552,7 @@ namespace OpenSim.Region.Framework.Scenes
3508 } 3552 }
3509 } 3553 }
3510 // Honor parcel landing type and position. 3554 // Honor parcel landing type and position.
3555 /*
3511 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); 3556 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
3512 if (land != null) 3557 if (land != null)
3513 { 3558 {
@@ -3516,6 +3561,7 @@ namespace OpenSim.Region.Framework.Scenes
3516 agent.startpos = land.LandData.UserLocation; 3561 agent.startpos = land.LandData.UserLocation;
3517 } 3562 }
3518 } 3563 }
3564 */// This is now handled properly in ScenePresence.MakeRootAgent
3519 } 3565 }
3520 3566
3521 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); 3567 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
@@ -4331,6 +4377,14 @@ namespace OpenSim.Region.Framework.Scenes
4331 } 4377 }
4332 4378
4333 /// <summary> 4379 /// <summary>
4380 /// Cheaply return the number of avatars in a region (without fetching a list object)
4381 /// </summary>
4382 public int GetRootAgentCount()
4383 {
4384 return m_sceneGraph.GetRootAgentCount();
4385 }
4386
4387 /// <summary>
4334 /// Return a list of all ScenePresences in this region. This returns child agents as well as root agents. 4388 /// Return a list of all ScenePresences in this region. This returns child agents as well as root agents.
4335 /// This list is a new object, so it can be iterated over without locking. 4389 /// This list is a new object, so it can be iterated over without locking.
4336 /// </summary> 4390 /// </summary>