diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 175 |
1 files changed, 146 insertions, 29 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a147628..32211c4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -137,6 +137,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
137 | protected SceneCommunicationService m_sceneGridService; | 137 | protected SceneCommunicationService m_sceneGridService; |
138 | public bool LoginsDisabled = true; | 138 | public bool LoginsDisabled = true; |
139 | public bool LoadingPrims = false; | 139 | public bool LoadingPrims = false; |
140 | public bool CombineRegions = false; | ||
140 | 141 | ||
141 | public new float TimeDilation | 142 | public new float TimeDilation |
142 | { | 143 | { |
@@ -150,6 +151,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
150 | 151 | ||
151 | public IXfer XferManager; | 152 | public IXfer XferManager; |
152 | 153 | ||
154 | protected ISnmpModule m_snmpService = null; | ||
155 | public ISnmpModule SnmpService | ||
156 | { | ||
157 | get | ||
158 | { | ||
159 | if (m_snmpService == null) | ||
160 | { | ||
161 | m_snmpService = RequestModuleInterface<ISnmpModule>(); | ||
162 | } | ||
163 | |||
164 | return m_snmpService; | ||
165 | } | ||
166 | } | ||
167 | |||
153 | protected IAssetService m_AssetService; | 168 | protected IAssetService m_AssetService; |
154 | protected IAuthorizationService m_AuthorizationService; | 169 | protected IAuthorizationService m_AuthorizationService; |
155 | 170 | ||
@@ -544,6 +559,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
544 | 559 | ||
545 | // Load region settings | 560 | // Load region settings |
546 | m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); | 561 | m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); |
562 | m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(m_regInfo.RegionID); | ||
563 | |||
547 | if (m_storageManager.EstateDataStore != null) | 564 | if (m_storageManager.EstateDataStore != null) |
548 | { | 565 | { |
549 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); | 566 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); |
@@ -606,9 +623,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
606 | //Animation states | 623 | //Animation states |
607 | m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); | 624 | m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); |
608 | // TODO: Change default to true once the feature is supported | 625 | // TODO: Change default to true once the feature is supported |
609 | m_usePreJump = startupConfig.GetBoolean("enableprejump", false); | 626 | m_usePreJump = startupConfig.GetBoolean("enableprejump", true); |
610 | |||
611 | m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); | 627 | m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); |
628 | |||
629 | m_log.DebugFormat("[SCENE]: prejump is {0}", m_usePreJump ? "ON" : "OFF"); | ||
612 | if (RegionInfo.NonphysPrimMax > 0) | 630 | if (RegionInfo.NonphysPrimMax > 0) |
613 | { | 631 | { |
614 | m_maxNonphys = RegionInfo.NonphysPrimMax; | 632 | m_maxNonphys = RegionInfo.NonphysPrimMax; |
@@ -649,6 +667,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
649 | } | 667 | } |
650 | 668 | ||
651 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); | 669 | m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); |
670 | CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false); | ||
652 | 671 | ||
653 | m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true); | 672 | m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true); |
654 | if (m_generateMaptiles) | 673 | if (m_generateMaptiles) |
@@ -912,6 +931,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
912 | /// <param name="seconds">float indicating duration before restart.</param> | 931 | /// <param name="seconds">float indicating duration before restart.</param> |
913 | public virtual void Restart(float seconds) | 932 | public virtual void Restart(float seconds) |
914 | { | 933 | { |
934 | Restart(seconds, true); | ||
935 | } | ||
936 | |||
937 | /// <summary> | ||
938 | /// Given float seconds, this will restart the region. showDialog will optionally alert the users. | ||
939 | /// </summary> | ||
940 | /// <param name="seconds">float indicating duration before restart.</param> | ||
941 | public virtual void Restart(float seconds, bool showDialog) | ||
942 | { | ||
915 | // notifications are done in 15 second increments | 943 | // notifications are done in 15 second increments |
916 | // so .. if the number of seconds is less then 15 seconds, it's not really a restart request | 944 | // so .. if the number of seconds is less then 15 seconds, it's not really a restart request |
917 | // It's a 'Cancel restart' request. | 945 | // It's a 'Cancel restart' request. |
@@ -932,8 +960,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
932 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); | 960 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); |
933 | m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); | 961 | m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); |
934 | m_restartTimer.Start(); | 962 | m_restartTimer.Start(); |
935 | m_dialogModule.SendNotificationToUsersInRegion( | 963 | if (showDialog) |
964 | { | ||
965 | m_dialogModule.SendNotificationToUsersInRegion( | ||
936 | UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0))); | 966 | UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0))); |
967 | } | ||
937 | } | 968 | } |
938 | } | 969 | } |
939 | 970 | ||
@@ -1291,16 +1322,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1291 | // Check if any objects have reached their targets | 1322 | // Check if any objects have reached their targets |
1292 | CheckAtTargets(); | 1323 | CheckAtTargets(); |
1293 | 1324 | ||
1294 | // Update SceneObjectGroups that have scheduled themselves for updates | ||
1295 | // Objects queue their updates onto all scene presences | ||
1296 | if (m_frame % m_update_objects == 0) | ||
1297 | m_sceneGraph.UpdateObjectGroups(); | ||
1298 | |||
1299 | // Run through all ScenePresences looking for updates | 1325 | // Run through all ScenePresences looking for updates |
1300 | // Presence updates and queued object updates for each presence are sent to clients | 1326 | // Presence updates and queued object updates for each presence are sent to clients |
1301 | if (m_frame % m_update_presences == 0) | 1327 | if (m_frame % m_update_presences == 0) |
1302 | m_sceneGraph.UpdatePresences(); | 1328 | m_sceneGraph.UpdatePresences(); |
1303 | 1329 | ||
1330 | // Update SceneObjectGroups that have scheduled themselves for updates | ||
1331 | // Objects queue their updates onto all scene presences | ||
1332 | if (m_frame % m_update_objects == 0) | ||
1333 | m_sceneGraph.UpdateObjectGroups(); | ||
1334 | |||
1304 | if (m_frame % m_update_coarse_locations == 0) | 1335 | if (m_frame % m_update_coarse_locations == 0) |
1305 | { | 1336 | { |
1306 | List<Vector3> coarseLocations; | 1337 | List<Vector3> coarseLocations; |
@@ -1629,6 +1660,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1629 | public void StoreWindlightProfile(RegionLightShareData wl) | 1660 | public void StoreWindlightProfile(RegionLightShareData wl) |
1630 | { | 1661 | { |
1631 | m_regInfo.WindlightSettings = wl; | 1662 | m_regInfo.WindlightSettings = wl; |
1663 | wl.Save(); | ||
1632 | m_storageManager.DataStore.StoreRegionWindlightSettings(wl); | 1664 | m_storageManager.DataStore.StoreRegionWindlightSettings(wl); |
1633 | m_eventManager.TriggerOnSaveNewWindlightProfile(); | 1665 | m_eventManager.TriggerOnSaveNewWindlightProfile(); |
1634 | } | 1666 | } |
@@ -1789,14 +1821,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
1789 | /// <returns></returns> | 1821 | /// <returns></returns> |
1790 | public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter) | 1822 | public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter) |
1791 | { | 1823 | { |
1824 | |||
1825 | float wheight = (float)RegionInfo.RegionSettings.WaterHeight; | ||
1826 | Vector3 wpos = Vector3.Zero; | ||
1827 | // Check for water surface intersection from above | ||
1828 | if ( (RayStart.Z > wheight) && (RayEnd.Z < wheight) ) | ||
1829 | { | ||
1830 | float ratio = (RayStart.Z - wheight) / (RayStart.Z - RayEnd.Z); | ||
1831 | wpos.X = RayStart.X - (ratio * (RayStart.X - RayEnd.X)); | ||
1832 | wpos.Y = RayStart.Y - (ratio * (RayStart.Y - RayEnd.Y)); | ||
1833 | wpos.Z = wheight; | ||
1834 | } | ||
1835 | |||
1792 | Vector3 pos = Vector3.Zero; | 1836 | Vector3 pos = Vector3.Zero; |
1793 | if (RayEndIsIntersection == (byte)1) | 1837 | if (RayEndIsIntersection == (byte)1) |
1794 | { | 1838 | { |
1795 | pos = RayEnd; | 1839 | pos = RayEnd; |
1796 | return pos; | ||
1797 | } | 1840 | } |
1798 | 1841 | else if (RayTargetID != UUID.Zero) | |
1799 | if (RayTargetID != UUID.Zero) | ||
1800 | { | 1842 | { |
1801 | SceneObjectPart target = GetSceneObjectPart(RayTargetID); | 1843 | SceneObjectPart target = GetSceneObjectPart(RayTargetID); |
1802 | 1844 | ||
@@ -1818,7 +1860,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1818 | EntityIntersection ei = target.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, FaceCenter); | 1860 | EntityIntersection ei = target.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, FaceCenter); |
1819 | 1861 | ||
1820 | // Un-comment out the following line to Get Raytrace results printed to the console. | 1862 | // Un-comment out the following line to Get Raytrace results printed to the console. |
1821 | // m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString()); | 1863 | // m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString()); |
1822 | float ScaleOffset = 0.5f; | 1864 | float ScaleOffset = 0.5f; |
1823 | 1865 | ||
1824 | // If we hit something | 1866 | // If we hit something |
@@ -1841,13 +1883,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1841 | //pos.Z -= 0.25F; | 1883 | //pos.Z -= 0.25F; |
1842 | 1884 | ||
1843 | } | 1885 | } |
1844 | |||
1845 | return pos; | ||
1846 | } | 1886 | } |
1847 | else | 1887 | else |
1848 | { | 1888 | { |
1849 | // We don't have a target here, so we're going to raytrace all the objects in the scene. | 1889 | // We don't have a target here, so we're going to raytrace all the objects in the scene. |
1850 | |||
1851 | EntityIntersection ei = m_sceneGraph.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection), true, false); | 1890 | EntityIntersection ei = m_sceneGraph.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection), true, false); |
1852 | 1891 | ||
1853 | // Un-comment the following line to print the raytrace results to the console. | 1892 | // Un-comment the following line to print the raytrace results to the console. |
@@ -1856,13 +1895,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1856 | if (ei.HitTF) | 1895 | if (ei.HitTF) |
1857 | { | 1896 | { |
1858 | pos = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z); | 1897 | pos = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z); |
1859 | } else | 1898 | } |
1899 | else | ||
1860 | { | 1900 | { |
1861 | // fall back to our stupid functionality | 1901 | // fall back to our stupid functionality |
1862 | pos = RayEnd; | 1902 | pos = RayEnd; |
1863 | } | 1903 | } |
1864 | |||
1865 | return pos; | ||
1866 | } | 1904 | } |
1867 | } | 1905 | } |
1868 | else | 1906 | else |
@@ -1873,8 +1911,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1873 | //increase height so its above the ground. | 1911 | //increase height so its above the ground. |
1874 | //should be getting the normal of the ground at the rez point and using that? | 1912 | //should be getting the normal of the ground at the rez point and using that? |
1875 | pos.Z += scale.Z / 2f; | 1913 | pos.Z += scale.Z / 2f; |
1876 | return pos; | 1914 | // return pos; |
1877 | } | 1915 | } |
1916 | |||
1917 | // check against posible water intercept | ||
1918 | if (wpos.Z > pos.Z) pos = wpos; | ||
1919 | return pos; | ||
1878 | } | 1920 | } |
1879 | 1921 | ||
1880 | 1922 | ||
@@ -2007,13 +2049,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
2007 | public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) | 2049 | public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) |
2008 | { | 2050 | { |
2009 | return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates); | 2051 | return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates); |
2010 | } | 2052 | } |
2011 | 2053 | ||
2012 | /// <summary> | 2054 | /// <summary> |
2013 | /// Delete every object from the scene. This does not include attachments worn by avatars. | 2055 | /// Delete every object from the scene. This does not include attachments worn by avatars. |
2014 | /// </summary> | 2056 | /// </summary> |
2015 | public void DeleteAllSceneObjects() | 2057 | public void DeleteAllSceneObjects() |
2016 | { | 2058 | { |
2059 | DeleteAllSceneObjects(false); | ||
2060 | } | ||
2061 | |||
2062 | /// <summary> | ||
2063 | /// Delete every object from the scene. This does not include attachments worn by avatars. | ||
2064 | /// </summary> | ||
2065 | public void DeleteAllSceneObjects(bool exceptNoCopy) | ||
2066 | { | ||
2067 | List<SceneObjectGroup> toReturn = new List<SceneObjectGroup>(); | ||
2017 | lock (Entities) | 2068 | lock (Entities) |
2018 | { | 2069 | { |
2019 | ICollection<EntityBase> entities = new List<EntityBase>(Entities); | 2070 | ICollection<EntityBase> entities = new List<EntityBase>(Entities); |
@@ -2023,11 +2074,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
2023 | if (e is SceneObjectGroup) | 2074 | if (e is SceneObjectGroup) |
2024 | { | 2075 | { |
2025 | SceneObjectGroup sog = (SceneObjectGroup)e; | 2076 | SceneObjectGroup sog = (SceneObjectGroup)e; |
2026 | if (!sog.IsAttachment) | 2077 | if (sog != null && !sog.IsAttachment) |
2027 | DeleteSceneObject((SceneObjectGroup)e, false); | 2078 | { |
2079 | if (!exceptNoCopy || ((sog.GetEffectivePermissions() & (uint)PermissionMask.Copy) != 0)) | ||
2080 | { | ||
2081 | DeleteSceneObject((SceneObjectGroup)e, false); | ||
2082 | } | ||
2083 | else | ||
2084 | { | ||
2085 | toReturn.Add((SceneObjectGroup)e); | ||
2086 | } | ||
2087 | } | ||
2028 | } | 2088 | } |
2029 | } | 2089 | } |
2030 | } | 2090 | } |
2091 | if (toReturn.Count > 0) | ||
2092 | { | ||
2093 | returnObjects(toReturn.ToArray(), UUID.Zero); | ||
2094 | } | ||
2031 | } | 2095 | } |
2032 | 2096 | ||
2033 | /// <summary> | 2097 | /// <summary> |
@@ -2395,6 +2459,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2395 | /// <returns>True if the SceneObjectGroup was added, False if it was not</returns> | 2459 | /// <returns>True if the SceneObjectGroup was added, False if it was not</returns> |
2396 | public bool AddSceneObject(SceneObjectGroup sceneObject) | 2460 | public bool AddSceneObject(SceneObjectGroup sceneObject) |
2397 | { | 2461 | { |
2462 | if (sceneObject.OwnerID == UUID.Zero) | ||
2463 | { | ||
2464 | m_log.ErrorFormat("[SCENE]: Owner ID for {0} was zero", sceneObject.UUID); | ||
2465 | return false; | ||
2466 | } | ||
2467 | |||
2398 | // If the user is banned, we won't let any of their objects | 2468 | // If the user is banned, we won't let any of their objects |
2399 | // enter. Period. | 2469 | // enter. Period. |
2400 | // | 2470 | // |
@@ -2444,15 +2514,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
2444 | if (AttachmentsModule != null) | 2514 | if (AttachmentsModule != null) |
2445 | AttachmentsModule.AttachObject(sp.ControllingClient, grp, 0, false); | 2515 | AttachmentsModule.AttachObject(sp.ControllingClient, grp, 0, false); |
2446 | 2516 | ||
2517 | m_log.DebugFormat("[SCENE]: Attachment {0} arrived and scene presence was found, attaching", sceneObject.UUID); | ||
2447 | } | 2518 | } |
2448 | else | 2519 | else |
2449 | { | 2520 | { |
2521 | m_log.DebugFormat("[SCENE]: Attachment {0} arrived and scene presence was not found, setting to temp", sceneObject.UUID); | ||
2450 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2522 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2451 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); | 2523 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); |
2452 | } | 2524 | } |
2525 | if (sceneObject.OwnerID == UUID.Zero) | ||
2526 | { | ||
2527 | m_log.ErrorFormat("[SCENE]: Owner ID for {0} was zero after attachment processing. BUG!", sceneObject.UUID); | ||
2528 | return false; | ||
2529 | } | ||
2453 | } | 2530 | } |
2454 | else | 2531 | else |
2455 | { | 2532 | { |
2533 | if (sceneObject.OwnerID == UUID.Zero) | ||
2534 | { | ||
2535 | m_log.ErrorFormat("[SCENE]: Owner ID for non-attachment {0} was zero", sceneObject.UUID); | ||
2536 | return false; | ||
2537 | } | ||
2456 | AddRestoredSceneObject(sceneObject, true, false); | 2538 | AddRestoredSceneObject(sceneObject, true, false); |
2457 | 2539 | ||
2458 | if (!Permissions.CanObjectEntry(sceneObject.UUID, | 2540 | if (!Permissions.CanObjectEntry(sceneObject.UUID, |
@@ -2723,6 +2805,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2723 | client.OnFetchInventory += HandleFetchInventory; | 2805 | client.OnFetchInventory += HandleFetchInventory; |
2724 | client.OnUpdateInventoryItem += UpdateInventoryItemAsset; | 2806 | client.OnUpdateInventoryItem += UpdateInventoryItemAsset; |
2725 | client.OnCopyInventoryItem += CopyInventoryItem; | 2807 | client.OnCopyInventoryItem += CopyInventoryItem; |
2808 | client.OnMoveItemsAndLeaveCopy += MoveInventoryItemsLeaveCopy; | ||
2726 | client.OnMoveInventoryItem += MoveInventoryItem; | 2809 | client.OnMoveInventoryItem += MoveInventoryItem; |
2727 | client.OnRemoveInventoryItem += RemoveInventoryItem; | 2810 | client.OnRemoveInventoryItem += RemoveInventoryItem; |
2728 | client.OnRemoveInventoryFolder += RemoveInventoryFolder; | 2811 | client.OnRemoveInventoryFolder += RemoveInventoryFolder; |
@@ -3008,6 +3091,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3008 | /// <param name="flags"></param> | 3091 | /// <param name="flags"></param> |
3009 | public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) | 3092 | public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) |
3010 | { | 3093 | { |
3094 | //Add half the avatar's height so that the user doesn't fall through prims | ||
3095 | ScenePresence presence; | ||
3096 | if (TryGetScenePresence(remoteClient.AgentId, out presence)) | ||
3097 | { | ||
3098 | if (presence.Appearance != null) | ||
3099 | { | ||
3100 | position.Z = position.Z + (presence.Appearance.AvatarHeight / 2); | ||
3101 | } | ||
3102 | } | ||
3103 | |||
3011 | if (GridUserService != null && GridUserService.SetHome(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt)) | 3104 | if (GridUserService != null && GridUserService.SetHome(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt)) |
3012 | // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot. | 3105 | // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot. |
3013 | m_dialogModule.SendAlertToUser(remoteClient, "Home position set."); | 3106 | m_dialogModule.SendAlertToUser(remoteClient, "Home position set."); |
@@ -3102,7 +3195,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3102 | m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); | 3195 | m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); |
3103 | 3196 | ||
3104 | } | 3197 | } |
3198 | m_log.Debug("[Scene] Beginning ClientClosed"); | ||
3105 | m_eventManager.TriggerClientClosed(agentID, this); | 3199 | m_eventManager.TriggerClientClosed(agentID, this); |
3200 | m_log.Debug("[Scene] Finished ClientClosed"); | ||
3106 | } | 3201 | } |
3107 | catch (NullReferenceException) | 3202 | catch (NullReferenceException) |
3108 | { | 3203 | { |
@@ -3110,7 +3205,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3110 | // Avatar is already disposed :/ | 3205 | // Avatar is already disposed :/ |
3111 | } | 3206 | } |
3112 | 3207 | ||
3208 | m_log.Debug("[Scene] Beginning OnRemovePresence"); | ||
3113 | m_eventManager.TriggerOnRemovePresence(agentID); | 3209 | m_eventManager.TriggerOnRemovePresence(agentID); |
3210 | m_log.Debug("[Scene] Finished OnRemovePresence"); | ||
3114 | ForEachClient( | 3211 | ForEachClient( |
3115 | delegate(IClientAPI client) | 3212 | delegate(IClientAPI client) |
3116 | { | 3213 | { |
@@ -3126,8 +3223,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3126 | } | 3223 | } |
3127 | 3224 | ||
3128 | // Remove the avatar from the scene | 3225 | // Remove the avatar from the scene |
3226 | m_log.Debug("[Scene] Begin RemoveScenePresence"); | ||
3129 | m_sceneGraph.RemoveScenePresence(agentID); | 3227 | m_sceneGraph.RemoveScenePresence(agentID); |
3228 | m_log.Debug("[Scene] Finished RemoveScenePresence. Removing the client manager"); | ||
3130 | m_clientManager.Remove(agentID); | 3229 | m_clientManager.Remove(agentID); |
3230 | m_log.Debug("[Scene] Removed the client manager. Firing avatar.close"); | ||
3131 | 3231 | ||
3132 | try | 3232 | try |
3133 | { | 3233 | { |
@@ -3141,9 +3241,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3141 | { | 3241 | { |
3142 | m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString()); | 3242 | m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString()); |
3143 | } | 3243 | } |
3144 | 3244 | m_log.Debug("[Scene] Done. Firing RemoveCircuit"); | |
3145 | m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); | 3245 | m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); |
3146 | 3246 | m_log.Debug("[Scene] The avatar has left the building"); | |
3147 | //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); | 3247 | //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); |
3148 | //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); | 3248 | //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); |
3149 | } | 3249 | } |
@@ -3283,6 +3383,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3283 | { | 3383 | { |
3284 | if (land != null && !TestLandRestrictions(agent, land, out reason)) | 3384 | if (land != null && !TestLandRestrictions(agent, land, out reason)) |
3285 | { | 3385 | { |
3386 | m_log.DebugFormat("[CONNECTION BEGIN]: Denying access to {0} due to no land access", agent.AgentID.ToString()); | ||
3286 | return false; | 3387 | return false; |
3287 | } | 3388 | } |
3288 | } | 3389 | } |
@@ -3396,6 +3497,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3396 | } | 3497 | } |
3397 | } | 3498 | } |
3398 | // Honor parcel landing type and position. | 3499 | // Honor parcel landing type and position. |
3500 | /* | ||
3501 | ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); | ||
3399 | if (land != null) | 3502 | if (land != null) |
3400 | { | 3503 | { |
3401 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) | 3504 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) |
@@ -3403,6 +3506,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3403 | agent.startpos = land.LandData.UserLocation; | 3506 | agent.startpos = land.LandData.UserLocation; |
3404 | } | 3507 | } |
3405 | } | 3508 | } |
3509 | */// This is now handled properly in ScenePresence.MakeRootAgent | ||
3406 | } | 3510 | } |
3407 | 3511 | ||
3408 | return true; | 3512 | return true; |
@@ -3765,12 +3869,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
3765 | return false; | 3869 | return false; |
3766 | } | 3870 | } |
3767 | 3871 | ||
3872 | public bool IncomingCloseAgent(UUID agentID) | ||
3873 | { | ||
3874 | return IncomingCloseAgent(agentID, false); | ||
3875 | } | ||
3876 | |||
3877 | public bool IncomingCloseChildAgent(UUID agentID) | ||
3878 | { | ||
3879 | return IncomingCloseAgent(agentID, true); | ||
3880 | } | ||
3881 | |||
3768 | /// <summary> | 3882 | /// <summary> |
3769 | /// Tell a single agent to disconnect from the region. | 3883 | /// Tell a single agent to disconnect from the region. |
3770 | /// </summary> | 3884 | /// </summary> |
3771 | /// <param name="regionHandle"></param> | ||
3772 | /// <param name="agentID"></param> | 3885 | /// <param name="agentID"></param> |
3773 | public bool IncomingCloseAgent(UUID agentID) | 3886 | /// <param name="childOnly"></param> |
3887 | public bool IncomingCloseAgent(UUID agentID, bool childOnly) | ||
3774 | { | 3888 | { |
3775 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); | 3889 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); |
3776 | 3890 | ||
@@ -3782,7 +3896,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3782 | { | 3896 | { |
3783 | m_sceneGraph.removeUserCount(false); | 3897 | m_sceneGraph.removeUserCount(false); |
3784 | } | 3898 | } |
3785 | else | 3899 | else if (!childOnly) |
3786 | { | 3900 | { |
3787 | m_sceneGraph.removeUserCount(true); | 3901 | m_sceneGraph.removeUserCount(true); |
3788 | } | 3902 | } |
@@ -3798,9 +3912,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3798 | } | 3912 | } |
3799 | else | 3913 | else |
3800 | presence.ControllingClient.SendShutdownConnectionNotice(); | 3914 | presence.ControllingClient.SendShutdownConnectionNotice(); |
3915 | presence.ControllingClient.Close(false); | ||
3916 | } | ||
3917 | else if (!childOnly) | ||
3918 | { | ||
3919 | presence.ControllingClient.Close(true); | ||
3801 | } | 3920 | } |
3802 | |||
3803 | presence.ControllingClient.Close(); | ||
3804 | return true; | 3921 | return true; |
3805 | } | 3922 | } |
3806 | 3923 | ||