diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/World')
3 files changed, 41 insertions, 23 deletions
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 9c838d0..d206f69 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | |||
@@ -838,6 +838,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
838 | if (module != null) | 838 | if (module != null) |
839 | module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice); | 839 | module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice); |
840 | } | 840 | } |
841 | |||
842 | public void MoveMoney(UUID fromAgentID, UUID toAgentID, int amount, string text) | ||
843 | { | ||
844 | } | ||
841 | } | 845 | } |
842 | 846 | ||
843 | public enum TransactionType : int | 847 | public enum TransactionType : int |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index be0d56e..d0b822c 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
44 | private readonly string m_firstname; | 44 | private readonly string m_firstname; |
45 | private readonly string m_lastname; | 45 | private readonly string m_lastname; |
46 | private readonly Vector3 m_startPos; | 46 | private readonly Vector3 m_startPos; |
47 | private readonly UUID m_uuid = UUID.Random(); | 47 | private UUID m_uuid = UUID.Random(); |
48 | private readonly Scene m_scene; | 48 | private readonly Scene m_scene; |
49 | private readonly UUID m_ownerID; | 49 | private readonly UUID m_ownerID; |
50 | 50 | ||
@@ -171,7 +171,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
171 | #pragma warning disable 67 | 171 | #pragma warning disable 67 |
172 | public event Action<IClientAPI> OnLogout; | 172 | public event Action<IClientAPI> OnLogout; |
173 | public event ObjectPermissions OnObjectPermissions; | 173 | public event ObjectPermissions OnObjectPermissions; |
174 | 174 | public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy; | |
175 | public event MoneyTransferRequest OnMoneyTransferRequest; | 175 | public event MoneyTransferRequest OnMoneyTransferRequest; |
176 | public event ParcelBuy OnParcelBuy; | 176 | public event ParcelBuy OnParcelBuy; |
177 | public event Action<IClientAPI> OnConnectionClosed; | 177 | public event Action<IClientAPI> OnConnectionClosed; |
@@ -377,7 +377,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
377 | public event ClassifiedInfoRequest OnClassifiedInfoRequest; | 377 | public event ClassifiedInfoRequest OnClassifiedInfoRequest; |
378 | public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; | 378 | public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; |
379 | public event ClassifiedDelete OnClassifiedDelete; | 379 | public event ClassifiedDelete OnClassifiedDelete; |
380 | public event ClassifiedDelete OnClassifiedGodDelete; | 380 | public event ClassifiedGodDelete OnClassifiedGodDelete; |
381 | 381 | ||
382 | public event EventNotificationAddRequest OnEventNotificationAddRequest; | 382 | public event EventNotificationAddRequest OnEventNotificationAddRequest; |
383 | public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; | 383 | public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; |
@@ -416,6 +416,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
416 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 416 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
417 | public event SimWideDeletesDelegate OnSimWideDeletes; | 417 | public event SimWideDeletesDelegate OnSimWideDeletes; |
418 | public event SendPostcard OnSendPostcard; | 418 | public event SendPostcard OnSendPostcard; |
419 | public event ChangeInventoryItemFlags OnChangeInventoryItemFlags; | ||
419 | public event MuteListEntryUpdate OnUpdateMuteListEntry; | 420 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
420 | public event MuteListEntryRemove OnRemoveMuteListEntry; | 421 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
421 | public event GodlikeMessage onGodlikeMessage; | 422 | public event GodlikeMessage onGodlikeMessage; |
@@ -443,6 +444,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
443 | public virtual UUID AgentId | 444 | public virtual UUID AgentId |
444 | { | 445 | { |
445 | get { return m_uuid; } | 446 | get { return m_uuid; } |
447 | set { m_uuid = value; } | ||
446 | } | 448 | } |
447 | 449 | ||
448 | public UUID SessionId | 450 | public UUID SessionId |
@@ -851,8 +853,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
851 | 853 | ||
852 | public void Close() | 854 | public void Close() |
853 | { | 855 | { |
854 | // Remove ourselves from the scene | 856 | Close(true); |
855 | m_scene.RemoveClient(AgentId, false); | 857 | } |
858 | |||
859 | public void Close(bool sendStop) | ||
860 | { | ||
856 | } | 861 | } |
857 | 862 | ||
858 | public void Start() | 863 | public void Start() |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 2052cdb..ae46c97 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -140,29 +140,38 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
140 | // acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); | 140 | // acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); |
141 | // } | 141 | // } |
142 | 142 | ||
143 | lock (m_avatars) | 143 | ManualResetEvent ev = new ManualResetEvent(false); |
144 | { | ||
145 | scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd); | ||
146 | scene.AddNewClient(npcAvatar, PresenceType.Npc); | ||
147 | 144 | ||
148 | ScenePresence sp; | 145 | Util.FireAndForget(delegate(object x) { |
149 | if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) | 146 | lock (m_avatars) |
150 | { | 147 | { |
151 | // m_log.DebugFormat( | 148 | scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd); |
152 | // "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID); | 149 | scene.AddNewClient(npcAvatar, PresenceType.Npc); |
153 | 150 | ||
154 | sp.CompleteMovement(npcAvatar, false); | 151 | ScenePresence sp; |
155 | m_avatars.Add(npcAvatar.AgentId, npcAvatar); | 152 | if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) |
156 | m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId); | 153 | { |
154 | m_log.DebugFormat( | ||
155 | "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID); | ||
156 | |||
157 | sp.CompleteMovement(npcAvatar, false); | ||
158 | m_avatars.Add(npcAvatar.AgentId, npcAvatar); | ||
159 | } | ||
160 | else | ||
161 | { | ||
162 | m_log.WarnFormat("[NPC MODULE]: Could not find scene presence for NPC {0} {1}", sp.Name, sp.UUID); | ||
163 | npcAvatar.AgentId = UUID.Zero; | ||
164 | } | ||
157 | 165 | ||
158 | return npcAvatar.AgentId; | ||
159 | } | ||
160 | else | ||
161 | { | ||
162 | m_log.WarnFormat("[NPC MODULE]: Could not find scene presence for NPC {0} {1}", sp.Name, sp.UUID); | ||
163 | return UUID.Zero; | ||
164 | } | 166 | } |
165 | } | 167 | ev.Set(); |
168 | }); | ||
169 | |||
170 | ev.WaitOne(); | ||
171 | |||
172 | // m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId); | ||
173 | |||
174 | return npcAvatar.AgentId; | ||
166 | } | 175 | } |
167 | 176 | ||
168 | public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget) | 177 | public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget) |