Commit Graph

795 Commits (e506341fdb9f3b6996d3c97de007f2b142fcddd3)

Author SHA1 Message Date
Justin Clark-Casey (justincc) 27abe040bd Stop exceptions being generated on agent connection if a telehub object has been deleted or has no spawn points. 2014-01-20 19:37:50 +00:00
Justin Clark-Casey (justincc) 5a6ad028e3 refactor: Rename Scene.AddNewClient() to AddNewAgent() to make it obvious in the code that this is symmetric with CloseAgent() 2013-09-27 22:29:16 +01:00
Justin Clark-Casey (justincc) e6c0267def refactor: rename Scene.IncomingCloseAgent() to CloseAgent() in order to make it clear that all non-clientstack callers should be using this rather than RemoveClient() in order to step through the ScenePresence state machine properly.
Adds IScene.CloseAgent() to replace RemoveClient()
2013-09-27 22:29:10 +01:00
Justin Clark-Casey (justincc) 0114c8bd15 Reinsert client.SceneAgent checks into LLUDPServer.HandleCompleteMovementIntoRegion() to fix race condition regression in commit 7dbc93c (Wed Sep 18 21:41:51 2013 +0100)
This check is necessary to close a race condition where the CompleteAgentMovement processing could proceed when the UseCircuitCode thread had added the client to the client manager but before the ScenePresence had registered to process the CompleteAgentMovement message.
This is most probably why the message appeared to get lost on a proportion of entity transfers.
A better long term solution may be to set the IClientAPI.SceneAgent property before the client is added to the manager.
2013-09-26 20:11:05 +01:00
Justin Clark-Casey (justincc) 914a92335a Change some message log levels in Scene.IncomingUpdateChildAgent() for debugging purposes 2013-09-26 20:09:21 +01:00
Justin Clark-Casey (justincc) 5dabecf95d Revert "Also check user authorization if looking to upgrade from a child to a root agent."
This reverts commit c7ded0618c.
This proves not to be necessary - the necessary checks are already being done via QueryAccess() before cross or teleport
2013-09-26 20:07:02 +01:00
Justin Clark-Casey (justincc) 689f79fead Create regression TestCrossOnSameSimulatorNoRootDestPerm() to check that avatars are not allowed to cross into a neighbour where they are not authorized, even if a child agent was allowed. 2013-09-26 20:06:57 +01:00
Justin Clark-Casey (justincc) d1d4dd547a refactor: rename *ChildAgentDataUpdate() methods to *UpdateChildAgent()
verb-noun is consistent with other similar methods
2013-09-26 20:06:38 +01:00
Justin Clark-Casey (justincc) 1a55309ea7 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-26 20:06:32 +01:00
Diva Canto e2b7d941b6 Restore group membership check for HG users in QueryAccess. 2013-09-05 07:48:10 -07:00
Justin Clark-Casey (justincc) 62b12783df Fix bug where users teleporting to non-neighbour regions could continue to hear chat from their source region for some time after teleport completion.
This occurs on v2 teleport since the source region now waits 15 secs before closing the old child agent, which could still receive chat.
This commit introduces a ScenePresenceState.PreClose which is set before the wait, so that ChatModule can check for ScenePresenceState.Running.
This was theoretically also an issue on v1 teleport but since the pause before close was only 2 secs there, it was not noticed.
2013-09-02 19:21:53 +01:00
Justin Clark-Casey (justincc) 935888d6da Comment out warning about agent updating without valid session ID for now.
This causes extreme console spam if a simulator running latest master and one running 0.7.5 have adjacent regions occupied by avatars.
2013-09-02 17:47:04 +01:00
Justin Clark-Casey (justincc) 2e7f7c41a7 Also check user authorization if looking to upgrade from a child to a root agent.
Relevant if a child agent has been allowed into the region which should not be upgraded to a root agent.
2013-08-27 00:35:33 +01:00
Diva Canto ed0ffae151 Potential fix for access control bug on login introduced with SeeIntoRegion commit. 2013-08-26 20:28:52 +01:00
Justin Clark-Casey (justincc) ea5bab5107 For a Hypergrid user, delay estate access checks until NewUserConnection() so that they work.
This is necessary because the hypergrid groups checks (as referenced by estates) require an agent circuit to be present to construct the hypergrid ID.
However, this is not around until Scene.NewUserConnection(), as called by CreateAgent() in EntityTransferModule.
Therefore, if we're dealing with a hypergrid user, delay the check until NewUserConnection()/CreateAgent()
The entity transfer impact should be minimal since CreateAgent() is the next significant call after NewUserConnection()
However, to preserve the accuracy of query access we will only relax the check for HG users.
2013-08-26 20:04:07 +01:00
Justin Clark-Casey (justincc) 416bbe9583 Stop error messages being misleadingly generated when on client connection activity timeout, a root connection triggers a CloseAgent to a neighbour region which has already closed the agent due to inactivity.
Also separates out log messages to distinguish between close not finding an agent and wrong auth token, and downgrades former to debug and latter to warn
2013-08-22 22:46:40 +01:00
Justin Clark-Casey (justincc) 3f8d79024b Rely on the Scene.IncomingCloseAgent() check as to whether the connection should be kept open after teleport-end rather than doing this in the ET Module
This is safer since the close check in IncomingCloseAgent() is done under lock conditions, which prevents a race between ETM and Scene.AddClient()
2013-08-15 14:07:57 +01:00
Justin Clark-Casey (justincc) 2231fcf5b4 Do not use the SP.DoNotCloseAfterTeleport flag for child agent connections.
This approach has problems if a client quits without sending a proper logout but then reconnects before the connection is closed due to inactivity.
In this case, the DoNotCloseAfterTeleport was wrongly set.
The simplest approach is to close child agents on teleport as quickly as possible so that races are very unlikely to occur
Hence, this code now closes child agents as the first action after a sucessful teleport.
2013-08-15 13:46:46 +01:00
Justin Clark-Casey (justincc) fd519748e9 Add method doc to Scene.RemoveClient() to ask any callers to use Scene.IncomingCloseAgent() instead.
IncomingCloseAgent() now sets the scene presence state machine properly, which is necessary to avoid races between multiple sources of close.
Hence, it's also necessary for everyone to consistently call IncomingCloseAgent()
Calling RemoveClient() directly is currently generating an attention-grabbing exception though this right now this is harmless.
2013-08-14 19:36:52 +01:00
Justin Clark-Casey (justincc) 97bcb59bee Merge branch 'TeleportWork' 2013-08-09 17:52:29 +01:00
Diva Canto 2cdcf62b48 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2013-08-09 08:31:30 -07:00
Diva Canto 7e01213bf2 Go easy on enforcing session ids in position updates 2013-08-09 08:31:15 -07:00
Justin Clark-Casey (justincc) 99bce9d877 Fix an issue with an A->C->B->A teleport where these regions are in a row (A,B,C) where the A root agent is still closed, terminating the connection.
This was occuring because teleport to B did not set DoNotCloseAfterTeleport on A as it was a neighbour (where it isn't set to avoid the issue where the source region doesn't send Close() to regions that are still neighbours (hence not resetting DoNotCloseAfterTeleport).
Fix here is to still set DoNotCloseAfterTeleport if scene presence is still registered as in transit from A
2013-08-09 00:24:22 +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
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 3194ffdab8 Fixed incomplete commit r/23317 -- see_into_region. Put the guard around estate bans also, and delete the obsolete config var. 2013-08-07 08:01:59 -07:00
Diva Canto dd2c211e62 Comment debug message 2013-07-26 07:40:55 -07:00
Diva Canto 878ce1e6b2 This should fix all issues with teleports. One should be able to TP as fast as needed. (Although sometimes Justin's state machine kicks in and doesn't let you) The EventQueues are a hairy mess, and it's very easy to mess things up. But it looks like this commit makes them work right. Here's what's going on:
- Child and root agents are only closed after 15 sec, maybe
- If the user comes back, they aren't closed, and everything is reused
- On the receiving side, clients and scene presences are reused if they already exist
- Caps are always recreated (this is where I spent most of my time!). It turns out that, because the agents carry the seeds around, the seed gets the same URL, except for the root agent coming back to a far away region, which gets a new seed (because we don't know what was its seed in the departing region, and we can't send it back to the client when the agent returns there).
2013-07-25 23:44:58 -07: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 14530b2607 Minor adjustment on timings of waits. 2013-07-24 14:29:37 -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 aae29c0ee2 Further tweaks on TPs: not sending the callback URL and instead waiting 15sec before closing the agent. This seems to be working fairly well. The viewer seems to have an 8 sec delay between UseCircuitCode and CompleteMovement.
Also added back the position on UpdateAgent, because it's needed for TPing between neighboring regions.
2013-07-24 14:27:37 -07:00
Diva Canto 00d4a26eef Amend previous commit. 2013-07-24 12:49:30 -07:00
Diva Canto e103e34f1d Added config var that we all thought was already there: see_into_region. (Note: different from the defunct see_into_neighboring_sim, which used to control the process from the other end). This enables child agents in neighbors for which the root agent doesn't have permission to be in. 2013-07-24 11:25:41 -07:00
Diva Canto c8dcb8474d Let's go easy on authenticating ChildAgentUpdates, otherwise this will be chaotic while ppl are using different versions of opensim. Warning only, but no enforcement. 2013-07-14 10:26:05 -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 e4f741f006 This should fix the failing test. 2013-07-13 22:52:51 -07:00
Diva Canto a2ee887c6d Deleted a line too many 2013-07-13 22:32:52 -07:00
Diva Canto b4f1b9acf6 Guard against unauthorized agent deletes. 2013-07-13 21:28:46 -07:00
Diva Canto 67e500383e Put guards on a bunch of exception-inducing code, as seen in logs from load test. 2013-07-09 14:12:52 -07:00
Diva Canto 8265a88c4a Throttle the viewer's requests for region handles. Apparently Kokua is requesting this for all landmarks in inventory. Not sure why. But this seems to be the root cause of the login freeze mentioned before. This commit adds a blocking queue / process thread pattern. 2013-07-04 14:51:18 -07:00
Diva Canto da3aa44138 Debug the RegionHandle handler (same issue) 2013-07-04 13:27:53 -07: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
Robert Adams 439f11cc3c Add region heartbeat start event to complement heartbeat end event.
This allows object modification before the usual heartbeat operation.
2013-05-30 19:16:31 -07:00
Justin Clark-Casey (justincc) cc7aa88b26 Try caching the user name for a new agent earlier on in the process of establishing a connection, to see if this helps with "Unknown UserUMMTGUN" issues.
The UMMTGUN form of Unknown User seems to appear because a viewer sometimes sends a UUIDNameRequest UDP request that fails to find a binding.
However, in theory the incoming agent should have made that binding before any such request is triggered.
So moving this binding to an earlier point in the process to see if this makes a difference.
Unknown user name is also updated to UserUMMTGUN2 - if you see the old name then you need to clear your viewer cache.
This relates to http://opensimulator.org/mantis/view.php?id=6625
2013-05-29 23:08:54 +01: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
Justin Clark-Casey (justincc) bd31821792 On logout, send close child agent requests to neighbours asynchronously, so user is not prevented from relogging if many neighbours are present but not responsive.
The symptom here is that previous user connections are still present but are labelled active == false
2013-05-16 16:37:21 +01:00
Diva Canto a4431381fa Finalize the logic for SetHome. See comments in Land/LandManagementModule.cs about who has permission to set home where. 2013-05-11 07:58:14 -07:00