From c164b85ea6351f7a00ea6ec2776101287976da10 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Dec 2009 20:26:44 -0800 Subject: * Added packing/unpacking of the Home fields in PresenceInfo * Cleaned up IUserService and beefed up UserAccoutData --- OpenSim/Services/Interfaces/IUserService.cs | 66 +++++++++++++++++------------ 1 file changed, 38 insertions(+), 28 deletions(-) (limited to 'OpenSim/Services/Interfaces/IUserService.cs') diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index 92bd8ef..02d5459 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; using OpenMetaverse; @@ -36,37 +37,17 @@ namespace OpenSim.Services.Interfaces { } - public UserAccount(UUID userID, UUID homeRegionID, float homePositionX, - float homePositionY, float homePositionZ, float homeLookAtX, - float homeLookAtY, float homeLookAtZ) + public UserAccount(UUID userID) { UserID = userID; - HomeRegionID = homeRegionID; - HomePositionX = homePositionX; - HomePositionY = homePositionY; - HomePositionZ = homePositionZ; - HomeLookAtX = homeLookAtX; - HomeLookAtY = homeLookAtY; - HomeLookAtZ = homeLookAtZ; } public string FirstName; public string LastName; + public string Email; public UUID UserID; public UUID ScopeID; - // For informational purposes only! - // - public string HomeRegionName; - - public UUID HomeRegionID; - public float HomePositionX; - public float HomePositionY; - public float HomePositionZ; - public float HomeLookAtX; - public float HomeLookAtY; - public float HomeLookAtZ; - // These are here because they // concern the account rather than // the profile. They just happen to @@ -76,6 +57,41 @@ namespace OpenSim.Services.Interfaces public int UserFlags; public string AccountType; + public UserAccount(Dictionary kvp) + { + if (kvp.ContainsKey("FirstName")) + FirstName = kvp["FirstName"].ToString(); + if (kvp.ContainsKey("LastName")) + LastName = kvp["LastName"].ToString(); + if (kvp.ContainsKey("Email")) + Email = kvp["Email"].ToString(); + if (kvp.ContainsKey("UserID")) + UUID.TryParse(kvp["UserID"].ToString(), out UserID); + if (kvp.ContainsKey("ScopeID")) + UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID); + if (kvp.ContainsKey("GodLevel")) + Int32.TryParse(kvp["GodLevel"].ToString(), out GodLevel); + if (kvp.ContainsKey("UserFlags")) + Int32.TryParse(kvp["UserFlags"].ToString(), out UserFlags); + if (kvp.ContainsKey("AccountType")) + AccountType = kvp["AccountType"].ToString(); + + } + + public Dictionary ToKeyValuePairs() + { + Dictionary result = new Dictionary(); + result["FirstName"] = FirstName; + result["LastName"] = LastName; + result["Email"] = Email; + result["UserID"] = UserID.ToString(); + result["ScopeID"] = ScopeID.ToString(); + result["GodLevel"] = GodLevel.ToString(); + result["UserFlags"] = UserFlags.ToString(); + result["AccountType"] = AccountType.ToString(); + + return result; + } }; public interface IUserAccountService @@ -87,12 +103,6 @@ namespace OpenSim.Services.Interfaces // List GetUserAccount(UUID scopeID, string query); - - // This will set only the home region portion of the data! - // Can't be used to set god level, flags, type or change the name! - // - bool SetHomePosition(UserAccount data, UUID RegionID, UUID RegionSecret); - // Update all updatable fields // bool SetUserAccount(UserAccount data, UUID PrincipalID, string token); -- cgit v1.1 From 18d93c2ceed3d74dfdcd7c482a3db664b5a13e04 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Dec 2009 20:29:52 -0800 Subject: * Added Created field to UserAccountData --- OpenSim/Services/Interfaces/IUserService.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Services/Interfaces/IUserService.cs') diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index 02d5459..6742758 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs @@ -57,6 +57,8 @@ namespace OpenSim.Services.Interfaces public int UserFlags; public string AccountType; + public DateTime Created; + public UserAccount(Dictionary kvp) { if (kvp.ContainsKey("FirstName")) @@ -75,6 +77,8 @@ namespace OpenSim.Services.Interfaces Int32.TryParse(kvp["UserFlags"].ToString(), out UserFlags); if (kvp.ContainsKey("AccountType")) AccountType = kvp["AccountType"].ToString(); + if (kvp.ContainsKey("Created")) + DateTime.TryParse(kvp["Created"].ToString(), out Created); } @@ -89,6 +93,7 @@ namespace OpenSim.Services.Interfaces result["GodLevel"] = GodLevel.ToString(); result["UserFlags"] = UserFlags.ToString(); result["AccountType"] = AccountType.ToString(); + result["Created"] = Created.ToString(); return result; } -- cgit v1.1 From 3cb68d1c8b4d7f5960b50db0040fe4e5f4ea6f77 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Dec 2009 20:37:21 -0800 Subject: Removed AccountType, GodLevel and UserFlags from UserAccountData. Doesn't belong there. --- OpenSim/Services/Interfaces/IUserService.cs | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'OpenSim/Services/Interfaces/IUserService.cs') diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index 6742758..e458178 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs @@ -48,15 +48,6 @@ namespace OpenSim.Services.Interfaces public UUID UserID; public UUID ScopeID; - // These are here because they - // concern the account rather than - // the profile. They just happen to - // be used in the Linden profile as well - // - public int GodLevel; - public int UserFlags; - public string AccountType; - public DateTime Created; public UserAccount(Dictionary kvp) @@ -71,12 +62,6 @@ namespace OpenSim.Services.Interfaces UUID.TryParse(kvp["UserID"].ToString(), out UserID); if (kvp.ContainsKey("ScopeID")) UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID); - if (kvp.ContainsKey("GodLevel")) - Int32.TryParse(kvp["GodLevel"].ToString(), out GodLevel); - if (kvp.ContainsKey("UserFlags")) - Int32.TryParse(kvp["UserFlags"].ToString(), out UserFlags); - if (kvp.ContainsKey("AccountType")) - AccountType = kvp["AccountType"].ToString(); if (kvp.ContainsKey("Created")) DateTime.TryParse(kvp["Created"].ToString(), out Created); @@ -90,9 +75,6 @@ namespace OpenSim.Services.Interfaces result["Email"] = Email; result["UserID"] = UserID.ToString(); result["ScopeID"] = ScopeID.ToString(); - result["GodLevel"] = GodLevel.ToString(); - result["UserFlags"] = UserFlags.ToString(); - result["AccountType"] = AccountType.ToString(); result["Created"] = Created.ToString(); return result; -- cgit v1.1 From f40001f8eddd2bb2c1023e4c6eb1f3a7ae820720 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Dec 2009 20:53:20 -0800 Subject: Added the ServiceURLs field to UserAccountData --- OpenSim/Services/Interfaces/IUserService.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'OpenSim/Services/Interfaces/IUserService.cs') diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index e458178..ecbb344 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs @@ -48,6 +48,8 @@ namespace OpenSim.Services.Interfaces public UUID UserID; public UUID ScopeID; + public Dictionary ServiceURLs; + public DateTime Created; public UserAccount(Dictionary kvp) @@ -64,6 +66,17 @@ namespace OpenSim.Services.Interfaces UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID); if (kvp.ContainsKey("Created")) DateTime.TryParse(kvp["Created"].ToString(), out Created); + if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null) + { + if (kvp["ServiceURLs"] is Dictionary) + { + ServiceURLs = new Dictionary(); + foreach (KeyValuePair urls in (Dictionary)kvp["ServiceURLs"]) + { + ServiceURLs.Add(urls.Key, urls.Value); + } + } + } } @@ -76,6 +89,7 @@ namespace OpenSim.Services.Interfaces result["UserID"] = UserID.ToString(); result["ScopeID"] = ScopeID.ToString(); result["Created"] = Created.ToString(); + result["ServiceURLs"] = ServiceURLs; return result; } -- cgit v1.1 From a462e440d5b5dca97f9b32fa41e24d763456ce97 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 29 Dec 2009 08:06:07 -0800 Subject: Better way of setting ServiceURLs --- OpenSim/Services/Interfaces/IUserService.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'OpenSim/Services/Interfaces/IUserService.cs') diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index ecbb344..8279b9a 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs @@ -66,18 +66,8 @@ namespace OpenSim.Services.Interfaces UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID); if (kvp.ContainsKey("Created")) DateTime.TryParse(kvp["Created"].ToString(), out Created); - if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null) - { - if (kvp["ServiceURLs"] is Dictionary) - { - ServiceURLs = new Dictionary(); - foreach (KeyValuePair urls in (Dictionary)kvp["ServiceURLs"]) - { - ServiceURLs.Add(urls.Key, urls.Value); - } - } - } - + if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null && (kvp["ServiceURLs"] is Dictionary)) + ServiceURLs = (Dictionary)kvp["ServiceURLs"]; } public Dictionary ToKeyValuePairs() -- cgit v1.1 From 6eb5754f5a4b9707f43572ce1e5743054d784818 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 29 Dec 2009 13:27:21 -0800 Subject: Polished the IUserService interface. --- OpenSim/Services/Interfaces/IUserService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services/Interfaces/IUserService.cs') diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index 8279b9a..b6f8774 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs @@ -89,10 +89,11 @@ namespace OpenSim.Services.Interfaces { UserAccount GetUserAccount(UUID scopeID, UUID userID); UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName); + UserAccount GetUserAccount(UUID scopeID, string Email); // Returns the list of avatars that matches both the search // criterion and the scope ID passed // - List GetUserAccount(UUID scopeID, string query); + List GetUserAccounts(UUID scopeID, string query); // Update all updatable fields // -- cgit v1.1 From 2294683f0747fd5691437ed4e10a73ae45c7650c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 29 Dec 2009 13:39:21 -0800 Subject: Tighten up the IUserService interface again. No need for auth tokens at this level. --- OpenSim/Services/Interfaces/IUserService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services/Interfaces/IUserService.cs') diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index b6f8774..1089c6c 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs @@ -97,9 +97,9 @@ namespace OpenSim.Services.Interfaces // Update all updatable fields // - bool SetUserAccount(UserAccount data, UUID PrincipalID, string token); + bool SetUserAccount(UserAccount data); // Creates a user data record - bool CreateUserAccount(UserAccount data, UUID PrincipalID, string token); + bool CreateUserAccount(UserAccount data); } } -- cgit v1.1 From b4483df2701483aabd43fc7d03ebd74770d70170 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 29 Dec 2009 15:58:40 -0800 Subject: * All modules and connectors for user account service are in place. Untested. * Cleaned up a few things on presence connectors --- OpenSim/Services/Interfaces/IUserService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services/Interfaces/IUserService.cs') diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index 1089c6c..e4e4bec 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs @@ -48,7 +48,7 @@ namespace OpenSim.Services.Interfaces public UUID UserID; public UUID ScopeID; - public Dictionary ServiceURLs; + public Dictionary ServiceURLs; public DateTime Created; @@ -67,7 +67,7 @@ namespace OpenSim.Services.Interfaces if (kvp.ContainsKey("Created")) DateTime.TryParse(kvp["Created"].ToString(), out Created); if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null && (kvp["ServiceURLs"] is Dictionary)) - ServiceURLs = (Dictionary)kvp["ServiceURLs"]; + ServiceURLs = (Dictionary)kvp["ServiceURLs"]; } public Dictionary ToKeyValuePairs() -- cgit v1.1 From b6097ae9a8a4566330d882213179feba6d05da62 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 Dec 2009 22:23:17 +0000 Subject: Some modifications to user service. Query by name is implemented now --- OpenSim/Services/Interfaces/IUserService.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services/Interfaces/IUserService.cs') diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index e4e4bec..1bdaaab 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs @@ -37,20 +37,20 @@ namespace OpenSim.Services.Interfaces { } - public UserAccount(UUID userID) + public UserAccount(UUID principalID) { - UserID = userID; + PrincipalID = principalID; } public string FirstName; public string LastName; public string Email; - public UUID UserID; + public UUID PrincipalID; public UUID ScopeID; public Dictionary ServiceURLs; - public DateTime Created; + public int Created; public UserAccount(Dictionary kvp) { @@ -60,12 +60,12 @@ namespace OpenSim.Services.Interfaces LastName = kvp["LastName"].ToString(); if (kvp.ContainsKey("Email")) Email = kvp["Email"].ToString(); - if (kvp.ContainsKey("UserID")) - UUID.TryParse(kvp["UserID"].ToString(), out UserID); + if (kvp.ContainsKey("PrincipalID")) + UUID.TryParse(kvp["PrincipalID"].ToString(), out PrincipalID); if (kvp.ContainsKey("ScopeID")) UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID); if (kvp.ContainsKey("Created")) - DateTime.TryParse(kvp["Created"].ToString(), out Created); + Convert.ToInt32(kvp["Created"].ToString()); if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null && (kvp["ServiceURLs"] is Dictionary)) ServiceURLs = (Dictionary)kvp["ServiceURLs"]; } @@ -76,7 +76,7 @@ namespace OpenSim.Services.Interfaces result["FirstName"] = FirstName; result["LastName"] = LastName; result["Email"] = Email; - result["UserID"] = UserID.ToString(); + result["PrincipalID"] = PrincipalID.ToString(); result["ScopeID"] = ScopeID.ToString(); result["Created"] = Created.ToString(); result["ServiceURLs"] = ServiceURLs; -- cgit v1.1 From 3507005d9decdbf579fb2b7b9928a7d97bd6cf5b Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 31 Dec 2009 01:16:16 +0000 Subject: Remove CreateUserAccount. Rename SetUserAccount to StoreUserAccount. Implement the fetch operations fully. Rename one last UserService file to UserAccountService --- OpenSim/Services/Interfaces/IUserService.cs | 105 ---------------------------- 1 file changed, 105 deletions(-) delete mode 100644 OpenSim/Services/Interfaces/IUserService.cs (limited to 'OpenSim/Services/Interfaces/IUserService.cs') diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs deleted file mode 100644 index 1bdaaab..0000000 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using OpenMetaverse; - -namespace OpenSim.Services.Interfaces -{ - public class UserAccount - { - public UserAccount() - { - } - - public UserAccount(UUID principalID) - { - PrincipalID = principalID; - } - - public string FirstName; - public string LastName; - public string Email; - public UUID PrincipalID; - public UUID ScopeID; - - public Dictionary ServiceURLs; - - public int Created; - - public UserAccount(Dictionary kvp) - { - if (kvp.ContainsKey("FirstName")) - FirstName = kvp["FirstName"].ToString(); - if (kvp.ContainsKey("LastName")) - LastName = kvp["LastName"].ToString(); - if (kvp.ContainsKey("Email")) - Email = kvp["Email"].ToString(); - if (kvp.ContainsKey("PrincipalID")) - UUID.TryParse(kvp["PrincipalID"].ToString(), out PrincipalID); - if (kvp.ContainsKey("ScopeID")) - UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID); - if (kvp.ContainsKey("Created")) - Convert.ToInt32(kvp["Created"].ToString()); - if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null && (kvp["ServiceURLs"] is Dictionary)) - ServiceURLs = (Dictionary)kvp["ServiceURLs"]; - } - - public Dictionary ToKeyValuePairs() - { - Dictionary result = new Dictionary(); - result["FirstName"] = FirstName; - result["LastName"] = LastName; - result["Email"] = Email; - result["PrincipalID"] = PrincipalID.ToString(); - result["ScopeID"] = ScopeID.ToString(); - result["Created"] = Created.ToString(); - result["ServiceURLs"] = ServiceURLs; - - return result; - } - }; - - public interface IUserAccountService - { - UserAccount GetUserAccount(UUID scopeID, UUID userID); - UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName); - UserAccount GetUserAccount(UUID scopeID, string Email); - // Returns the list of avatars that matches both the search - // criterion and the scope ID passed - // - List GetUserAccounts(UUID scopeID, string query); - - // Update all updatable fields - // - bool SetUserAccount(UserAccount data); - - // Creates a user data record - bool CreateUserAccount(UserAccount data); - } -} -- cgit v1.1