diff options
Diffstat (limited to 'OpenSim/Services/Interfaces/IUserService.cs')
-rw-r--r-- | OpenSim/Services/Interfaces/IUserService.cs | 80 |
1 files changed, 41 insertions, 39 deletions
diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index 92bd8ef..1bdaaab 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using OpenMetaverse; | 30 | using OpenMetaverse; |
30 | 31 | ||
@@ -36,68 +37,69 @@ namespace OpenSim.Services.Interfaces | |||
36 | { | 37 | { |
37 | } | 38 | } |
38 | 39 | ||
39 | public UserAccount(UUID userID, UUID homeRegionID, float homePositionX, | 40 | public UserAccount(UUID principalID) |
40 | float homePositionY, float homePositionZ, float homeLookAtX, | ||
41 | float homeLookAtY, float homeLookAtZ) | ||
42 | { | 41 | { |
43 | UserID = userID; | 42 | PrincipalID = principalID; |
44 | HomeRegionID = homeRegionID; | ||
45 | HomePositionX = homePositionX; | ||
46 | HomePositionY = homePositionY; | ||
47 | HomePositionZ = homePositionZ; | ||
48 | HomeLookAtX = homeLookAtX; | ||
49 | HomeLookAtY = homeLookAtY; | ||
50 | HomeLookAtZ = homeLookAtZ; | ||
51 | } | 43 | } |
52 | 44 | ||
53 | public string FirstName; | 45 | public string FirstName; |
54 | public string LastName; | 46 | public string LastName; |
55 | public UUID UserID; | 47 | public string Email; |
48 | public UUID PrincipalID; | ||
56 | public UUID ScopeID; | 49 | public UUID ScopeID; |
57 | 50 | ||
58 | // For informational purposes only! | 51 | public Dictionary<string, object> ServiceURLs; |
59 | // | ||
60 | public string HomeRegionName; | ||
61 | 52 | ||
62 | public UUID HomeRegionID; | 53 | public int Created; |
63 | public float HomePositionX; | ||
64 | public float HomePositionY; | ||
65 | public float HomePositionZ; | ||
66 | public float HomeLookAtX; | ||
67 | public float HomeLookAtY; | ||
68 | public float HomeLookAtZ; | ||
69 | 54 | ||
70 | // These are here because they | 55 | public UserAccount(Dictionary<string, object> kvp) |
71 | // concern the account rather than | 56 | { |
72 | // the profile. They just happen to | 57 | if (kvp.ContainsKey("FirstName")) |
73 | // be used in the Linden profile as well | 58 | FirstName = kvp["FirstName"].ToString(); |
74 | // | 59 | if (kvp.ContainsKey("LastName")) |
75 | public int GodLevel; | 60 | LastName = kvp["LastName"].ToString(); |
76 | public int UserFlags; | 61 | if (kvp.ContainsKey("Email")) |
77 | public string AccountType; | 62 | Email = kvp["Email"].ToString(); |
63 | if (kvp.ContainsKey("PrincipalID")) | ||
64 | UUID.TryParse(kvp["PrincipalID"].ToString(), out PrincipalID); | ||
65 | if (kvp.ContainsKey("ScopeID")) | ||
66 | UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID); | ||
67 | if (kvp.ContainsKey("Created")) | ||
68 | Convert.ToInt32(kvp["Created"].ToString()); | ||
69 | if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null && (kvp["ServiceURLs"] is Dictionary<string, string>)) | ||
70 | ServiceURLs = (Dictionary<string, object>)kvp["ServiceURLs"]; | ||
71 | } | ||
72 | |||
73 | public Dictionary<string, object> ToKeyValuePairs() | ||
74 | { | ||
75 | Dictionary<string, object> result = new Dictionary<string, object>(); | ||
76 | result["FirstName"] = FirstName; | ||
77 | result["LastName"] = LastName; | ||
78 | result["Email"] = Email; | ||
79 | result["PrincipalID"] = PrincipalID.ToString(); | ||
80 | result["ScopeID"] = ScopeID.ToString(); | ||
81 | result["Created"] = Created.ToString(); | ||
82 | result["ServiceURLs"] = ServiceURLs; | ||
78 | 83 | ||
84 | return result; | ||
85 | } | ||
79 | }; | 86 | }; |
80 | 87 | ||
81 | public interface IUserAccountService | 88 | public interface IUserAccountService |
82 | { | 89 | { |
83 | UserAccount GetUserAccount(UUID scopeID, UUID userID); | 90 | UserAccount GetUserAccount(UUID scopeID, UUID userID); |
84 | UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName); | 91 | UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName); |
92 | UserAccount GetUserAccount(UUID scopeID, string Email); | ||
85 | // Returns the list of avatars that matches both the search | 93 | // Returns the list of avatars that matches both the search |
86 | // criterion and the scope ID passed | 94 | // criterion and the scope ID passed |
87 | // | 95 | // |
88 | List<UserAccount> GetUserAccount(UUID scopeID, string query); | 96 | List<UserAccount> GetUserAccounts(UUID scopeID, string query); |
89 | |||
90 | |||
91 | // This will set only the home region portion of the data! | ||
92 | // Can't be used to set god level, flags, type or change the name! | ||
93 | // | ||
94 | bool SetHomePosition(UserAccount data, UUID RegionID, UUID RegionSecret); | ||
95 | 97 | ||
96 | // Update all updatable fields | 98 | // Update all updatable fields |
97 | // | 99 | // |
98 | bool SetUserAccount(UserAccount data, UUID PrincipalID, string token); | 100 | bool SetUserAccount(UserAccount data); |
99 | 101 | ||
100 | // Creates a user data record | 102 | // Creates a user data record |
101 | bool CreateUserAccount(UserAccount data, UUID PrincipalID, string token); | 103 | bool CreateUserAccount(UserAccount data); |
102 | } | 104 | } |
103 | } | 105 | } |