diff options
author | Diva Canto | 2009-12-28 20:26:44 -0800 |
---|---|---|
committer | Diva Canto | 2009-12-28 20:26:44 -0800 |
commit | c164b85ea6351f7a00ea6ec2776101287976da10 (patch) | |
tree | 884193165c1139340b4ae17f3aaabf63a4b3bbe2 /OpenSim | |
parent | Add the indices to really make this table work (diff) | |
download | opensim-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 '')
-rw-r--r-- | OpenSim/Data/IUserAccountData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IPresenceService.cs | 9 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IUserService.cs | 66 |
3 files changed, 48 insertions, 29 deletions
diff --git a/OpenSim/Data/IUserAccountData.cs b/OpenSim/Data/IUserAccountData.cs index 6bec188..d1d6c66 100644 --- a/OpenSim/Data/IUserAccountData.cs +++ b/OpenSim/Data/IUserAccountData.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Data | |||
40 | } | 40 | } |
41 | 41 | ||
42 | /// <summary> | 42 | /// <summary> |
43 | /// An interface for connecting to the authentication datastore | 43 | /// An interface for connecting to the user accounts datastore |
44 | /// </summary> | 44 | /// </summary> |
45 | public interface IUserAccountData | 45 | public interface IUserAccountData |
46 | { | 46 | { |
diff --git a/OpenSim/Services/Interfaces/IPresenceService.cs b/OpenSim/Services/Interfaces/IPresenceService.cs index 2582648..2dad7e6 100644 --- a/OpenSim/Services/Interfaces/IPresenceService.cs +++ b/OpenSim/Services/Interfaces/IPresenceService.cs | |||
@@ -65,6 +65,12 @@ namespace OpenSim.Services.Interfaces | |||
65 | Boolean.TryParse(kvp["online"].ToString(), out Online); | 65 | Boolean.TryParse(kvp["online"].ToString(), out Online); |
66 | if (kvp.ContainsKey("position")) | 66 | if (kvp.ContainsKey("position")) |
67 | Vector3.TryParse(kvp["position"].ToString(), out Position); | 67 | Vector3.TryParse(kvp["position"].ToString(), out Position); |
68 | if (kvp.ContainsKey("HomeRegionID")) | ||
69 | UUID.TryParse(kvp["HomeRegionID"].ToString(), out HomeRegionID); | ||
70 | if (kvp.ContainsKey("HomePosition")) | ||
71 | Vector3.TryParse(kvp["HomePosition"].ToString(), out HomePosition); | ||
72 | if (kvp.ContainsKey("HomeLookAt")) | ||
73 | Vector3.TryParse(kvp["HomeLookAt"].ToString(), out HomeLookAt); | ||
68 | 74 | ||
69 | } | 75 | } |
70 | 76 | ||
@@ -78,6 +84,9 @@ namespace OpenSim.Services.Interfaces | |||
78 | result["logout"] = Logout.ToString(); | 84 | result["logout"] = Logout.ToString(); |
79 | result["position"] = Position.ToString(); | 85 | result["position"] = Position.ToString(); |
80 | result["lookAt"] = LookAt.ToString(); | 86 | result["lookAt"] = LookAt.ToString(); |
87 | result["HomeRegionID"] = HomeRegionID.ToString(); | ||
88 | result["HomePosition"] = HomePosition.ToString(); | ||
89 | result["HomeLookAt"] = HomeLookAt.ToString(); | ||
81 | 90 | ||
82 | return result; | 91 | return result; |
83 | } | 92 | } |
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 | ||
28 | using System; | ||
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using OpenMetaverse; | 30 | using 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); |