aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorSignpostMarv2012-11-11 20:42:55 +0000
committerDiva Canto2012-11-11 13:50:38 -0800
commitf560d581bbeb420dccdfa80c574724deada8038b (patch)
treee596e224cf5329220075a4066f940b72662160fb /OpenSim
parentconverting NPC module to ISharedRegionModule (diff)
downloadopensim-SC_OLD-f560d581bbeb420dccdfa80c574724deada8038b.zip
opensim-SC_OLD-f560d581bbeb420dccdfa80c574724deada8038b.tar.gz
opensim-SC_OLD-f560d581bbeb420dccdfa80c574724deada8038b.tar.bz2
opensim-SC_OLD-f560d581bbeb420dccdfa80c574724deada8038b.tar.xz
document & 80-character width terminal formatting
Signed-off-by: Diva Canto <diva@metaverseink.com>
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Interfaces/INPCModule.cs114
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs129
2 files changed, 158 insertions, 85 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
index d582149..9817cf7 100644
--- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
@@ -32,14 +32,16 @@ using OpenSim.Region.Framework.Scenes;
32namespace OpenSim.Region.Framework.Interfaces 32namespace OpenSim.Region.Framework.Interfaces
33{ 33{
34 /// <summary> 34 /// <summary>
35 /// Temporary interface. More methods to come at some point to make NPCs more object oriented rather than 35 /// Temporary interface. More methods to come at some point to make NPCs
36 /// controlling purely through module level interface calls (e.g. sit/stand). 36 /// more object oriented rather than controlling purely through module
37 /// level interface calls (e.g. sit/stand).
37 /// </summary> 38 /// </summary>
38 public interface INPC 39 public interface INPC
39 { 40 {
40 /// <summary> 41 /// <summary>
41 /// Should this NPC be sensed by LSL sensors as an 'agent' (interpreted here to mean a normal user) 42 /// Should this NPC be sensed by LSL sensors as an 'agent'
42 /// rather than an OpenSim specific NPC extension? 43 /// (interpreted here to mean a normal user) rather than an OpenSim
44 /// specific NPC extension?
43 /// </summary> 45 /// </summary>
44 bool SenseAsAgent { get; } 46 bool SenseAsAgent { get; }
45 } 47 }
@@ -53,35 +55,42 @@ namespace OpenSim.Region.Framework.Interfaces
53 /// <param name="lastname"></param> 55 /// <param name="lastname"></param>
54 /// <param name="position"></param> 56 /// <param name="position"></param>
55 /// <param name="senseAsAgent"> 57 /// <param name="senseAsAgent">
56 /// Make the NPC show up as an agent on LSL sensors. The default is that they 58 /// Make the NPC show up as an agent on LSL sensors. The default is
57 /// show up as the NPC type instead, but this is currently an OpenSim-only extension. 59 /// that they show up as the NPC type instead, but this is currently
60 /// an OpenSim-only extension.
58 /// </param> 61 /// </param>
59 /// <param name="scene"></param> 62 /// <param name="scene"></param>
60 /// <param name="appearance">The avatar appearance to use for the new NPC.</param> 63 /// <param name="appearance">
61 /// <returns>The UUID of the ScenePresence created. UUID.Zero if there was a failure.</returns> 64 /// The avatar appearance to use for the new NPC.
62 UUID CreateNPC( 65 /// </param>
63 string firstname, 66 /// <returns>
64 string lastname, 67 /// The UUID of the ScenePresence created. UUID.Zero if there was a
65 Vector3 position, 68 /// failure.
66 UUID owner, 69 /// </returns>
67 bool senseAsAgent, 70 UUID CreateNPC(string firstname, string lastname, Vector3 position,
68 Scene scene, 71 UUID owner, bool senseAsAgent, Scene scene,
69 AvatarAppearance appearance); 72 AvatarAppearance appearance);
70 73
71 /// <summary> 74 /// <summary>
72 /// Check if the agent is an NPC. 75 /// Check if the agent is an NPC.
73 /// </summary> 76 /// </summary>
74 /// <param name="agentID"></param> 77 /// <param name="agentID"></param>
75 /// <param name="scene"></param> 78 /// <param name="scene"></param>
76 /// <returns>True if the agent is an NPC in the given scene. False otherwise.</returns> 79 /// <returns>
80 /// True if the agent is an NPC in the given scene. False otherwise.
81 /// </returns>
77 bool IsNPC(UUID agentID, Scene scene); 82 bool IsNPC(UUID agentID, Scene scene);
78 83
79 /// <summary> 84 /// <summary>
80 /// Get the NPC. This is not currently complete - manipulation of NPCs still occurs through the region interface 85 /// Get the NPC.
81 /// </summary> 86 /// </summary>
87 /// <remarks>
88 /// This is not currently complete - manipulation of NPCs still occurs
89 /// through the region interface.
90 /// </remarks>
82 /// <param name="agentID"></param> 91 /// <param name="agentID"></param>
83 /// <param name="scene"></param> 92 /// <param name="scene"></param>
84 /// <returns>The NPC. null if it does not exist.</returns> 93 /// <returns>The NPC. null if it does not exist.</returns>
85 INPC GetNPC(UUID agentID, Scene scene); 94 INPC GetNPC(UUID agentID, Scene scene);
86 95
87 /// <summary> 96 /// <summary>
@@ -89,7 +98,10 @@ namespace OpenSim.Region.Framework.Interfaces
89 /// </summary> 98 /// </summary>
90 /// <param name="npcID"></param> 99 /// <param name="npcID"></param>
91 /// <param name="callerID"></param> 100 /// <param name="callerID"></param>
92 /// <returns>true if they do, false if they don't or if there's no NPC with the given ID.</returns> 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>
93 bool CheckPermissions(UUID npcID, UUID callerID); 105 bool CheckPermissions(UUID npcID, UUID callerID);
94 106
95 /// <summary> 107 /// <summary>
@@ -98,8 +110,12 @@ namespace OpenSim.Region.Framework.Interfaces
98 /// <param name="agentID"></param> 110 /// <param name="agentID"></param>
99 /// <param name="appearance"></param> 111 /// <param name="appearance"></param>
100 /// <param name="scene"></param> 112 /// <param name="scene"></param>
101 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns> 113 /// <returns>
102 bool SetNPCAppearance(UUID agentID, AvatarAppearance appearance, Scene scene); 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);
103 119
104 /// <summary> 120 /// <summary>
105 /// Move an NPC to a target over time. 121 /// Move an NPC to a target over time.
@@ -108,23 +124,29 @@ namespace OpenSim.Region.Framework.Interfaces
108 /// <param name="scene"></param> 124 /// <param name="scene"></param>
109 /// <param name="pos"></param> 125 /// <param name="pos"></param>
110 /// <param name="noFly"> 126 /// <param name="noFly">
111 /// If true, then the avatar will attempt to walk to the location even if it's up in the air. 127 /// If true, then the avatar will attempt to walk to the location even
112 /// This is to allow walking on prims. 128 /// if it's up in the air. This is to allow walking on prims.
113 /// </param> 129 /// </param>
114 /// <param name="landAtTarget"> 130 /// <param name="landAtTarget">
115 /// If true and the avatar is flying when it reaches the target, land. 131 /// If true and the avatar is flying when it reaches the target, land.
116 /// </param> name="running"> 132 /// </param> name="running">
117 /// If true, NPC moves with running speed. 133 /// If true, NPC moves with running speed.
118 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns> 134 /// <returns>
119 /// 135 /// True if the operation succeeded, false if there was no such agent
120 bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget, bool running); 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);
121 140
122 /// <summary> 141 /// <summary>
123 /// Stop the NPC's current movement. 142 /// Stop the NPC's current movement.
124 /// </summary> 143 /// </summary>
125 /// <param name="agentID">The UUID of the NPC</param> 144 /// <param name="agentID">The UUID of the NPC</param>
126 /// <param name="scene"></param> 145 /// <param name="scene"></param>
127 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns> 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>
128 bool StopMoveToTarget(UUID agentID, Scene scene); 150 bool StopMoveToTarget(UUID agentID, Scene scene);
129 151
130 /// <summary> 152 /// <summary>
@@ -133,7 +155,10 @@ namespace OpenSim.Region.Framework.Interfaces
133 /// <param name="agentID">The UUID of the NPC</param> 155 /// <param name="agentID">The UUID of the NPC</param>
134 /// <param name="scene"></param> 156 /// <param name="scene"></param>
135 /// <param name="text"></param> 157 /// <param name="text"></param>
136 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns> 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>
137 bool Say(UUID agentID, Scene scene, string text); 162 bool Say(UUID agentID, Scene scene, string text);
138 163
139 /// <summary> 164 /// <summary>
@@ -143,7 +168,10 @@ namespace OpenSim.Region.Framework.Interfaces
143 /// <param name="scene"></param> 168 /// <param name="scene"></param>
144 /// <param name="text"></param> 169 /// <param name="text"></param>
145 /// <param name="channel"></param> 170 /// <param name="channel"></param>
146 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns> 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>
147 bool Say(UUID agentID, Scene scene, string text, int channel); 175 bool Say(UUID agentID, Scene scene, string text, int channel);
148 176
149 /// <summary> 177 /// <summary>
@@ -153,7 +181,10 @@ namespace OpenSim.Region.Framework.Interfaces
153 /// <param name="scene"></param> 181 /// <param name="scene"></param>
154 /// <param name="text"></param> 182 /// <param name="text"></param>
155 /// <param name="channel"></param> 183 /// <param name="channel"></param>
156 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns> 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>
157 bool Shout(UUID agentID, Scene scene, string text, int channel); 188 bool Shout(UUID agentID, Scene scene, string text, int channel);
158 189
159 /// <summary> 190 /// <summary>
@@ -163,7 +194,10 @@ namespace OpenSim.Region.Framework.Interfaces
163 /// <param name="scene"></param> 194 /// <param name="scene"></param>
164 /// <param name="text"></param> 195 /// <param name="text"></param>
165 /// <param name="channel"></param> 196 /// <param name="channel"></param>
166 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns> 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>
167 bool Whisper(UUID agentID, Scene scene, string text, int channel); 201 bool Whisper(UUID agentID, Scene scene, string text, int channel);
168 202
169 /// <summary> 203 /// <summary>
@@ -188,7 +222,9 @@ namespace OpenSim.Region.Framework.Interfaces
188 /// </summary> 222 /// </summary>
189 /// <param name="agentID"></param> 223 /// <param name="agentID"></param>
190 /// <param name="partID"></param> 224 /// <param name="partID"></param>
191 /// <returns>true if the touch is actually attempted, false if not</returns> 225 /// <returns>
226 /// true if the touch is actually attempted, false if not.
227 /// </returns>
192 bool Touch(UUID agentID, UUID partID); 228 bool Touch(UUID agentID, UUID partID);
193 229
194 /// <summary> 230 /// <summary>
@@ -196,14 +232,20 @@ namespace OpenSim.Region.Framework.Interfaces
196 /// </summary> 232 /// </summary>
197 /// <param name="agentID">The UUID of the NPC</param> 233 /// <param name="agentID">The UUID of the NPC</param>
198 /// <param name="scene"></param> 234 /// <param name="scene"></param>
199 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns> 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>
200 bool DeleteNPC(UUID agentID, Scene scene); 239 bool DeleteNPC(UUID agentID, Scene scene);
201 240
202 /// <summary> 241 /// <summary>
203 /// Get the owner of a NPC 242 /// Get the owner of a NPC
204 /// </summary> 243 /// </summary>
205 /// <param name="agentID">The UUID of the NPC</param> 244 /// <param name="agentID">The UUID of the NPC</param>
206 /// <returns>UUID of owner if the NPC exists, UUID.Zero if there was no such agent, the agent is unowned or the agent was not an NPC</returns> 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>
207 UUID GetOwner(UUID agentID); 249 UUID GetOwner(UUID agentID);
208 } 250 }
209} \ No newline at end of file 251}
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index b372c88..41e7097 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -29,14 +29,16 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using System.Threading; 31using System.Threading;
32using Timer = System.Timers.Timer;
33
32using log4net; 34using log4net;
33using Nini.Config; 35using Nini.Config;
34using Mono.Addins; 36using Mono.Addins;
35using OpenMetaverse; 37using OpenMetaverse;
38
36using OpenSim.Region.Framework.Interfaces; 39using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
38using OpenSim.Framework; 41using OpenSim.Framework;
39using Timer=System.Timers.Timer;
40using OpenSim.Services.Interfaces; 42using OpenSim.Services.Interfaces;
41 43
42namespace OpenSim.Region.OptionalModules.World.NPC 44namespace OpenSim.Region.OptionalModules.World.NPC
@@ -44,9 +46,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
44 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 46 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
45 public class NPCModule : INPCModule, ISharedRegionModule 47 public class NPCModule : INPCModule, ISharedRegionModule
46 { 48 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly ILog m_log = LogManager.GetLogger(
50 MethodBase.GetCurrentMethod().DeclaringType);
48 51
49 private Dictionary<UUID, NPCAvatar> m_avatars = new Dictionary<UUID, NPCAvatar>(); 52 private Dictionary<UUID, NPCAvatar> m_avatars =
53 new Dictionary<UUID, NPCAvatar>();
50 54
51 public bool Enabled { get; private set; } 55 public bool Enabled { get; private set; }
52 56
@@ -89,8 +93,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
89 93
90 public bool IsNPC(UUID agentId, Scene scene) 94 public bool IsNPC(UUID agentId, Scene scene)
91 { 95 {
92 // FIXME: This implementation could not just use the ScenePresence.PresenceType (and callers could inspect 96 // FIXME: This implementation could not just use the
93 // that directly). 97 // ScenePresence.PresenceType (and callers could inspect that
98 // directly).
94 ScenePresence sp = scene.GetScenePresence(agentId); 99 ScenePresence sp = scene.GetScenePresence(agentId);
95 if (sp == null || sp.IsChildAgent) 100 if (sp == null || sp.IsChildAgent)
96 return false; 101 return false;
@@ -99,7 +104,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
99 return m_avatars.ContainsKey(agentId); 104 return m_avatars.ContainsKey(agentId);
100 } 105 }
101 106
102 public bool SetNPCAppearance(UUID agentId, AvatarAppearance appearance, Scene scene) 107 public bool SetNPCAppearance(UUID agentId,
108 AvatarAppearance appearance, Scene scene)
103 { 109 {
104 ScenePresence npc = scene.GetScenePresence(agentId); 110 ScenePresence npc = scene.GetScenePresence(agentId);
105 if (npc == null || npc.IsChildAgent) 111 if (npc == null || npc.IsChildAgent)
@@ -112,34 +118,35 @@ namespace OpenSim.Region.OptionalModules.World.NPC
112 // Delete existing npc attachments 118 // Delete existing npc attachments
113 scene.AttachmentsModule.DeleteAttachmentsFromScene(npc, false); 119 scene.AttachmentsModule.DeleteAttachmentsFromScene(npc, false);
114 120
115 // XXX: We can't just use IAvatarFactoryModule.SetAppearance() yet since it doesn't transfer attachments 121 // XXX: We can't just use IAvatarFactoryModule.SetAppearance() yet
116 AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true); 122 // since it doesn't transfer attachments
123 AvatarAppearance npcAppearance = new AvatarAppearance(appearance,
124 true);
117 npc.Appearance = npcAppearance; 125 npc.Appearance = npcAppearance;
118 126
119 // Rez needed npc attachments 127 // Rez needed npc attachments
120 scene.AttachmentsModule.RezAttachments(npc); 128 scene.AttachmentsModule.RezAttachments(npc);
121 129
122 IAvatarFactoryModule module = scene.RequestModuleInterface<IAvatarFactoryModule>(); 130 IAvatarFactoryModule module =
131 scene.RequestModuleInterface<IAvatarFactoryModule>();
123 module.SendAppearance(npc.UUID); 132 module.SendAppearance(npc.UUID);
124 133
125 return true; 134 return true;
126 } 135 }
127 136
128 public UUID CreateNPC( 137 public UUID CreateNPC(string firstname, string lastname,
129 string firstname, 138 Vector3 position, UUID owner, bool senseAsAgent, Scene scene,
130 string lastname, 139 AvatarAppearance appearance)
131 Vector3 position,
132 UUID owner,
133 bool senseAsAgent,
134 Scene scene,
135 AvatarAppearance appearance)
136 { 140 {
137 NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, owner, senseAsAgent, scene); 141 NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position,
138 npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue); 142 owner, senseAsAgent, scene);
143 npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0,
144 int.MaxValue);
139 145
140 m_log.DebugFormat( 146 m_log.DebugFormat(
141 "[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}", 147 "[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}",
142 firstname, lastname, npcAvatar.AgentId, owner, senseAsAgent, position, scene.RegionInfo.RegionName); 148 firstname, lastname, npcAvatar.AgentId, owner,
149 senseAsAgent, position, scene.RegionInfo.RegionName);
143 150
144 AgentCircuitData acd = new AgentCircuitData(); 151 AgentCircuitData acd = new AgentCircuitData();
145 acd.AgentID = npcAvatar.AgentId; 152 acd.AgentID = npcAvatar.AgentId;
@@ -147,42 +154,55 @@ namespace OpenSim.Region.OptionalModules.World.NPC
147 acd.lastname = lastname; 154 acd.lastname = lastname;
148 acd.ServiceURLs = new Dictionary<string, object>(); 155 acd.ServiceURLs = new Dictionary<string, object>();
149 156
150 AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true); 157 AvatarAppearance npcAppearance = new AvatarAppearance(appearance,
158 true);
151 acd.Appearance = npcAppearance; 159 acd.Appearance = npcAppearance;
152 160
153// for (int i = 0; i < acd.Appearance.Texture.FaceTextures.Length; i++) 161 /*
154// { 162 for (int i = 0;
155// m_log.DebugFormat( 163 i < acd.Appearance.Texture.FaceTextures.Length; i++)
156// "[NPC MODULE]: NPC avatar {0} has texture id {1} : {2}", 164 {
157// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); 165 m_log.DebugFormat(
158// } 166 "[NPC MODULE]: NPC avatar {0} has texture id {1} : {2}",
167 acd.AgentID, i,
168 acd.Appearance.Texture.FaceTextures[i]);
169 }
170 */
159 171
160 lock (m_avatars) 172 lock (m_avatars)
161 { 173 {
162 scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd); 174 scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode,
175 acd);
163 scene.AddNewClient(npcAvatar, PresenceType.Npc); 176 scene.AddNewClient(npcAvatar, PresenceType.Npc);
164 177
165 ScenePresence sp; 178 ScenePresence sp;
166 if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) 179 if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp))
167 { 180 {
168// m_log.DebugFormat( 181 /*
169// "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID); 182 m_log.DebugFormat(
183 "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}",
184 sp.Name, sp.UUID);
185 */
170 186
171 sp.CompleteMovement(npcAvatar, false); 187 sp.CompleteMovement(npcAvatar, false);
172 m_avatars.Add(npcAvatar.AgentId, npcAvatar); 188 m_avatars.Add(npcAvatar.AgentId, npcAvatar);
173 m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name); 189 m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}",
190 npcAvatar.AgentId, sp.Name);
174 191
175 return npcAvatar.AgentId; 192 return npcAvatar.AgentId;
176 } 193 }
177 else 194 else
178 { 195 {
179 m_log.WarnFormat("[NPC MODULE]: Could not find scene presence for NPC {0} {1}", sp.Name, sp.UUID); 196 m_log.WarnFormat(
197 "[NPC MODULE]: Could not find scene presence for NPC {0} {1}",
198 sp.Name, sp.UUID);
180 return UUID.Zero; 199 return UUID.Zero;
181 } 200 }
182 } 201 }
183 } 202 }
184 203
185 public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget, bool running) 204 public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos,
205 bool noFly, bool landAtTarget, bool running)
186 { 206 {
187 lock (m_avatars) 207 lock (m_avatars)
188 { 208 {
@@ -192,12 +212,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
192 if (scene.TryGetScenePresence(agentID, out sp)) 212 if (scene.TryGetScenePresence(agentID, out sp))
193 { 213 {
194 m_log.DebugFormat( 214 m_log.DebugFormat(
195 "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}", 215 "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}",
196 sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget); 216 sp.Name, pos, scene.RegionInfo.RegionName,
217 noFly, landAtTarget);
197 218
198 sp.MoveToTarget(pos, noFly, landAtTarget); 219 sp.MoveToTarget(pos, noFly, landAtTarget);
199 sp.SetAlwaysRun = running; 220 sp.SetAlwaysRun = running;
200 221
201 return true; 222 return true;
202 } 223 }
203 } 224 }
@@ -270,9 +291,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
270 ScenePresence sp; 291 ScenePresence sp;
271 if (scene.TryGetScenePresence(agentID, out sp)) 292 if (scene.TryGetScenePresence(agentID, out sp))
272 { 293 {
273 sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero); 294 sp.HandleAgentRequestSit(m_avatars[agentID], agentID,
274 // sp.HandleAgentSit(m_avatars[agentID], agentID); 295 partID, Vector3.Zero);
275 296 //sp.HandleAgentSit(m_avatars[agentID], agentID);
297
276 return true; 298 return true;
277 } 299 }
278 } 300 }
@@ -281,7 +303,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
281 return false; 303 return false;
282 } 304 }
283 305
284 public bool Whisper(UUID agentID, Scene scene, string text, int channel) 306 public bool Whisper(UUID agentID, Scene scene, string text,
307 int channel)
285 { 308 {
286 lock (m_avatars) 309 lock (m_avatars)
287 { 310 {
@@ -356,16 +379,23 @@ namespace OpenSim.Region.OptionalModules.World.NPC
356 NPCAvatar av; 379 NPCAvatar av;
357 if (m_avatars.TryGetValue(agentID, out av)) 380 if (m_avatars.TryGetValue(agentID, out av))
358 { 381 {
359// m_log.DebugFormat("[NPC MODULE]: Found {0} {1} to remove", agentID, av.Name); 382 /*
383 m_log.DebugFormat("[NPC MODULE]: Found {0} {1} to remove",
384 agentID, av.Name);
385 */
360 scene.RemoveClient(agentID, false); 386 scene.RemoveClient(agentID, false);
361 m_avatars.Remove(agentID); 387 m_avatars.Remove(agentID);
362 388 /*
363 m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}", agentID, av.Name); 389 m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}",
390 agentID, av.Name);
391 */
364 return true; 392 return true;
365 } 393 }
366 } 394 }
367 395 /*
368// m_log.DebugFormat("[NPC MODULE]: Could not find {0} to remove", agentID); 396 m_log.DebugFormat("[NPC MODULE]: Could not find {0} to remove",
397 agentID);
398 */
369 return false; 399 return false;
370 } 400 }
371 401
@@ -389,7 +419,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
389 /// <returns>true if they do, false if they don't.</returns> 419 /// <returns>true if they do, false if they don't.</returns>
390 private bool CheckPermissions(NPCAvatar av, UUID callerID) 420 private bool CheckPermissions(NPCAvatar av, UUID callerID)
391 { 421 {
392 return callerID == UUID.Zero || av.OwnerID == UUID.Zero || av.OwnerID == callerID; 422 return callerID == UUID.Zero || av.OwnerID == UUID.Zero ||
423 av.OwnerID == callerID;
393 } 424 }
394 } 425 }
395} 426}