Exemplo n.º 1
0
        /// <summary>
        /// Delegate used to let authentication modules authenticate the user name and password.
        /// </summary>
        /// <param name="realm">Realm that the user want to authenticate in</param>
        /// <param name="userName">User name specified by client</param>
        /// <param name="password">Password supplied by the delegate</param>
        /// <param name="login">object that will be stored in a session variable called <see cref="AuthModule.AuthenticationTag"/> if authentication was successful.</param>
        /// <exception cref="ForbiddenException">throw forbidden exception if too many attempts have been made.</exception>
        private void OnAuthenticate(string realm, string userName, ref string password, out object login)
        {
            // digest authentication encrypts password which means that
            // we need to provide the authenticator with a stored password.

            // you should really query a DB or something
            if (userName == "arne")
            {
                password = "******";

                // login can be fetched from IHttpSession in all modules
                login = new User(1, "arne");
            }
            else
            {
                password = string.Empty;
                login = null;
            }
        }
Exemplo n.º 2
0
        private void GetInventory(User user, ref LindenLoginData response)
        {
            Hashtable folderData;

            if (m_inventoryClient != null)
            {
                InventorySkeleton skeleton;
                if (m_inventoryClient.TryGetInventorySkeleton(user.ID, out skeleton))
                {
                    response.InventoryRoot = skeleton.RootFolderID;
                    response.AgentInventory = FillInventorySkeleton(skeleton.Skeleton);

                    response.InventoryLibRoot = skeleton.LibraryFolderID;
                    response.InventoryLibraryOwner = skeleton.LibraryOwner;
                    response.InventoryLibrary = FillInventorySkeleton(skeleton.LibrarySkeleton);

                    response.SetInitialOutfit("Default Outfit", false);
                    return;
                }
                else
                {
                    m_log.Error("Failed to fetch inventory for " + user.Name + ", returning a temporary root folder");
                }
            }

            m_log.Info("Returning a random root folder ID so login will succeed");

            response.InventoryRoot = UUID.Random();
            response.AgentInventory = new ArrayList(1);

            folderData = new Hashtable();
            folderData["name"] = "My Inventory";
            folderData["parent_id"] = UUID.Zero.ToString();
            folderData["type_default"] = (int)AssetType.Folder;
            folderData["folder_id"] = response.InventoryRoot.ToString();
            folderData["version"] = 1;

            response.AgentInventory.Add(folderData);

            response.SetInitialOutfit("Default Outfit", false);
        }
Exemplo n.º 3
0
 private void SetActiveGestures(User user, ref LindenLoginData response)
 {
     // TODO: Pull this information out of user.ExtraData
     //response.ActiveGestures
 }
Exemplo n.º 4
0
        private void FillOutRezAgentResponse(User user, Uri seedCapability, Vector3 startPosition, Vector3 lookAt, ref OSDMap responseMap)
        {
            IPAddress externalAddress = m_lludp.MasqueradeAddress ?? m_lludp.Address;
            uint regionX, regionY;
            GetRegionXY(m_scene.MinPosition, out regionX, out regionY);

            responseMap["connect"] = OSD.FromBoolean(true);
            responseMap["agent_id"] = OSD.FromUUID(user.ID);
            responseMap["sim_host"] = OSD.FromString(externalAddress.ToString());
            responseMap["sim_port"] = OSD.FromInteger(m_lludp.Port);
            responseMap["region_seed_capability"] = OSD.FromUri(seedCapability);
            responseMap["position"] = OSD.FromVector3(startPosition);
            responseMap["look_at"] = OSD.FromVector3(lookAt);

            // Region information
            responseMap["region_id"] = OSD.FromUUID(m_scene.ID);
            responseMap["region_x"] = OSD.FromInteger(regionX);
            responseMap["region_y"] = OSD.FromInteger(regionY);
        }