aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Interfaces/IUserService.cs
diff options
context:
space:
mode:
authorDiva Canto2009-12-28 20:26:44 -0800
committerDiva Canto2009-12-28 20:26:44 -0800
commitc164b85ea6351f7a00ea6ec2776101287976da10 (patch)
tree884193165c1139340b4ae17f3aaabf63a4b3bbe2 /OpenSim/Services/Interfaces/IUserService.cs
parentAdd the indices to really make this table work (diff)
downloadopensim-SC_OLD-c164b85ea6351f7a00ea6ec2776101287976da10.zip
opensim-SC_OLD-c164b85ea6351f7a00ea6ec2776101287976da10.tar.gz
opensim-SC_OLD-c164b85ea6351f7a00ea6ec2776101287976da10.tar.bz2
opensim-SC_OLD-c164b85ea6351f7a00ea6ec2776101287976da10.tar.xz
* Added packing/unpacking of the Home fields in PresenceInfo
* Cleaned up IUserService and beefed up UserAccoutData
Diffstat (limited to 'OpenSim/Services/Interfaces/IUserService.cs')
-rw-r--r--OpenSim/Services/Interfaces/IUserService.cs66
1 files changed, 38 insertions, 28 deletions
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 @@
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
28using System;
28using System.Collections.Generic; 29using System.Collections.Generic;
29using OpenMetaverse; 30using OpenMetaverse;
30 31
@@ -36,37 +37,17 @@ namespace OpenSim.Services.Interfaces
36 { 37 {
37 } 38 }
38 39
39 public UserAccount(UUID userID, UUID homeRegionID, float homePositionX, 40 public UserAccount(UUID userID)
40 float homePositionY, float homePositionZ, float homeLookAtX,
41 float homeLookAtY, float homeLookAtZ)
42 { 41 {
43 UserID = userID; 42 UserID = userID;
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;
47 public string Email;
55 public UUID UserID; 48 public UUID UserID;
56 public UUID ScopeID; 49 public UUID ScopeID;
57 50
58 // For informational purposes only!
59 //
60 public string HomeRegionName;
61
62 public UUID HomeRegionID;
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
70 // These are here because they 51 // These are here because they
71 // concern the account rather than 52 // concern the account rather than
72 // the profile. They just happen to 53 // the profile. They just happen to
@@ -76,6 +57,41 @@ namespace OpenSim.Services.Interfaces
76 public int UserFlags; 57 public int UserFlags;
77 public string AccountType; 58 public string AccountType;
78 59
60 public UserAccount(Dictionary<string, object> kvp)
61 {
62 if (kvp.ContainsKey("FirstName"))
63 FirstName = kvp["FirstName"].ToString();
64 if (kvp.ContainsKey("LastName"))
65 LastName = kvp["LastName"].ToString();
66 if (kvp.ContainsKey("Email"))
67 Email = kvp["Email"].ToString();
68 if (kvp.ContainsKey("UserID"))
69 UUID.TryParse(kvp["UserID"].ToString(), out UserID);
70 if (kvp.ContainsKey("ScopeID"))
71 UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID);
72 if (kvp.ContainsKey("GodLevel"))
73 Int32.TryParse(kvp["GodLevel"].ToString(), out GodLevel);
74 if (kvp.ContainsKey("UserFlags"))
75 Int32.TryParse(kvp["UserFlags"].ToString(), out UserFlags);
76 if (kvp.ContainsKey("AccountType"))
77 AccountType = kvp["AccountType"].ToString();
78
79 }
80
81 public Dictionary<string, object> ToKeyValuePairs()
82 {
83 Dictionary<string, object> result = new Dictionary<string, object>();
84 result["FirstName"] = FirstName;
85 result["LastName"] = LastName;
86 result["Email"] = Email;
87 result["UserID"] = UserID.ToString();
88 result["ScopeID"] = ScopeID.ToString();
89 result["GodLevel"] = GodLevel.ToString();
90 result["UserFlags"] = UserFlags.ToString();
91 result["AccountType"] = AccountType.ToString();
92
93 return result;
94 }
79 }; 95 };
80 96
81 public interface IUserAccountService 97 public interface IUserAccountService
@@ -87,12 +103,6 @@ namespace OpenSim.Services.Interfaces
87 // 103 //
88 List<UserAccount> GetUserAccount(UUID scopeID, string query); 104 List<UserAccount> GetUserAccount(UUID scopeID, string query);
89 105
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
96 // Update all updatable fields 106 // Update all updatable fields
97 // 107 //
98 bool SetUserAccount(UserAccount data, UUID PrincipalID, string token); 108 bool SetUserAccount(UserAccount data, UUID PrincipalID, string token);