public void LoginTo(UserAccount account, ClientInfo clientInfo, SessionInfo sessionInfo, DestinationInfo destinationInfo, CircuitInfo circuitInfo, AppearanceInfo appearance, TeleportFlags flags, out string seedCapsURI)
        {
            if (!destinationInfo.LocalToGrid)
            {
                throw new NotSupportedException("Remote login not supported");
            }

            string lastMessage = string.Empty;

            if (destinationInfo.ID != UUID.Zero)
            {
                /* try specified destination first */
                destinationInfo.TeleportFlags = flags | TeleportFlags.ViaLogin;
                try
                {
                    QueryAccess(destinationInfo, account, destinationInfo.Position);
                    PostAgent_Local(account, clientInfo, sessionInfo, destinationInfo, circuitInfo, appearance, UUID.Random, (int)WearableType.NumWearables, out seedCapsURI);
                    return;
                }
                catch (Exception e)
                {
                    m_Log.Debug(string.Format("Failed to login {0} {1} to original destination {2} ({3})", account.Principal.FirstName, account.Principal.LastName, destinationInfo.Name, destinationInfo.ID), e);
                    lastMessage = e.Message;
                }
            }

            foreach (RegionInfo fallbackRegion in m_GridService.GetFallbackRegions())
            {
                destinationInfo.UpdateFromRegion(fallbackRegion);
                destinationInfo.StartLocation = "safe";
                destinationInfo.Position      = new Vector3(128, 128, 23);
                destinationInfo.LookAt        = Vector3.UnitX;
                destinationInfo.TeleportFlags = flags | TeleportFlags.ViaRegionID;

                try
                {
                    QueryAccess(destinationInfo, account, destinationInfo.Position);
                    PostAgent_Local(account, clientInfo, sessionInfo, destinationInfo, circuitInfo, appearance, UUID.Random, (int)WearableType.NumWearables, out seedCapsURI);
                    return;
                }
                catch (Exception e)
                {
                    m_Log.Debug(string.Format("Failed to login {0} {1} to fallback destination {2} ({3})", account.Principal.FirstName, account.Principal.LastName, destinationInfo.Name, destinationInfo.ID), e);
                    if (string.IsNullOrEmpty(lastMessage))
                    {
                        lastMessage = e.Message;
                    }
                }
            }
            throw new LoginFailedException("No suitable destination found");
        }
示例#2
0
        private void HandleMapServerGetFallbackRegions(HttpRequest req, Map jsondata)
        {
            List <RegionInfo> regions;

            try
            {
                regions = m_GridService.GetFallbackRegions();
            }
            catch
            {
                m_WebIF.ErrorResponse(req, AdminWebIfErrorResult.NotPossible);
                return;
            }
            ReturnRegionsResult(req, regions);
        }