Commit Graph

178 Commits (e506341fdb9f3b6996d3c97de007f2b142fcddd3)

Author SHA1 Message Date
Justin Clark-Casey (justincc) 5c35aa560e Refactor: merge SceneGraph.AddScenePresence() into CreateAndAddChildScenePresence() since the former was only ever called from the latter
This allows us to remove dead code relating to adding root agents directly to the scenegraph, which never happens.
2013-09-04 00:43:35 +01:00
Melanie 81ad9255b5 Hook up Keyframe motion to almost everything. Failing to cross a sim border
may yield unexpected results in some cases. No database persistence yet,
2013-06-06 03:03:05 +01:00
Melanie 7bf33d333a Plumb the path from the client to the extra physics params and back 2013-02-07 22:25:28 +00:00
Justin Clark-Casey (justincc) 81aeecc907 Allow "show object", "show part", "dump object" and "delete object" to accept a local ID as well as a UUID.
This means that the sub-commands are now id rather than uuid, e.g. show object id
2012-10-24 04:10:22 +01:00
Justin Clark-Casey (justincc) cd325fdf02 Pass the "attachToBackup" bool given to SceneGraph.AddNewSceneObject() down into the 3-parameter AddNewSceneObject() method instead of always hardcoding true.
This doesn't affect any core OpenSimulator code since all callers were passing true anyway
But it allows region modules to create objects that are never persisted.
2012-08-24 21:36:20 +01:00
SignpostMarv ef4122213c enables configurable minimum sizes for physical & non-physical prims 2012-08-15 23:35:23 +01:00
Melanie fc77bca936 Committing Avination's memleak fix-a-thon, installment #3
When linking, detach the no longer used SOG's from backup so they can be
collected. Since their Children collection is never emptied, they prevent
their former SOPs from being collected as well.
2012-07-23 19:53:26 +01:00
Justin Clark-Casey (justincc) e9a121e1b2 Add TestCreateDuplicateRootScenePresence() regression test. 2012-07-19 21:54:50 +01:00
Justin Clark-Casey (justincc) 7ff4eec79c Remove redundant SetScene() function in Scene.AddSceneObject()
This is always done later on in SceneGraph.AddSceneObject() if the call hasn't failed due to sanity checks.
There's no other purpose for this method to exist and it's dangerous/pointless to call in other conditions.
2012-07-07 00:02:45 +01:00
Justin Clark-Casey (justincc) 056c9a59b2 Add assert to attachment regression tests to check that number of objects in the scene graph 2012-07-06 23:07:50 +01:00
Justin Clark-Casey (justincc) 5c162ccd57 Go back to calling IncomingCloseAgent() in the "kick user" command for consistency instead of IClientAPI.Close() directly.
This no longer double counts child agent removals
2012-06-08 00:59:39 +01:00
Justin Clark-Casey (justincc) d547bcf8d1 Remove duplicate update of user count in Scene.IncomingCloseAgent()
This is already done in Scene.RemoveClient() which IncomingCloseAgent() always ends up calling.
2012-06-08 00:40:38 +01:00
Justin Clark-Casey (justincc) 4d34763f8c Check agent limit against root agent count rather than both root and child agents
From sl docs such as http://community.secondlife.com/t5/English-Knowledge-Base/Managing-Private-Regions/ta-p/700115
agent should apply to avatars only.
This makes sense from a user perspective, and also from a code perspective since child agents with no physics or actions take up a fraction of root agent resources.
As such, the check is now only performed in Scene.QueryAccess() - cross and teleport check this before allowing an agent to translocate.
This also removes an off-by-one error that could occur in certain circumstances on teleport when a new child agent was double counted when a pre-teleport agent update was performed.
This does not affect an existing bug where limits or other QueryAccess() checks are not applied to avatars logging directly into a region.
2012-05-17 23:33:26 +01:00
Justin Clark-Casey (justincc) abbd050a13 Perform SceneGraph.DuplicateObject() under existing m_updateLock already used for link and delinking, in order to avoid race conditions.
DuplicateObject() relies on source object having correct link numbers for the duration of the dupe.
Both link and delink can change link numbers such that they are not consistent for short periods of time.
2012-05-08 21:31:35 +01:00
Justin Clark-Casey (justincc) 859646ef5c minor: Add some method doc. Add warnings since calling SOG link/delink methods directly rather than through Scene may allow race conditions. 2012-04-17 23:54:51 +01:00
Justin Clark-Casey (justincc) 7468299673 Eliminate race condition where many callers would check SOP.PhysicsActor != null then assume it was still not null in later code.
Another thread could come and turn off physics for a part (null PhysicsActor) at any point.
Had to turn off localCopy on warp3D CoreModules section in prebuild.xml since on current nant this copies all DLLs in bin/ which can be a very large number with compiled DLLs
No obvious reason for doing that copy - nothing else does it.
2012-04-03 05:51:38 +01:00
Justin Clark-Casey (justincc) 32a953fed7 refactor: Rename SOG.GetChildPart() to GetPart() since it can also return the 'root' part. 2012-03-31 01:52:06 +01:00
Justin Clark-Casey (justincc) f0406f9fe2 Rename SOG.HasChildPrim(uint) to SOG.ContainsPart(uint) to match existing ContainsPart method and remove method duplication.
HasChildPrim is also misleading since the 'root' prim can also be returned.
2012-03-31 01:45:37 +01:00
Justin Clark-Casey (justincc) a4b01ef38a Replace script-lines-per-second with the script execution time scaled by its measurement period and an idealised frame time.
The previous lines-per-second measurement used for top scripts report was inaccurate, since lines executed does not reflect time taken to execute.
Also, every fetch of the report would reset all the numbers limiting its usefulness and we weren't even guaranteed to see the top 100.
The actual measurement value should be script execution time per frame but XEngine does not work this way.
Therefore, we use actual script execution time scaled by the measurement period and an idealised frame time.
This is still not ideal but gives reasonable results and allows scripts to be compared.
This commit moves script execution time calculations from SceneGraph into IScriptModule implementations.
2012-03-16 00:34:30 +00:00
Justin Clark-Casey (justincc) 06dda14505 Simplify minimap coarse location code by just reference SP.AbsolutePosition
This is rather than checking whether the avatar is sitting and doing its own calculation.
2012-03-09 02:50:57 +00:00
Justin Clark-Casey (justincc) 94e58ff6b9 Use SP.ParentPart instead of ParentID in places where it's more efficient (saving extra null checks, etc.)
However, it looks like we should retain SP.ParentID since it's much easier to use that in places where another thread could change ParentPart to null.
Otherwise one has to clumsily put ParentPart in a reference, etc. to avoid a race.
2012-03-09 02:38:11 +00:00
Justin Clark-Casey (justincc) 84184708de Fix a bug where changing shape parameters of a child prim in a linkset would not persist.
Resolves http://opensimulator.org/mantis/view.php?id=5819
2012-02-18 01:15:43 +00:00
Justin Clark-Casey (justincc) ebe5e1731d In ObjectTortureTests, run garbage collector on Teardown and run scene loop update when scene objects have been deleted.
At least on mono 2.6.4, running GC.Collect() is not guaranteed to force gc of all objects when run in the same method where those objects had references.
Therefore, GC.Collect() is now being done in the per-script teardown of ObjectTortureTests.
In addition, scene loop update is being run after garbage collection in order to clean out the viewer update list of scene objects in the SceneGraph.
These measures mean that scene objects/parts are now garbage collected after a test run if deleted from the scene, resulting in a much better memory usage report (though probably still not very accurate).
However, deletion takes a very long time - what's really needed is to find out now why the entire scene isn't being GC'd by this measure.
This change hasn't yet been applied to the other stress tests.
2012-02-15 01:45:25 +00:00
Justin Clark-Casey (justincc) dfa19e23f0 Stop a scene object from attempting to link with itself (which results in an exception and constant complaints in v3 viewers).
Aims to address http://opensimulator.org/mantis/view.php?id=5878
2012-02-08 22:19:34 +00:00
Dan Lake 146d78edfa ObjectAddedToScene event should be fired when duplicating objects 2012-02-02 17:41:05 -08:00
Dan Lake c10193c72b Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-01 16:25:35 -08:00
Justin Clark-Casey (justincc) 10b9348071 Remove scene object null check on SceneGraph.AddSceneObject(). Complain explicitly if there's an attempt to add any object with a zero UUID.
Callers themselves need to check that they're not attempting to add a null scene object.
2012-01-31 20:30:30 +00:00
Justin Clark-Casey (justincc) f3780b9eae Add torture tests to test adding 10,000, 100,000 and 200,000 single prim scene objects.
These can be run using the "nant torture" target.  They are not part of "nant test" due to their long-run future nature.
Such tests are designed to do some testing of extreme situations and give some feedback on memory usage, etc.
However, data can be inconsistent due to different machine circumstances and virtual machine actions.
This area is under development.
2012-01-31 19:56:37 +00:00
Justin Clark-Casey (justincc) 9d93c4808e lock SceneObjectGroupsByFullID in SceneGraph.ForEachSOG() to stop failure if SceneObjectGroupsByFullID is updated elsewhere at the same time. 2012-01-30 19:21:58 +00:00
Dan Lake 3d1f43046d Removed unused delegates in SceneGraph: ObjectDuplicateDelegate, ObjectCreateDelegate, ObjectDeleteDelegate 2012-01-24 17:05:53 -08:00
Dan Lake 488fe0ae9c Removed unused events in SceneGraph: OnObjectCreate, OnObjectRemove, OnObjectDuplicate 2012-01-24 13:41:26 -08:00
Dan Lake 2c6272d11a Add a version of GetGroupByPrim to Scene which accepts UUID instead of localID 2012-01-19 03:01:37 -08:00
Justin Clark-Casey (justincc) f7dbdba447 Remove unused m_physicalPrim parameter from SOG.ApplyPhysics() 2011-12-22 19:52:09 +00:00
Justin Clark-Casey (justincc) f9137c923b Fix bug where objects could not be set to a new group if the group had been created in that client session, or if no other action has been performed on the object.
There were two problems here:
1) On object group update, we looked for the group is the IClientAPI group cache rather than in the groups service.  This fails to groups created newly in that session
2) On object group update, we weren't setting the HasGroupChanged flag.  This meant that the change was not persisted unless some other action set this flag.
This commit fixes these issues and hopefully addresses http://opensimulator.org/mantis/view.php?id=5588
This commit also moves HandleObjectGroupUpdate() to the GroupsModule from the Scene.PacketHandlers.cs file
2011-12-17 02:23:24 +00:00
Dan Lake 10e664eedc Fix compile error from an earlier commit 2011-11-10 17:37:33 -08:00
Melanie a5838cf0a6 Prevent linking objects while they are deeded. On unlinking deeded objects,
set LastOwnerID properly so the parts cannot be transferred, circumventing
no trans perms
2011-11-11 00:28:12 +00:00
Melanie c803ed28c3 Replacing te linking code with the code from Avination. Link sets prims are now
numbered properly even when sets are linked to sets.
2011-11-05 00:09:37 +00:00
Dan Lake 94dc7d07eb Renamed ForEachRootScenePresence to ForEachAvatar. Cleaned up calls to
the 3 iteration functions so more of them are using the correct
iteration for the action they are performing. The 3 iterators that seem
to fit all actions within OpenSim at this time are:

