diff options
Diffstat (limited to 'OpenSim/Services/Interfaces')
-rw-r--r-- | OpenSim/Services/Interfaces/IAvatarService.cs | 204 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/ILibraryService.cs | 43 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/ILoginService.cs | 53 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IPresenceService.cs | 68 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/ISimulationService.cs | 26 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IUserAccountService.cs | 123 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/IUserService.cs | 103 |
7 files changed, 500 insertions, 120 deletions
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs new file mode 100644 index 0000000..ea08ea5 --- /dev/null +++ b/OpenSim/Services/Interfaces/IAvatarService.cs | |||
@@ -0,0 +1,204 @@ | |||
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 null; | ||
127 | } | ||
128 | |||
129 | public AvatarData(AvatarAppearance appearance) | ||
130 | { | ||
131 | AvatarType = 1; // SL avatars | ||
132 | Data = new Dictionary<string, string>(); | ||
133 | |||
134 | // Wearables | ||
135 | Data["AvatarHeight"] = appearance.AvatarHeight.ToString(); | ||
136 | Data["BodyItem"] = appearance.BodyItem.ToString(); | ||
137 | Data["EyesItem"] = appearance.EyesItem.ToString(); | ||
138 | Data["GlovesItem"] = appearance.GlovesItem.ToString(); | ||
139 | Data["HairItem"] = appearance.HairItem.ToString(); | ||
140 | //Data["HipOffset"] = appearance.HipOffset.ToString(); | ||
141 | Data["JacketItem"] = appearance.JacketItem.ToString(); | ||
142 | Data["Owner"] = appearance.Owner.ToString(); | ||
143 | Data["PantsItem"] = appearance.PantsItem.ToString(); | ||
144 | Data["Serial"] = appearance.Serial.ToString(); | ||
145 | Data["ShirtItem"] = appearance.ShirtItem.ToString(); | ||
146 | Data["ShoesItem"] = appearance.ShoesItem.ToString(); | ||
147 | Data["SkinItem"] = appearance.SkinItem.ToString(); | ||
148 | Data["SkirtItem"] = appearance.SkirtItem.ToString(); | ||
149 | Data["SocksItem"] = appearance.SocksItem.ToString(); | ||
150 | Data["UnderPantsItem"] = appearance.UnderPantsItem.ToString(); | ||
151 | Data["UnderShirtItem"] = appearance.UnderShirtItem.ToString(); | ||
152 | |||
153 | // Attachments | ||
154 | Hashtable attachs = appearance.GetAttachments(); | ||
155 | foreach (KeyValuePair<int, Hashtable> kvp in attachs) | ||
156 | { | ||
157 | Data["_ap_" + kvp.Key] = kvp.Value["item"].ToString(); | ||
158 | } | ||
159 | } | ||
160 | |||
161 | public AvatarAppearance ToAvatarAppearance() | ||
162 | { | ||
163 | AvatarAppearance appearance = new AvatarAppearance(); | ||
164 | // Wearables | ||
165 | appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]); | ||
166 | appearance.BodyItem = UUID.Parse(Data["BodyItem"]); | ||
167 | appearance.EyesItem = UUID.Parse(Data["EyesItem"]); | ||
168 | appearance.GlovesItem = UUID.Parse(Data["GlovesItem"]); | ||
169 | appearance.HairItem = UUID.Parse(Data["HairItem"]); | ||
170 | //appearance.HipOffset = float.Parse(Data["HipOffset"]); | ||
171 | appearance.JacketItem = UUID.Parse(Data["JacketItem"]); | ||
172 | appearance.Owner = UUID.Parse(Data["Owner"]); | ||
173 | appearance.PantsItem = UUID.Parse(Data["PantsItem"]); | ||
174 | appearance.Serial = Int32.Parse(Data["Serial"]); | ||
175 | appearance.ShirtItem = UUID.Parse(Data["ShirtItem"]); | ||
176 | appearance.ShoesItem = UUID.Parse(Data["ShoesItem"]); | ||
177 | appearance.SkinItem = UUID.Parse(Data["SkinItem"]); | ||
178 | appearance.SkirtItem = UUID.Parse(Data["SkirtItem"]); | ||
179 | appearance.SocksItem = UUID.Parse(Data["SocksItem"]); | ||
180 | appearance.UnderPantsItem = UUID.Parse(Data["UnderPantsItem"]); | ||
181 | appearance.UnderShirtItem = UUID.Parse(Data["UnderShirtItem"]); | ||
182 | |||
183 | // Attachments | ||
184 | Dictionary<string, string> attchs = new Dictionary<string, string>(); | ||
185 | foreach (KeyValuePair<string, string> _kvp in Data) | ||
186 | if (_kvp.Key.StartsWith("_ap_")) | ||
187 | attchs[_kvp.Key] = _kvp.Value; | ||
188 | Hashtable aaAttachs = new Hashtable(); | ||
189 | foreach (KeyValuePair<string, string> _kvp in attchs) | ||
190 | { | ||
191 | string pointStr = _kvp.Key.Substring(4); | ||
192 | int point = 0; | ||
193 | if (!Int32.TryParse(pointStr, out point)) | ||
194 | continue; | ||
195 | Hashtable tmp = new Hashtable(); | ||
196 | tmp["item"] = _kvp.Value; | ||
197 | tmp["asset"] = UUID.Zero.ToString(); | ||
198 | aaAttachs[point] = tmp; | ||
199 | } | ||
200 | |||
201 | return appearance; | ||
202 | } | ||
203 | } | ||
204 | } | ||
diff --git a/OpenSim/Services/Interfaces/ILibraryService.cs b/OpenSim/Services/Interfaces/ILibraryService.cs new file mode 100644 index 0000000..861cf0e --- /dev/null +++ b/OpenSim/Services/Interfaces/ILibraryService.cs | |||
@@ -0,0 +1,43 @@ | |||
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 | |||
31 | using OpenSim.Framework; | ||
32 | using OpenMetaverse; | ||
33 | |||
34 | namespace OpenSim.Services.Interfaces | ||
35 | { | ||
36 | public interface ILibraryService | ||
37 | { | ||
38 | InventoryFolderImpl LibraryRootFolder { get; } | ||
39 | |||
40 | Dictionary<UUID, InventoryFolderImpl> GetAllFolders(); | ||
41 | } | ||
42 | |||
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..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/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index a169ab7..14f462c 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(GridRegion destination, 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..87f0e6c --- /dev/null +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs | |||
@@ -0,0 +1,123 @@ | |||
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 string FirstName; | ||
46 | public string LastName; | ||
47 | public string Email; | ||
48 | public UUID PrincipalID; | ||
49 | public UUID ScopeID; | ||
50 | |||
51 | public Dictionary<string, object> ServiceURLs; | ||
52 | |||
53 | public int Created; | ||
54 | |||
55 | public UserAccount(Dictionary<string, object> kvp) | ||
56 | { | ||
57 | if (kvp.ContainsKey("FirstName")) | ||
58 | FirstName = kvp["FirstName"].ToString(); | ||
59 | if (kvp.ContainsKey("LastName")) | ||
60 | LastName = kvp["LastName"].ToString(); | ||
61 | if (kvp.ContainsKey("Email")) | ||
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) | ||
70 | { | ||
71 | ServiceURLs = new Dictionary<string, object>(); | ||
72 | string str = kvp["ServiceURLs"].ToString(); | ||
73 | if (str != string.Empty) | ||
74 | { | ||
75 | string[] parts = str.Split(new char[] { '#' }); | ||
76 | Dictionary<string, object> dic = new Dictionary<string, object>(); | ||
77 | foreach (string s in parts) | ||
78 | { | ||
79 | string[] parts2 = s.Split(new char[] { '=' }); | ||
80 | if (parts2.Length == 2) | ||
81 | ServiceURLs[parts2[0]] = parts2[1]; | ||
82 | } | ||
83 | } | ||
84 | } | ||
85 | } | ||
86 | |||
87 | public Dictionary<string, object> ToKeyValuePairs() | ||
88 | { | ||
89 | Dictionary<string, object> result = new Dictionary<string, object>(); | ||
90 | result["FirstName"] = FirstName; | ||
91 | result["LastName"] = LastName; | ||
92 | result["Email"] = Email; | ||
93 | result["PrincipalID"] = PrincipalID.ToString(); | ||
94 | result["ScopeID"] = ScopeID.ToString(); | ||
95 | result["Created"] = Created.ToString(); | ||
96 | string str = string.Empty; | ||
97 | foreach (KeyValuePair<string, object> kvp in ServiceURLs) | ||
98 | { | ||
99 | str += kvp.Key + "=" + kvp.Value + "#"; | ||
100 | } | ||
101 | result["ServiceURLs"] = str; | ||
102 | |||
103 | return result; | ||
104 | } | ||
105 | |||
106 | }; | ||
107 | |||
108 | public interface IUserAccountService | ||
109 | { | ||
110 | UserAccount GetUserAccount(UUID scopeID, UUID userID); | ||
111 | UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName); | ||
112 | UserAccount GetUserAccount(UUID scopeID, string Email); | ||
113 | // Returns the list of avatars that matches both the search | ||
114 | // criterion and the scope ID passed | ||
115 | // | ||
116 | List<UserAccount> GetUserAccounts(UUID scopeID, string query); | ||
117 | |||
118 | // Store the data given, wich replaces the sotred data, therefore | ||
119 | // must be complete. | ||
120 | // | ||
121 | bool StoreUserAccount(UserAccount data); | ||
122 | } | ||
123 | } | ||
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 | } | ||