Add ToOSDMap() overrides to the Stat subclass CounterStat.
Add a GetStatsAsOSDMap method to StatsManager which allows the filtered
fetching of stats for eventual returning over the internets.
In co-op termination, extend EventWaitHandle to give this an indefinite lifetime in order to avoid a later RemotingException if scripts are being loaded into their own domains.

This is necessary because XEngineScriptBase now retains a reference to an EventWaitHandle when co-op termination is active.
Aims to address http://opensimulator.org/mantis/view.php?id=6634
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Reinsert PhysicsActor variable back into SOP.SubscribeForCollisionEvents() in order to avoid a race condition.

A separate PhysicsActor variable is used in case some other thread removes the PhysicsActor whilst this code is executing.
If this is now impossible please revert - just adding this now whilst I remember.
Also makes method comment into proper method doc.
Added UploadBakedTexture/UploadBakedTextureServerConnector, so that this can eventually be served by a robust instance. NOT FINISHED YET.
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.
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Same issue as previous commit.
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!
Trying to reduce CPU usage on logins and TPs: trying radical elimination of all FireAndForgets throughout CompleteMovement. There were 4.
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 682537738008746f0aca22954902f3a4dfbdc95f.
Some more debug to see how many threads are available.
Gatekeeper: stop bogus agents earlier, here at the Gatekeeper. No need to bother the sim.
Deleted GET agent all around. Not used.
Guard against unauthorized agent deletes.
Deleted a line too many
This should fix the failing test.
And this fixes the other failing tests. Justin, the thread pool is not being initialized in the tests!
Change the auth token to be the user's sessionid.
Authenticate ChildAgentUpdate too.