ForEachAvatar: Perform an action on all avatars (root presences)
ForEachClient: Perform an action on all clients (root or child clients)
ForEachRootClient: Perform an action on all clients that have an avatar

There are still a dozen places or so calling the old
ForEachScenePresence that will take a little more refactoring to
eliminate.
2011-11-03 17:06:08 -07:00
Dan Lake e2c51a977d Changes UpdateFlag in SOP to an enumeration of NONE, TERSE and FULL.
UpdateFlag is now referenced/used only within SOP and SOG. Outsiders are
using ScheduleFullUpdate, ScheduleTerseUpdate or ClearUpdateSchedule on
SOP consistently now. Also started working toward eliminating those
calls to ScheduleFullUpdate, ScheduleTerseUpdate or ClearUpdateSchedule
from outside SOP in favor of just setting properties on SOP and let SOP
decide if an update should be scheduled. This consolidates the update
policy within SOP and the client rather than everywhere that makes
changes to SOP. Some places forget to call update while others call it
multiple times, "just to be sure".

UpdateFlag and Schedule*Update will both be made private shortly.

UpdateFlag is intended to be transient and internal to SOP so it has
been removed from XML serializer for SOPs.
2011-11-02 14:59:00 -07:00
Justin Clark-Casey (justincc) 6d97545b6b Remove the SyncRoot locking from Scene which was only being done around the main physics loop and ScenePresence position and velocity setting
This is no longer necessary with ODECharacter taints (ODEPrim was already not taking part in this).  BSCharacter was already tainting.
2011-10-29 02:42:53 +01:00
Dan Lake b98613091c Added new ForEachRootScenePresence to Scene since almost every delegate passed to ForEachScenePresence checks for !IsChildAgent first. It consolidates child and root handling for coming refactors. 2011-10-27 00:42:21 -07:00
Justin Clark-Casey (justincc) ca83f99332 Instead of adding stat agentMS in all kinds of places, calculate it instead in the main Scene.Update() loop, like the other stats
Some of the places where agentMS was added were in separate threads launched by the update loop.  I don't believe this is correct, since such threads are no longer contributing to frame time.
Some of the places were also driven by client input rather than the scene loop.  I don't believe it's appropriate to add this kind of stuff to scene loop stats.
These changes hopefully have the nice affect of making the broken out frame stats actually add up to the total frame time
2011-10-06 00:45:25 +01:00
Justin Clark-Casey (justincc) 7d033187d8 Make reported sim fps more accurate, in line with frame time ms
Also remove some unused fields and improve naming on others.
2011-10-05 22:08:56 +01:00
Justin Clark-Casey (justincc) 8880aea728 Stop attempts to rewear already worn items from removing and reattaching.
Viewer 2/3 will sometimes attempt to rewear attachments, even though they have already been attached during the main login process.
This change ignores those attempts.
This stops script failures during login, as the rewearing was racing with the script startup code.
It might also help with attachments being abnormally put into deleted state.
Hopefully resolves some more of http://opensimulator.org/mantis/view.php?id=5644
2011-09-13 22:13:58 +01:00
Justin Clark-Casey (justincc) 618277e797 Comment out attachments code in Scene.IncomingCreateObject(UUID userID, UUID itemID) for now
As far as I can see, this is only invoked by a PUT request to ObjectHandlers, which is not being used anyway.
Invoking attachments code at this point is probably inappropriate since it would still be invoked when the client entered the scene.
Being commented to simplify analysis of attachments issues.  Can be uncommented when in use.
Also, small tweak to lock and log removal of a SOG from the SceneObjectGroupsByLocalPartID collection in SceneGraph.GetGroupByPrim() if an inconsistency is found.
2011-09-13 20:25:32 +01:00
Justin Clark-Casey (justincc) df73833a2c stop the duplicate remove of the root part ids from the full part and local part indexes in SG.DeleteSceneObject()
this is unnecessary because the parts array iterated through contains the root part as well as the non-root parts
2011-09-13 18:11:13 +01:00
Justin Clark-Casey (justincc) 07ba28f1de In SG.AddSceneObject(), stop unnecessarily adding the root part to object indexes sepearately from the other parts.
The SOG.Parts property contains the root part as well as the non-root parts
2011-09-13 17:56:02 +01:00
Justin Clark-Casey (justincc) 56cd7d9685 stop the redundant passing in of RegionInfo to SceneGraph, since the Scene is always passed in at the same time. 2011-09-12 22:51:56 +01:00
Justin Clark-Casey (justincc) 00f8946bd4 minor: if the script engine fails to find a prim for a script, also print out that prim's local id in the error message. 2011-09-12 22:44:14 +01:00
Justin Clark-Casey (justincc) 7eca929686 Eliminate pointless checks of SOG.RootPart != null
It's never possible for SOG to have no RootPart, except in the first few picosends of the big bang when it's pulled from region persistence or deserialized
2011-09-01 02:11:00 +01:00