Commit Graph

380 Commits (4c812884be59d76039afee74725fc45981356f36)

Author SHA1 Message Date
Dan Lake 9a16e76f51 Simplified IsInTransit property on ScenePresence and removed InTransit() which called IsInTransit=true which called m_inTransit=true. Also removed NotInTransit(). 2011-10-06 12:39:19 -07:00
Dan Lake 08f264d096 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Conflicts:
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
2011-10-06 12:22:15 -07:00
Dan Lake bd9ba904c3 Refactor ScenePresence so gets and sets are through properties. Added private sets when needed. Removed redundant code when methods replicated what the set already does 2011-10-06 12:19:31 -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) 56dbab35e1 Remove unimplementated UpdateMovement() methods from SOG, SOP.
SP still has an implementation but this is now just a public method on SP rather than an abstract one in EntityBase.
No point making the code more complex until it actually needs to be,
2011-10-01 01:26:50 +01:00
Dan Lake 28a482a7ee Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-09-21 16:24:48 -07:00
Dan Lake 2c0bb8118d Commented out new debug statements in ScenePresence 2011-09-21 16:24:19 -07:00
Justin Clark-Casey (justincc) d358125cac Reinstate option to land an npc when it reaches a target.
This is moved into ScenePresence for now as a general facility
2011-09-22 00:16:05 +01:00
Justin Clark-Casey (justincc) f9438e7147 Remove unused and never set SP.PreviousRotation 2011-09-21 22:01:57 +01:00
Justin Clark-Casey (justincc) 572b680cb0 get rid of an incredibly noisy logging message from the last commit 2011-09-21 20:15:06 +01:00
Justin Clark-Casey (justincc) c9c40343af Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-09-21 20:05:11 +01:00
Justin Clark-Casey (justincc) 8159fd7110 When calling osNpcMoveTo(), rotate the avatar in the direction of travel.
This stops the npc walking backwards if the target is directly behind.
This means that the npc no longer returns to its original rotation once movement has finished.
If you want this behaviour, please store and reset the original rotation after movement.
This is somewhat to address http://opensimulator.org/mantis/view.php?id=5678
2011-09-21 19:28:41 +01:00
Dan Lake fa9291512a Make debug statements in ScenePresence consistent and add a few more 2011-09-20 14:07:10 -07:00
Justin Clark-Casey (justincc) 385c4a210d On setting a new avatar appearance, if height hasn't changed then don't set that same height in ScenePresence.
This prevents unnecessary work in the ODE module, though possibly that should be checking against same size sets itself
2011-09-17 00:26:53 +01:00
Justin Clark-Casey (justincc) 6f542f73d4 Stop the avatar stalling on its first boarder cross when using the ODE plugin
When upgrading the previously child agent to a root, the code was setting the Size parameter on the ODECharacter PhysicsActor.
This in turn reset Velocity, which cause the border stall.
I'm fixing this by commenting out the Velocity = Vector3.Zero lines since they don't appear to play a useful purpose
2011-09-16 23:57:16 +01:00
Justin Clark-Casey (justincc) adfe713b43 minor: I was wrong about OffsetPosition - sometimes it genuinely does return offset position!
Add method doc to explain this.
2011-09-16 22:55:24 +01:00
Justin Clark-Casey (justincc) b2356340d2 Remove setter from SP.OffsetPosition, since all sets should flow through SP.AbsolutePosition
OffsetPosition is also misnamed - it returns the absolute position and never contains an offset.
2011-09-16 22:51:36 +01:00
Justin Clark-Casey (justincc) bd991fc95f Don't try and delete attachments for child agent close 2011-09-13 22:54:50 +01:00
Justin Clark-Casey (justincc) dea0935361 eliminate redundant SP.m_regionInfo since it always has the scene.
We were already referencing through the scene in some places.
2011-09-12 23:00:15 +01:00
Justin Clark-Casey (justincc) 62b2450529 remove the unused SP.initializeScenePresence() 2011-09-12 22:54:54 +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) ea0f78c971 Start locking entire add/remove operations on an IScenePresence.AttachmentsSyncLock object
Attach and detach packets are processed asynchronously when received from a viewer.
Bugs like http://opensimulator.org/mantis/view.php?id=5644 indicate that in some situations (such as attaching/detaching entire folders of objects at once), there are race conditions between these threads.
Since multiple data structures need to be updated on attach/detach, it's not enough to lock the individual collections.
Therefore, this commit introduces a new IScenePresence.AttachmentsSyncLock which add/remove operations lock on.
2011-09-12 21:57:22 +01:00
Justin Clark-Casey (justincc) 728fd0b1b8 lock attachments when enumerating through them in ScenePresence.CopyTo().
May have some effect on http://opensimulator.org/mantis/view.php?id=5644
2011-09-10 01:09:17 +01:00
Justin Clark-Casey (justincc) 9c32b131fd Add extra log information when attachments fail validation 2011-09-10 00:57:52 +01:00
Justin Clark-Casey (justincc) cf73afec35 Try disabling the inconsistent attachment state check to see if this actually has an impact.
The code in question is over three years old and just be catching an inconsistency rather than being wholly necessary.
This commit still carries out the check and prints all the previous log warnings but a 'failure' no longer prevents avatar region crossing or teleport, and it doesn't give the client the error message.
This will have some kind of impact on http://opensimulator.org/mantis/view.php?id=5672
2011-09-05 23:42:37 +01:00
Justin Clark-Casey (justincc) 5c1fa968ab Stop NPCs losing attachments when the source avatar takes them off.
This was happening because we were using the source avatar's item IDs in the clone appearance.
Switch to using the asset IDs of attachments instead for NPCs.
The InventoryAccessModule and AttachmentModule had to be changed to allow rezzing of an object without an associated inventory item.
Hopefully goes some way towards resolving http://opensimulator.org/mantis/view.php?id=5653
2011-09-03 01:11:16 +01:00
Justin Clark-Casey (justincc) 7d58b5fa15 move common code into AttachmentsModule.DeleteAttachmentsFromScene() 2011-08-31 17:53:58 +01:00
Justin Clark-Casey (justincc) e69f246b86 refactor: move multiple class to set avatar height into associated SP.AddToPhysicalScene() 2011-08-31 17:25:18 +01:00
Justin Clark-Casey (justincc) 899d109e82 get rid of appearance null checks - this is never null 2011-08-31 17:13:53 +01:00
Justin Clark-Casey (justincc) 54839d28ad remove pointless m_attachments == null check since this field is never null 2011-08-31 16:46:43 +01:00
Justin Clark-Casey (justincc) 5a5206449f minor: seal up another instance of using the appearance list without locking 2011-08-31 16:41:58 +01:00
Justin Clark-Casey (justincc) 32444d98cb Make SP.Attachments available as sp.GetAttachments() instead.
The approach here, as in other parts of OpenSim, is to return a copy of the list rather than the attachments list itself
This prevents callers from forgetting to lock the list when they read it, as was happening in various parts of the codebase.
It also improves liveness.
This might improve attachment anomolies when performing region crossings.
2011-08-31 16:29:51 +01:00
Justin Clark-Casey (justincc) 1809aaf74c minor: remove already processed avatar null check in Scene.RemoveClient()
remove some now duplicated method doc
2011-08-30 23:36:45 +01:00
Justin Clark-Casey (justincc) ddc733cd3d refactor: move SP.SaveChangedAttachments() fully into AttachmentsModule 2011-08-30 23:32:30 +01:00
Justin Clark-Casey (justincc) 04bafd2122 refactor: Move ScenePresence.RezAttachments() into AttachmentsModule
This adds an incomplete IScenePresence to match ISceneEntity
2011-08-30 23:06:10 +01:00
Justin Clark-Casey (justincc) be357f8fee Fix bug in persisting saved appearances for npcs
Assets have to be marked non-local as well as non-temporary to persist.  This is now done.
Hopefully addresses http://opensimulator.org/mantis/view.php?id=5660
2011-08-30 01:58:32 +01:00
Justin Clark-Casey (justincc) d4d894c20f Stop avatars returning from neighbouring regions from stalling on the border crossing.
On making a root agent, we need to reset the ScenePresence.m_movement_flag so that it doesn't remember the
movement registered to the client when it exited the initial region.
If this is remember, then the client avatar movement isn't updated and it appears to stall in mid-air, though this is resolved with a prod/release of any other direction key.
This bug was probably introduced a few weeks ago.  Surprised that nobody brought it up.
2011-08-27 01:28:33 +01:00
Justin Clark-Casey (justincc) 33a894f3d2 refactor: move SOP.IsAttachment and AttachmentPoint up into SOG to avoid pointless duplication of identical values 2011-08-27 00:15:21 +01:00
Justin Clark-Casey (justincc) d5dc8133fc remove pointless IsDeleted check on SP.RezAttachments()
IsDeleted is never set for an SP, even though it's on EntityBase.
It might be an idea to set it in the future
2011-08-24 22:37:08 +01:00
Justin Clark-Casey (justincc) 6d4432f440 refactor: simplify EntityBase.IsDeleted property 2011-08-24 22:34:26 +01:00
Justin Clark-Casey (justincc) afd5469eec Remove pointless contains check in ScenePresence.RemoveAttachment() 2011-08-23 00:08:29 +01:00
Justin Clark-Casey (justincc) d328046efb If an attachment fails, then start logging the exception for now, in order to help with the inconsistent state bug.
This also refactors AttachmentsModules to stop pointlessly refetching the ScenePresence in various methods.  However, more of this is required.
2011-08-22 23:59:48 +01:00
Justin Clark-Casey (justincc) 2eaadf2dc0 Add warning log message to say which attachment fails validation in order to pin down problems with "Inconsistent Attachment State" 2011-08-22 23:28:37 +01:00
Justin Clark-Casey (justincc) 49258350e8 refactor: fold CreateSceneViewer() back into ScenePresence constructor 2011-08-18 01:22:01 +01:00
Justin Clark-Casey (justincc) 45c37ef494 refactor: Fold 3 ScenePresence() constructors into one since only one is called. 2011-08-18 01:11:23 +01:00
Justin Clark-Casey (justincc) c1a34cd8da Don't try to save changed attachment states when an NPC with attachments is removed from the scene.
This is done by introducing a PresenceType enum into ScenePresence which currently has two values, User and Npc.
This seems better than a SaveAttachments flag in terms of code comprehension, though I'm still slightly uneasy about introducing these semantics to core objects
2011-08-18 00:53:05 +01:00
Justin Clark-Casey (justincc) d73c424078 get rid of logged warnings about lack of some modules - afaik these never occur in real life and just clutter up tests 2011-08-16 23:12:58 +01:00
Justin Clark-Casey (justincc) b3a4b10531 eliminate redundant ground sitting checks since these are already done in enclosing control structures 2011-08-11 03:16:46 +01:00
Justin Clark-Casey (justincc) 1aa1711893 eliminate the rotation parameter from SP.HandleMoveToTargetUpdate(). This can just use the currently set Rotation
looks like I spoke to soon about eliminating jerkiness on "go here"/autopilot.  It's still there.
2011-08-11 03:06:38 +01:00
Justin Clark-Casey (justincc) 36f7d36fa1 instead of setting avatar rotation twice in SP.HandleAgentUpdate(), eliminate the second setting in AddNewMovement() 2011-08-11 02:54:15 +01:00