Commit Graph

713 Commits (8b267b5bb547b807dd3cb6cd83ea03bd101e19ff)

Author SHA1 Message Date
Justin Clark-Casey (justincc) 377b79bafc Move conditionals which control whether a task is placed in the JobEngine inside Watchdog.RunJob() (renamed from RunWhenPossible) and generalize them. 2014-11-21 01:08:58 +00:00
Justin Clark-Casey (justincc) 3372210c46 Label all threadpool calls being made in core OpenSimulator. This is to add problem diagnosis.
"show threadpool calls" now also returns named (labelled), anonymous (unlabelled) and total call stats.
2014-11-04 00:55:48 +00:00
Justin Clark-Casey (justincc) b9b2f5686f If JobEngine is active, then use it to copy/rez attachments for an avatar entering the scene that isn't initially logging on. This will execute tasks consecutively rather than concurrently.
This has two aims
1) Reduce initial teleport failures when a foreign Hypergrid user enters a region by not holding up the teleport for attachment rez (this can be particularly costly when HG gets all assets in the object graph.
2) Reduce server load that may impact other simulator activities.
This complements existing JobEngine options that perform initial login attachment rez and appearance send in consecutive tasks.
2014-10-14 16:57:58 +01:00
Justin Clark-Casey (justincc) a6c79fe956 Fix regression from recent a02dae5 where stand positions are no longer correct when a sit target is specified.
Adjusts stand position using just avatar position relative to the root prim instead.
Fixes http://opensimulator.org/mantis/view.php?id=7315 and preserves previous fix for http://opensimulator.org/mantis/view.php?id=7299
2014-09-23 17:27:13 +01:00
Justin Clark-Casey (justincc) 0b7736b861 Temporarily add root agent rez attachments work to job engine if it is running rather than as a fire and forget.
Experiment to see if serializing attachment rez and send initial data jobs improves other parts of sim performance.
2014-09-09 18:26:41 +01:00
Justin Clark-Casey (justincc) a086adf427 Add experimental job engine to see if queueing some existing async work during root agent entry to a region improves perf rather than always attempting to execute everything concurrently
Job engine is controlled via "debug jobengine start|stop|status".
Can only currently be enabled and disabled dynamically at runtime.
Currently only applies to code sending initial region data (objects, other avatar data) to a client.
2014-09-09 18:14:56 +01:00
Justin Clark-Casey (justincc) 41f2f3132b For monitoring purposes, start non-timeout tasks (which do not currently use a threadpool) via Watchdog.RunInThread() rather than Util.RunThreadNoTimeout()
The functionality is the same but this allow us to monitor such tasks via "show threads" and abort them for test purposes, etc.
Also extends thread names to provide more info (e.g. SendInitialDataToClient says what client the task is for).
2014-09-05 23:20:59 +01:00
Justin Clark-Casey (justincc) ac866a1c46 Add [EntityTransfer] AllowAvatarCrossing setting to determine whether avatars are allowed to cross regions at all.
Defaults to true.  For test purposes.
2014-09-03 00:25:56 +01:00
Justin Clark-Casey (justincc) d582db6132 Fix recent regression from 473c5594 where camera started to judder on moving vehicles.
Other parts of OpenSimulator are relying on SP.Velocity == 0 for vehicles.
So add and use SP.GetWorldVelocity() instead when we need vehicle velocity, along the same lines as existing SP.GetWorldRotation()
2014-09-02 23:39:52 +01:00
Justin Clark-Casey (justincc) 473c559478 As per the LL grid, if an avatar is sitting then return it's velocity relative to the region rather than relative to its seat.
Resolves http://opensimulator.org/mantis/view.php?id=7175
2014-08-30 01:09:33 +01:00
Justin Clark-Casey (justincc) a02dae566c Fix issue where moving a seated avatar would not adjust their subsequent stand position.
Addresses http://opensimulator.org/mantis/view.php?id=7299
2014-08-30 00:26:18 +01:00
Justin Clark-Casey (justincc) e0c6bfa81e If a user moves back in sight of a child region before the agent has been closed on teleport, don't unnecessarily resend all avatar and object data about that region. 2014-08-15 21:47:34 +01:00
Justin Clark-Casey (justincc) 91e1aaa5d4 On teleport to a region that already has a child agent established (e.g. a neighbour) don't resend all the initial avatar and object data again.
This is unnecessary since it has been received (and data continues to be received) in the existing child connection.
2014-08-15 21:47:34 +01:00
Justin Clark-Casey (justincc) bc0895c758 On entity transfer of scene presence, replace polling sleep in SP.WaitForUpdateAgent() with a triggered event instead.
Rapid polls are more expensive than triggered events (several polls vs one trigger) and may be problematic on heavily loaded simulators where many threads are vying for processor time.
A triggered event is also slightly quicker as there is no maximum 200ms wait between polls.
2014-08-13 23:45:51 +01:00
Justin Clark-Casey (justincc) 0d2a25b477 Remove redundant origin region lock in SP.CompleteMovement()
This is already going to be correctly set by WaitForUpdateAgent() earlier on in that method, which is always called where a callback to the originating region is required.
2014-08-13 23:11:32 +01:00
Justin Clark-Casey (justincc) 961cb9cc77 refactor: Rename recent new Client*UpdateTolerance to Root*UpdateTolerance for better accuracy and consistency with other similar parameters 2014-08-06 00:35:26 +01:00
Justin Clark-Casey (justincc) fcf5fb5dfd Implement "scene debug set root-upd-per" for dropping 1 in N root agent updates except to originator
For experimental purposes.
Also corrects a previous bug where each terse update sent was counted rather than each set of terse updates to agents.
2014-07-29 18:54:16 +01:00
Justin Clark-Casey (justincc) 0f87a99e54 Add debug mechanism for only sending 1 in N AgentUpdate packets to child agents.
Allows experiments in manually reducing updates under heavy load.
Activated by "debug scene set client-upd-per" console command.
In a simple test, can send as few as every 4th update before observed movement starts becoming disturbingly rubber-banded.
2014-07-29 18:09:11 +01:00
Justin Clark-Casey (justincc) f54fccba1e Make it possible to change avatar position update, rotation and velocity tolerances on the fly.
This is done via "debug scene set client-pos-upd, client-rot-upd, client-vel-upd".
For testing purposes.
2014-07-29 03:13:10 +01:00
Oren Hurvitz 899bcb7acd Fixed: after a Hypergrid teleport, attachments often either disappear, or appear both on the avatar AND as in-world objects.
Another manifestation of this bug is that after a Hypergrid teleport, when you click on one of the avatar's attachments the object doesn't show its name. This means that the viewer knows the attachment is there, but the simulator does not.

