OpenSim.Services.Connectors.UserAccountServicesConnector.GetUserAccount C# (CSharp) Method

GetUserAccount() public method

public GetUserAccount ( UUID scopeID, UUID userID ) : UserAccount
scopeID UUID
userID UUID
return OpenSim.Services.Interfaces.UserAccount
        public virtual UserAccount GetUserAccount(UUID scopeID, UUID userID)
        {
            //m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUserAccount {0}", userID);
            Dictionary<string, object> sendData = new Dictionary<string, object>();
            //sendData["SCOPEID"] = scopeID.ToString();
            sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
            sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
            sendData["METHOD"] = "getaccount";

            sendData["ScopeID"] = scopeID;
            sendData["UserID"] = userID.ToString();

            return SendAndGetReply(sendData);
        }

Same methods

UserAccountServicesConnector::GetUserAccount ( UUID scopeID, string email ) : UserAccount
UserAccountServicesConnector::GetUserAccount ( UUID scopeID, string firstName, string lastName ) : UserAccount

Usage Example

Exemplo n.º 1
0
        public void UserAccounts_001()
        {
            UserAccountServicesConnector m_Connector = new UserAccountServicesConnector(DemonServer.Address);

            string first = "Completely";
            string last = "Clueless";
            string email = "*****@*****.**";

            UserAccount account = m_Connector.CreateUser(first, last, "123", email, UUID.Zero);
            Assert.IsNotNull(account, "Failed to create account " + first + " " + last);
            UUID user1 = account.PrincipalID;

            account = m_Connector.GetUserAccount(UUID.Zero, user1);
            Assert.NotNull(account, "Failed to retrieve account for user id " + user1);
            Assert.AreEqual(account.FirstName, first, "First name does not match");
            Assert.AreEqual(account.LastName, last, "Last name does not match");

            account = m_Connector.GetUserAccount(UUID.Zero, first, last);
            Assert.IsNotNull(account, "Failed to retrieve account for user " + first + " " + last);
            Assert.AreEqual(account.FirstName, first, "First name does not match (bis)");
            Assert.AreEqual(account.LastName, last, "Last name does not match (bis)");

            account.Email = "*****@*****.**";
            bool success = m_Connector.StoreUserAccount(account);
            Assert.IsTrue(success, "Failed to store existing account");

            account = m_Connector.GetUserAccount(UUID.Zero, user1);
            Assert.NotNull(account, "Failed to retrieve account for user id " + user1);
            Assert.AreEqual(account.Email, "*****@*****.**", "Incorrect email");

            account = new UserAccount(UUID.Zero, "DoesNot", "Exist", "*****@*****.**");
            success = m_Connector.StoreUserAccount(account);
            Assert.IsFalse(success, "Storing a non-existing account must fail");

            account = m_Connector.GetUserAccount(UUID.Zero, "DoesNot", "Exist");
            Assert.IsNull(account, "Account DoesNot Exist must not be there");

        }
All Usage Examples Of OpenSim.Services.Connectors.UserAccountServicesConnector::GetUserAccount