diff options
Diffstat (limited to 'OpenSim/Services/Interfaces')
-rw-r--r-- | OpenSim/Services/Interfaces/IAuthenticationService.cs | 11 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IAvatarService.cs | 241 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IFriendsService.cs | 80 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IGatekeeperService.cs | 59 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IGridService.cs | 24 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/ILibraryService.cs (renamed from OpenSim/Services/Interfaces/IHyperlink.cs) | 22 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/ILoginService.cs | 53 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IPresenceService.cs | 88 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/ISimulationService.cs | 26 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IUserAccountService.cs | 153 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IUserService.cs | 103 |
11 files changed, 712 insertions, 148 deletions
diff --git a/OpenSim/Services/Interfaces/IAuthenticationService.cs b/OpenSim/Services/Interfaces/IAuthenticationService.cs index 9225773..9de261b 100644 --- a/OpenSim/Services/Interfaces/IAuthenticationService.cs +++ b/OpenSim/Services/Interfaces/IAuthenticationService.cs | |||
@@ -66,6 +66,17 @@ namespace OpenSim.Services.Interfaces | |||
66 | bool Release(UUID principalID, string token); | 66 | bool Release(UUID principalID, string token); |
67 | 67 | ||
68 | ////////////////////////////////////////////////////// | 68 | ////////////////////////////////////////////////////// |
69 | // SetPassword for a principal | ||
70 | // | ||
71 | // This method exists for the service, but may or may not | ||
72 | // be served remotely. That is, the authentication | ||
73 | // handlers may not include one handler for this, | ||
74 | // because it's a bit risky. Such handlers require | ||
75 | // authentication/authorization. | ||
76 | // | ||
77 | bool SetPassword(UUID principalID, string passwd); | ||
78 | |||
79 | ////////////////////////////////////////////////////// | ||
69 | // Grid | 80 | // Grid |
70 | // | 81 | // |
71 | // We no longer need a shared secret between grid | 82 | // We no longer need a shared secret between grid |
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs new file mode 100644 index 0000000..de3bcf9 --- /dev/null +++ b/OpenSim/Services/Interfaces/IAvatarService.cs | |||
@@ -0,0 +1,241 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | ||
31 | |||
32 | using OpenSim.Framework; | ||
33 | |||
34 | using OpenMetaverse; | ||
35 | |||
36 | namespace OpenSim.Services.Interfaces | ||
37 | { | ||
38 | public interface IAvatarService | ||
39 | { | ||
40 | /// <summary> | ||
41 | /// Called by the login service | ||
42 | /// </summary> | ||
43 | /// <param name="userID"></param> | ||
44 | /// <returns></returns> | ||
45 | AvatarData GetAvatar(UUID userID); | ||
46 | |||
47 | /// <summary> | ||
48 | /// Called by everyone who can change the avatar data (so, regions) | ||
49 | /// </summary> | ||
50 | /// <param name="userID"></param> | ||
51 | /// <param name="avatar"></param> | ||
52 | /// <returns></returns> | ||
53 | bool SetAvatar(UUID userID, AvatarData avatar); | ||
54 | |||
55 | /// <summary> | ||
56 | /// Not sure if it's needed | ||
57 | /// </summary> | ||
58 | /// <param name="userID"></param> | ||
59 | /// <returns></returns> | ||
60 | bool ResetAvatar(UUID userID); | ||
61 | |||
62 | /// <summary> | ||
63 | /// These methods raison d'etre: | ||
64 | /// No need to send the entire avatar data (SetAvatar) for changing attachments | ||
65 | /// </summary> | ||
66 | /// <param name="userID"></param> | ||
67 | /// <param name="attach"></param> | ||
68 | /// <returns></returns> | ||
69 | bool SetItems(UUID userID, string[] names, string[] values); | ||
70 | bool RemoveItems(UUID userID, string[] names); | ||
71 | } | ||
72 | |||
73 | /// <summary> | ||
74 | /// Each region/client that uses avatars will have a data structure | ||
75 | /// of this type representing the avatars. | ||
76 | /// </summary> | ||
77 | public class AvatarData | ||
78 | { | ||
79 | // This pretty much determines which name/value pairs will be | ||
80 | // present below. The name/value pair describe a part of | ||
81 | // the avatar. For SL avatars, these would be "shape", "texture1", | ||
82 | // etc. For other avatars, they might be "mesh", "skin", etc. | ||
83 | // The value portion is a URL that is expected to resolve to an | ||
84 | // asset of the type required by the handler for that field. | ||
85 | // It is required that regions can access these URLs. Allowing | ||
86 | // direct access by a viewer is not required, and, if provided, | ||
87 | // may be read-only. A "naked" UUID can be used to refer to an | ||
88 | // asset int he current region's asset service, which is not | ||
89 | // portable, but allows legacy appearance to continue to | ||
90 | // function. Closed, LL-based grids will never need URLs here. | ||
91 | |||
92 | public int AvatarType; | ||
93 | public Dictionary<string,string> Data; | ||
94 | |||
95 | public AvatarData() | ||
96 | { | ||
97 | } | ||
98 | |||
99 | public AvatarData(Dictionary<string, object> kvp) | ||
100 | { | ||
101 | Data = new Dictionary<string, string>(); | ||
102 | |||
103 | if (kvp.ContainsKey("AvatarType")) | ||
104 | Int32.TryParse(kvp["AvatarType"].ToString(), out AvatarType); | ||
105 | |||
106 | foreach (KeyValuePair<string, object> _kvp in kvp) | ||
107 | { | ||
108 | if (_kvp.Value != null) | ||
109 | Data[_kvp.Key] = _kvp.Value.ToString(); | ||
110 | } | ||
111 | } | ||
112 | |||
113 | /// <summary> | ||
114 | /// </summary> | ||
115 | /// <returns></returns> | ||
116 | public Dictionary<string, object> ToKeyValuePairs() | ||
117 | { | ||
118 | Dictionary<string, object> result = new Dictionary<string, object>(); | ||
119 | |||
120 | result["AvatarType"] = AvatarType.ToString(); | ||
121 | foreach (KeyValuePair<string, string> _kvp in Data) | ||
122 | { | ||
123 | if (_kvp.Value != null) | ||
124 | result[_kvp.Key] = _kvp.Value; | ||
125 | } | ||
126 | return result; | ||
127 | } | ||
128 | |||
129 | public AvatarData(AvatarAppearance appearance) | ||
130 | { | ||
131 | AvatarType = 1; // SL avatars | ||
132 | Data = new Dictionary<string, string>(); | ||
133 | |||
134 | Data["Serial"] = appearance.Serial.ToString(); | ||
135 | // Wearables | ||
136 | Data["AvatarHeight"] = appearance.AvatarHeight.ToString(); | ||
137 | Data["BodyItem"] = appearance.BodyItem.ToString(); | ||
138 | Data["EyesItem"] = appearance.EyesItem.ToString(); | ||
139 | Data["GlovesItem"] = appearance.GlovesItem.ToString(); | ||
140 | Data["HairItem"] = appearance.HairItem.ToString(); | ||
141 | Data["JacketItem"] = appearance.JacketItem.ToString(); | ||
142 | Data["PantsItem"] = appearance.PantsItem.ToString(); | ||
143 | Data["ShirtItem"] = appearance.ShirtItem.ToString(); | ||
144 | Data["ShoesItem"] = appearance.ShoesItem.ToString(); | ||
145 | Data["SkinItem"] = appearance.SkinItem.ToString(); | ||
146 | Data["SkirtItem"] = appearance.SkirtItem.ToString(); | ||
147 | Data["SocksItem"] = appearance.SocksItem.ToString(); | ||
148 | Data["UnderPantsItem"] = appearance.UnderPantsItem.ToString(); | ||
149 | Data["UnderShirtItem"] = appearance.UnderShirtItem.ToString(); | ||
150 | |||
151 | Data["BodyAsset"] = appearance.BodyAsset.ToString(); | ||
152 | Data["EyesAsset"] = appearance.EyesAsset.ToString(); | ||
153 | Data["GlovesAsset"] = appearance.GlovesAsset.ToString(); | ||
154 | Data["HairAsset"] = appearance.HairAsset.ToString(); | ||
155 | Data["JacketAsset"] = appearance.JacketAsset.ToString(); | ||
156 | Data["PantsAsset"] = appearance.PantsAsset.ToString(); | ||
157 | Data["ShirtAsset"] = appearance.ShirtAsset.ToString(); | ||
158 | Data["ShoesAsset"] = appearance.ShoesAsset.ToString(); | ||
159 | Data["SkinAsset"] = appearance.SkinAsset.ToString(); | ||
160 | Data["SkirtAsset"] = appearance.SkirtAsset.ToString(); | ||
161 | Data["SocksAsset"] = appearance.SocksAsset.ToString(); | ||
162 | Data["UnderPantsAsset"] = appearance.UnderPantsAsset.ToString(); | ||
163 | Data["UnderShirtAsset"] = appearance.UnderShirtAsset.ToString(); | ||
164 | |||
165 | // Attachments | ||
166 | Hashtable attachs = appearance.GetAttachments(); | ||
167 | if (attachs != null) | ||
168 | foreach (DictionaryEntry dentry in attachs) | ||
169 | { | ||
170 | if (dentry.Value != null) | ||
171 | { | ||
172 | Hashtable tab = (Hashtable)dentry.Value; | ||
173 | if (tab.ContainsKey("item") && tab["item"] != null) | ||
174 | Data["_ap_" + dentry.Key] = tab["item"].ToString(); | ||
175 | } | ||
176 | } | ||
177 | } | ||
178 | |||
179 | public AvatarAppearance ToAvatarAppearance(UUID owner) | ||
180 | { | ||
181 | AvatarAppearance appearance = new AvatarAppearance(owner); | ||
182 | try | ||
183 | { | ||
184 | appearance.Serial = Int32.Parse(Data["Serial"]); | ||
185 | |||
186 | // Wearables | ||
187 | appearance.BodyItem = UUID.Parse(Data["BodyItem"]); | ||
188 | appearance.EyesItem = UUID.Parse(Data["EyesItem"]); | ||
189 | appearance.GlovesItem = UUID.Parse(Data["GlovesItem"]); | ||
190 | appearance.HairItem = UUID.Parse(Data["HairItem"]); | ||
191 | appearance.JacketItem = UUID.Parse(Data["JacketItem"]); | ||
192 | appearance.PantsItem = UUID.Parse(Data["PantsItem"]); | ||
193 | appearance.ShirtItem = UUID.Parse(Data["ShirtItem"]); | ||
194 | appearance.ShoesItem = UUID.Parse(Data["ShoesItem"]); | ||
195 | appearance.SkinItem = UUID.Parse(Data["SkinItem"]); | ||
196 | appearance.SkirtItem = UUID.Parse(Data["SkirtItem"]); | ||
197 | appearance.SocksItem = UUID.Parse(Data["SocksItem"]); | ||
198 | appearance.UnderPantsItem = UUID.Parse(Data["UnderPantsItem"]); | ||
199 | appearance.UnderShirtItem = UUID.Parse(Data["UnderShirtItem"]); | ||
200 | |||
201 | appearance.BodyAsset = UUID.Parse(Data["BodyAsset"]); | ||
202 | appearance.EyesAsset = UUID.Parse(Data["EyesAsset"]); | ||
203 | appearance.GlovesAsset = UUID.Parse(Data["GlovesAsset"]); | ||
204 | appearance.HairAsset = UUID.Parse(Data["HairAsset"]); | ||
205 | appearance.JacketAsset = UUID.Parse(Data["JacketAsset"]); | ||
206 | appearance.PantsAsset = UUID.Parse(Data["PantsAsset"]); | ||
207 | appearance.ShirtAsset = UUID.Parse(Data["ShirtAsset"]); | ||
208 | appearance.ShoesAsset = UUID.Parse(Data["ShoesAsset"]); | ||
209 | appearance.SkinAsset = UUID.Parse(Data["SkinAsset"]); | ||
210 | appearance.SkirtAsset = UUID.Parse(Data["SkirtAsset"]); | ||
211 | appearance.SocksAsset = UUID.Parse(Data["SocksAsset"]); | ||
212 | appearance.UnderPantsAsset = UUID.Parse(Data["UnderPantsAsset"]); | ||
213 | appearance.UnderShirtAsset = UUID.Parse(Data["UnderShirtAsset"]); | ||
214 | |||
215 | // Attachments | ||
216 | Dictionary<string, string> attchs = new Dictionary<string, string>(); | ||
217 | foreach (KeyValuePair<string, string> _kvp in Data) | ||
218 | if (_kvp.Key.StartsWith("_ap_")) | ||
219 | attchs[_kvp.Key] = _kvp.Value; | ||
220 | Hashtable aaAttachs = new Hashtable(); | ||
221 | foreach (KeyValuePair<string, string> _kvp in attchs) | ||
222 | { | ||
223 | string pointStr = _kvp.Key.Substring(4); | ||
224 | int point = 0; | ||
225 | if (!Int32.TryParse(pointStr, out point)) | ||
226 | continue; | ||
227 | Hashtable tmp = new Hashtable(); | ||
228 | UUID uuid = UUID.Zero; | ||
229 | UUID.TryParse(_kvp.Value, out uuid); | ||
230 | tmp["item"] = uuid; | ||
231 | tmp["asset"] = UUID.Zero.ToString(); | ||
232 | aaAttachs[point] = tmp; | ||
233 | } | ||
234 | appearance.SetAttachments(aaAttachs); | ||
235 | } | ||
236 | catch { } | ||
237 | |||
238 | return appearance; | ||
239 | } | ||
240 | } | ||
241 | } | ||
diff --git a/OpenSim/Services/Interfaces/IFriendsService.cs b/OpenSim/Services/Interfaces/IFriendsService.cs new file mode 100644 index 0000000..2692c48 --- /dev/null +++ b/OpenSim/Services/Interfaces/IFriendsService.cs | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using OpenMetaverse; | ||
30 | using OpenSim.Framework; | ||
31 | using System.Collections.Generic; | ||
32 | |||
33 | namespace OpenSim.Services.Interfaces | ||
34 | { | ||
35 | public class FriendInfo | ||
36 | { | ||
37 | public UUID PrincipalID; | ||
38 | public string Friend; | ||
39 | public int MyFlags; | ||
40 | public int TheirFlags; | ||
41 | |||
42 | public FriendInfo() | ||
43 | { | ||
44 | } | ||
45 | |||
46 | public FriendInfo(Dictionary<string, object> kvp) | ||
47 | { | ||
48 | PrincipalID = UUID.Zero; | ||
49 | if (kvp.ContainsKey("PrincipalID") && kvp["PrincipalID"] != null) | ||
50 | UUID.TryParse(kvp["PrincipalID"].ToString(), out PrincipalID); | ||
51 | Friend = string.Empty; | ||
52 | if (kvp.ContainsKey("Friend") && kvp["Friend"] != null) | ||
53 | Friend = kvp["Friend"].ToString(); | ||
54 | MyFlags = 0; | ||
55 | if (kvp.ContainsKey("MyFlags") && kvp["MyFlags"] != null) | ||
56 | Int32.TryParse(kvp["MyFlags"].ToString(), out MyFlags); | ||
57 | TheirFlags = 0; | ||
58 | if (kvp.ContainsKey("TheirFlags") && kvp["TheirFlags"] != null) | ||
59 | Int32.TryParse(kvp["TheirFlags"].ToString(), out TheirFlags); | ||
60 | } | ||
61 | |||
62 | public Dictionary<string, object> ToKeyValuePairs() | ||
63 | { | ||
64 | Dictionary<string, object> result = new Dictionary<string, object>(); | ||
65 | result["PricipalID"] = PrincipalID.ToString(); | ||
66 | result["Friend"] = Friend; | ||
67 | result["MyFlags"] = MyFlags.ToString(); | ||
68 | result["TheirFlags"] = TheirFlags.ToString(); | ||
69 | |||
70 | return result; | ||
71 | } | ||
72 | } | ||
73 | |||
74 | public interface IFriendsService | ||
75 | { | ||
76 | FriendInfo[] GetFriends(UUID PrincipalID); | ||
77 | bool StoreFriend(UUID PrincipalID, string Friend, int flags); | ||
78 | bool Delete(UUID PrincipalID, string Friend); | ||
79 | } | ||
80 | } | ||
diff --git a/OpenSim/Services/Interfaces/IGatekeeperService.cs b/OpenSim/Services/Interfaces/IGatekeeperService.cs new file mode 100644 index 0000000..ca7b9b3 --- /dev/null +++ b/OpenSim/Services/Interfaces/IGatekeeperService.cs | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Net; | ||
30 | using System.Collections.Generic; | ||
31 | |||
32 | using OpenSim.Framework; | ||
33 | using OpenMetaverse; | ||
34 | |||
35 | namespace OpenSim.Services.Interfaces | ||
36 | { | ||
37 | public interface IGatekeeperService | ||
38 | { | ||
39 | bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason); | ||
40 | GridRegion GetHyperlinkRegion(UUID regionID); | ||
41 | |||
42 | bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); | ||
43 | |||
44 | } | ||
45 | |||
46 | /// <summary> | ||
47 | /// HG1.5 only | ||
48 | /// </summary> | ||
49 | public interface IUserAgentService | ||
50 | { | ||
51 | bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, out string reason); | ||
52 | void LogoutAgent(UUID userID, UUID sessionID); | ||
53 | GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); | ||
54 | |||
55 | bool AgentIsComingHome(UUID sessionID, string thisGridExternalName); | ||
56 | bool VerifyAgent(UUID sessionID, string token); | ||
57 | bool VerifyClient(UUID sessionID, string token); | ||
58 | } | ||
59 | } | ||
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 5135f6d..e55b633 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs | |||
@@ -90,6 +90,10 @@ namespace OpenSim.Services.Interfaces | |||
90 | 90 | ||
91 | List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax); | 91 | List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax); |
92 | 92 | ||
93 | List<GridRegion> GetDefaultRegions(UUID scopeID); | ||
94 | List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y); | ||
95 | |||
96 | int GetRegionFlags(UUID scopeID, UUID regionID); | ||
93 | } | 97 | } |
94 | 98 | ||
95 | public class GridRegion | 99 | public class GridRegion |
@@ -154,7 +158,8 @@ namespace OpenSim.Services.Interfaces | |||
154 | public UUID TerrainImage = UUID.Zero; | 158 | public UUID TerrainImage = UUID.Zero; |
155 | public byte Access; | 159 | public byte Access; |
156 | public int Maturity; | 160 | public int Maturity; |
157 | public string RegionSecret; | 161 | public string RegionSecret = string.Empty; |
162 | public string Token = string.Empty; | ||
158 | 163 | ||
159 | public GridRegion() | 164 | public GridRegion() |
160 | { | 165 | { |
@@ -200,12 +205,6 @@ namespace OpenSim.Services.Interfaces | |||
200 | Maturity = ConvertFrom.RegionSettings.Maturity; | 205 | Maturity = ConvertFrom.RegionSettings.Maturity; |
201 | RegionSecret = ConvertFrom.regionSecret; | 206 | RegionSecret = ConvertFrom.regionSecret; |
202 | EstateOwner = ConvertFrom.EstateSettings.EstateOwner; | 207 | EstateOwner = ConvertFrom.EstateSettings.EstateOwner; |
203 | if (EstateOwner == UUID.Zero) | ||
204 | { | ||
205 | EstateOwner = ConvertFrom.MasterAvatarAssignedUUID; | ||
206 | ConvertFrom.EstateSettings.EstateOwner = EstateOwner; | ||
207 | ConvertFrom.EstateSettings.Save(); | ||
208 | } | ||
209 | } | 208 | } |
210 | 209 | ||
211 | public GridRegion(GridRegion ConvertFrom) | 210 | public GridRegion(GridRegion ConvertFrom) |
@@ -267,8 +266,6 @@ namespace OpenSim.Services.Interfaces | |||
267 | 266 | ||
268 | return new IPEndPoint(ia, m_internalEndPoint.Port); | 267 | return new IPEndPoint(ia, m_internalEndPoint.Port); |
269 | } | 268 | } |
270 | |||
271 | set { m_externalHostName = value.ToString(); } | ||
272 | } | 269 | } |
273 | 270 | ||
274 | public string ExternalHostName | 271 | public string ExternalHostName |
@@ -288,11 +285,6 @@ namespace OpenSim.Services.Interfaces | |||
288 | get { return Util.UIntsToLong((uint)RegionLocX, (uint)RegionLocY); } | 285 | get { return Util.UIntsToLong((uint)RegionLocX, (uint)RegionLocY); } |
289 | } | 286 | } |
290 | 287 | ||
291 | public int getInternalEndPointPort() | ||
292 | { | ||
293 | return m_internalEndPoint.Port; | ||
294 | } | ||
295 | |||
296 | public Dictionary<string, object> ToKeyValuePairs() | 288 | public Dictionary<string, object> ToKeyValuePairs() |
297 | { | 289 | { |
298 | Dictionary<string, object> kvp = new Dictionary<string, object>(); | 290 | Dictionary<string, object> kvp = new Dictionary<string, object>(); |
@@ -308,6 +300,7 @@ namespace OpenSim.Services.Interfaces | |||
308 | kvp["access"] = Access.ToString(); | 300 | kvp["access"] = Access.ToString(); |
309 | kvp["regionSecret"] = RegionSecret; | 301 | kvp["regionSecret"] = RegionSecret; |
310 | kvp["owner_uuid"] = EstateOwner.ToString(); | 302 | kvp["owner_uuid"] = EstateOwner.ToString(); |
303 | kvp["Token"] = Token.ToString(); | ||
311 | // Maturity doesn't seem to exist in the DB | 304 | // Maturity doesn't seem to exist in the DB |
312 | return kvp; | 305 | return kvp; |
313 | } | 306 | } |
@@ -365,6 +358,9 @@ namespace OpenSim.Services.Interfaces | |||
365 | if (kvp.ContainsKey("owner_uuid")) | 358 | if (kvp.ContainsKey("owner_uuid")) |
366 | EstateOwner = new UUID(kvp["owner_uuid"].ToString()); | 359 | EstateOwner = new UUID(kvp["owner_uuid"].ToString()); |
367 | 360 | ||
361 | if (kvp.ContainsKey("Token")) | ||
362 | Token = kvp["Token"].ToString(); | ||
363 | |||
368 | } | 364 | } |
369 | } | 365 | } |
370 | 366 | ||
diff --git a/OpenSim/Services/Interfaces/IHyperlink.cs b/OpenSim/Services/Interfaces/ILibraryService.cs index ed3ff23..861cf0e 100644 --- a/OpenSim/Services/Interfaces/IHyperlink.cs +++ b/OpenSim/Services/Interfaces/ILibraryService.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -25,25 +25,19 @@ | |||
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 OpenSim.Framework; | 28 | using System; |
29 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 29 | using System.Collections.Generic; |
30 | 30 | ||
31 | using OpenSim.Framework; | ||
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
32 | 33 | ||
33 | namespace OpenSim.Services.Interfaces | 34 | namespace OpenSim.Services.Interfaces |
34 | { | 35 | { |
35 | public interface IHyperlinkService | 36 | public interface ILibraryService |
36 | { | 37 | { |
37 | GridRegion TryLinkRegion(IClientAPI client, string regionDescriptor); | 38 | InventoryFolderImpl LibraryRootFolder { get; } |
38 | GridRegion GetHyperlinkRegion(ulong handle); | ||
39 | ulong FindRegionHandle(ulong handle); | ||
40 | |||
41 | bool SendUserInformation(GridRegion region, AgentCircuitData aCircuit); | ||
42 | void AdjustUserInformation(AgentCircuitData aCircuit); | ||
43 | 39 | ||
44 | bool CheckUserAtEntry(UUID userID, UUID sessionID, out bool comingHome); | 40 | Dictionary<UUID, InventoryFolderImpl> GetAllFolders(); |
45 | void AcceptUser(ForeignUserProfileData user, GridRegion home); | ||
46 | |||
47 | bool IsLocalUser(UUID userID); | ||
48 | } | 41 | } |
42 | |||
49 | } | 43 | } |
diff --git a/OpenSim/Services/Interfaces/ILoginService.cs b/OpenSim/Services/Interfaces/ILoginService.cs new file mode 100644 index 0000000..24bf342 --- /dev/null +++ b/OpenSim/Services/Interfaces/ILoginService.cs | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Net; | ||
32 | |||
33 | using OpenMetaverse.StructuredData; | ||
34 | |||
35 | namespace OpenSim.Services.Interfaces | ||
36 | { | ||
37 | public abstract class LoginResponse | ||
38 | { | ||
39 | public abstract Hashtable ToHashtable(); | ||
40 | public abstract OSD ToOSDMap(); | ||
41 | } | ||
42 | |||
43 | public abstract class FailedLoginResponse : LoginResponse | ||
44 | { | ||
45 | } | ||
46 | |||
47 | public interface ILoginService | ||
48 | { | ||
49 | LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, IPEndPoint clientIP); | ||
50 | } | ||
51 | |||
52 | |||
53 | } | ||
diff --git a/OpenSim/Services/Interfaces/IPresenceService.cs b/OpenSim/Services/Interfaces/IPresenceService.cs index aa1c5bf..b4c1859 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,94 @@ 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 | } | ||
93 | |||
94 | public static PresenceInfo[] GetOnlinePresences(PresenceInfo[] pinfos) | ||
95 | { | ||
96 | if (pinfos == null) | ||
97 | return null; | ||
98 | |||
99 | List<PresenceInfo> lst = new List<PresenceInfo>(pinfos); | ||
100 | lst = lst.FindAll(delegate(PresenceInfo each) { return each.Online; }); | ||
101 | |||
102 | return lst.ToArray(); | ||
103 | } | ||
104 | |||
105 | public static PresenceInfo GetOnlinePresence(PresenceInfo[] pinfos) | ||
106 | { | ||
107 | pinfos = GetOnlinePresences(pinfos); | ||
108 | if (pinfos != null && pinfos.Length >= 1) | ||
109 | return pinfos[0]; | ||
110 | |||
111 | return null; | ||
112 | } | ||
39 | } | 113 | } |
40 | 114 | ||
41 | public interface IPresenceService | 115 | public interface IPresenceService |
42 | { | 116 | { |
43 | bool Report(PresenceInfo presence); | 117 | bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID); |
118 | bool LogoutAgent(UUID sessionID, Vector3 position, Vector3 lookAt); | ||
119 | bool LogoutRegionAgents(UUID regionID); | ||
120 | |||
121 | bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt); | ||
122 | bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt); | ||
123 | |||
124 | PresenceInfo GetAgent(UUID sessionID); | ||
125 | PresenceInfo[] GetAgents(string[] userIDs); | ||
44 | } | 126 | } |
45 | } | 127 | } |
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index a169ab7..ec24d90 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs | |||
@@ -29,13 +29,17 @@ using System; | |||
29 | using OpenSim.Framework; | 29 | using OpenSim.Framework; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | 31 | ||
32 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
33 | |||
32 | namespace OpenSim.Services.Interfaces | 34 | namespace OpenSim.Services.Interfaces |
33 | { | 35 | { |
34 | public interface ISimulationService | 36 | public interface ISimulationService |
35 | { | 37 | { |
38 | IScene GetScene(ulong regionHandle); | ||
39 | |||
36 | #region Agents | 40 | #region Agents |
37 | 41 | ||
38 | bool CreateAgent(ulong regionHandle, AgentCircuitData aCircuit, out string reason); | 42 | bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason); |
39 | 43 | ||
40 | /// <summary> | 44 | /// <summary> |
41 | /// Full child agent update. | 45 | /// Full child agent update. |
@@ -43,7 +47,7 @@ namespace OpenSim.Services.Interfaces | |||
43 | /// <param name="regionHandle"></param> | 47 | /// <param name="regionHandle"></param> |
44 | /// <param name="data"></param> | 48 | /// <param name="data"></param> |
45 | /// <returns></returns> | 49 | /// <returns></returns> |
46 | bool UpdateAgent(ulong regionHandle, AgentData data); | 50 | bool UpdateAgent(GridRegion destination, AgentData data); |
47 | 51 | ||
48 | /// <summary> | 52 | /// <summary> |
49 | /// Short child agent update, mostly for position. | 53 | /// Short child agent update, mostly for position. |
@@ -51,9 +55,9 @@ namespace OpenSim.Services.Interfaces | |||
51 | /// <param name="regionHandle"></param> | 55 | /// <param name="regionHandle"></param> |
52 | /// <param name="data"></param> | 56 | /// <param name="data"></param> |
53 | /// <returns></returns> | 57 | /// <returns></returns> |
54 | bool UpdateAgent(ulong regionHandle, AgentPosition data); | 58 | bool UpdateAgent(GridRegion destination, AgentPosition data); |
55 | 59 | ||
56 | bool RetrieveAgent(ulong regionHandle, UUID id, out IAgentData agent); | 60 | bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent); |
57 | 61 | ||
58 | /// <summary> | 62 | /// <summary> |
59 | /// Message from receiving region to departing region, telling it got contacted by the client. | 63 | /// Message from receiving region to departing region, telling it got contacted by the client. |
@@ -63,7 +67,7 @@ namespace OpenSim.Services.Interfaces | |||
63 | /// <param name="id"></param> | 67 | /// <param name="id"></param> |
64 | /// <param name="uri"></param> | 68 | /// <param name="uri"></param> |
65 | /// <returns></returns> | 69 | /// <returns></returns> |
66 | bool ReleaseAgent(ulong regionHandle, UUID id, string uri); | 70 | bool ReleaseAgent(UUID originRegion, UUID id, string uri); |
67 | 71 | ||
68 | /// <summary> | 72 | /// <summary> |
69 | /// Close agent. | 73 | /// Close agent. |
@@ -71,7 +75,7 @@ namespace OpenSim.Services.Interfaces | |||
71 | /// <param name="regionHandle"></param> | 75 | /// <param name="regionHandle"></param> |
72 | /// <param name="id"></param> | 76 | /// <param name="id"></param> |
73 | /// <returns></returns> | 77 | /// <returns></returns> |
74 | bool CloseAgent(ulong regionHandle, UUID id); | 78 | bool CloseAgent(GridRegion destination, UUID id); |
75 | 79 | ||
76 | #endregion Agents | 80 | #endregion Agents |
77 | 81 | ||
@@ -84,7 +88,7 @@ namespace OpenSim.Services.Interfaces | |||
84 | /// <param name="sog"></param> | 88 | /// <param name="sog"></param> |
85 | /// <param name="isLocalCall"></param> | 89 | /// <param name="isLocalCall"></param> |
86 | /// <returns></returns> | 90 | /// <returns></returns> |
87 | bool CreateObject(ulong regionHandle, ISceneObject sog, bool isLocalCall); | 91 | bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall); |
88 | 92 | ||
89 | /// <summary> | 93 | /// <summary> |
90 | /// Create an object from the user's inventory in the destination region. | 94 | /// Create an object from the user's inventory in the destination region. |
@@ -94,15 +98,9 @@ namespace OpenSim.Services.Interfaces | |||
94 | /// <param name="userID"></param> | 98 | /// <param name="userID"></param> |
95 | /// <param name="itemID"></param> | 99 | /// <param name="itemID"></param> |
96 | /// <returns></returns> | 100 | /// <returns></returns> |
97 | bool CreateObject(ulong regionHandle, UUID userID, UUID itemID); | 101 | bool CreateObject(GridRegion destination, UUID userID, UUID itemID); |
98 | 102 | ||
99 | #endregion Objects | 103 | #endregion Objects |
100 | 104 | ||
101 | #region Regions | ||
102 | |||
103 | bool HelloNeighbour(ulong regionHandle, RegionInfo thisRegion); | ||
104 | |||
105 | #endregion Regions | ||
106 | |||
107 | } | 105 | } |
108 | } | 106 | } |
diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs new file mode 100644 index 0000000..3dacf53 --- /dev/null +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | ||
31 | |||
32 | namespace OpenSim.Services.Interfaces | ||
33 | { | ||
34 | public class UserAccount | ||
35 | { | ||
36 | public UserAccount() | ||
37 | { | ||
38 | } | ||
39 | |||
40 | public UserAccount(UUID principalID) | ||
41 | { | ||
42 | PrincipalID = principalID; | ||
43 | } | ||
44 | |||
45 | public UserAccount(UUID scopeID, string firstName, string lastName, string email) | ||
46 | { | ||
47 | PrincipalID = UUID.Random(); | ||
48 | ScopeID = scopeID; | ||
49 | FirstName = firstName; | ||
50 | LastName = lastName; | ||
51 | Email = email; | ||
52 | ServiceURLs = new Dictionary<string, object>(); | ||
53 | // Created = ??? | ||
54 | } | ||
55 | |||
56 | public string FirstName; | ||
57 | public string LastName; | ||
58 | public string Email; | ||
59 | public UUID PrincipalID; | ||
60 | public UUID ScopeID; | ||
61 | public int UserLevel; | ||
62 | public int UserFlags; | ||
63 | public string UserTitle; | ||
64 | |||
65 | public Dictionary<string, object> ServiceURLs; | ||
66 | |||
67 | public int Created; | ||
68 | |||
69 | public string Name | ||
70 | { | ||
71 | get { return FirstName + " " + LastName; } | ||
72 | } | ||
73 | |||
74 | public UserAccount(Dictionary<string, object> kvp) | ||
75 | { | ||
76 | if (kvp.ContainsKey("FirstName")) | ||
77 | FirstName = kvp["FirstName"].ToString(); | ||
78 | if (kvp.ContainsKey("LastName")) | ||
79 | LastName = kvp["LastName"].ToString(); | ||
80 | if (kvp.ContainsKey("Email")) | ||
81 | Email = kvp["Email"].ToString(); | ||
82 | if (kvp.ContainsKey("PrincipalID")) | ||
83 | UUID.TryParse(kvp["PrincipalID"].ToString(), out PrincipalID); | ||
84 | if (kvp.ContainsKey("ScopeID")) | ||
85 | UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID); | ||
86 | if (kvp.ContainsKey("UserLevel")) | ||
87 | Convert.ToInt32(kvp["UserLevel"].ToString()); | ||
88 | if (kvp.ContainsKey("UserFlags")) | ||
89 | Convert.ToInt32(kvp["UserFlags"].ToString()); | ||
90 | if (kvp.ContainsKey("UserTitle")) | ||
91 | Email = kvp["UserTitle"].ToString(); | ||
92 | |||
93 | if (kvp.ContainsKey("Created")) | ||
94 | Convert.ToInt32(kvp["Created"].ToString()); | ||
95 | if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null) | ||
96 | { | ||
97 | ServiceURLs = new Dictionary<string, object>(); | ||
98 | string str = kvp["ServiceURLs"].ToString(); | ||
99 | if (str != string.Empty) | ||
100 | { | ||
101 | string[] parts = str.Split(new char[] { ';' }); | ||
102 | Dictionary<string, object> dic = new Dictionary<string, object>(); | ||
103 | foreach (string s in parts) | ||
104 | { | ||
105 | string[] parts2 = s.Split(new char[] { '*' }); | ||
106 | if (parts2.Length == 2) | ||
107 | ServiceURLs[parts2[0]] = parts2[1]; | ||
108 | } | ||
109 | } | ||
110 | } | ||
111 | } | ||
112 | |||
113 | public Dictionary<string, object> ToKeyValuePairs() | ||
114 | { | ||
115 | Dictionary<string, object> result = new Dictionary<string, object>(); | ||
116 | result["FirstName"] = FirstName; | ||
117 | result["LastName"] = LastName; | ||
118 | result["Email"] = Email; | ||
119 | result["PrincipalID"] = PrincipalID.ToString(); | ||
120 | result["ScopeID"] = ScopeID.ToString(); | ||
121 | result["Created"] = Created.ToString(); | ||
122 | result["UserLevel"] = UserLevel.ToString(); | ||
123 | result["UserFlags"] = UserFlags.ToString(); | ||
124 | result["UserTitle"] = UserTitle; | ||
125 | |||
126 | string str = string.Empty; | ||
127 | foreach (KeyValuePair<string, object> kvp in ServiceURLs) | ||
128 | { | ||
129 | str += kvp.Key + "*" + (kvp.Value == null ? "" : kvp.Value) + ";"; | ||
130 | } | ||
131 | result["ServiceURLs"] = str; | ||
132 | |||
133 | return result; | ||
134 | } | ||
135 | |||
136 | }; | ||
137 | |||
138 | public interface IUserAccountService | ||
139 | { | ||
140 | UserAccount GetUserAccount(UUID scopeID, UUID userID); | ||
141 | UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName); | ||
142 | UserAccount GetUserAccount(UUID scopeID, string Email); | ||
143 | // Returns the list of avatars that matches both the search | ||
144 | // criterion and the scope ID passed | ||
145 | // | ||
146 | List<UserAccount> GetUserAccounts(UUID scopeID, string query); | ||
147 | |||
148 | // Store the data given, wich replaces the sotred data, therefore | ||
149 | // must be complete. | ||
150 | // | ||
151 | bool StoreUserAccount(UserAccount data); | ||
152 | } | ||
153 | } | ||
diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs deleted file mode 100644 index 92bd8ef..0000000 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ /dev/null | |||
@@ -1,103 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System.Collections.Generic; | ||
29 | using OpenMetaverse; | ||
30 | |||
31 | namespace OpenSim.Services.Interfaces | ||
32 | { | ||
33 | public class UserAccount | ||
34 | { | ||
35 | public UserAccount() | ||
36 | { | ||
37 | } | ||
38 | |||
39 | public UserAccount(UUID userID, UUID homeRegionID, float homePositionX, | ||
40 | float homePositionY, float homePositionZ, float homeLookAtX, | ||
41 | float homeLookAtY, float homeLookAtZ) | ||
42 | { | ||
43 | UserID = userID; | ||
44 | HomeRegionID = homeRegionID; | ||
45 | HomePositionX = homePositionX; | ||
46 | HomePositionY = homePositionY; | ||
47 | HomePositionZ = homePositionZ; | ||
48 | HomeLookAtX = homeLookAtX; | ||
49 | HomeLookAtY = homeLookAtY; | ||
50 | HomeLookAtZ = homeLookAtZ; | ||
51 | } | ||
52 | |||
53 | public string FirstName; | ||
54 | public string LastName; | ||
55 | public UUID UserID; | ||
56 | public UUID ScopeID; | ||
57 | |||
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 | ||
71 | // concern the account rather than | ||
72 | // the profile. They just happen to | ||
73 | // be used in the Linden profile as well | ||
74 | // | ||
75 | public int GodLevel; | ||
76 | public int UserFlags; | ||
77 | public string AccountType; | ||
78 | |||
79 | }; | ||
80 | |||
81 | public interface IUserAccountService | ||
82 | { | ||
83 | UserAccount GetUserAccount(UUID scopeID, UUID userID); | ||
84 | UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName); | ||
85 | // Returns the list of avatars that matches both the search | ||
86 | // criterion and the scope ID passed | ||
87 | // | ||
88 | List<UserAccount> GetUserAccount(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 | |||
96 | // Update all updatable fields | ||
97 | // | ||
98 | bool SetUserAccount(UserAccount data, UUID PrincipalID, string token); | ||
99 | |||
100 | // Creates a user data record | ||
101 | bool CreateUserAccount(UserAccount data, UUID PrincipalID, string token); | ||
102 | } | ||
103 | } | ||