Merge branch 'master' into careminster

Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Helpers.cs
	prebuild.xml
This commit is contained in:
Melanie
2012-07-23 18:54:12 +01:00
16 changed files with 761 additions and 252 deletions

View File

@@ -68,6 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
private const int AGENT = 1;
private const int AGENT_BY_USERNAME = 0x10;
private const int NPC = 0x20;
private const int OS_NPC = 0x01000000;
private const int ACTIVE = 2;
private const int PASSIVE = 4;
private const int SCRIPTED = 8;
@@ -220,7 +221,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
List<SensedEntity> sensedEntities = new List<SensedEntity>();
// Is the sensor type is AGENT and not SCRIPTED then include agents
if ((ts.type & (AGENT | AGENT_BY_USERNAME | NPC)) != 0 && (ts.type & SCRIPTED) == 0)
if ((ts.type & (AGENT | AGENT_BY_USERNAME | NPC | OS_NPC)) != 0 && (ts.type & SCRIPTED) == 0)
{
sensedEntities.AddRange(doAgentSensor(ts));
}
@@ -484,7 +485,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
// "[SENSOR REPEAT]: Inspecting scene presence {0}, type {1} on sensor sweep for {2}, type {3}",
// presence.Name, presence.PresenceType, ts.name, ts.type);
if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc)
if ((ts.type & NPC) == 0 && (ts.type & OS_NPC) == 0 && presence.PresenceType == PresenceType.Npc)
{
INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
if (npcData == null || !npcData.SenseAsAgent)

View File

@@ -56,6 +56,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int ACTIVE = 2;
public const int PASSIVE = 4;
public const int SCRIPTED = 8;
public const int OS_NPC = 0x01000000;
public const int CONTROL_FWD = 1;
public const int CONTROL_BACK = 2;

View File

@@ -36,6 +36,7 @@ using OpenSim.Framework;
using OpenSim.Region.CoreModules;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Region.ScriptEngine.Shared
{
@@ -83,6 +84,12 @@ namespace OpenSim.Region.ScriptEngine.Shared
public class DetectParams
{
public const int AGENT = 1;
public const int ACTIVE = 2;
public const int PASSIVE = 4;
public const int SCRIPTED = 8;
public const int OS_NPC = 0x01000000;
public DetectParams()
{
Key = UUID.Zero;
@@ -199,8 +206,27 @@ namespace OpenSim.Region.ScriptEngine.Shared
Type = 0x01; // Avatar
if (presence.PresenceType == PresenceType.Npc)
Type = 0x20;
// Cope Impl. We don't use OS_NPC.
//if (presence.PresenceType != PresenceType.Npc)
//{
// Type = AGENT;
//}
//else
//{
// Type = OS_NPC;
// INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
// INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
// if (npcData.SenseAsAgent)
// {
// Type |= AGENT;
// }
//}
if (presence.Velocity != Vector3.Zero)
Type |= 0x02; // Active
Type |= ACTIVE;
Group = presence.ControllingClient.ActiveGroupId;
@@ -215,15 +241,15 @@ namespace OpenSim.Region.ScriptEngine.Shared
Name = part.Name;
Owner = part.OwnerID;
if (part.Velocity == Vector3.Zero)
Type = 0x04; // Passive
Type = PASSIVE;
else
Type = 0x02; // Passive
Type = ACTIVE;
foreach (SceneObjectPart p in part.ParentGroup.Parts)
{
if (p.Inventory.ContainsScripts())
{
Type |= 0x08; // Scripted
Type |= SCRIPTED; // Scripted
break;
}
}