mirror of
https://github.com/opensim/opensim.git
synced 2026-05-16 11:46:04 +08:00
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.
This commit is contained in:
@@ -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))
|
||||
{
|
||||
keep = false;
|
||||
}
|
||||
|
||||
if (keep && (ts.keyID != null) && (ts.keyID != LLUUID.Zero) && (ts.keyID != ent.UUID))
|
||||
{
|
||||
keep = false;
|
||||
}
|
||||
|
||||
if (keep&& (ts.name.Length > 0))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user