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.
This is to avoid excessive and inconsistent delays between behaviours that currently need to embed sleeps in other actions (e.g. physics) and other behaviours.
Might need a more sophisticated approach in the long term.
This is not guaranteed to be accurate since users may be left "online" in certain situations.
For example, if a simulator crashes and they never login/logout again.
To counter this somewhat, only users continuously online for less than 5 days are shown.
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.
This requires a new GridService.GetDefaultHypergridRegions() so ROBUST services require updating but not simulators.
This method still returns regions flagged with just DefaultRegion after any DefaultHGRegions, so if no DefaultHGRegions are specified
then existing configured defaults will still work.
Immediate use is for conference where we need to be able to specify different defaults
However, this is also generally useful to send experienced HG users to one default location and local users whose specified region fails (e.g. no "home" or "last") to another.
If the port is specified it is added but a ":0" is not added if the port is zero.
This enables the hypergrid address short form "hypergridGateway:regionName"
which is handled by the parser but failed because of this zero port addition.
This is very similar to my earlier revert in bcb8605f84 and fails for the same reasons.
Reverting this change because it causes a problem if access is denied to the user.
This reverts commit c7a8afbb8d.
Fallback doesn't work at this level as the change of destination isn't communicated to the source region/viewer
Reverting because this introduces a bug when access does fail.
More detail in revert of main commit.
This reverts commit ec32c1d4b6.
This exception was very likely harmless since it occurred after the restart had taken place, but still misleading.
Thanks to SCGreyWolf for the code change suggestion in http://opensimulator.org/mantis/view.php?id=6747, though I did this in a slightly different way.
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