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.cs177
1 files changed, 147 insertions, 30 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 18705a8..73472a9 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
@@ -541,6 +556,8 @@ namespace OpenSim.Region.Framework.Scenes
541 556
542 // Load region settings 557 // Load region settings
543 m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); 558 m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);
559 m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(m_regInfo.RegionID);
560
544 if (m_storageManager.EstateDataStore != null) 561 if (m_storageManager.EstateDataStore != null)
545 { 562 {
546 m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); 563 m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false);
@@ -603,9 +620,10 @@ namespace OpenSim.Region.Framework.Scenes
603 //Animation states 620 //Animation states
604 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); 621 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
605 // TODO: Change default to true once the feature is supported 622 // TODO: Change default to true once the feature is supported
606 m_usePreJump = startupConfig.GetBoolean("enableprejump", false); 623 m_usePreJump = startupConfig.GetBoolean("enableprejump", true);
607
608 m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); 624 m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
625
626 m_log.DebugFormat("[SCENE]: prejump is {0}", m_usePreJump ? "ON" : "OFF");
609 if (RegionInfo.NonphysPrimMax > 0) 627 if (RegionInfo.NonphysPrimMax > 0)
610 { 628 {
611 m_maxNonphys = RegionInfo.NonphysPrimMax; 629 m_maxNonphys = RegionInfo.NonphysPrimMax;
@@ -646,6 +664,7 @@ namespace OpenSim.Region.Framework.Scenes
646 } 664 }
647 665
648 m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); 666 m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
667 CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false);
649 } 668 }
650 catch 669 catch
651 { 670 {
@@ -886,6 +905,15 @@ namespace OpenSim.Region.Framework.Scenes
886 /// <param name="seconds">float indicating duration before restart.</param> 905 /// <param name="seconds">float indicating duration before restart.</param>
887 public virtual void Restart(float seconds) 906 public virtual void Restart(float seconds)
888 { 907 {
908 Restart(seconds, true);
909 }
910
911 /// <summary>
912 /// Given float seconds, this will restart the region. showDialog will optionally alert the users.
913 /// </summary>
914 /// <param name="seconds">float indicating duration before restart.</param>
915 public virtual void Restart(float seconds, bool showDialog)
916 {
889 // notifications are done in 15 second increments 917 // 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 918 // 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. 919 // It's a 'Cancel restart' request.
@@ -906,8 +934,11 @@ namespace OpenSim.Region.Framework.Scenes
906 m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); 934 m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
907 m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); 935 m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
908 m_restartTimer.Start(); 936 m_restartTimer.Start();
909 m_dialogModule.SendNotificationToUsersInRegion( 937 if (showDialog)
938 {
939 m_dialogModule.SendNotificationToUsersInRegion(
910 UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0))); 940 UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0)));
941 }
911 } 942 }
912 } 943 }
913 944
@@ -1265,16 +1296,16 @@ namespace OpenSim.Region.Framework.Scenes
1265 // Check if any objects have reached their targets 1296 // Check if any objects have reached their targets
1266 CheckAtTargets(); 1297 CheckAtTargets();
1267 1298
1268 // Update SceneObjectGroups that have scheduled themselves for updates
1269 // Objects queue their updates onto all scene presences
1270 if (m_frame % m_update_objects == 0)
1271 m_sceneGraph.UpdateObjectGroups();
1272
1273 // Run through all ScenePresences looking for updates 1299 // Run through all ScenePresences looking for updates
1274 // Presence updates and queued object updates for each presence are sent to clients 1300 // Presence updates and queued object updates for each presence are sent to clients
1275 if (m_frame % m_update_presences == 0) 1301 if (m_frame % m_update_presences == 0)
1276 m_sceneGraph.UpdatePresences(); 1302 m_sceneGraph.UpdatePresences();
1277 1303
1304 // Update SceneObjectGroups that have scheduled themselves for updates
1305 // Objects queue their updates onto all scene presences
1306 if (m_frame % m_update_objects == 0)
1307 m_sceneGraph.UpdateObjectGroups();
1308
1278 if (m_frame % m_update_coarse_locations == 0) 1309 if (m_frame % m_update_coarse_locations == 0)
1279 { 1310 {
1280 List<Vector3> coarseLocations; 1311 List<Vector3> coarseLocations;
@@ -1603,6 +1634,7 @@ namespace OpenSim.Region.Framework.Scenes
1603 public void StoreWindlightProfile(RegionLightShareData wl) 1634 public void StoreWindlightProfile(RegionLightShareData wl)
1604 { 1635 {
1605 m_regInfo.WindlightSettings = wl; 1636 m_regInfo.WindlightSettings = wl;
1637 wl.Save();
1606 m_storageManager.DataStore.StoreRegionWindlightSettings(wl); 1638 m_storageManager.DataStore.StoreRegionWindlightSettings(wl);
1607 m_eventManager.TriggerOnSaveNewWindlightProfile(); 1639 m_eventManager.TriggerOnSaveNewWindlightProfile();
1608 } 1640 }
@@ -1758,14 +1790,24 @@ namespace OpenSim.Region.Framework.Scenes
1758 /// <returns></returns> 1790 /// <returns></returns>
1759 public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter) 1791 public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter)
1760 { 1792 {
1793
1794 float wheight = (float)RegionInfo.RegionSettings.WaterHeight;
1795 Vector3 wpos = Vector3.Zero;
1796 // Check for water surface intersection from above
1797 if ( (RayStart.Z > wheight) && (RayEnd.Z < wheight) )
1798 {
1799 float ratio = (RayStart.Z - wheight) / (RayStart.Z - RayEnd.Z);
1800 wpos.X = RayStart.X - (ratio * (RayStart.X - RayEnd.X));
1801 wpos.Y = RayStart.Y - (ratio * (RayStart.Y - RayEnd.Y));
1802 wpos.Z = wheight;
1803 }
1804
1761 Vector3 pos = Vector3.Zero; 1805 Vector3 pos = Vector3.Zero;
1762 if (RayEndIsIntersection == (byte)1) 1806 if (RayEndIsIntersection == (byte)1)
1763 { 1807 {
1764 pos = RayEnd; 1808 pos = RayEnd;
1765 return pos;
1766 } 1809 }
1767 1810 else if (RayTargetID != UUID.Zero)
1768 if (RayTargetID != UUID.Zero)
1769 { 1811 {
1770 SceneObjectPart target = GetSceneObjectPart(RayTargetID); 1812 SceneObjectPart target = GetSceneObjectPart(RayTargetID);
1771 1813
@@ -1787,7 +1829,7 @@ namespace OpenSim.Region.Framework.Scenes
1787 EntityIntersection ei = target.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, FaceCenter); 1829 EntityIntersection ei = target.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, FaceCenter);
1788 1830
1789 // Un-comment out the following line to Get Raytrace results printed to the console. 1831 // Un-comment out the following line to Get Raytrace results printed to the console.
1790 // m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString()); 1832 // m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString());
1791 float ScaleOffset = 0.5f; 1833 float ScaleOffset = 0.5f;
1792 1834
1793 // If we hit something 1835 // If we hit something
@@ -1810,13 +1852,10 @@ namespace OpenSim.Region.Framework.Scenes
1810 //pos.Z -= 0.25F; 1852 //pos.Z -= 0.25F;
1811 1853
1812 } 1854 }
1813
1814 return pos;
1815 } 1855 }
1816 else 1856 else
1817 { 1857 {
1818 // We don't have a target here, so we're going to raytrace all the objects in the scene. 1858 // We don't have a target here, so we're going to raytrace all the objects in the scene.
1819
1820 EntityIntersection ei = m_sceneGraph.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection), true, false); 1859 EntityIntersection ei = m_sceneGraph.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection), true, false);
1821 1860
1822 // Un-comment the following line to print the raytrace results to the console. 1861 // Un-comment the following line to print the raytrace results to the console.
@@ -1825,13 +1864,12 @@ namespace OpenSim.Region.Framework.Scenes
1825 if (ei.HitTF) 1864 if (ei.HitTF)
1826 { 1865 {
1827 pos = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z); 1866 pos = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z);
1828 } else 1867 }
1868 else
1829 { 1869 {
1830 // fall back to our stupid functionality 1870 // fall back to our stupid functionality
1831 pos = RayEnd; 1871 pos = RayEnd;
1832 } 1872 }
1833
1834 return pos;
1835 } 1873 }
1836 } 1874 }
1837 else 1875 else
@@ -1842,8 +1880,12 @@ namespace OpenSim.Region.Framework.Scenes
1842 //increase height so its above the ground. 1880 //increase height so its above the ground.
1843 //should be getting the normal of the ground at the rez point and using that? 1881 //should be getting the normal of the ground at the rez point and using that?
1844 pos.Z += scale.Z / 2f; 1882 pos.Z += scale.Z / 2f;
1845 return pos; 1883// return pos;
1846 } 1884 }
1885
1886 // check against posible water intercept
1887 if (wpos.Z > pos.Z) pos = wpos;
1888 return pos;
1847 } 1889 }
1848 1890
1849 1891
@@ -1976,13 +2018,22 @@ namespace OpenSim.Region.Framework.Scenes
1976 public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) 2018 public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
1977 { 2019 {
1978 return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates); 2020 return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates);
1979 } 2021 }
1980 2022
1981 /// <summary> 2023 /// <summary>
1982 /// Delete every object from the scene. This does not include attachments worn by avatars. 2024 /// Delete every object from the scene. This does not include attachments worn by avatars.
1983 /// </summary> 2025 /// </summary>
1984 public void DeleteAllSceneObjects() 2026 public void DeleteAllSceneObjects()
1985 { 2027 {
2028 DeleteAllSceneObjects(false);
2029 }
2030
2031 /// <summary>
2032 /// Delete every object from the scene. This does not include attachments worn by avatars.
2033 /// </summary>
2034 public void DeleteAllSceneObjects(bool exceptNoCopy)
2035 {
2036 List<SceneObjectGroup> toReturn = new List<SceneObjectGroup>();
1986 lock (Entities) 2037 lock (Entities)
1987 { 2038 {
1988 ICollection<EntityBase> entities = new List<EntityBase>(Entities); 2039 ICollection<EntityBase> entities = new List<EntityBase>(Entities);
@@ -1992,11 +2043,24 @@ namespace OpenSim.Region.Framework.Scenes
1992 if (e is SceneObjectGroup) 2043 if (e is SceneObjectGroup)
1993 { 2044 {
1994 SceneObjectGroup sog = (SceneObjectGroup)e; 2045 SceneObjectGroup sog = (SceneObjectGroup)e;
1995 if (!sog.IsAttachment) 2046 if (sog != null && !sog.IsAttachment)
1996 DeleteSceneObject((SceneObjectGroup)e, false); 2047 {
2048 if (!exceptNoCopy || ((sog.GetEffectivePermissions() & (uint)PermissionMask.Copy) != 0))
2049 {
2050 DeleteSceneObject((SceneObjectGroup)e, false);
2051 }
2052 else
2053 {
2054 toReturn.Add((SceneObjectGroup)e);
2055 }
2056 }
1997 } 2057 }
1998 } 2058 }
1999 } 2059 }
2060 if (toReturn.Count > 0)
2061 {
2062 returnObjects(toReturn.ToArray(), UUID.Zero);
2063 }
2000 } 2064 }
2001 2065
2002 /// <summary> 2066 /// <summary>
@@ -2364,6 +2428,12 @@ namespace OpenSim.Region.Framework.Scenes
2364 /// <returns>True if the SceneObjectGroup was added, False if it was not</returns> 2428 /// <returns>True if the SceneObjectGroup was added, False if it was not</returns>
2365 public bool AddSceneObject(SceneObjectGroup sceneObject) 2429 public bool AddSceneObject(SceneObjectGroup sceneObject)
2366 { 2430 {
2431 if (sceneObject.OwnerID == UUID.Zero)
2432 {
2433 m_log.ErrorFormat("[SCENE]: Owner ID for {0} was zero", sceneObject.UUID);
2434 return false;
2435 }
2436
2367 // If the user is banned, we won't let any of their objects 2437 // If the user is banned, we won't let any of their objects
2368 // enter. Period. 2438 // enter. Period.
2369 // 2439 //
@@ -2413,15 +2483,27 @@ namespace OpenSim.Region.Framework.Scenes
2413 if (AttachmentsModule != null) 2483 if (AttachmentsModule != null)
2414 AttachmentsModule.AttachObject(sp.ControllingClient, grp, 0, false); 2484 AttachmentsModule.AttachObject(sp.ControllingClient, grp, 0, false);
2415 2485
2486 m_log.DebugFormat("[SCENE]: Attachment {0} arrived and scene presence was found, attaching", sceneObject.UUID);
2416 } 2487 }
2417 else 2488 else
2418 { 2489 {
2490 m_log.DebugFormat("[SCENE]: Attachment {0} arrived and scene presence was not found, setting to temp", sceneObject.UUID);
2419 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2491 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2420 RootPrim.AddFlag(PrimFlags.TemporaryOnRez); 2492 RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
2421 } 2493 }
2494 if (sceneObject.OwnerID == UUID.Zero)
2495 {
2496 m_log.ErrorFormat("[SCENE]: Owner ID for {0} was zero after attachment processing. BUG!", sceneObject.UUID);
2497 return false;
2498 }
2422 } 2499 }
2423 else 2500 else
2424 { 2501 {
2502 if (sceneObject.OwnerID == UUID.Zero)
2503 {
2504 m_log.ErrorFormat("[SCENE]: Owner ID for non-attachment {0} was zero", sceneObject.UUID);
2505 return false;
2506 }
2425 AddRestoredSceneObject(sceneObject, true, false); 2507 AddRestoredSceneObject(sceneObject, true, false);
2426 2508
2427 if (!Permissions.CanObjectEntry(sceneObject.UUID, 2509 if (!Permissions.CanObjectEntry(sceneObject.UUID,
@@ -2694,6 +2776,7 @@ namespace OpenSim.Region.Framework.Scenes
2694 client.OnFetchInventory += HandleFetchInventory; 2776 client.OnFetchInventory += HandleFetchInventory;
2695 client.OnUpdateInventoryItem += UpdateInventoryItemAsset; 2777 client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
2696 client.OnCopyInventoryItem += CopyInventoryItem; 2778 client.OnCopyInventoryItem += CopyInventoryItem;
2779 client.OnMoveItemsAndLeaveCopy += MoveInventoryItemsLeaveCopy;
2697 client.OnMoveInventoryItem += MoveInventoryItem; 2780 client.OnMoveInventoryItem += MoveInventoryItem;
2698 client.OnRemoveInventoryItem += RemoveInventoryItem; 2781 client.OnRemoveInventoryItem += RemoveInventoryItem;
2699 client.OnRemoveInventoryFolder += RemoveInventoryFolder; 2782 client.OnRemoveInventoryFolder += RemoveInventoryFolder;
@@ -2979,6 +3062,16 @@ namespace OpenSim.Region.Framework.Scenes
2979 /// <param name="flags"></param> 3062 /// <param name="flags"></param>
2980 public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) 3063 public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags)
2981 { 3064 {
3065 //Add half the avatar's height so that the user doesn't fall through prims
3066 ScenePresence presence;
3067 if (TryGetScenePresence(remoteClient.AgentId, out presence))
3068 {
3069 if (presence.Appearance != null)
3070 {
3071 position.Z = position.Z + (presence.Appearance.AvatarHeight / 2);
3072 }
3073 }
3074
2982 if (GridUserService != null && GridUserService.SetHome(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt)) 3075 if (GridUserService != null && GridUserService.SetHome(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt))
2983 // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot. 3076 // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot.
2984 m_dialogModule.SendAlertToUser(remoteClient, "Home position set."); 3077 m_dialogModule.SendAlertToUser(remoteClient, "Home position set.");
@@ -3073,7 +3166,9 @@ namespace OpenSim.Region.Framework.Scenes
3073 m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); 3166 m_sceneGridService.SendCloseChildAgentConnections(agentID, regions);
3074 3167
3075 } 3168 }
3169 m_log.Debug("[Scene] Beginning ClientClosed");
3076 m_eventManager.TriggerClientClosed(agentID, this); 3170 m_eventManager.TriggerClientClosed(agentID, this);
3171 m_log.Debug("[Scene] Finished ClientClosed");
3077 } 3172 }
3078 catch (NullReferenceException) 3173 catch (NullReferenceException)
3079 { 3174 {
@@ -3081,7 +3176,9 @@ namespace OpenSim.Region.Framework.Scenes
3081 // Avatar is already disposed :/ 3176 // Avatar is already disposed :/
3082 } 3177 }
3083 3178
3179 m_log.Debug("[Scene] Beginning OnRemovePresence");
3084 m_eventManager.TriggerOnRemovePresence(agentID); 3180 m_eventManager.TriggerOnRemovePresence(agentID);
3181 m_log.Debug("[Scene] Finished OnRemovePresence");
3085 ForEachClient( 3182 ForEachClient(
3086 delegate(IClientAPI client) 3183 delegate(IClientAPI client)
3087 { 3184 {
@@ -3097,8 +3194,11 @@ namespace OpenSim.Region.Framework.Scenes
3097 } 3194 }
3098 3195
3099 // Remove the avatar from the scene 3196 // Remove the avatar from the scene
3197 m_log.Debug("[Scene] Begin RemoveScenePresence");
3100 m_sceneGraph.RemoveScenePresence(agentID); 3198 m_sceneGraph.RemoveScenePresence(agentID);
3199 m_log.Debug("[Scene] Finished RemoveScenePresence. Removing the client manager");
3101 m_clientManager.Remove(agentID); 3200 m_clientManager.Remove(agentID);
3201 m_log.Debug("[Scene] Removed the client manager. Firing avatar.close");
3102 3202
3103 try 3203 try
3104 { 3204 {
@@ -3112,9 +3212,9 @@ namespace OpenSim.Region.Framework.Scenes
3112 { 3212 {
3113 m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString()); 3213 m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString());
3114 } 3214 }
3115 3215 m_log.Debug("[Scene] Done. Firing RemoveCircuit");
3116 m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); 3216 m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
3117 3217 m_log.Debug("[Scene] The avatar has left the building");
3118 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); 3218 //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
3119 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); 3219 //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
3120 } 3220 }
@@ -3253,6 +3353,7 @@ namespace OpenSim.Region.Framework.Scenes
3253 { 3353 {
3254 if (land != null && !TestLandRestrictions(agent, land, out reason)) 3354 if (land != null && !TestLandRestrictions(agent, land, out reason))
3255 { 3355 {
3356 m_log.DebugFormat("[CONNECTION BEGIN]: Denying access to {0} due to no land access", agent.AgentID.ToString());
3256 return false; 3357 return false;
3257 } 3358 }
3258 } 3359 }
@@ -3366,6 +3467,8 @@ namespace OpenSim.Region.Framework.Scenes
3366 } 3467 }
3367 } 3468 }
3368 // Honor parcel landing type and position. 3469 // Honor parcel landing type and position.
3470 /*
3471 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
3369 if (land != null) 3472 if (land != null)
3370 { 3473 {
3371 if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) 3474 if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero)
@@ -3373,6 +3476,7 @@ namespace OpenSim.Region.Framework.Scenes
3373 agent.startpos = land.LandData.UserLocation; 3476 agent.startpos = land.LandData.UserLocation;
3374 } 3477 }
3375 } 3478 }
3479 */// This is now handled properly in ScenePresence.MakeRootAgent
3376 } 3480 }
3377 3481
3378 return true; 3482 return true;
@@ -3735,12 +3839,22 @@ namespace OpenSim.Region.Framework.Scenes
3735 return false; 3839 return false;
3736 } 3840 }
3737 3841
3842 public bool IncomingCloseAgent(UUID agentID)
3843 {
3844 return IncomingCloseAgent(agentID, false);
3845 }
3846
3847 public bool IncomingCloseChildAgent(UUID agentID)
3848 {
3849 return IncomingCloseAgent(agentID, true);
3850 }
3851
3738 /// <summary> 3852 /// <summary>
3739 /// Tell a single agent to disconnect from the region. 3853 /// Tell a single agent to disconnect from the region.
3740 /// </summary> 3854 /// </summary>
3741 /// <param name="regionHandle"></param>
3742 /// <param name="agentID"></param> 3855 /// <param name="agentID"></param>
3743 public bool IncomingCloseAgent(UUID agentID) 3856 /// <param name="childOnly"></param>
3857 public bool IncomingCloseAgent(UUID agentID, bool childOnly)
3744 { 3858 {
3745 //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); 3859 //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID);
3746 3860
@@ -3752,7 +3866,7 @@ namespace OpenSim.Region.Framework.Scenes
3752 { 3866 {
3753 m_sceneGraph.removeUserCount(false); 3867 m_sceneGraph.removeUserCount(false);
3754 } 3868 }
3755 else 3869 else if (!childOnly)
3756 { 3870 {
3757 m_sceneGraph.removeUserCount(true); 3871 m_sceneGraph.removeUserCount(true);
3758 } 3872 }
@@ -3768,9 +3882,12 @@ namespace OpenSim.Region.Framework.Scenes
3768 } 3882 }
3769 else 3883 else
3770 presence.ControllingClient.SendShutdownConnectionNotice(); 3884 presence.ControllingClient.SendShutdownConnectionNotice();
3885 presence.ControllingClient.Close(false);
3886 }
3887 else if (!childOnly)
3888 {
3889 presence.ControllingClient.Close(true);
3771 } 3890 }
3772
3773 presence.ControllingClient.Close();
3774 return true; 3891 return true;
3775 } 3892 }
3776 3893
@@ -4879,4 +4996,4 @@ namespace OpenSim.Region.Framework.Scenes
4879 return offsets.ToArray(); 4996 return offsets.ToArray();
4880 } 4997 }
4881 } 4998 }
4882} \ No newline at end of file 4999}