From 56697133d406fd7dea90e0cf4088dac611df2e6a Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sat, 1 Mar 2008 00:59:23 +0000 Subject: Thank you very much, Kinoc for: * Impelements llInstantMessage * Reimplements llOwnerSay as llInstantMessage(llGetOWner(),msg). * Try's to better identify the "True Name" of objects in llDetectedName by checking for avatar name, scene Object Part name and entity name. * Uses similar logic in the llSensor and llSensorRepeat functions. --- .../AsyncCommandPlugins/SensorRepeat.cs | 33 +++++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins') diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs index edf3fde..bff85af 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs @@ -236,7 +236,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin // Right type too, what about the other params , key and name ? bool keep = true; - if (ts.arc != Math.PI) + if (ts.arc < Math.PI) { // not omni-directional. Can you see it ? // vec forward_dir = llRot2Fwd(llGetRot()) @@ -261,15 +261,40 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin if (ang_obj > ts.arc) keep = false; } - if (keep && (ts.name.Length > 0) && (ts.name != ent.Name)) + + if (keep && (ts.keyID != null) && (ts.keyID != LLUUID.Zero) && (ts.keyID != ent.UUID)) { keep = false; } - if (keep && (ts.keyID != null) && (ts.keyID != LLUUID.Zero) && (ts.keyID != ent.UUID)) + if (keep&& (ts.name.Length > 0)) { - keep = false; + string avatarname=null; + string objectname=null; + string entname =ent.Name; + + // try avatar username surname + UserProfileData profile = m_CmdManager.m_ScriptEngine.World.CommsManager.UserService.GetUserProfile(ent.UUID); + if (profile != null) + { + avatarname = profile.username + " " + profile.surname; + } + // try an scene object + SceneObjectPart SOP = m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(ent.UUID); + if (SOP != null) + { + objectname = SOP.Name; + } + + + if ((ts.name != entname) && (ts.name != avatarname) && (ts.name != objectname)) + { + keep = false; + } + + } + if (keep == true) SensedObjects.Add(ent.UUID); } } -- cgit v1.1