diff options
Diffstat (limited to 'OpenSim/Services/Interfaces')
-rw-r--r-- | OpenSim/Services/Interfaces/IPresenceService.cs | 68 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IUserService.cs | 80 |
2 files changed, 106 insertions, 42 deletions
diff --git a/OpenSim/Services/Interfaces/IPresenceService.cs b/OpenSim/Services/Interfaces/IPresenceService.cs index aa1c5bf..2dad7e6 100644 --- a/OpenSim/Services/Interfaces/IPresenceService.cs +++ b/OpenSim/Services/Interfaces/IPresenceService.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 OpenSim.Framework; | 29 | using OpenSim.Framework; |
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
@@ -33,13 +34,74 @@ namespace OpenSim.Services.Interfaces | |||
33 | { | 34 | { |
34 | public class PresenceInfo | 35 | public class PresenceInfo |
35 | { | 36 | { |
36 | public UUID PrincipalID; | 37 | public string UserID; |
37 | public UUID RegionID; | 38 | public UUID RegionID; |
38 | public Dictionary<string, string> Data; | 39 | public bool Online; |
40 | public DateTime Login; | ||
41 | public DateTime Logout; | ||
42 | public Vector3 Position; | ||
43 | public Vector3 LookAt; | ||
44 | public UUID HomeRegionID; | ||
45 | public Vector3 HomePosition; | ||
46 | public Vector3 HomeLookAt; | ||
47 | |||
48 | public PresenceInfo() | ||
49 | { | ||
50 | } | ||
51 | |||
52 | public PresenceInfo(Dictionary<string, object> kvp) | ||
53 | { | ||
54 | if (kvp.ContainsKey("UserID")) | ||
55 | UserID = kvp["UserID"].ToString(); | ||
56 | if (kvp.ContainsKey("RegionID")) | ||
57 | UUID.TryParse(kvp["RegionID"].ToString(), out RegionID); | ||
58 | if (kvp.ContainsKey("login")) | ||
59 | DateTime.TryParse(kvp["login"].ToString(), out Login); | ||
60 | if (kvp.ContainsKey("logout")) | ||
61 | DateTime.TryParse(kvp["logout"].ToString(), out Logout); | ||
62 | if (kvp.ContainsKey("lookAt")) | ||
63 | Vector3.TryParse(kvp["lookAt"].ToString(), out LookAt); | ||
64 | if (kvp.ContainsKey("online")) | ||
65 | Boolean.TryParse(kvp["online"].ToString(), out Online); | ||
66 | if (kvp.ContainsKey("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); | ||
74 | |||
75 | } | ||
76 | |||
77 | public Dictionary<string, object> ToKeyValuePairs() | ||
78 | { | ||
79 | Dictionary<string, object> result = new Dictionary<string, object>(); | ||
80 | result["UserID"] = UserID; | ||
81 | result["RegionID"] = RegionID.ToString(); | ||
82 | result["online"] = Online.ToString(); | ||
83 | result["login"] = Login.ToString(); | ||
84 | result["logout"] = Logout.ToString(); | ||
85 | result["position"] = Position.ToString(); | ||
86 | result["lookAt"] = LookAt.ToString(); | ||
87 | result["HomeRegionID"] = HomeRegionID.ToString(); | ||
88 | result["HomePosition"] = HomePosition.ToString(); | ||
89 | result["HomeLookAt"] = HomeLookAt.ToString(); | ||
90 | |||
91 | return result; | ||
92 | } | ||
39 | } | 93 | } |
40 | 94 | ||
41 | public interface IPresenceService | 95 | public interface IPresenceService |
42 | { | 96 | { |
43 | bool Report(PresenceInfo presence); | 97 | bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID); |
98 | bool LogoutAgent(UUID sessionID); | ||
99 | bool LogoutRegionAgents(UUID regionID); | ||
100 | |||
101 | bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt); | ||
102 | bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt); | ||
103 | |||
104 | PresenceInfo GetAgent(UUID sessionID); | ||
105 | PresenceInfo[] GetAgents(string[] userIDs); | ||
44 | } | 106 | } |
45 | } | 107 | } |
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 | } |