clockwerk-opensim-stable – Blame information for rev 1

Subversion Repositories:
Rev:
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 /// Check if the agent is an NPC.
76 /// </summary>
77 /// <param name="agentID"></param>
78 /// <param name="scene"></param>
79 /// <returns>
80 /// True if the agent is an NPC in the given scene. False otherwise.
81 /// </returns>
82 bool IsNPC(UUID agentID, Scene scene);
83  
84 /// <summary>
85 /// Get the NPC.
86 /// </summary>
87 /// <remarks>
88 /// This is not currently complete - manipulation of NPCs still occurs
89 /// through the region interface.
90 /// </remarks>
91 /// <param name="agentID"></param>
92 /// <param name="scene"></param>
93 /// <returns>The NPC. null if it does not exist.</returns>
94 INPC GetNPC(UUID agentID, Scene scene);
95  
96 /// <summary>
97 /// Check if the caller has permission to manipulate the given NPC.
98 /// </summary>
99 /// <param name="npcID"></param>
100 /// <param name="callerID"></param>
101 /// <returns>
102 /// true if they do, false if they don't or if there's no NPC with the
103 /// given ID.
104 /// </returns>
105 bool CheckPermissions(UUID npcID, UUID callerID);
106  
107 /// <summary>
108 /// Set the appearance for an NPC.
109 /// </summary>
110 /// <param name="agentID"></param>
111 /// <param name="appearance"></param>
112 /// <param name="scene"></param>
113 /// <returns>
114 /// True if the operation succeeded, false if there was no such agent
115 /// or the agent was not an NPC.
116 /// </returns>
117 bool SetNPCAppearance(UUID agentID, AvatarAppearance appearance,
118 Scene scene);
119  
120 /// <summary>
121 /// Move an NPC to a target over time.
122 /// </summary>
123 /// <param name="agentID">The UUID of the NPC</param>
124 /// <param name="scene"></param>
125 /// <param name="pos"></param>
126 /// <param name="noFly">
127 /// If true, then the avatar will attempt to walk to the location even
128 /// if it's up in the air. This is to allow walking on prims.
129 /// </param>
130 /// <param name="landAtTarget">
131 /// If true and the avatar is flying when it reaches the target, land.
132 /// </param> name="running">
133 /// If true, NPC moves with running speed.
134 /// <returns>
135 /// True if the operation succeeded, false if there was no such agent
136 /// or the agent was not an NPC.
137 /// </returns>
138 bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly,
139 bool landAtTarget, bool running);
140  
141 /// <summary>
142 /// Stop the NPC's current movement.
143 /// </summary>
144 /// <param name="agentID">The UUID of the NPC</param>
145 /// <param name="scene"></param>
146 /// <returns>
147 /// True if the operation succeeded, false if there was no such agent
148 /// or the agent was not an NPC.
149 /// </returns>
150 bool StopMoveToTarget(UUID agentID, Scene scene);
151  
152 /// <summary>
153 /// Get the NPC to say something.
154 /// </summary>
155 /// <param name="agentID">The UUID of the NPC</param>
156 /// <param name="scene"></param>
157 /// <param name="text"></param>
158 /// <returns>
159 /// True if the operation succeeded, false if there was no such agent
160 /// or the agent was not an NPC.
161 /// </returns>
162 bool Say(UUID agentID, Scene scene, string text);
163  
164 /// <summary>
165 /// Get the NPC to say something.
166 /// </summary>
167 /// <param name="agentID">The UUID of the NPC</param>
168 /// <param name="scene"></param>
169 /// <param name="text"></param>
170 /// <param name="channel"></param>
171 /// <returns>
172 /// True if the operation succeeded, false if there was no such agent
173 /// or the agent was not an NPC.
174 /// </returns>
175 bool Say(UUID agentID, Scene scene, string text, int channel);
176  
177 /// <summary>
178 /// Get the NPC to shout something.
179 /// </summary>
180 /// <param name="agentID">The UUID of the NPC</param>
181 /// <param name="scene"></param>
182 /// <param name="text"></param>
183 /// <param name="channel"></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 Shout(UUID agentID, Scene scene, string text, int channel);
189  
190 /// <summary>
191 /// Get the NPC to whisper 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 Whisper(UUID agentID, Scene scene, string text, int channel);
202  
203 /// <summary>
204 /// Sit the NPC.
205 /// </summary>
206 /// <param name="agentID"></param>
207 /// <param name="partID"></param>
208 /// <param name="scene"></param>
209 /// <returns>true if the sit succeeded, false if not</returns>
210 bool Sit(UUID agentID, UUID partID, Scene scene);
211  
212 /// <summary>
213 /// Stand a sitting NPC.
214 /// </summary>
215 /// <param name="agentID"></param>
216 /// <param name="scene"></param>
217 /// <returns>true if the stand succeeded, false if not</returns>
218 bool Stand(UUID agentID, Scene scene);
219  
220 /// <summary>
221 /// Get the NPC to touch an object.
222 /// </summary>
223 /// <param name="agentID"></param>
224 /// <param name="partID"></param>
225 /// <returns>
226 /// true if the touch is actually attempted, false if not.
227 /// </returns>
228 bool Touch(UUID agentID, UUID partID);
229  
230 /// <summary>
231 /// Delete an NPC.
232 /// </summary>
233 /// <param name="agentID">The UUID of the NPC</param>
234 /// <param name="scene"></param>
235 /// <returns>
236 /// True if the operation succeeded, false if there was no such agent
237 /// or the agent was not an NPC.
238 /// </returns>
239 bool DeleteNPC(UUID agentID, Scene scene);
240  
241 /// <summary>
242 /// Get the owner of a NPC
243 /// </summary>
244 /// <param name="agentID">The UUID of the NPC</param>
245 /// <returns>
246 /// UUID of owner if the NPC exists, UUID.Zero if there was no such
247 /// agent, the agent is unowned or the agent was not an NPC.
248 /// </returns>
249 UUID GetOwner(UUID agentID);
250 }
251 }