aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
diff options
context:
space:
mode:
authorMelanie2011-04-08 04:19:17 +0100
committerMelanie2011-04-08 04:19:17 +0100
commitabea0c74c2b092d0474880a30433d9d0a2400aa8 (patch)
tree8b4e347bcdec3ee12a3026f789a96b1ffd32762e /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
parenttrivial whitespace removal to trigger a panda rebuild (diff)
downloadopensim-SC_OLD-abea0c74c2b092d0474880a30433d9d0a2400aa8.zip
opensim-SC_OLD-abea0c74c2b092d0474880a30433d9d0a2400aa8.tar.gz
opensim-SC_OLD-abea0c74c2b092d0474880a30433d9d0a2400aa8.tar.bz2
opensim-SC_OLD-abea0c74c2b092d0474880a30433d9d0a2400aa8.tar.xz
Add support for the new display name related functions in LSL. This does not
implement the display names functionality as such, but it allows scripts that are display name aware to function as if the display name were implemented and set to the avatar name.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs26
1 files changed, 22 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index fefbb35..47c7915 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -50,6 +50,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
50 private Object SenseLock = new Object(); 50 private Object SenseLock = new Object();
51 51
52 private const int AGENT = 1; 52 private const int AGENT = 1;
53 private const int AGENT_BY_USERNAME = 0x10;
53 private const int ACTIVE = 2; 54 private const int ACTIVE = 2;
54 private const int PASSIVE = 4; 55 private const int PASSIVE = 4;
55 private const int SCRIPTED = 8; 56 private const int SCRIPTED = 8;
@@ -202,7 +203,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
202 List<SensedEntity> sensedEntities = new List<SensedEntity>(); 203 List<SensedEntity> sensedEntities = new List<SensedEntity>();
203 204
204 // Is the sensor type is AGENT and not SCRIPTED then include agents 205 // Is the sensor type is AGENT and not SCRIPTED then include agents
205 if ((ts.type & AGENT) != 0 && (ts.type & SCRIPTED) == 0) 206 if ((ts.type & (AGENT | AGENT_BY_USERNAME)) != 0 && (ts.type & SCRIPTED) == 0)
206 { 207 {
207 sensedEntities.AddRange(doAgentSensor(ts)); 208 sensedEntities.AddRange(doAgentSensor(ts));
208 } 209 }
@@ -493,9 +494,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
493 { 494 {
494 ScenePresence sp; 495 ScenePresence sp;
495 // Try lookup by name will return if/when found 496 // Try lookup by name will return if/when found
496 if (!m_CmdManager.m_ScriptEngine.World.TryGetAvatarByName(ts.name, out sp)) 497 if (((ts.type & AGENT) != 0) && m_CmdManager.m_ScriptEngine.World.TryGetAvatarByName(ts.name, out sp))
497 return sensedEntities; 498 senseEntity(sp);
498 senseEntity(sp); 499 if ((ts.type & AGENT_BY_USERNAME) != 0)
500 {
501 m_CmdManager.m_ScriptEngine.World.ForEachScenePresence(
502 delegate (ScenePresence ssp)
503 {
504 if (ssp.Lastname == "Resident")
505 {
506 if (ssp.Firstname.ToLower() == ts.name)
507 senseEntity(ssp);
508 return;
509 }
510 if (ssp.Name.Replace(" ", ".").ToLower() == ts.name)
511 senseEntity(ssp);
512 }
513 );
514 }
515
516 return sensedEntities;
499 } 517 }
500 else 518 else
501 { 519 {