diff options
author | mingchen | 2008-06-06 23:20:02 +0000 |
---|---|---|
committer | mingchen | 2008-06-06 23:20:02 +0000 |
commit | 0fe363ba65d18bd324396fa1482567bc2db65d1e (patch) | |
tree | 983da1fbe2de5a4dfb2157d851561c2e55ae7f31 /OpenSim/Region/Environment | |
parent | * llSetPrimitiveParams PRIM_FLEXIBLE is now supported. (diff) | |
download | opensim-SC-0fe363ba65d18bd324396fa1482567bc2db65d1e.zip opensim-SC-0fe363ba65d18bd324396fa1482567bc2db65d1e.tar.gz opensim-SC-0fe363ba65d18bd324396fa1482567bc2db65d1e.tar.bz2 opensim-SC-0fe363ba65d18bd324396fa1482567bc2db65d1e.tar.xz |
*Made Object Counting correct with linked objects and turned the previously protected functions that only return object counts to public so it can be easily used by outside classes.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 8 |
2 files changed, 18 insertions, 14 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 4c9257d..589d642 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -214,7 +214,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
214 | { | 214 | { |
215 | // QuadTree.AddSceneObject(sceneObject); | 215 | // QuadTree.AddSceneObject(sceneObject); |
216 | Entities.Add(sceneObject.UUID, sceneObject); | 216 | Entities.Add(sceneObject.UUID, sceneObject); |
217 | m_numPrim++; | 217 | m_numPrim += sceneObject.Children.Count; |
218 | 218 | ||
219 | return true; | 219 | return true; |
220 | } | 220 | } |
@@ -228,14 +228,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
228 | /// </summary> | 228 | /// </summary> |
229 | /// <param name="sceneObject"></param> | 229 | /// <param name="sceneObject"></param> |
230 | /// <returns>true if the object was deleted, false if there was no object to delete</returns> | 230 | /// <returns>true if the object was deleted, false if there was no object to delete</returns> |
231 | protected internal bool DeleteSceneObject(LLUUID uuid) | 231 | protected internal bool DeleteSceneObject(LLUUID uuid, bool resultOfObjectLinked) |
232 | { | 232 | { |
233 | lock (Entities) | 233 | lock (Entities) |
234 | { | 234 | { |
235 | if (Entities.ContainsKey(uuid)) | 235 | if (Entities.ContainsKey(uuid)) |
236 | { | 236 | { |
237 | Console.WriteLine("REMOVED " + ((SceneObjectGroup)Entities[uuid]).Children.Count + "!"); | ||
238 | if (!resultOfObjectLinked) | ||
239 | { | ||
240 | m_numPrim -= ((SceneObjectGroup)Entities[uuid]).Children.Count; | ||
241 | } | ||
237 | Entities.Remove(uuid); | 242 | Entities.Remove(uuid); |
238 | m_numPrim--; | ||
239 | 243 | ||
240 | return true; | 244 | return true; |
241 | } | 245 | } |
@@ -584,7 +588,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
584 | } | 588 | } |
585 | } | 589 | } |
586 | 590 | ||
587 | protected internal int GetChildAgentCount() | 591 | public int GetChildAgentCount() |
588 | { | 592 | { |
589 | // some network situations come in where child agents get closed twice. | 593 | // some network situations come in where child agents get closed twice. |
590 | if (m_numChildAgents < 0) | 594 | if (m_numChildAgents < 0) |
@@ -595,27 +599,27 @@ namespace OpenSim.Region.Environment.Scenes | |||
595 | return m_numChildAgents; | 599 | return m_numChildAgents; |
596 | } | 600 | } |
597 | 601 | ||
598 | protected internal int GetRootAgentCount() | 602 | public int GetRootAgentCount() |
599 | { | 603 | { |
600 | return m_numRootAgents; | 604 | return m_numRootAgents; |
601 | } | 605 | } |
602 | 606 | ||
603 | protected internal int GetTotalObjects() | 607 | public int GetTotalObjectsCount() |
604 | { | 608 | { |
605 | return m_numPrim; | 609 | return m_numPrim; |
606 | } | 610 | } |
607 | 611 | ||
608 | protected internal int GetActiveObjects() | 612 | public int GetActiveObjectsCount() |
609 | { | 613 | { |
610 | return m_physicalPrim; | 614 | return m_physicalPrim; |
611 | } | 615 | } |
612 | 616 | ||
613 | protected internal int GetActiveScripts() | 617 | public int GetActiveScriptsCount() |
614 | { | 618 | { |
615 | return m_activeScripts; | 619 | return m_activeScripts; |
616 | } | 620 | } |
617 | 621 | ||
618 | protected internal int GetScriptLPS() | 622 | public int GetScriptLPS() |
619 | { | 623 | { |
620 | int returnval = m_scriptLPS; | 624 | int returnval = m_scriptLPS; |
621 | m_scriptLPS = 0; | 625 | m_scriptLPS = 0; |
@@ -1437,7 +1441,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1437 | // think it's selected, so it will never send a deselect... | 1441 | // think it's selected, so it will never send a deselect... |
1438 | copy.IsSelected = false; | 1442 | copy.IsSelected = false; |
1439 | 1443 | ||
1440 | m_numPrim++; | 1444 | m_numPrim += copy.Children.Count; |
1441 | 1445 | ||
1442 | copy.StartScripts(); | 1446 | copy.StartScripts(); |
1443 | copy.ScheduleGroupForFullUpdate(); | 1447 | copy.ScheduleGroupForFullUpdate(); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 211f320..7d076ef 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -757,13 +757,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
757 | m_statsReporter.AddInPackets(0); | 757 | m_statsReporter.AddInPackets(0); |
758 | m_statsReporter.SetRootAgents(m_innerScene.GetRootAgentCount()); | 758 | m_statsReporter.SetRootAgents(m_innerScene.GetRootAgentCount()); |
759 | m_statsReporter.SetChildAgents(m_innerScene.GetChildAgentCount()); | 759 | m_statsReporter.SetChildAgents(m_innerScene.GetChildAgentCount()); |
760 | m_statsReporter.SetObjects(m_innerScene.GetTotalObjects()); | 760 | m_statsReporter.SetObjects(m_innerScene.GetTotalObjectsCount()); |
761 | m_statsReporter.SetActiveObjects(m_innerScene.GetActiveObjects()); | 761 | m_statsReporter.SetActiveObjects(m_innerScene.GetActiveObjectsCount()); |
762 | frameMS = System.Environment.TickCount - frameMS; | 762 | frameMS = System.Environment.TickCount - frameMS; |
763 | m_statsReporter.addFrameMS(frameMS); | 763 | m_statsReporter.addFrameMS(frameMS); |
764 | m_statsReporter.addPhysicsMS(physicsMS); | 764 | m_statsReporter.addPhysicsMS(physicsMS); |
765 | m_statsReporter.addOtherMS(otherMS); | 765 | m_statsReporter.addOtherMS(otherMS); |
766 | m_statsReporter.SetActiveScripts(m_innerScene.GetActiveScripts()); | 766 | m_statsReporter.SetActiveScripts(m_innerScene.GetActiveScriptsCount()); |
767 | m_statsReporter.addScriptLines(m_innerScene.GetScriptLPS()); | 767 | m_statsReporter.addScriptLines(m_innerScene.GetScriptLPS()); |
768 | } | 768 | } |
769 | } | 769 | } |
@@ -1412,7 +1412,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1412 | /// <returns>true if the object was in the scene, false if it was not</returns> | 1412 | /// <returns>true if the object was in the scene, false if it was not</returns> |
1413 | public bool UnlinkSceneObject(LLUUID uuid) | 1413 | public bool UnlinkSceneObject(LLUUID uuid) |
1414 | { | 1414 | { |
1415 | if (m_innerScene.DeleteSceneObject(uuid)) | 1415 | if (m_innerScene.DeleteSceneObject(uuid,true)) |
1416 | { | 1416 | { |
1417 | m_storageManager.DataStore.RemoveObject(uuid, m_regInfo.RegionID); | 1417 | m_storageManager.DataStore.RemoveObject(uuid, m_regInfo.RegionID); |
1418 | 1418 | ||