diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/World')
4 files changed, 62 insertions, 49 deletions
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 35f44d0..17d1591 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | |||
@@ -198,7 +198,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
198 | { | 198 | { |
199 | } | 199 | } |
200 | 200 | ||
201 | public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount) | 201 | public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount, UUID txn) |
202 | { | 202 | { |
203 | string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID)); | 203 | string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID)); |
204 | 204 | ||
@@ -835,6 +835,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
835 | if (module != null) | 835 | if (module != null) |
836 | module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice); | 836 | module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice); |
837 | } | 837 | } |
838 | |||
839 | public void MoveMoney(UUID fromAgentID, UUID toAgentID, int amount, string text) | ||
840 | { | ||
841 | } | ||
838 | } | 842 | } |
839 | 843 | ||
840 | public enum TransactionType : int | 844 | public enum TransactionType : int |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 553443f..a6a53aa 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
47 | private readonly string m_firstname; | 47 | private readonly string m_firstname; |
48 | private readonly string m_lastname; | 48 | private readonly string m_lastname; |
49 | private readonly Vector3 m_startPos; | 49 | private readonly Vector3 m_startPos; |
50 | private readonly UUID m_uuid = UUID.Random(); | 50 | private UUID m_uuid = UUID.Random(); |
51 | private readonly Scene m_scene; | 51 | private readonly Scene m_scene; |
52 | private readonly UUID m_ownerID; | 52 | private readonly UUID m_ownerID; |
53 | 53 | ||
@@ -221,7 +221,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
221 | #pragma warning disable 67 | 221 | #pragma warning disable 67 |
222 | public event Action<IClientAPI> OnLogout; | 222 | public event Action<IClientAPI> OnLogout; |
223 | public event ObjectPermissions OnObjectPermissions; | 223 | public event ObjectPermissions OnObjectPermissions; |
224 | 224 | public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy; | |
225 | public event MoneyTransferRequest OnMoneyTransferRequest; | 225 | public event MoneyTransferRequest OnMoneyTransferRequest; |
226 | public event ParcelBuy OnParcelBuy; | 226 | public event ParcelBuy OnParcelBuy; |
227 | public event Action<IClientAPI> OnConnectionClosed; | 227 | public event Action<IClientAPI> OnConnectionClosed; |
@@ -241,6 +241,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
241 | public event ObjectDrop OnObjectDrop; | 241 | public event ObjectDrop OnObjectDrop; |
242 | public event StartAnim OnStartAnim; | 242 | public event StartAnim OnStartAnim; |
243 | public event StopAnim OnStopAnim; | 243 | public event StopAnim OnStopAnim; |
244 | public event ChangeAnim OnChangeAnim; | ||
244 | public event LinkObjects OnLinkObjects; | 245 | public event LinkObjects OnLinkObjects; |
245 | public event DelinkObjects OnDelinkObjects; | 246 | public event DelinkObjects OnDelinkObjects; |
246 | public event RequestMapBlocks OnRequestMapBlocks; | 247 | public event RequestMapBlocks OnRequestMapBlocks; |
@@ -290,6 +291,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
290 | public event UpdatePrimTexture OnUpdatePrimTexture; | 291 | public event UpdatePrimTexture OnUpdatePrimTexture; |
291 | public event UpdateVector OnUpdatePrimGroupPosition; | 292 | public event UpdateVector OnUpdatePrimGroupPosition; |
292 | public event UpdateVector OnUpdatePrimSinglePosition; | 293 | public event UpdateVector OnUpdatePrimSinglePosition; |
294 | public event ClientChangeObject onClientChangeObject; | ||
293 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; | 295 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; |
294 | public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; | 296 | public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; |
295 | public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; | 297 | public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; |
@@ -428,7 +430,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
428 | public event ClassifiedInfoRequest OnClassifiedInfoRequest; | 430 | public event ClassifiedInfoRequest OnClassifiedInfoRequest; |
429 | public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; | 431 | public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; |
430 | public event ClassifiedDelete OnClassifiedDelete; | 432 | public event ClassifiedDelete OnClassifiedDelete; |
431 | public event ClassifiedDelete OnClassifiedGodDelete; | 433 | public event ClassifiedGodDelete OnClassifiedGodDelete; |
432 | 434 | ||
433 | public event EventNotificationAddRequest OnEventNotificationAddRequest; | 435 | public event EventNotificationAddRequest OnEventNotificationAddRequest; |
434 | public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; | 436 | public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; |
@@ -467,11 +469,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
467 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 469 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
468 | public event SimWideDeletesDelegate OnSimWideDeletes; | 470 | public event SimWideDeletesDelegate OnSimWideDeletes; |
469 | public event SendPostcard OnSendPostcard; | 471 | public event SendPostcard OnSendPostcard; |
472 | public event ChangeInventoryItemFlags OnChangeInventoryItemFlags; | ||
470 | public event MuteListEntryUpdate OnUpdateMuteListEntry; | 473 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
471 | public event MuteListEntryRemove OnRemoveMuteListEntry; | 474 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
472 | public event GodlikeMessage onGodlikeMessage; | 475 | public event GodlikeMessage onGodlikeMessage; |
473 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; | 476 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
474 | 477 | public event GenericCall2 OnUpdateThrottles; | |
475 | #pragma warning restore 67 | 478 | #pragma warning restore 67 |
476 | 479 | ||
477 | #endregion | 480 | #endregion |
@@ -494,6 +497,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
494 | public virtual UUID AgentId | 497 | public virtual UUID AgentId |
495 | { | 498 | { |
496 | get { return m_uuid; } | 499 | get { return m_uuid; } |
500 | set { m_uuid = value; } | ||
497 | } | 501 | } |
498 | 502 | ||
499 | public UUID SessionId | 503 | public UUID SessionId |
@@ -599,6 +603,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
599 | public virtual void SetChildAgentThrottle(byte[] throttle) | 603 | public virtual void SetChildAgentThrottle(byte[] throttle) |
600 | { | 604 | { |
601 | } | 605 | } |
606 | |||
607 | public void SetAgentThrottleSilent(int throttle, int setting) | ||
608 | { | ||
609 | |||
610 | |||
611 | } | ||
602 | public byte[] GetThrottlesPacked(float multiplier) | 612 | public byte[] GetThrottlesPacked(float multiplier) |
603 | { | 613 | { |
604 | return new byte[0]; | 614 | return new byte[0]; |
@@ -743,6 +753,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
743 | { | 753 | { |
744 | } | 754 | } |
745 | 755 | ||
756 | public void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId) | ||
757 | { | ||
758 | } | ||
759 | |||
746 | public virtual void SendRemoveInventoryItem(UUID itemID) | 760 | public virtual void SendRemoveInventoryItem(UUID itemID) |
747 | { | 761 | { |
748 | } | 762 | } |
@@ -759,7 +773,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
759 | { | 773 | { |
760 | } | 774 | } |
761 | 775 | ||
762 | public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data) | 776 | public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory) |
763 | { | 777 | { |
764 | } | 778 | } |
765 | public virtual void SendAbortXferPacket(ulong xferID) | 779 | public virtual void SendAbortXferPacket(ulong xferID) |
@@ -909,10 +923,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
909 | 923 | ||
910 | public void Close() | 924 | public void Close() |
911 | { | 925 | { |
912 | Close(false); | 926 | Close(true, false); |
913 | } | 927 | } |
914 | 928 | ||
915 | public void Close(bool force) | 929 | public void Close(bool sendStop, bool force) |
916 | { | 930 | { |
917 | // Remove ourselves from the scene | 931 | // Remove ourselves from the scene |
918 | m_scene.RemoveClient(AgentId, false); | 932 | m_scene.RemoveClient(AgentId, false); |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 7d46d92..8c9c006 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -143,10 +143,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
143 | npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, | 143 | npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, |
144 | int.MaxValue); | 144 | int.MaxValue); |
145 | 145 | ||
146 | m_log.DebugFormat( | 146 | // m_log.DebugFormat( |
147 | "[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}", |
148 | firstname, lastname, npcAvatar.AgentId, owner, | 148 | // firstname, lastname, npcAvatar.AgentId, owner, senseAsAgent, position, scene.RegionInfo.RegionName); |
149 | senseAsAgent, position, scene.RegionInfo.RegionName); | ||
150 | 149 | ||
151 | AgentCircuitData acd = new AgentCircuitData(); | 150 | AgentCircuitData acd = new AgentCircuitData(); |
152 | acd.AgentID = npcAvatar.AgentId; | 151 | acd.AgentID = npcAvatar.AgentId; |
@@ -169,36 +168,30 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
169 | } | 168 | } |
170 | */ | 169 | */ |
171 | 170 | ||
172 | lock (m_avatars) | 171 | ManualResetEvent ev = new ManualResetEvent(false); |
173 | { | ||
174 | scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, | ||
175 | acd); | ||
176 | scene.AddNewClient(npcAvatar, PresenceType.Npc); | ||
177 | 172 | ||
178 | ScenePresence sp; | 173 | Util.FireAndForget(delegate(object x) { |
179 | if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) | 174 | lock (m_avatars) |
180 | { | 175 | { |
181 | /* | 176 | scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd); |
182 | m_log.DebugFormat( | 177 | scene.AddNewClient(npcAvatar, PresenceType.Npc); |
183 | "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", | ||
184 | sp.Name, sp.UUID); | ||
185 | */ | ||
186 | |||
187 | sp.CompleteMovement(npcAvatar, false); | ||
188 | m_avatars.Add(npcAvatar.AgentId, npcAvatar); | ||
189 | m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", | ||
190 | npcAvatar.AgentId, sp.Name); | ||
191 | 178 | ||
192 | return npcAvatar.AgentId; | 179 | ScenePresence sp; |
193 | } | 180 | if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) |
194 | else | 181 | { |
195 | { | 182 | sp.CompleteMovement(npcAvatar, false); |
196 | m_log.WarnFormat( | 183 | m_avatars.Add(npcAvatar.AgentId, npcAvatar); |
197 | "[NPC MODULE]: Could not find scene presence for NPC {0} {1}", | 184 | // m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name); |
198 | sp.Name, sp.UUID); | 185 | } |
199 | return UUID.Zero; | ||
200 | } | 186 | } |
201 | } | 187 | ev.Set(); |
188 | }); | ||
189 | |||
190 | ev.WaitOne(); | ||
191 | |||
192 | // m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId); | ||
193 | |||
194 | return npcAvatar.AgentId; | ||
202 | } | 195 | } |
203 | 196 | ||
204 | public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, | 197 | public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, |
@@ -211,10 +204,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
211 | ScenePresence sp; | 204 | ScenePresence sp; |
212 | if (scene.TryGetScenePresence(agentID, out sp)) | 205 | if (scene.TryGetScenePresence(agentID, out sp)) |
213 | { | 206 | { |
214 | m_log.DebugFormat( | 207 | // m_log.DebugFormat( |
215 | "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}", | 208 | // "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}", |
216 | sp.Name, pos, scene.RegionInfo.RegionName, | 209 | // sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget); |
217 | noFly, landAtTarget); | ||
218 | 210 | ||
219 | sp.MoveToTarget(pos, noFly, landAtTarget); | 211 | sp.MoveToTarget(pos, noFly, landAtTarget); |
220 | sp.SetAlwaysRun = running; | 212 | sp.SetAlwaysRun = running; |
@@ -385,10 +377,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
385 | */ | 377 | */ |
386 | scene.RemoveClient(agentID, false); | 378 | scene.RemoveClient(agentID, false); |
387 | m_avatars.Remove(agentID); | 379 | m_avatars.Remove(agentID); |
388 | /* | 380 | |
389 | m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}", | 381 | // m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}", agentID, av.Name); |
390 | agentID, av.Name); | ||
391 | */ | ||
392 | return true; | 382 | return true; |
393 | } | 383 | } |
394 | } | 384 | } |
@@ -405,9 +395,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
405 | { | 395 | { |
406 | NPCAvatar av; | 396 | NPCAvatar av; |
407 | if (m_avatars.TryGetValue(npcID, out av)) | 397 | if (m_avatars.TryGetValue(npcID, out av)) |
398 | { | ||
399 | if (npcID == callerID) | ||
400 | return true; | ||
408 | return CheckPermissions(av, callerID); | 401 | return CheckPermissions(av, callerID); |
402 | } | ||
409 | else | 403 | else |
404 | { | ||
410 | return false; | 405 | return false; |
406 | } | ||
411 | } | 407 | } |
412 | } | 408 | } |
413 | 409 | ||
@@ -419,8 +415,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
419 | /// <returns>true if they do, false if they don't.</returns> | 415 | /// <returns>true if they do, false if they don't.</returns> |
420 | private bool CheckPermissions(NPCAvatar av, UUID callerID) | 416 | private bool CheckPermissions(NPCAvatar av, UUID callerID) |
421 | { | 417 | { |
422 | return callerID == UUID.Zero || av.OwnerID == UUID.Zero || | 418 | return callerID == UUID.Zero || av.OwnerID == UUID.Zero || av.OwnerID == callerID || av.AgentId == callerID; |
423 | av.OwnerID == callerID; | ||
424 | } | 419 | } |
425 | } | 420 | } |
426 | } | 421 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs index bf23040..34362af 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs | |||
@@ -110,7 +110,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
110 | // ScenePresence.SendInitialData() to reset our entire appearance. | 110 | // ScenePresence.SendInitialData() to reset our entire appearance. |
111 | m_scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId)); | 111 | m_scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId)); |
112 | 112 | ||
113 | m_afMod.SetAppearance(sp, originalTe, null); | 113 | m_afMod.SetAppearance(sp, originalTe, null, new WearableCacheItem[0] ); |
114 | 114 | ||
115 | UUID npcId = m_npcMod.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, m_scene, sp.Appearance); | 115 | UUID npcId = m_npcMod.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, m_scene, sp.Appearance); |
116 | 116 | ||