From 2f398231acda79e313c2975ecdd5a6015cb71a54 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 23 Apr 2012 15:31:45 +0300 Subject: Minor improvements to logging Eliminated an extra newline in the console if the log line doesn't contain a category (example of a category: "[ASSETS]"). --- OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs') diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 2b8379d..435a683 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -157,7 +157,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC sp.CompleteMovement(npcAvatar, false); m_avatars.Add(npcAvatar.AgentId, npcAvatar); - m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId); + m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name); return npcAvatar.AgentId; } @@ -299,7 +299,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC scene.RemoveClient(agentID, false); m_avatars.Remove(agentID); -// m_log.DebugFormat("[NPC MODULE]: Removed {0} {1}", agentID, av.Name); + m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}", agentID, av.Name); return true; } } -- cgit v1.1 From b8114d2b67c8ae8d7551a2ece2177f8b7e958112 Mon Sep 17 00:00:00 2001 From: Talun Date: Tue, 24 Apr 2012 21:54:13 +0100 Subject: Add a version of osNpcSay that takes a channel number Mantis 5747 osNpcSay(UUID npc, string message) left untouched New functions:- osNpcSay(UUID npc, int channel, string message) osNpcShout(UUID npc, int channel, string message) osNpcWhisper(UUID npc, int channel, string message) Signed-off-by: BlueWall --- .../Region/OptionalModules/World/NPC/NPCModule.cs | 43 +++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs') diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 2b8379d..adc6f9c 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -212,6 +212,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC public bool Say(UUID agentID, Scene scene, string text) { + return Say(agentID, scene, text, 0); + } + + public bool Say(UUID agentID, Scene scene, string text, int channel) + { lock (m_avatars) { if (m_avatars.ContainsKey(agentID)) @@ -219,7 +224,25 @@ namespace OpenSim.Region.OptionalModules.World.NPC ScenePresence sp; scene.TryGetScenePresence(agentID, out sp); - m_avatars[agentID].Say(text); + m_avatars[agentID].Say(channel, text); + + return true; + } + } + + return false; + } + + public bool Shout(UUID agentID, Scene scene, string text, int channel) + { + lock (m_avatars) + { + if (m_avatars.ContainsKey(agentID)) + { + ScenePresence sp; + scene.TryGetScenePresence(agentID, out sp); + + m_avatars[agentID].Shout(channel, text); return true; } @@ -246,6 +269,24 @@ namespace OpenSim.Region.OptionalModules.World.NPC return false; } + public bool Whisper(UUID agentID, Scene scene, string text, int channel) + { + lock (m_avatars) + { + if (m_avatars.ContainsKey(agentID)) + { + ScenePresence sp; + scene.TryGetScenePresence(agentID, out sp); + + m_avatars[agentID].Whisper(channel, text); + + return true; + } + } + + return false; + } + public bool Stand(UUID agentID, Scene scene) { lock (m_avatars) -- cgit v1.1 From b697d0e895dc7670e160188501da88a780455500 Mon Sep 17 00:00:00 2001 From: dahlia Date: Sun, 6 May 2012 23:54:50 -0700 Subject: add OS_NPC_RUNNING option to osNpcMoveToTarget() to allow running speed for moving NPCs --- OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs') diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 3ac1eb1..541ad7d 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -169,7 +169,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC } } - public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget) + public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget, bool running = false) { lock (m_avatars) { @@ -183,6 +183,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget); sp.MoveToTarget(pos, noFly, landAtTarget); + sp.SetAlwaysRun = running; return true; } -- cgit v1.1 From 4186fa10f0eba3628ef8222db2e4b0e2b69df5cd Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 7 May 2012 00:08:56 -0700 Subject: remove default values from prior commit since mono cant deal with them --- OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs') diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 541ad7d..d3456ab 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -169,7 +169,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC } } - public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget, bool running = false) + public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget, bool running) { lock (m_avatars) { -- cgit v1.1 From 1b1f841c6aaf2453b3aca0eade84855ae658e655 Mon Sep 17 00:00:00 2001 From: Talun Date: Tue, 3 Jul 2012 11:10:09 +0100 Subject: Mantis 6063 osNpcTouch. Allow NPCS to touch obects. --- OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs') diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index d3456ab..1e85fb4 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -305,6 +305,16 @@ namespace OpenSim.Region.OptionalModules.World.NPC return false; } + public bool Touch(UUID agentID, UUID objectID) + { + lock (m_avatars) + { + if (m_avatars.ContainsKey(agentID)) + return m_avatars[agentID].Touch(objectID); + return false; + } + } + public UUID GetOwner(UUID agentID) { lock (m_avatars) -- cgit v1.1