aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs4
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs15
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs45
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 69c16c7..cbc3813 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
48 private readonly string m_firstname; 48 private readonly string m_firstname;
49 private readonly string m_lastname; 49 private readonly string m_lastname;
50 private readonly Vector3 m_startPos; 50 private readonly Vector3 m_startPos;
51 private readonly UUID m_uuid = UUID.Random(); 51 private UUID m_uuid = UUID.Random();
52 private readonly Scene m_scene; 52 private readonly Scene m_scene;
53 private readonly UUID m_ownerID; 53 private readonly UUID m_ownerID;
54 54
@@ -206,7 +206,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
206#pragma warning disable 67 206#pragma warning disable 67
207 public event Action<IClientAPI> OnLogout; 207 public event Action<IClientAPI> OnLogout;
208 public event ObjectPermissions OnObjectPermissions; 208 public event ObjectPermissions OnObjectPermissions;
209 209 public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
210 public event MoneyTransferRequest OnMoneyTransferRequest; 210 public event MoneyTransferRequest OnMoneyTransferRequest;
211 public event ParcelBuy OnParcelBuy; 211 public event ParcelBuy OnParcelBuy;
212 public event Action<IClientAPI> OnConnectionClosed; 212 public event Action<IClientAPI> OnConnectionClosed;
@@ -412,7 +412,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
412 public event ClassifiedInfoRequest OnClassifiedInfoRequest; 412 public event ClassifiedInfoRequest OnClassifiedInfoRequest;
413 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; 413 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
414 public event ClassifiedDelete OnClassifiedDelete; 414 public event ClassifiedDelete OnClassifiedDelete;
415 public event ClassifiedDelete OnClassifiedGodDelete; 415 public event ClassifiedGodDelete OnClassifiedGodDelete;
416 416
417 public event EventNotificationAddRequest OnEventNotificationAddRequest; 417 public event EventNotificationAddRequest OnEventNotificationAddRequest;
418 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; 418 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
@@ -451,6 +451,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
451 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; 451 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
452 public event SimWideDeletesDelegate OnSimWideDeletes; 452 public event SimWideDeletesDelegate OnSimWideDeletes;
453 public event SendPostcard OnSendPostcard; 453 public event SendPostcard OnSendPostcard;
454 public event ChangeInventoryItemFlags OnChangeInventoryItemFlags;
454 public event MuteListEntryUpdate OnUpdateMuteListEntry; 455 public event MuteListEntryUpdate OnUpdateMuteListEntry;
455 public event MuteListEntryRemove OnRemoveMuteListEntry; 456 public event MuteListEntryRemove OnRemoveMuteListEntry;
456 public event GodlikeMessage onGodlikeMessage; 457 public event GodlikeMessage onGodlikeMessage;
@@ -478,6 +479,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
478 public virtual UUID AgentId 479 public virtual UUID AgentId
479 { 480 {
480 get { return m_uuid; } 481 get { return m_uuid; }
482 set { m_uuid = value; }
481 } 483 }
482 484
483 public UUID SessionId 485 public UUID SessionId
@@ -886,8 +888,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
886 888
887 public void Close() 889 public void Close()
888 { 890 {
889 // Remove ourselves from the scene 891 Close(true);
890 m_scene.RemoveClient(AgentId, false); 892 }
893
894 public void Close(bool sendStop)
895 {
891 } 896 }
892 897
893 public void Start() 898 public void Start()
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 2b8379d..68f21c8 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -144,29 +144,38 @@ namespace OpenSim.Region.OptionalModules.World.NPC
144// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); 144// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]);
145// } 145// }
146 146
147 lock (m_avatars) 147 ManualResetEvent ev = new ManualResetEvent(false);
148 {
149 scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd);
150 scene.AddNewClient(npcAvatar, PresenceType.Npc);
151 148
152 ScenePresence sp; 149 Util.FireAndForget(delegate(object x) {
153 if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) 150 lock (m_avatars)
154 { 151 {
155// m_log.DebugFormat( 152 scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd);
156// "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID); 153 scene.AddNewClient(npcAvatar, PresenceType.Npc);
157 154
158 sp.CompleteMovement(npcAvatar, false); 155 ScenePresence sp;
159 m_avatars.Add(npcAvatar.AgentId, npcAvatar); 156 if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp))
160 m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId); 157 {
158 m_log.DebugFormat(
159 "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID);
160
161 sp.CompleteMovement(npcAvatar, false);
162 m_avatars.Add(npcAvatar.AgentId, npcAvatar);
163 }
164 else
165 {
166 m_log.WarnFormat("[NPC MODULE]: Could not find scene presence for NPC {0} {1}", sp.Name, sp.UUID);
167 npcAvatar.AgentId = UUID.Zero;
168 }
161 169
162 return npcAvatar.AgentId;
163 }
164 else
165 {
166 m_log.WarnFormat("[NPC MODULE]: Could not find scene presence for NPC {0} {1}", sp.Name, sp.UUID);
167 return UUID.Zero;
168 } 170 }
169 } 171 ev.Set();
172 });
173
174 ev.WaitOne();
175
176// m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId);
177
178 return npcAvatar.AgentId;
170 } 179 }
171 180
172 public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget) 181 public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget)