aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs44
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs62
2 files changed, 65 insertions, 41 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
index b166588..68a484a 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
@@ -59,6 +59,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
59 59
60 public void AddRegion(Scene scene) 60 public void AddRegion(Scene scene)
61 { 61 {
62 }
63
64 public void RemoveRegion(Scene scene)
65 {
66 }
67
68 public void RegionLoaded(Scene scene)
69 {
62 m_scene = scene; 70 m_scene = scene;
63 71
64 IScriptModuleComms comms = scene.RequestModuleInterface<IScriptModuleComms>(); 72 IScriptModuleComms comms = scene.RequestModuleInterface<IScriptModuleComms>();
@@ -73,14 +81,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
73 } 81 }
74 } 82 }
75 83
76 public void RemoveRegion(Scene scene)
77 {
78 }
79
80 public void RegionLoaded(Scene scene)
81 {
82 }
83
84 public void Close() 84 public void Close()
85 { 85 {
86 } 86 }
@@ -120,6 +120,34 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
120 if (!m_scene.TryGetScenePresence(item.PermsGranter, out target)) 120 if (!m_scene.TryGetScenePresence(item.PermsGranter, out target))
121 return; 121 return;
122 122
123 if (target.UUID != hostPart.ParentGroup.OwnerID)
124 {
125 uint effectivePerms = hostPart.ParentGroup.GetEffectivePermissions();
126
127 if ((effectivePerms & (uint)PermissionMask.Transfer) == 0)
128 return;
129
130 hostPart.ParentGroup.SetOwnerId(target.UUID);
131 hostPart.ParentGroup.SetRootPartOwner(hostPart.ParentGroup.RootPart, target.UUID, target.ControllingClient.ActiveGroupId);
132
133 if (m_scene.Permissions.PropagatePermissions())
134 {
135 foreach (SceneObjectPart child in hostPart.ParentGroup.Parts)
136 {
137 child.Inventory.ChangeInventoryOwner(target.UUID);
138 child.TriggerScriptChangedEvent(Changed.OWNER);
139 child.ApplyNextOwnerPermissions();
140 }
141 }
142
143 hostPart.ParentGroup.RootPart.ObjectSaleType = 0;
144 hostPart.ParentGroup.RootPart.SalePrice = 10;
145
146 hostPart.ParentGroup.HasGroupChanged = true;
147 hostPart.ParentGroup.RootPart.SendPropertiesToClient(target.ControllingClient);
148 hostPart.ParentGroup.RootPart.ScheduleFullUpdate();
149 }
150
123 attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, true, true); 151 attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, true, true);
124 } 152 }
125 } 153 }
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 3f19370..cef2cfd 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -177,16 +177,17 @@ namespace OpenSim.Region.OptionalModules.World.NPC
177 if (m_avatars.ContainsKey(agentID)) 177 if (m_avatars.ContainsKey(agentID))
178 { 178 {
179 ScenePresence sp; 179 ScenePresence sp;
180 scene.TryGetScenePresence(agentID, out sp); 180 if (scene.TryGetScenePresence(agentID, out sp))
181 181 {
182// m_log.DebugFormat( 182 m_log.DebugFormat(
183// "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}", 183 "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}",
184// sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget); 184 sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget);
185
186 sp.MoveToTarget(pos, noFly, landAtTarget);
187 sp.SetAlwaysRun = running;
188 185
189 return true; 186 sp.MoveToTarget(pos, noFly, landAtTarget);
187 sp.SetAlwaysRun = running;
188
189 return true;
190 }
190 } 191 }
191 } 192 }
192 193
@@ -200,12 +201,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
200 if (m_avatars.ContainsKey(agentID)) 201 if (m_avatars.ContainsKey(agentID))
201 { 202 {
202 ScenePresence sp; 203 ScenePresence sp;
203 scene.TryGetScenePresence(agentID, out sp); 204 if (scene.TryGetScenePresence(agentID, out sp))
204 205 {
205 sp.Velocity = Vector3.Zero; 206 sp.Velocity = Vector3.Zero;
206 sp.ResetMoveToTarget(); 207 sp.ResetMoveToTarget();
207 208
208 return true; 209 return true;
210 }
209 } 211 }
210 } 212 }
211 213
@@ -223,9 +225,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
223 { 225 {
224 if (m_avatars.ContainsKey(agentID)) 226 if (m_avatars.ContainsKey(agentID))
225 { 227 {
226 ScenePresence sp;
227 scene.TryGetScenePresence(agentID, out sp);
228
229 m_avatars[agentID].Say(channel, text); 228 m_avatars[agentID].Say(channel, text);
230 229
231 return true; 230 return true;
@@ -241,9 +240,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
241 { 240 {
242 if (m_avatars.ContainsKey(agentID)) 241 if (m_avatars.ContainsKey(agentID))
243 { 242 {
244 ScenePresence sp;
245 scene.TryGetScenePresence(agentID, out sp);
246
247 m_avatars[agentID].Shout(channel, text); 243 m_avatars[agentID].Shout(channel, text);
248 244
249 return true; 245 return true;
@@ -260,11 +256,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
260 if (m_avatars.ContainsKey(agentID)) 256 if (m_avatars.ContainsKey(agentID))
261 { 257 {
262 ScenePresence sp; 258 ScenePresence sp;
263 scene.TryGetScenePresence(agentID, out sp); 259 if (scene.TryGetScenePresence(agentID, out sp))
264 sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero); 260 {
265// sp.HandleAgentSit(m_avatars[agentID], agentID); 261 sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero);
266 262 // sp.HandleAgentSit(m_avatars[agentID], agentID);
267 return true; 263
264 return true;
265 }
268 } 266 }
269 } 267 }
270 268
@@ -277,9 +275,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
277 { 275 {
278 if (m_avatars.ContainsKey(agentID)) 276 if (m_avatars.ContainsKey(agentID))
279 { 277 {
280 ScenePresence sp;
281 scene.TryGetScenePresence(agentID, out sp);
282
283 m_avatars[agentID].Whisper(channel, text); 278 m_avatars[agentID].Whisper(channel, text);
284 279
285 return true; 280 return true;
@@ -296,10 +291,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC
296 if (m_avatars.ContainsKey(agentID)) 291 if (m_avatars.ContainsKey(agentID))
297 { 292 {
298 ScenePresence sp; 293 ScenePresence sp;
299 scene.TryGetScenePresence(agentID, out sp); 294 if (scene.TryGetScenePresence(agentID, out sp))
300 sp.StandUp(); 295 {
296 sp.StandUp();
301 297
302 return true; 298 return true;
299 }
303 } 300 }
304 } 301 }
305 302
@@ -312,6 +309,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
312 { 309 {
313 if (m_avatars.ContainsKey(agentID)) 310 if (m_avatars.ContainsKey(agentID))
314 return m_avatars[agentID].Touch(objectID); 311 return m_avatars[agentID].Touch(objectID);
312
315 return false; 313 return false;
316 } 314 }
317 } 315 }
@@ -322,9 +320,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
322 { 320 {
323 NPCAvatar av; 321 NPCAvatar av;
324 if (m_avatars.TryGetValue(agentID, out av)) 322 if (m_avatars.TryGetValue(agentID, out av))
325 {
326 return av.OwnerID; 323 return av.OwnerID;
327 }
328 } 324 }
329 325
330 return UUID.Zero; 326 return UUID.Zero;