aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins
diff options
context:
space:
mode:
authorMelanie2011-04-08 03:50:27 +0200
committerMelanie2011-04-08 03:50:27 +0200
commit33dd74e410bcd95364d8029a3f2a21b522c9f9d2 (patch)
tree06d8a6e482ad1dd464a8f4cd292275a9878f133d /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins
parentMerge branch 'master' into careminster-presence-refactor (diff)
downloadopensim-SC_OLD-33dd74e410bcd95364d8029a3f2a21b522c9f9d2.zip
opensim-SC_OLD-33dd74e410bcd95364d8029a3f2a21b522c9f9d2.tar.gz
opensim-SC_OLD-33dd74e410bcd95364d8029a3f2a21b522c9f9d2.tar.bz2
opensim-SC_OLD-33dd74e410bcd95364d8029a3f2a21b522c9f9d2.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')
-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 c4f90d2..3afedc7 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 }
@@ -505,9 +506,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
505 { 506 {
506 ScenePresence sp; 507 ScenePresence sp;
507 // Try lookup by name will return if/when found 508 // Try lookup by name will return if/when found
508 if (!m_CmdManager.m_ScriptEngine.World.TryGetAvatarByName(ts.name, out sp)) 509 if (((ts.type & AGENT) != 0) && m_CmdManager.m_ScriptEngine.World.TryGetAvatarByName(ts.name, out sp))
509 return sensedEntities; 510 senseEntity(sp);
510 senseEntity(sp); 511 if ((ts.type & AGENT_BY_USERNAME) != 0)
512 {
513 m_CmdManager.m_ScriptEngine.World.ForEachScenePresence(
514 delegate (ScenePresence ssp)
515 {
516 if (ssp.Lastname == "Resident")
517 {
518 if (ssp.Firstname.ToLower() == ts.name)
519 senseEntity(ssp);
520 return;
521 }
522 if (ssp.Name.Replace(" ", ".").ToLower() == ts.name)
523 senseEntity(ssp);
524 }
525 );
526 }
527
528 return sensedEntities;
511 } 529 }
512 else 530 else
513 { 531 {