Commit Graph

713 Commits (8b267b5bb547b807dd3cb6cd83ea03bd101e19ff)

Author SHA1 Message Date
Justin Clark-Casey (justincc) 03b2b5b77b minor: Make log message at top of ScenePresence.CompleteMovement info level and comment out later log message in ScenePresence.MakeRootAgent()
Need an info message since this is currently important in detecting teleport issue when not at debug log level.
CompleteMovement message occurs before MakeRootAgent() one did
2013-09-19 20:59:27 +01:00
Justin Clark-Casey (justincc) 8999f06025 minor: correct method name in comment 2013-09-18 23:13:31 +01:00
Justin Clark-Casey (justincc) ddcbd4bb7d refactor: rename *ChildAgentDataUpdate() methods to *UpdateChildAgent()
verb-noun is consistent with other similar methods
2013-09-18 23:09:38 +01:00
Justin Clark-Casey (justincc) 3ce46adb2a minor: Make log message when Scene.IncomingChildAgentDateUpdate() more explicit that there is a problem if it still finds the agent to be a child if the sender wanted to wait till it became root
Add some comments about the mssage sequence, though much more data is at
http://opensimulator.org/wiki/Teleports
2013-09-18 22:56:00 +01:00
Justin Clark-Casey (justincc) 61c20bd06a Remove old and unused ScenePresence.RestoreInCurrentScene() 2013-08-23 00:53:42 +01:00
Justin Clark-Casey (justincc) 1f39a763a5 Don't allow users to attempt to sit on objects in a child region without going to that region first.
If this is attempted, they get a "Try moving closer.  Can't sit on object because it is not in the same region as you." message instead, which is the same as current ll grid.
Sitting on ground is okay, since viewer navigates avatar to required region first before sitting.
2013-08-21 21:35:03 +01:00
Justin Clark-Casey (justincc) d38d5ecbac minor: remove mono compiler warnings from ScenePresence 2013-08-17 01:00:20 +01:00
Justin Clark-Casey (justincc) bfdcdbb2f3 Increase wait for source region to sent UpdateAgent to 10 seconds instead of 4.
This is giving much better results on teleports between simulators over my lan where for some reason there is a pause before the receiving simulator processes UpdateAgent()
At this point, v2 teleports between neighbour and non-neighbour regions on a single simulator and between v2 simulators and between a v1 and v2 simulator
are working okay for me in different scenarios (e.g. simple teleport, teleport back to original quickly and re-teleport, teleport back to neighbour and re-teleport. etc.)
2013-08-09 17:59:58 +01:00
Justin Clark-Casey (justincc) 97bcb59bee Merge branch 'TeleportWork' 2013-08-09 17:52:29 +01:00
Justin Clark-Casey (justincc) b1c26a56b3 Fix an issue where under teleport v2 protocol, teleporting from regions in an line from A->B->C would not close region A when reaching C
The root cause was that v2 was only closing neighbour agents if the root connection also needed a close.
However, fixing this requires the neighbour regions also detect when they should not close due to re-teleports re-establishing the child connection.
This involves restructuring the code to introduce a scene presence state machine that can serialize the different add and remove client calls that are now possible with the late close of the
This commit appears to fix these issues and improve teleport, but still has holes on at least quick reteleporting (and possibly occasionally on ordinary teleports).
Also, has not been completely tested yet in scenarios where regions are running on different simulators
2013-08-08 23:29:30 +01:00
Dan Lake 9fc97cbbf7 Make m_originRegionID in ScenePresence public to allow DSG module to work for now. Once the code churn on teleport ends, I can find a better solution 2013-08-08 12:44:03 -07:00
Justin Clark-Casey (justincc) b10710d4a5 minor: add some method doc to ScenePresence fields used for entity transfer, add minor details to some log messages, rename a misleading local variable name.
No functional changes.
2013-08-07 23:17:31 +01:00
Diva Canto 946b370966 Child agent updates: remove the dependency on the root agent's camera position. That was a complete overkill that is unnecessary at this point. 2013-08-05 14:21:17 -07:00
Diva Canto 07e4958b19 Turn off edit beams when object is derezed while being edited. (mantis #6722) 2013-08-01 20:40:13 -07:00
Justin Clark-Casey (justincc) a08f01fa83 Fix NPC regression test failures.
These were genuine failures caused by ScenePresence.CompleteMovement() waiting for an UpdateAgent from NPC introduction that would never come.
Instead, we do not wait if the agent is an NPC.
2013-07-26 18:43:15 +01:00
Justin Clark-Casey (justincc) 72ed49af5f Reset DoNotClose scene presence teleport flag before pausing. Rename DoNotClose to DoNotCloseAfterTeleport 2013-07-26 01:38:04 +01:00
Justin Clark-Casey (justincc) 1fabdcc43c If a returning teleport starts to reuse a downgraded child connection that was a previous root agent, do not close that child agent at the end of the 15 sec teleport timer.
This prevents an issue if the user teleports back to the neighbour simulator of a source before 15 seconds have elapsed.
This more closely emulates observed linden behaviour, though the timeout there is 50 secs and applies to all the pre-teleport agents.
Currently sticks a DoNotClose flag on ScenePresence though this may be temporary as possibly it could be incorporated into the ETM state machine
2013-07-26 01:04:16 +01:00
Diva Canto 4e5c7bdeb3 Moved TriggerOnMakeRootAgent back to the end of MakeRootAgent, to see if that eliminates the temporary placement at infinity upon TPs 2013-07-24 14:30:13 -07:00
Diva Canto 879cbb4575 This commit message intentionally left blank (last commit was idiotic) 2013-07-24 14:28:55 -07:00
Diva Canto 261512606d Improve the opening test in CompleteMovement, to account for multiple flags besides ViaLogin. 2013-07-24 14:28:41 -07:00
Diva Canto 3891a8946b New Teleport protocol (V2), still compatible with V1 and older. (version of the destination is being checked)
In this new protocol, and as committed before, the viewer is not sent EnableSimulator/EstablishChildCommunication for the destination. Instead, it is sent TeleportFinish directly. TeleportFinish, in turn, makes the viewer send a UserCircuitCode packet followed by CompleteMovementIntoRegion packet. These 2 packets tend to occur one after the other almost immediately to the point that when CMIR arrives the client is not even connected yet and that packet is ignored (there might have been some race conditions here before); then the viewer sends CMIR again within 5-8 secs. But the delay between them may be higher in busier regions, which may lead to race conditions.
This commit improves the process so there are are no race conditions at the destination. CompleteMovement (triggered by the viewer) waits until Update has been sent from the origin. Update, in turn, waits until there is a *root* scene presence -- so making sure CompleteMovement has run MakeRoot. In other words, there are two threadlets at the destination, one from the viewer and one from the origin region, waiting for each other to do the right thing. That makes it safe to close the agent at the origin upon return of the Update call without having to wait for callback, because we are absolutely sure that the viewer knows it is in th new region.
Note also that in the V1 protocol, the destination was getting UseCircuitCode from the viewer twice -- once on EstablishAgentCommunication and then again on TeleportFinish. The second UCC was being ignored, but it shows how we were not following the expected steps...
2013-07-24 14:27:58 -07:00
Diva Canto 901bdfed40 Restoring landing on prims, which had been affected by the edit beams commit. 2013-07-23 14:31:16 -07:00
Diva Canto 8d18ad2f6f Minor aesthetic change to make things more clear. 2013-07-21 09:02:56 -07:00
Diva Canto b5ab0698d6 EDIT BEAMS!!! They had been missing from OpenSim since ever. Thanks to lkalif for telling me how to route the information. The viewer effect is under the distance filter, so only avatars with cameras < 10m away see the beams. 2013-07-21 09:01:44 -07:00
Diva Canto 3919c80505 A couple of small optimizations over the previous commit 2013-07-21 09:00:57 -07:00
Diva Canto d5a1779465 Manage AgentUpdates more sanely:
- The existing event to scene has been split into 2: OnAgentUpdate and OnAgentCameraUpdate, to better reflect the two types of updates that the viewer sends. We can run one without the other, which is what happens when the avie is still but the user is camming around
- Added thresholds (as opposed to equality) to determine whether the update is significant or not. I thin these thresholds are ok, but we can play with them later
- Ignore updates of HeadRotation, which were problematic and aren't being used up stream
2013-07-21 09:00:42 -07:00
Diva Canto c61ff917ef Authenticate ChildAgentUpdate too. 2013-07-14 09:21:28 -07:00
Diva Canto f3b3e21dea Change the auth token to be the user's sessionid. 2013-07-14 07:28:40 -07:00
Diva Canto fcb0349d56 And this fixes the other failing tests. Justin, the thread pool is not being initialized in the tests! 2013-07-13 23:01:41 -07:00
Diva Canto b4f1b9acf6 Guard against unauthorized agent deletes. 2013-07-13 21:28:46 -07:00
Diva Canto 5a1d6727e1 Some more debug to see how many threads are available. 2013-07-13 11:39:17 -07:00
Diva Canto bc405a6a34 That didn't fix the problem.
Revert "Trying to reduce CPU usage on logins and TPs: trying radical elimination of all FireAndForgets throughout CompleteMovement. There were 4."

This reverts commit 6825377380.
2013-07-13 11:30:37 -07:00
Diva Canto 6825377380 Trying to reduce CPU usage on logins and TPs: trying radical elimination of all FireAndForgets throughout CompleteMovement. There were 4. 2013-07-13 11:11:18 -07:00
Diva Canto 3a26e366d2 This commit effectively reverses the previous one, but it's just to log that we found the root of the rez delay: the priority scheme BestAvatarResponsiveness, which is currently the default, was the culprit. Changing it to FrontBack made the region rez be a lot more natural.
BestAvatarResponsiveness introduces the region rez delay in cases where the region is full of avatars with lots of attachments, which is the case in CC load tests. In that case, the inworld prims are sent only after all avatar attachments are sent. Not recommended for regions with heavy avatar traffic!
2013-07-13 10:35:41 -07:00
Diva Canto ff4ad60207 Same issue as previous commit. 2013-07-13 10:05:11 -07:00
Diva Canto a412b1d682 Moved SendInitialDataToMe to earlier in CompleteMovement. Moved TriggerOnMakeRootAgent to the end of CompleteMovement.
Justin, if you read this, there's a long story here. Some time ago you placed SendInitialDataToMe at the very beginning of client creation (in LLUDPServer). That is problematic, as we discovered relatively recently: on TPs, as soon as the client starts getting data from child agents, it starts requesting resources back *from the simulator where its root agent is*. We found this to be the problem behind meshes missing on HG TPs (because the viewer was requesting the meshes of the receiving sim from the departing grid). But this affects much more than meshes and HG TPs. It may also explain cloud avatars after a local TP: baked textures are only stored in the simulator, so if a child agent receives a UUID of a baked texture in the destination sim and requests that texture from the departing sim where the root agent is, it will fail to get that texture.
Bottom line: we need to delay sending the new simulator data to the viewer until we are absolutely sure that the viewer knows that its main agent is in a new sim. Hence, moving it to CompleteMovement.
Now I am trying to tune the initial rez delay that we all experience in the CC. I think that when I fixed the issue described above, I may have moved SendInitialDataToMe to much later than it should be, so now I'm moving to earlier in CompleteMovement.
2013-07-13 09:46:58 -07:00
Robert Adams 7556a0f699 Add TriggerScenePresenceUpdated events when an animation is added
or removed. Shouldn't impact anyone as only DSG seems to use
OnScenePresenceUpdated event.
Some minor format changes to AnimationSet's ToString().
2013-06-11 17:18:12 -07:00
Justin Clark-Casey (justincc) f41fc4eb25 Avoid a deadlock where a script can attempt to take a ScriptInstance.m_Scripts lock then a lock on SP.m_attachments whilst SP.MakeRootAgent() attempts to take in the opposite order.
This is because scripts (at least on XEngine) start unsuspended - deceptively the ResumeScripts() calls in various places in the code are actually completely redundant (and useless).
The solution chosen here is to use a copy of the SP attachments and not have the list locked whilst creating the scripts when an avatar enters the region.
This looks to address http://opensimulator.org/mantis/view.php?id=6557
2013-06-05 22:20:48 +01:00
Robert Adams 4d32ca19bf Trigger OnScenePresenceUpdated when the avatar's animations change. 2013-05-30 19:16:36 -07:00
Justin Clark-Casey (justincc) 8f9a726465 If on a sit request we sit the avatar on a different prim in a linkset for some reason (e.g. because it has a sit target), then send the actual sit prim UUID to the viewer rather than the requested one.
This purports to fix the issue described in http://opensimulator.org/mantis/view.php?id=6653 where the camera can end up following the requested sit prim rather than the actual.
The original spot was by Vegaslon, this commit just goes about it in a slightly different way
This commit also makes m_requestedSitTargetUUID to be the actual UUID, which is consistent with m_requestedSitTargetID which was already doing this.
However, this adjustment has no practical effect since we only currently need to know that there's any requested sit UUID at all, not which one it is.
2013-05-30 19:27:20 +01:00
Diva Canto 233b9ec4d7 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2013-05-28 20:59:54 -07:00
Mic Bowman a087dbed7f One more appearance change: drop sending the SendAppearance packet
to avatar when it becomes root. This packet shows up in the viewer
logs as an error and appears to cause problems for completing the
texture rebake process for v1 viewers in some cases.
2013-05-24 13:26:07 -07:00
Diva Canto 10e4fb2ce2 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2013-05-20 09:26:15 -07:00
Diva Canto 26904cc5a1 Add comment 2013-05-20 09:25:50 -07:00
Justin Clark-Casey (justincc) d214e2d0c4 On closing child agents, send separate asynchronous requests to each neighbour rather than sending all closes concurrently on a separate thread.
This is to reduce race conditions where neighbours may be responding erratically, thus mixing up create and close agent requests in time.
This mirrors OpenSimulator behaviour on enabling child agents where each region is contacted separately.
2013-05-16 17:12:02 +01:00
Diva Canto 91091c3e54 Second take at HGTP-mesh bug: delay sending the initial data only for agents that are coming via TP (root agents) 2013-05-14 09:06:58 -07:00
Diva Canto 645da54f25 Revert "HGTP-mesh bug: the mesh download requests were going to the departing sims for a little while. This was also true for local TPs. BUt for local TPs the assets are on the same server, so it doesn't matter. For HGTPs, it matters. This potential fix moves sending the initial data to later, after the client has completed the movement into the region. Fingers crossed that it doesn't mess other things up!"
This reverts commit f32a21d967.
2013-05-14 08:47:18 -07:00
Diva Canto f32a21d967 HGTP-mesh bug: the mesh download requests were going to the departing sims for a little while. This was also true for local TPs. BUt for local TPs the assets are on the same server, so it doesn't matter. For HGTPs, it matters. This potential fix moves sending the initial data to later, after the client has completed the movement into the region. Fingers crossed that it doesn't mess other things up! 2013-05-14 08:12:01 -07:00
Justin Clark-Casey (justincc) 023faa227e Check viewer 2/3 attachment calls against avatar appearance attachment data rather than actually attached objects
By checking against the grid's Avatar data, we can ignore viewer side attachments but still initiate these calls simulator-side.
Initiating simulator-side is always necessary for version 1 viewers.
This is a further commit to resolve http://opensimulator.org/mantis/view.php?id=6581
2013-03-29 23:10:28 +00:00
Justin Clark-Casey (justincc) 23ae4c0a4d Fix bug where CHANGED_REGION and/or CHANGED_TELEPORT weren't firing for scripts in attachments.
This was because the script resumption in AttachmentsModule was firing the attach event instead.
Had to reinstate the code in 285bd3a do we can resume the scripts there instead, though the bug existed before its removal.
This is to resolve http://opensimulator.org/mantis/view.php?id=6578
2013-03-29 02:21:38 +00:00
Justin Clark-Casey (justincc) 285bd3abc8 Eliminate code which tries to restart attachment scripts in ScenePresence.MakeRootAgent(), since this is already done in AttachmentsModule 2013-03-29 00:49:55 +00:00
Justin Clark-Casey (justincc) 4ad9b27530 If the viewer has already rezzed any attachments itself, then ignore the simulator-side rez attachments call.
This is a further effort to reduce v3 viewer race conditions where this call may clash with the viewer signalling attachment wearing from its current outfit folder.
2013-03-28 22:51:59 +00:00
Justin Clark-Casey (justincc) 3b377f16b2 Fix regression tests by making a new NPC always trigger simulator side attachment code when created.
Regression from previous commit c2093ccc.  Failed because NPCs don't set the ViaLogin flag
2013-03-28 22:44:59 +00:00
Justin Clark-Casey (justincc) c2093ccce1 Move the simulator-side RezAttachments call on login to SP.MakeRootAgent with the other attachments code, using TeleportFlags.ViaLogin check to fire if necessary.
This is to simplify the code (no tricky 'wasChild' signalling required)
and to reduce the risk of a thread clash between simulator-side attaching (necessary for v1 viewers)
and the viewer-side attaching the v3 viewers perform.
2013-03-28 22:07:58 +00:00
Justin Clark-Casey (justincc) 01636ca900 Fix teleporting into the non-SW 256x256 corner of a megaregion, though currently with a 10 second delay before auto-reteleport to the correct location.
This now does a check for border crossing (required to trigger the teleport) immediately in SP.MakeRootAgent().
If left any later, it looks like the physics scene changes the position and stops the cross happening.
If done any earlier, nothing happens because the cross-code currently requires a PhysicsActor to be in place, thuogh it's probably not necessary for this case.
2013-03-23 00:47:59 +00:00
Justin Clark-Casey (justincc) 93206ef0fa Add "show borders" command to show the borders of a region.
This is relevant to mega-regions where the borders are very different to a regular region.
Also adds some method doc and other code comments.
2013-03-23 00:45:21 +00:00
Justin Clark-Casey (justincc) 3cb1c23554 Force a viewer object update for attachments at the end of the final Scene.CompleteMovement() in order to make all multi-attachments appear on the destination region.
For some reason, sending updates before this will not have this effect.
This may be something related to some viewers (e.g. LL 3.3.4) or something OpenSimulator isn't getting quite right.
2013-03-20 01:46:50 +00:00
Justin Clark-Casey (justincc) e9c394fb4e Make llGetObjectDetails() return the correct world rotation for a sitting avatar
This addresses http://opensimulator.org/mantis/view.php?id=6567
This creates a ScenePresence.GetWorldRotation() with the same semantics as SOP.GetWorldRotation()
SP.Rotation can't be used since it's relative to the sat upon prim if the avatar is sitting.
2013-03-14 21:23:48 +00:00
Justin Clark-Casey (justincc) 8960418e7d Add regression test for presence crossing between regions on the same simulator.
Unlike a much earlier commented out version of this test, this is done in synchronous mode.
2013-03-06 21:37:53 +00:00
Justin Clark-Casey (justincc) a93f06eb88 minor: Add doc to ScenePresence.IsInTransit to make it clear that this is set only for region crossing and not teleport, etc. 2013-02-22 23:08:42 +00:00
teravus 6560d80fa8 * Fix walking to <NaN, NaN, NaN> via autopilot. 2013-02-16 22:54:37 -05:00
Melanie 6f3dcf58b8 Fix code to check for no spawn points. Possibly a merge artefact? 2013-02-10 20:00:39 +00:00
BlueWall adedd70c35 Fix teleport/telehub issue:
Fix bug that allowed only login access to regions with mis-configured telehubs. Administrators now have teleport access when there exists a mis-configured telehub in the region. Estate owners are now placed at region center in the absence of spawnpoints instead of being denied access. Grid Gods are unrestricted. All others are denied access to the region until spawnpoints are assigned to the telehub object.
2013-02-10 13:01:33 -05:00
teravus d8d4e7f236 Sit and Spin reduction. If sitting, slam avatar angular velocity to zero. 2013-02-01 15:42:24 -05:00
teravus 52ea6eadae * This adds a bit more to the previous flying roll effect by adding additional roll when pressing page down, and reducing your roll when pressing page up to make it feel more responsive and give the user more visual feedback. 2013-01-30 07:34:48 -05:00
teravus 7c4e0ff03c * Adds a satisfying angular roll when an avatar is flying and turning. (General, not physics). Makes flying not feel as stiff. 2013-01-30 06:22:05 -05:00
Justin Clark-Casey (justincc) fc6115f777 Check the existing ScenePresence.ParentPart to make sure we're not trying to sit on a prim we're already sat upon, rather than looking up the part from scratch.
An adaptation of commit 055b8a2
Having both ParentID and ParentPart references now is redundant.  ParentID should probably be eliminated.
2013-01-19 02:29:02 +00:00
Justin Clark-Casey (justincc) 74256c0cc4 Restore previous client AO behaviour by not allowing them to remove the default animation but continue to allow scripts to do so.
This keeps the fix from http://opensimulator.org/mantis/view.php?id=6327
and fixes the behaviour regression in http://opensimulator.org/mantis/view.php?id=6483
Animations may still exhibit different behaviour if both scripts and clients are adjusting animations.
A change in the behaviour of client AO to not remove all animations may be a better long term approach.
2013-01-18 22:57:09 +00:00
dahlia 055b8a2d58 move resit fix to ScenePresence.cs and allow for requesting sit on objects other than the object currently sat on 2013-01-14 22:24:24 -08:00
Robert Adams fdf8732cd7 ScenePresence passes the avatar rotation down to the physics engine. This will be a no-op for ODE but enables asymmetrical avatars for BulletSim. 2012-12-28 16:29:16 -08:00
Robert Adams 5afab9bcfe Add check to always push terse updates for presences that have new velocities of zero. 2012-12-27 22:12:27 -08:00
Dan Lake 88b094cbf7 Simplify sit code a bit by determining correct animation in HandleSit instead of HandleSitRequest. This eliminates m_nextSitAnimation, an unneeded state-saving variable in ScenePresence 2012-12-13 13:05:28 -08:00
Justin Clark-Casey (justincc) 597a101b9f Minor formatting for 0962a35d and a few one-line comments as to why that code is there 2012-11-20 05:09:44 +00:00
Iain Oliver 0962a35d2f Fix movetotarget on mega regions. 2012-11-20 04:54:13 +00:00
Dan Lake 2e106cd5de Change to earlier commit for TargetVelocity to support distributed physics. 2012-11-02 03:09:04 -07:00
Dan Lake ffe4d738fb Add TargetVelocity to PhysicsActor interface to support distributed physics. No change to existing functions. 2012-10-31 17:13:18 -07:00
Melanie fd9cb3cb68 Store and send the current movement animation state to a new sim on crossing 2012-10-30 23:08:22 +00:00
Justin Clark-Casey (justincc) c97890ca69 Add "force gc" region console command which manually invokes garbage collection.
For debugging purposes.
2012-10-29 22:53:06 +00:00
Oren Hurvitz b4923da334 Changed "course" to "coarse" in several places 2012-10-25 23:32:37 +01:00
SignpostMarv 8d431c6359 formatting 2012-09-04 00:03:43 +01:00
SignpostMarv 663bfbb372 although the attachmentPoint argument is a uint, zero is not a valid attachment point 2012-09-04 00:03:43 +01:00
Justin Clark-Casey (justincc) ba58331b29 Extend "Restarting scripts in attachments" debug log message to show actual name of user and the region they are in 2012-08-24 22:56:05 +01:00
Robert Adams 7243d4f842 BulletSim: Properly regenerate hulls when objects made physical.
This fixes the problem of non-base shapes (cubes and spheres)
    falling through the terrain.
2012-08-17 14:45:18 -07:00
Robert Adams 5c192b9bab Modify order of code so SOP doesn't set the physics actor flying
property multiple times every time Update is called.
This eliminates zillions of settings which is better for BulletSim.
The should be no functionality change.
2012-08-17 13:34:20 -07:00
Justin Clark-Casey (justincc) e94831ddab Stop explicitly closing and nulling out Animator in order to prevent NREs in various places due to race conditions.
Even where checks are being made they aren't enough since they all assume that the Animator they just checked is still there in the next line, which is not necessarily the case without locking.
The memory used is small and these should be GC'd anyway when the SP is released.  If this is not happening then the wider problem of old SPs being retained needs to be resolved.
2012-07-19 22:59:28 +01:00
Justin Clark-Casey (justincc) 337ea019bd If a part has a sit target and an avatar is already sitting, allow another avatar to sit in the position given if no sit target was set.
Previous behave was that the second avatar could not sit.
This matches behaviour observed on the LL grid.
2012-07-10 23:55:22 +01:00
Justin Clark-Casey (justincc) cdea572d2e refactor: move management of SOP.SitTargetAvatar into SOP.AddSittingAvatar() and SOP.RemoveSittingAvatar() 2012-07-10 23:50:04 +01:00
Justin Clark-Casey (justincc) 11e0ad6dc8 Revert "refactor: Add SOP.IsSitTargetOccupied to improve readability"
This reverts commit c8f0d476d2.
On reconsideration, I think this is less readable since immediately following code still sets SitTargetAvatar directly
2012-07-10 23:39:05 +01:00
Justin Clark-Casey (justincc) c8f0d476d2 refactor: Add SOP.IsSitTargetOccupied to improve readability 2012-07-10 23:34:40 +01:00
Justin Clark-Casey (justincc) 69a6f6e3cd refactor: use sit orientation argument passed in to SP.SendSitResponse() rather than creating a new copy
There are no issues with side-effects since this is a struct.
2012-07-10 23:26:40 +01:00
Justin Clark-Casey (justincc) e8347b7095 Move common code to detect whether a part has a valid sit target into a SOP property rather than being repeated in SP.
This also makes the detection in SP.FindNextAvailableSitTarget() and SendSitResponse() identical.
Previously they varied slightly (SendSitResponse didn't check for an older type of invalid quaternion) but the practical effect is most probably zero.
2012-07-10 23:21:39 +01:00
Justin Clark-Casey (justincc) 506437b684 Remove log line accidentally left in SP.SendSitResponse() 2012-07-10 23:06:34 +01:00
Justin Clark-Casey (justincc) d6f563794e Don't allow a prim to be sat upon if its part of an attachment 2012-07-09 21:43:44 +01:00
Justin Clark-Casey (justincc) 2eaa6d5ace Do not allow a script to attach a prim if its being sat upon.
This prevents a stack overflow where a get position on the avatar will refer to the attachment which will in turn refer back to the avatar.
This required recording of all sitting avatars on a prim which is done separately from recording the sit target avatar.
Recording HashSet is null if there are no sitting avatars in order to save memory.
2012-07-09 21:24:32 +01:00
Justin Clark-Casey (justincc) d043213317 refactor: Move ScenePresence <-> AgentData attachments copying code into AttachmentsModule. 2012-06-27 00:41:46 +01:00
Justin Clark-Casey (justincc) e5b739aaeb When attachments are being saved and deleted for a closing root agent, delete first to avoid a hud race condition with update threads.
If delete doesn't occur first then the update thread can outrace the IsAttachment = false necessary to save attachments and send hud artifacts to other viewers.
2012-06-25 22:48:13 +01:00
Justin Clark-Casey (justincc) bab7dab4c5 Comment out the scene presence sitting debug log messages for now 2012-06-11 23:37:16 +01:00
Justin Clark-Casey (justincc) 30f4a33f01 Don't make duplicate call to ScenePresence.Close() separately in ETM.DoTeleport() if an agent needs closing.
This is always done as part of Scene.RemoveClient()
Also refactors try/catching in Scene.RemoveClient() to log NREs instead of silently discarding, since these are useful symptoms of problems.
2012-06-08 01:26:43 +01:00
BlueWall 895dadbdbd Cleanup + change properties to set fields with private set : Thanks Justin for the tip. 2012-05-18 19:34:12 -04:00
BlueWall c05f87b50c Provide Telehub setting to allow use of landmarks
Setting to allow use of landmarks to override telehub routing. Default is off.
2012-05-18 17:51:38 -04:00
Justin Clark-Casey (justincc) 521ad080f1 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-05-17 23:56:36 +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
BlueWall 295bb3227d Force the default Telehub router if no matches are found in the config. 2012-05-17 00:47:19 -04:00
BlueWall 7c229c8b81 Add configurable SpawnPointRouting
Will use one of three selected methods to route avatar landing
	points when using Telehubs. The setting is in [Startup] using
        SpawnPointRouting = closest/random/sequence

	closest: The default setting. Routes avatar to the nearest SpawnPoint
	to the location.

	random: Picks random SpawnPoints to land the avatar.

	sequence: Follows a sequence to place the avatar on the next available
	SpawnPoint location

Conflicts:

	OpenSim/Region/Framework/Scenes/Scene.cs
2012-05-13 17:20:54 -04:00
Dan Lake 3bc5620d74 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-05-08 16:06:02 -07:00
Dan Lake 20952c75c5 Trigger event when scene presences are updated 2012-05-08 16:05:34 -07:00
Talun c21c9e13ef Mantis 1456 same region teleport of a sitting avatar.
Region to region was fixed some time ago in EntityTransferModule.
This applies the same fix for same region teleports.
2012-05-09 00:02:13 +01:00
Talun 92fde6ed26 Mantis 60004 problems with damage and llSetDamage. In damage enabled areas this patch - Deletes any objects that have damage set > 0 that deliver that damage to an avatar Stops Gods receiving damage, Stops volume detect objects causing damage Deletes NPCS when their helth reduces to zero Gradually "heals" damage to an avatar Resets health on going to a non damage area 2012-05-04 21:01:09 +01:00
Justin Clark-Casey (justincc) fcd5b0817b Reinsert a 2000ms delay before closing a no longer required agent on the source region after teleport to resolve Imprudence teleport problems.
Viewers 1 and 3 are fine with doing this immediately.  However, Imprudence has a small delay (<200ms, >500ms) after receiving the AgentCompleteMovement reply packet on the destination region before regarding that region as the currnet region.
If Imprudence receives a DisableSimulator in this period, it quits.
We are not restoring the full 5000ms delay since this brings back a bug where teleports permanently fail if an avatar tries to teleport back too quickly.
This commit also sends the AgentCompleteMovement packet to the client before telling the source region to release its old agent, in order to further cut down any possibility of the DisableSimulator being recieved before the AgentMovementComplete.
2012-05-03 22:30:36 +01:00
Justin Clark-Casey (justincc) 9d2e1c67a8 Add regression test for teleporting between neighbouring regions on the same simulator
This adds a non-advertised wait_for_callback option in [EntityTransfer].  Default is always true.
Teleport tests disable the wait for callback from the destination region in order to run within a single thread.
2012-05-01 23:14:12 +01:00
Justin Clark-Casey (justincc) d0598c63f3 refactor: Simplify by combining SafeSendControlsToScripts() from fe8e835 into SendControlsToScripts() (instead of SendControlToScripts()). 2012-04-30 17:33:08 +01:00
Oren Hurvitz fe8e835bfc Fixed: scripted controls didn't work if the avatar was sitting down
This fixes a bug introduced in 6473674bbf
2012-04-30 17:18:15 +01:00
Oren Hurvitz 6473674bbf Fixed: custom walking animations didn't stop when the avatar stopped walking.
This happened because the scripts were notified about control changes (e.g., the user stopped pressing the Forward key) when the animation was still WALK, so the script didn't stop the walking animation. Fixing this required: a) Update the movement animation *before* notifying the script; b) Add locking to prevent clashes with the Heartbeat thread (which also updates the animations); c) Handle the case of a user who stops walking just as the avatar is in the air: the avatar should STAND in that case, not WALK.

This reverts commit feef1dd732.
2012-04-27 20:47:02 +01:00
Justin Clark-Casey (justincc) cb6791fb30 Tweak log messages on local region to region teleport path to help with problem resolution. 2012-04-26 22:35:25 +01:00
Justin Clark-Casey (justincc) 74dbfe6bb5 Comment out avatar move to target message for now. 2012-04-25 23:46:42 +01:00
Melanie 3be3189ee0 Commit the avination Teleport() methods (adaptedto justincc's changes) 2012-04-25 04:00:01 +01:00
Justin Clark-Casey (justincc) 683cfc6f82 refactor: Combine ScenePresence.Teleport() and TeleportWithMomentum()
These are identical apart from setting Velocity = zero, which has no practical effect anyway since this is zeroed when the avatar is added back to the physics scene.
2012-04-25 02:07:55 +01:00
Justin Clark-Casey (justincc) a65ca24701 Add regression test TestSameRegionTeleport() 2012-04-25 01:51:40 +01:00
Justin Clark-Casey (justincc) 24a0cc5261 refactor: Rename EstateSettings.IsEstateManager() to EstateSettings.IsEstateManagerOrOwner() to reflect what it actually does.
This makes it consistent with other parts of OpenSimulator that are treating ESTATE_MANAGER and ESTATE_OWNER as different entities.
As per opensim-dev mailing list.
2012-04-17 01:25:41 +01:00
Talun 08e509978d Mantis 55025 Implement script time.
Signed-off-by: nebadon <michael@osgrid.org>
2012-04-12 18:44:00 -07:00
Talun 78c0028179 Mantis5502 implementation of some of the new constants
Signed-off-by: Melanie <melanie@t-data.com>
2012-04-09 21:25:22 +01:00
Justin Clark-Casey (justincc) f2903db390 For llGetMass(), return the mass of the avatar is the object is attached.
As per http://lslwiki.net/lslwiki/wakka.php?wakka=llGetMass
This is the mass as used by the physics engine (ODE or Bullet).
2012-04-06 21:14:19 +01:00
Diva Canto 51dc1e709c HG 2.0: added the beginning of HGSuitcaseInventoryService. Plus moved the hack away from ScenePresence. This is better but it still doesn't restore the inventory upon arrival. 2012-03-28 15:01:37 -07:00
Diva Canto af96b99356 More on switching the root folder from under the viewer. More experiments. 2012-03-27 20:36:54 -07:00
Justin Clark-Casey (justincc) ab243f4a57 Incorporate scene teleporting debugging into "debug scene teleport true|false" command 2012-03-21 01:13:44 +00:00
nebadon bd1f848bf6 slight increase in jump power to make running jump slightly better. 2012-03-20 14:17:15 -07:00
nebadon 9ed3532c1b reduce avatar verticle jump from the absurd 5 meter jump to a less
absurd 3m vertical jump to better match what you would see in Second
Life and be more in line with what users would expect.
2012-03-20 13:45:38 -07:00
Justin Clark-Casey (justincc) 205c36d3a4 Get rid of unnecessary ParentID == 0 check on SP.Get_AbsolutePosition since this is handled by the necessary ParentPart check 2012-03-09 02:44:08 +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) b454326273 refactor: cleanup SP.HandleAgentSit so that everything is done within one if (part != null), rather than having unnecessary multiple checks 2012-03-09 02:33:48 +00:00
Justin Clark-Casey (justincc) 73c47f7205 Remove a race condition from SP.Set_AbsolutePosition where we assume the ParentPart is still not null if the ParentID != 0
Another thread could come in and stand the avatar between those two instructions.
2012-03-09 02:22:22 +00:00
Melanie 675d40357c Hold a ref to the prim we're sat on rather than querying scene each time
the check for significant is carried out. Prevents a deadlock condition.
2012-03-08 19:14:34 +00:00
Dan Lake 8d249f8456 ScenePresence line endings and fix AllowMovement default to true. 2012-03-02 09:19:13 -08:00
Dan Lake e8779cd9e5 In ScenePresence, removed several private variables used to store public parameters. They were only used by the get/set and make code harder to refactor. 2012-03-01 19:22:05 -08:00
Justin Clark-Casey (justincc) 90ea00a109 Try to resolve some problems with viewers crashing after hitting parcel banlines or freezing on the banline.
This involves
1) On forcible teleport, call m_scene.RequestTeleportLocation() rather than ScenePresence.Teleport() - only EntityTransferModule now should call SP.Teleport()
2) When avatar is being forcibly moved due to banlines, use a 'stop movement' tolerance of 0.2 to requested position rather than 1
This prevents the avatar sometimes being stuck to banlines until they teleport somewhere else.
This aims to fix some problems in http://opensimulator.org/mantis/view.php?id=5822
2012-02-23 22:56:42 +00:00
Melanie 1dfc990264 Add a position parameter to region crossing of objects. This avoids the
potential bad update that places an object at the opposite side of the
origin sim for a moment before actually crossing it. Especially important in
grids like OSG where lag between sims is high.
2012-02-23 01:40:30 +00:00
Diva Canto b489c85226 Amend to last commit. This should have been committed too. 2012-02-19 15:37:37 -08:00
Diva Canto 20c65ac438 A few more tweaks on position updates and create child agents. Mono hates concurrent uses of the same TCP connection, and even of the connections to the same server. So let's stop doing it. This patch makes movement much smoother when there are lots of neighbours. 2012-02-19 12:28:07 -08:00
Justin Clark-Casey (justincc) e7fd732209 Make ScenePresence.MovementFlag a private only settable value to reduce complexity of code analysis 2012-02-11 00:10:59 +00:00
Melanie 855d3a3ba5 Teleport routing, part 1 2012-01-24 04:06:37 +00:00
Justin Clark-Casey (justincc) 59a0c50d48 Comment out noisy log lines I accidentally included in the nant build target adjustment commit.
Left in the method doc.
2012-01-16 23:04:08 +00:00
Justin Clark-Casey (justincc) 82ad9d4e04 Remove monocov and other obsolete nant build targets.
monocov was a code coverage attempt 3 years ago which no longer works.
other removed targets have been commented out or unused for a very long time
2012-01-16 22:58:58 +00:00
Diva Canto 7b84942f86 HG landing points: this hopefully fixes some confusion that was making HG avies always land in 0,0 2012-01-10 11:10:47 -08:00
BlueWall 707c8c6f2b Add some run-time debugging support
Add configuration option - DEBUG to enable debugging methods. This is temporary for helping users testing teleport routing be able to report back the data with the test cases. We can remove when finished with this, or leave it if it proves to be useful.

	Users: set DEBUG = true in OpenSim.ini to get more information from teleport routing. The default is false. It presently prints the TeleportFlags value.
2012-01-09 18:19:55 -05:00
BlueWall b3a12167d6 Use our TeleportFlags
Switch to our TeleportFlags enum instead of LibOMV because we need to define a type for HG Logins. Also moved some debugging in ScenePresence into a function to make it simpler to enable/disable.
2012-01-09 17:54:35 -05:00
BlueWall 95345521f0 TP Routing debug
Fix test to checking against bitfield instead of int
2012-01-09 17:04:34 -05:00
BlueWall 3640afdd95 Fix teleport routing for incoming HG+Owner
Incoming HG owner/estate manager, etc. is routed according to the rules defined for teleports within the local grid. Left some commented debugging code inside so we can test other cases. Will remove when tings are settled in.
2012-01-09 14:31:22 -05:00
BlueWall 43145c7f67 Debugging HG teleport routing
Add some temporary debugging to the teleport routing to get a better view of what happens when HG jumps are made.
2012-01-09 13:07:02 -05:00
BlueWall 34c42cdab0 Fix HG teleport routing
Needed to breakout the ViaHGLogin check to it's own section. For some reason it would not factor in when combined with the other teleport flag types.
2012-01-09 01:37:28 -05:00
Melanie 0e855fea7c Fix a build break 2012-01-09 01:05:19 +00:00