clockwerk-opensim – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | vero | 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 OpenMetaverse; |
||
29 | using OpenSim.Framework; |
||
30 | using OpenSim.Region.Framework.Scenes; |
||
31 | |||
32 | namespace OpenSim.Region.Framework.Interfaces |
||
33 | { |
||
34 | /// <summary> |
||
35 | /// Temporary interface. More methods to come at some point to make NPCs |
||
36 | /// more object oriented rather than controlling purely through module |
||
37 | /// level interface calls (e.g. sit/stand). |
||
38 | /// </summary> |
||
39 | public interface INPC |
||
40 | { |
||
41 | /// <summary> |
||
42 | /// Should this NPC be sensed by LSL sensors as an 'agent' |
||
43 | /// (interpreted here to mean a normal user) rather than an OpenSim |
||
44 | /// specific NPC extension? |
||
45 | /// </summary> |
||
46 | bool SenseAsAgent { get; } |
||
47 | } |
||
48 | |||
49 | public interface INPCModule |
||
50 | { |
||
51 | /// <summary> |
||
52 | /// Create an NPC |
||
53 | /// </summary> |
||
54 | /// <param name="firstname"></param> |
||
55 | /// <param name="lastname"></param> |
||
56 | /// <param name="position"></param> |
||
57 | /// <param name="senseAsAgent"> |
||
58 | /// Make the NPC show up as an agent on LSL sensors. The default is |
||
59 | /// that they show up as the NPC type instead, but this is currently |
||
60 | /// an OpenSim-only extension. |
||
61 | /// </param> |
||
62 | /// <param name="scene"></param> |
||
63 | /// <param name="appearance"> |
||
64 | /// The avatar appearance to use for the new NPC. |
||
65 | /// </param> |
||
66 | /// <returns> |
||
67 | /// The UUID of the ScenePresence created. UUID.Zero if there was a |
||
68 | /// failure. |
||
69 | /// </returns> |
||
70 | UUID CreateNPC(string firstname, string lastname, Vector3 position, |
||
71 | UUID owner, bool senseAsAgent, Scene scene, |
||
72 | AvatarAppearance appearance); |
||
73 | |||
74 | /// <summary> |
||
75 | /// Create an NPC with a user-supplied agentID |
||
76 | /// </summary> |
||
77 | /// <param name="firstname"></param> |
||
78 | /// <param name="lastname"></param> |
||
79 | /// <param name="position"></param> |
||
80 | /// <param name="agentID"></param> |
||
81 | /// The desired agent ID |
||
82 | /// <param name="owner"></param> |
||
83 | /// <param name="senseAsAgent"> |
||
84 | /// Make the NPC show up as an agent on LSL sensors. The default is |
||
85 | /// that they show up as the NPC type instead, but this is currently |
||
86 | /// an OpenSim-only extension. |
||
87 | /// </param> |
||
88 | /// <param name="scene"></param> |
||
89 | /// <param name="appearance"> |
||
90 | /// The avatar appearance to use for the new NPC. |
||
91 | /// </param> |
||
92 | /// <returns> |
||
93 | /// The UUID of the ScenePresence created. UUID.Zero if there was a |
||
94 | /// failure. |
||
95 | /// </returns> |
||
96 | UUID CreateNPC(string firstname, string lastname, |
||
97 | Vector3 position, UUID agentID, UUID owner, bool senseAsAgent, Scene scene, |
||
98 | AvatarAppearance appearance); |
||
99 | |||
100 | /// <summary> |
||
101 | /// Check if the agent is an NPC. |
||
102 | /// </summary> |
||
103 | /// <param name="agentID"></param> |
||
104 | /// <param name="scene"></param> |
||
105 | /// <returns> |
||
106 | /// True if the agent is an NPC in the given scene. False otherwise. |
||
107 | /// </returns> |
||
108 | bool IsNPC(UUID agentID, Scene scene); |
||
109 | |||
110 | /// <summary> |
||
111 | /// Get the NPC. |
||
112 | /// </summary> |
||
113 | /// <remarks> |
||
114 | /// This is not currently complete - manipulation of NPCs still occurs |
||
115 | /// through the region interface. |
||
116 | /// </remarks> |
||
117 | /// <param name="agentID"></param> |
||
118 | /// <param name="scene"></param> |
||
119 | /// <returns>The NPC. null if it does not exist.</returns> |
||
120 | INPC GetNPC(UUID agentID, Scene scene); |
||
121 | |||
122 | /// <summary> |
||
123 | /// Check if the caller has permission to manipulate the given NPC. |
||
124 | /// </summary> |
||
125 | /// <param name="npcID"></param> |
||
126 | /// <param name="callerID"></param> |
||
127 | /// <returns> |
||
128 | /// true if they do, false if they don't or if there's no NPC with the |
||
129 | /// given ID. |
||
130 | /// </returns> |
||
131 | bool CheckPermissions(UUID npcID, UUID callerID); |
||
132 | |||
133 | /// <summary> |
||
134 | /// Set the appearance for an NPC. |
||
135 | /// </summary> |
||
136 | /// <param name="agentID"></param> |
||
137 | /// <param name="appearance"></param> |
||
138 | /// <param name="scene"></param> |
||
139 | /// <returns> |
||
140 | /// True if the operation succeeded, false if there was no such agent |
||
141 | /// or the agent was not an NPC. |
||
142 | /// </returns> |
||
143 | bool SetNPCAppearance(UUID agentID, AvatarAppearance appearance, |
||
144 | Scene scene); |
||
145 | |||
146 | /// <summary> |
||
147 | /// Move an NPC to a target over time. |
||
148 | /// </summary> |
||
149 | /// <param name="agentID">The UUID of the NPC</param> |
||
150 | /// <param name="scene"></param> |
||
151 | /// <param name="pos"></param> |
||
152 | /// <param name="noFly"> |
||
153 | /// If true, then the avatar will attempt to walk to the location even |
||
154 | /// if it's up in the air. This is to allow walking on prims. |
||
155 | /// </param> |
||
156 | /// <param name="landAtTarget"> |
||
157 | /// If true and the avatar is flying when it reaches the target, land. |
||
158 | /// </param> name="running"> |
||
159 | /// If true, NPC moves with running speed. |
||
160 | /// <returns> |
||
161 | /// True if the operation succeeded, false if there was no such agent |
||
162 | /// or the agent was not an NPC. |
||
163 | /// </returns> |
||
164 | bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, |
||
165 | bool landAtTarget, bool running); |
||
166 | |||
167 | /// <summary> |
||
168 | /// Stop the NPC's current movement. |
||
169 | /// </summary> |
||
170 | /// <param name="agentID">The UUID of the NPC</param> |
||
171 | /// <param name="scene"></param> |
||
172 | /// <returns> |
||
173 | /// True if the operation succeeded, false if there was no such agent |
||
174 | /// or the agent was not an NPC. |
||
175 | /// </returns> |
||
176 | bool StopMoveToTarget(UUID agentID, Scene scene); |
||
177 | |||
178 | /// <summary> |
||
179 | /// Get the NPC to say something. |
||
180 | /// </summary> |
||
181 | /// <param name="agentID">The UUID of the NPC</param> |
||
182 | /// <param name="scene"></param> |
||
183 | /// <param name="text"></param> |
||
184 | /// <returns> |
||
185 | /// True if the operation succeeded, false if there was no such agent |
||
186 | /// or the agent was not an NPC. |
||
187 | /// </returns> |
||
188 | bool Say(UUID agentID, Scene scene, string text); |
||
189 | |||
190 | /// <summary> |
||
191 | /// Get the NPC to say something. |
||
192 | /// </summary> |
||
193 | /// <param name="agentID">The UUID of the NPC</param> |
||
194 | /// <param name="scene"></param> |
||
195 | /// <param name="text"></param> |
||
196 | /// <param name="channel"></param> |
||
197 | /// <returns> |
||
198 | /// True if the operation succeeded, false if there was no such agent |
||
199 | /// or the agent was not an NPC. |
||
200 | /// </returns> |
||
201 | bool Say(UUID agentID, Scene scene, string text, int channel); |
||
202 | |||
203 | /// <summary> |
||
204 | /// Get the NPC to shout something. |
||
205 | /// </summary> |
||
206 | /// <param name="agentID">The UUID of the NPC</param> |
||
207 | /// <param name="scene"></param> |
||
208 | /// <param name="text"></param> |
||
209 | /// <param name="channel"></param> |
||
210 | /// <returns> |
||
211 | /// True if the operation succeeded, false if there was no such agent |
||
212 | /// or the agent was not an NPC. |
||
213 | /// </returns> |
||
214 | bool Shout(UUID agentID, Scene scene, string text, int channel); |
||
215 | |||
216 | /// <summary> |
||
217 | /// Get the NPC to whisper something. |
||
218 | /// </summary> |
||
219 | /// <param name="agentID">The UUID of the NPC</param> |
||
220 | /// <param name="scene"></param> |
||
221 | /// <param name="text"></param> |
||
222 | /// <param name="channel"></param> |
||
223 | /// <returns> |
||
224 | /// True if the operation succeeded, false if there was no such agent |
||
225 | /// or the agent was not an NPC. |
||
226 | /// </returns> |
||
227 | bool Whisper(UUID agentID, Scene scene, string text, int channel); |
||
228 | |||
229 | /// <summary> |
||
230 | /// Sit the NPC. |
||
231 | /// </summary> |
||
232 | /// <param name="agentID"></param> |
||
233 | /// <param name="partID"></param> |
||
234 | /// <param name="scene"></param> |
||
235 | /// <returns>true if the sit succeeded, false if not</returns> |
||
236 | bool Sit(UUID agentID, UUID partID, Scene scene); |
||
237 | |||
238 | /// <summary> |
||
239 | /// Stand a sitting NPC. |
||
240 | /// </summary> |
||
241 | /// <param name="agentID"></param> |
||
242 | /// <param name="scene"></param> |
||
243 | /// <returns>true if the stand succeeded, false if not</returns> |
||
244 | bool Stand(UUID agentID, Scene scene); |
||
245 | |||
246 | /// <summary> |
||
247 | /// Get the NPC to touch an object. |
||
248 | /// </summary> |
||
249 | /// <param name="agentID"></param> |
||
250 | /// <param name="partID"></param> |
||
251 | /// <returns> |
||
252 | /// true if the touch is actually attempted, false if not. |
||
253 | /// </returns> |
||
254 | bool Touch(UUID agentID, UUID partID); |
||
255 | |||
256 | /// <summary> |
||
257 | /// Delete an NPC. |
||
258 | /// </summary> |
||
259 | /// <param name="agentID">The UUID of the NPC</param> |
||
260 | /// <param name="scene"></param> |
||
261 | /// <returns> |
||
262 | /// True if the operation succeeded, false if there was no such agent |
||
263 | /// or the agent was not an NPC. |
||
264 | /// </returns> |
||
265 | bool DeleteNPC(UUID agentID, Scene scene); |
||
266 | |||
267 | /// <summary> |
||
268 | /// Get the owner of a NPC |
||
269 | /// </summary> |
||
270 | /// <param name="agentID">The UUID of the NPC</param> |
||
271 | /// <returns> |
||
272 | /// UUID of owner if the NPC exists, UUID.Zero if there was no such |
||
273 | /// agent, the agent is unowned or the agent was not an NPC. |
||
274 | /// </returns> |
||
275 | UUID GetOwner(UUID agentID); |
||
276 | } |
||
277 | } |