aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/World')
-rw-r--r--OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs4
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs21
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs47
3 files changed, 47 insertions, 25 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 e57e5e6..c9c12c6 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
@@ -174,7 +174,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
174#pragma warning disable 67 174#pragma warning disable 67
175 public event Action<IClientAPI> OnLogout; 175 public event Action<IClientAPI> OnLogout;
176 public event ObjectPermissions OnObjectPermissions; 176 public event ObjectPermissions OnObjectPermissions;
177 177 public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
178 public event MoneyTransferRequest OnMoneyTransferRequest; 178 public event MoneyTransferRequest OnMoneyTransferRequest;
179 public event ParcelBuy OnParcelBuy; 179 public event ParcelBuy OnParcelBuy;
180 public event Action<IClientAPI> OnConnectionClosed; 180 public event Action<IClientAPI> OnConnectionClosed;
@@ -243,6 +243,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
243 public event UpdatePrimTexture OnUpdatePrimTexture; 243 public event UpdatePrimTexture OnUpdatePrimTexture;
244 public event UpdateVector OnUpdatePrimGroupPosition; 244 public event UpdateVector OnUpdatePrimGroupPosition;
245 public event UpdateVector OnUpdatePrimSinglePosition; 245 public event UpdateVector OnUpdatePrimSinglePosition;
246 public event ClientChangeObject onClientChangeObject;
246 public event UpdatePrimRotation OnUpdatePrimGroupRotation; 247 public event UpdatePrimRotation OnUpdatePrimGroupRotation;
247 public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; 248 public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition;
248 public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; 249 public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
@@ -380,7 +381,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
380 public event ClassifiedInfoRequest OnClassifiedInfoRequest; 381 public event ClassifiedInfoRequest OnClassifiedInfoRequest;
381 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; 382 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
382 public event ClassifiedDelete OnClassifiedDelete; 383 public event ClassifiedDelete OnClassifiedDelete;
383 public event ClassifiedDelete OnClassifiedGodDelete; 384 public event ClassifiedGodDelete OnClassifiedGodDelete;
384 385
385 public event EventNotificationAddRequest OnEventNotificationAddRequest; 386 public event EventNotificationAddRequest OnEventNotificationAddRequest;
386 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; 387 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
@@ -419,6 +420,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
419 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; 420 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
420 public event SimWideDeletesDelegate OnSimWideDeletes; 421 public event SimWideDeletesDelegate OnSimWideDeletes;
421 public event SendPostcard OnSendPostcard; 422 public event SendPostcard OnSendPostcard;
423 public event ChangeInventoryItemFlags OnChangeInventoryItemFlags;
422 public event MuteListEntryUpdate OnUpdateMuteListEntry; 424 public event MuteListEntryUpdate OnUpdateMuteListEntry;
423 public event MuteListEntryRemove OnRemoveMuteListEntry; 425 public event MuteListEntryRemove OnRemoveMuteListEntry;
424 public event GodlikeMessage onGodlikeMessage; 426 public event GodlikeMessage onGodlikeMessage;
@@ -446,6 +448,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
446 public virtual UUID AgentId 448 public virtual UUID AgentId
447 { 449 {
448 get { return m_uuid; } 450 get { return m_uuid; }
451 set { m_uuid = value; }
449 } 452 }
450 453
451 public UUID SessionId 454 public UUID SessionId
@@ -854,8 +857,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
854 857
855 public void Close() 858 public void Close()
856 { 859 {
857 // Remove ourselves from the scene 860 Close(true);
858 m_scene.RemoveClient(AgentId, false); 861 }
862
863 public void Close(bool sendStop)
864 {
859 } 865 }
860 866
861 public void Start() 867 public void Start()
@@ -1189,5 +1195,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
1189 public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) 1195 public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data)
1190 { 1196 {
1191 } 1197 }
1198
1199 public void SendPartPhysicsProprieties(ISceneEntity entity)
1200 {
1201 }
1202
1192 } 1203 }
1193} 1204}
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index d3456ab..a32ab2a 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -144,29 +144,30 @@ 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 {0} {1}", npcAvatar.AgentId, sp.Name); 157 {
161 158 sp.CompleteMovement(npcAvatar, false);
162 return npcAvatar.AgentId; 159 m_avatars.Add(npcAvatar.AgentId, npcAvatar);
163 } 160 m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name);
164 else 161 }
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 } 162 }
169 } 163 ev.Set();
164 });
165
166 ev.WaitOne();
167
168// m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId);
169
170 return npcAvatar.AgentId;
170 } 171 }
171 172
172 public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget, bool running) 173 public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget, bool running)
@@ -356,9 +357,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC
356 { 357 {
357 NPCAvatar av; 358 NPCAvatar av;
358 if (m_avatars.TryGetValue(npcID, out av)) 359 if (m_avatars.TryGetValue(npcID, out av))
360 {
361 if (npcID == callerID)
362 return true;
359 return CheckPermissions(av, callerID); 363 return CheckPermissions(av, callerID);
364 }
360 else 365 else
366 {
361 return false; 367 return false;
368 }
362 } 369 }
363 } 370 }
364 371
@@ -370,7 +377,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
370 /// <returns>true if they do, false if they don't.</returns> 377 /// <returns>true if they do, false if they don't.</returns>
371 private bool CheckPermissions(NPCAvatar av, UUID callerID) 378 private bool CheckPermissions(NPCAvatar av, UUID callerID)
372 { 379 {
373 return callerID == UUID.Zero || av.OwnerID == UUID.Zero || av.OwnerID == callerID; 380 return callerID == UUID.Zero || av.OwnerID == UUID.Zero || av.OwnerID == callerID || av.AgentId == callerID;
374 } 381 }
375 } 382 }
376} 383}