The problem was caused by treating Hypergrid teleports as if they're Logins (because the teleport flag ViaLogin is enabled).

This may fix: http://opensimulator.org/mantis/view.php?id=7238
This may fix: http://opensimulator.org/mantis/view.php?id=7220
2014-07-21 09:29:51 +01:00
Oren Hurvitz 4c5d7d4683 Fixed problems if an avatar tries to cross regions when the previous cross hasn't completed yet
This caused the client to stop responding, and even the simulators to have problems. The solution is to disallow crossing before the previous cross has completed.
2014-07-21 09:23:13 +01:00
Diva Canto d99c8e68a7 It turns out that child agent management has had a bug for a while: there was an inconsistency in the scope between opening and closing child agents in neighboring regions. For opening (in EnableChildAgents), the region's DrawDistance was being used; for closing (in IsOUtsideView) , the viewer's (SP) DrawDistance was being used. This fixes this inconsistency, therefore eliminating bugs observed in TPs between, at least, neighboring varregions. 2014-07-04 10:13:53 -07:00
Diva Canto 807fb8339b Revert "Let HG users be gods too, if they have local permission to be so."
HG gods are not safe at this point. It's better to disallow this until
they can be made safe.

This reverts commit e86c765be3.
2014-06-09 22:00:10 -07:00
Diva Canto e86c765be3 Let HG users be gods too, if they have local permission to be so. 2014-06-09 21:46:24 -07:00
Robert Adams 22dade6463 varregion: More tweeking to only sending patches within avatar draw distance.
Still has problems with child avatars.
2014-05-31 12:19:50 -07:00
Justin Clark-Casey (justincc) bf5320eb26 minor: rename velocidyDiff -> velocityDiff 2014-05-30 22:21:13 +01:00
Justin Clark-Casey (justincc) 3c992b028c minor: Add some commented out logging to ScenePresence.SendTerseUpdateToAllClients() which is extremely helpful when investigating presence update triggers. 2014-05-30 22:18:07 +01:00
Justin Clark-Casey (justincc) 5015b0b485 If one is sitting on a child with an unset camera-eye and so using one set in a root prim, the focus should remain on the root prim.
Matches behaviour just tested on the Linden grid.
2014-05-23 01:55:05 +01:00
Justin Clark-Casey (justincc) c78a8271c4 Add any camera at compensation for sat upon child prims to any existing camera-at value, rather than replace. 2014-05-23 01:38:05 +01:00
Justin Clark-Casey (justincc) fbed245596 Compensate camera-at and camera-eye for child prim rotation when sitting on child prim with camera-eye set 2014-05-23 01:34:02 +01:00
Justin Clark-Casey (justincc) 3fbaef9275 If the root prim has a camera-at or camera-eye setting and a sat upon child prim does not, use the root prim offsets.
This matches behaviour just tested on the Linden Lab grid.
2014-05-22 23:52:28 +01:00
Justin Clark-Casey (justincc) 16bf38e1ab Fix issue where llSetCameraAtOffset() and llSetCameraEyeOffset() in non-root prims moved camera/focus to wrong position.
For non-root prim, eye offsets now need to be made relative to root prim if either camera-at or camera-eye are set.
Probably a regression since November 2013 when all sits were made relative to root prim to match viewer expections (and fix other bugs).
Addresses http://opensimulator.org/mantis/view.php?id=7176
2014-05-22 23:39:22 +01:00
Justin Clark-Casey (justincc) d93275745b minor: Remove some unused fields in ScenePresence 2014-05-20 23:57:03 +01:00
Justin Clark-Casey (justincc) 9479f64778 Fix issue where avatar and script chat could sometimes be heard from anywhere in neighbouring regions.
This was due to a silent uint overflow in ScenePresence.UpdateChildAgent() corrupting child agent positions
when the child agent was in a region with a greater x or y map co-ord than the root agent region
Probably introduced in beeec1c.
This still will not function properly with very high region map co-ords (in the millions) but other parts of the code don't handle this properly anyway.
Looks to address http://opensimulator.org/mantis/view.php?id=7163
2014-05-20 23:52:07 +01:00
Justin Clark-Casey (justincc) 7c12dfe185 On ScenePresence.MakeChildAgent(), reset the m_originRegionID as this is currently being used as a flag to orchestrate destination simulator threads on teleport.
If not reset, it's possible that teleports back and forth between simulators may not restart scripts in attachments.
2014-05-14 22:08:06 +01:00
Justin Clark-Casey (justincc) 2f7539a25b Remove a race where the client's SP.CompleteMovement() thread could attempt to restart attachment scripts before the source simulator's SP.UpdateAgent() thread had added them.
This commit changes the order of code so that attachments are re-added before the CompleteMovement() thread is released.
Relates to http://opensimulator.org/mantis/view.php?id=7148
2014-05-14 21:49:29 +01:00
Justin Clark-Casey (justincc) 5fc61942e0 minor: convert back some tabs to spaces that got into ScenePresence via recent patch bc969a6b 2014-04-29 20:15:29 +01:00
Justin Clark-Casey (justincc) d4eee213a9 Restore terrain height and flying adjustments that were eliminated from non-megaregion paths in ScenePresence.MoveToTarget() by recent patch bc969a6b 2014-04-29 20:05:08 +01:00
Justin Clark-Casey (justincc) 328bc3b76e Adjust avatar sit positioning on a target to pretty much exactly match that of the LL grid.
This uses an offset of 0.05 on the up vector of the sit orientation, after extensive analysis on
http://opensimulator.org/mantis/view.php?id=7096 and https://wiki.secondlife.com/wiki/Talk:LlSitTarget
This supersedes the previous adjustment in 5b73b9c4 which had been wrongly applied.
The maximum change is about 0.1 with a maximum height avatar.
This patch is all Aleric's work - I am applying manually in order to add these additional notes
2014-04-23 19:19:09 +01:00
Oren Hurvitz 998d7009a6 Eliminated many warnings 2014-04-23 16:37:36 +03:00
lillith_xue bc969a6b46 Possible solution for #7120 and #7051
Signed-off-by: Robert Adams <misterblue@misterblue.com>
2014-04-21 05:58:29 -07:00
Oren Hurvitz c725ad1577 Fixed: when teleporting between grids, the avatar name wasn't always updated.
When an avatar is in their home grid, their name appears as "First Last". In other grids the name appears as "First.Last @grid.example.com". However, viewers have a bug and they don't always show the new name. We use a trick (changing the Group Title briefly) in order to make the viewers show the new name. This is only done after a Hypergrid teleport.
2014-04-09 15:00:54 +01:00
Justin Clark-Casey (justincc) cacbb5c165 Don't re-retrieve sit part in SP.HandleAgentSit() when we already have it (this time with the right code change) 2014-04-05 02:16:14 +01:00
Justin Clark-Casey (justincc) aec723b955 Fix sp.AbsolutePosition when agent is sitting on a child prim, which in turns fixes llDetectedPos(), llGetLinkPrimitiveParams() and similar functions.
Add regression test for this case.
In relation to http://opensimulator.org/mantis/view.php?id=7043
2014-04-03 23:22:57 +01:00
Robert Adams 9406db3047 Fix problem with floating avatar by passing avatar size information
to the physics engine.

This operation was accidentally removed while in the middle of improving
the computation of the avatar height. This is a temp fix until the real
solution is added.
2014-04-02 21:52:24 -07:00
Justin Clark-Casey (justincc) e756457703 Remove redundant part.SitTargetAvatar setting from SP.MakeRootAgent as part.AddSittingAvatar already does this. 2014-04-03 01:21:50 +01:00
Justin Clark-Casey (justincc) 6ac9c9c972 refactor: Use m_sittingAvatars to maintain the list of sitting avatars instead of two independent structures that do exactly the same thing
m_sittingAvatars code also already properly handles locking to avoid races.
2014-04-03 01:14:39 +01:00
Justin Clark-Casey (justincc) e6d0dcd4e8 Fix bug where crossing to a neighbouring region and back again would trigger an exception, and a second recross would stop the user moving until relog
Also fixes an issue where sitting avatar counts became inaccurate after any cross.
Part of the problem was due to cloning code using MemberwiseClone() but not resetting certain collection structures.
Adds regression test for this case.
In relation to http://opensimulator.org/mantis/view.php?id=7050
2014-04-03 00:19:53 +01:00
Oren Hurvitz e131e73652 Run slow operations in a separate thread, instead of using FireAndForget (which has a 1-minute timeout)
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:55 +01:00
Oren Hurvitz 921f0052f4 Get the full viewer name even if it's (incorrectly) sent in the 'Channel' field
Recent versions of Firestorm and Singularity have started sending the viewer name in the 'Channel' field, leaving only their version number in the 'Viewer' field. So we need to search both of these fields for the viewer name.

This resolves http://opensimulator.org/mantis/view.php?id=6952
2014-03-24 12:26:52 +01:00