Merge branch 'master' into careminster

avinationmerge
Melanie 2009-12-31 06:42:33 +00:00
commit 67cfe34e67
2 changed files with 67 additions and 315 deletions

View File

@ -107,9 +107,6 @@ namespace OpenSim.Region.Framework.Scenes
[XmlIgnore] [XmlIgnore]
public bool DIE_AT_EDGE; public bool DIE_AT_EDGE;
[XmlIgnore]
public Dictionary<int, string> m_CollisionFilter;
// TODO: This needs to be persisted in next XML version update! // TODO: This needs to be persisted in next XML version update!
[XmlIgnore] [XmlIgnore]
public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; public readonly int[] PayPrice = {-2,-2,-2,-2,-2};
@ -459,15 +456,6 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.HasGroupChanged = true; ParentGroup.HasGroupChanged = true;
} }
} }
public Dictionary<int, string> CollisionFilter
{
get { return m_CollisionFilter; }
set
{
m_CollisionFilter = value;
}
}
public ulong RegionHandle public ulong RegionHandle
{ {
@ -1895,52 +1883,20 @@ namespace OpenSim.Region.Framework.Scenes
if (m_parentGroup.Scene == null) if (m_parentGroup.Scene == null)
return; return;
#region collision Filter
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
if (obj != null) if (obj != null)
{ {
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) DetectedObject detobj = new DetectedObject();
{ detobj.keyUUID = obj.UUID;
string data = ""; detobj.nameStr = obj.Name;
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); detobj.ownerUUID = obj._ownerID;
//If it is 1, it is to accept ONLY collisions from this object detobj.posVector = obj.AbsolutePosition;
if(data != "") detobj.rotQuat = obj.GetWorldRotation();
{ detobj.velVector = obj.Velocity;
DetectedObject detobj = new DetectedObject(); detobj.colliderType = 0;
detobj.keyUUID = obj.UUID; detobj.groupUUID = obj._groupID;
detobj.nameStr = obj.Name; colliding.Add(detobj);
detobj.ownerUUID = obj._ownerID;
detobj.posVector = obj.AbsolutePosition;
detobj.rotQuat = obj.GetWorldRotation();
detobj.velVector = obj.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = obj._groupID;
colliding.Add(detobj);
}
//If it is 0, it is to not accept collisions from this object
else
{
}
}
else
{
string data = "";
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
if(data == "")
{
DetectedObject detobj = new DetectedObject();
detobj.keyUUID = obj.UUID;
detobj.nameStr = obj.Name;
detobj.ownerUUID = obj._ownerID;
detobj.posVector = obj.AbsolutePosition;
detobj.rotQuat = obj.GetWorldRotation();
detobj.velVector = obj.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = obj._groupID;
colliding.Add(detobj);
}
}
} }
else else
{ {
@ -1952,52 +1908,19 @@ namespace OpenSim.Region.Framework.Scenes
if (av.LocalId == localId) if (av.LocalId == localId)
{ {
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) DetectedObject detobj = new DetectedObject();
{ detobj.keyUUID = av.UUID;
string data = ""; detobj.nameStr = av.ControllingClient.Name;
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); detobj.ownerUUID = av.UUID;
//If it is 1, it is to accept ONLY collisions from this avatar detobj.posVector = av.AbsolutePosition;
if(data != "") detobj.rotQuat = av.Rotation;
{ detobj.velVector = av.Velocity;
DetectedObject detobj = new DetectedObject(); detobj.colliderType = 0;
detobj.keyUUID = av.UUID; detobj.groupUUID = av.ControllingClient.ActiveGroupId;
detobj.nameStr = av.ControllingClient.Name; colliding.Add(detobj);
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
}
//If it is 0, it is to not accept collisions from this avatar
else
{
}
}
else
{
string data = "";
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
if(data == "")
{
DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID;
detobj.nameStr = av.ControllingClient.Name;
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
}
}
} }
} }
} }
#endregion
} }
if (colliding.Count > 0) if (colliding.Count > 0)
{ {
@ -2031,105 +1954,41 @@ namespace OpenSim.Region.Framework.Scenes
if (m_parentGroup.Scene == null) if (m_parentGroup.Scene == null)
return; return;
#region collision Filter
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
if (obj != null) if (obj != null)
{ {
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) DetectedObject detobj = new DetectedObject();
{ detobj.keyUUID = obj.UUID;
string data = ""; detobj.nameStr = obj.Name;
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); detobj.ownerUUID = obj._ownerID;
//If it is 1, it is to accept ONLY collisions from this object detobj.posVector = obj.AbsolutePosition;
if(data != "") detobj.rotQuat = obj.GetWorldRotation();
{ detobj.velVector = obj.Velocity;
DetectedObject detobj = new DetectedObject(); detobj.colliderType = 0;
detobj.keyUUID = obj.UUID; detobj.groupUUID = obj._groupID;
detobj.nameStr = obj.Name; colliding.Add(detobj);
detobj.ownerUUID = obj._ownerID;
detobj.posVector = obj.AbsolutePosition;
detobj.rotQuat = obj.GetWorldRotation();
detobj.velVector = obj.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = obj._groupID;
colliding.Add(detobj);
}
//If it is 0, it is to not accept collisions from this object
else
{
}
}
else
{
string data = "";
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
if(data == "")
{
DetectedObject detobj = new DetectedObject();
detobj.keyUUID = obj.UUID;
detobj.nameStr = obj.Name;
detobj.ownerUUID = obj._ownerID;
detobj.posVector = obj.AbsolutePosition;
detobj.rotQuat = obj.GetWorldRotation();
detobj.velVector = obj.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = obj._groupID;
colliding.Add(detobj);
}
}
} }
else else
{ {
ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avlist.Length; i++) for (int i = 0; i < avlist.Length; i++)
{ {
ScenePresence av = avlist[i]; ScenePresence av = avlist[i];
if (av.LocalId == localId) if (av.LocalId == localId)
{ {
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) DetectedObject detobj = new DetectedObject();
{ detobj.keyUUID = av.UUID;
string data = ""; detobj.nameStr = av.Name;
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); detobj.ownerUUID = av.UUID;
//If it is 1, it is to accept ONLY collisions from this avatar detobj.posVector = av.AbsolutePosition;
if(data != "") detobj.rotQuat = av.Rotation;
{ detobj.velVector = av.Velocity;
DetectedObject detobj = new DetectedObject(); detobj.colliderType = 0;
detobj.keyUUID = av.UUID; detobj.groupUUID = av.ControllingClient.ActiveGroupId;
detobj.nameStr = av.ControllingClient.Name; colliding.Add(detobj);
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
}
//If it is 0, it is to not accept collisions from this avatar
else
{
}
}
else
{
string data = "";
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
if(data == "")
{
DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID;
detobj.nameStr = av.ControllingClient.Name;
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
}
}
} }
} }
} }
@ -2147,7 +2006,6 @@ namespace OpenSim.Region.Framework.Scenes
m_parentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage); m_parentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage);
} }
} }
#endregion
} }
if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0) if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0)
@ -2166,52 +2024,19 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
if (m_parentGroup.Scene == null) if (m_parentGroup.Scene == null)
return; return;
#region collision Filter
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
if (obj != null) if (obj != null)
{ {
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) DetectedObject detobj = new DetectedObject();
{ detobj.keyUUID = obj.UUID;
string data = ""; detobj.nameStr = obj.Name;
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); detobj.ownerUUID = obj._ownerID;
//If it is 1, it is to accept ONLY collisions from this object detobj.posVector = obj.AbsolutePosition;
if(data != "") detobj.rotQuat = obj.GetWorldRotation();
{ detobj.velVector = obj.Velocity;
DetectedObject detobj = new DetectedObject(); detobj.colliderType = 0;
detobj.keyUUID = obj.UUID; detobj.groupUUID = obj._groupID;
detobj.nameStr = obj.Name; colliding.Add(detobj);
detobj.ownerUUID = obj._ownerID;
detobj.posVector = obj.AbsolutePosition;
detobj.rotQuat = obj.GetWorldRotation();
detobj.velVector = obj.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = obj._groupID;
colliding.Add(detobj);
}
//If it is 0, it is to not accept collisions from this object
else
{
}
}
else
{
string data = "";
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
if(data == "")
{
DetectedObject detobj = new DetectedObject();
detobj.keyUUID = obj.UUID;
detobj.nameStr = obj.Name;
detobj.ownerUUID = obj._ownerID;
detobj.posVector = obj.AbsolutePosition;
detobj.rotQuat = obj.GetWorldRotation();
detobj.velVector = obj.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = obj._groupID;
colliding.Add(detobj);
}
}
} }
else else
{ {
@ -2223,52 +2048,19 @@ namespace OpenSim.Region.Framework.Scenes
if (av.LocalId == localId) if (av.LocalId == localId)
{ {
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) DetectedObject detobj = new DetectedObject();
{ detobj.keyUUID = av.UUID;
string data = ""; detobj.nameStr = av.Name;
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); detobj.ownerUUID = av.UUID;
//If it is 1, it is to accept ONLY collisions from this avatar detobj.posVector = av.AbsolutePosition;
if(data != "") detobj.rotQuat = av.Rotation;
{ detobj.velVector = av.Velocity;
DetectedObject detobj = new DetectedObject(); detobj.colliderType = 0;
detobj.keyUUID = av.UUID; detobj.groupUUID = av.ControllingClient.ActiveGroupId;
detobj.nameStr = av.ControllingClient.Name; colliding.Add(detobj);
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
}
//If it is 0, it is to not accept collisions from this avatar
else
{
}
}
else
{
string data = "";
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
if(data == "")
{
DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID;
detobj.nameStr = av.ControllingClient.Name;
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
}
}
} }
} }
} }
#endregion
} }
if (colliding.Count > 0) if (colliding.Count > 0)

View File

@ -2812,15 +2812,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llCollisionFilter(string name, string id, int accept) public void llCollisionFilter(string name, string id, int accept)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
m_host.CollisionFilter.Clear(); NotImplemented("llCollisionFilter");
if(id != null)
{
m_host.CollisionFilter.Add(accept,id);
}
else
{
m_host.CollisionFilter.Add(accept,name);
}
} }
public void llTakeControls(int controls, int accept, int pass_on) public void llTakeControls(int controls, int accept, int pass_on)
@ -8331,43 +8323,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return -1; return -1;
} }
public void llSetInventoryPermMask(string item, int mask, int value) public void llSetInventoryPermMask(string item, int mask, int value)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) NotImplemented("llSetInventoryPermMask");
{
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
{
lock (m_host.TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
if (inv.Value.Name == item)
{
switch (mask)
{
case 0:
inv.Value.BasePermissions = (uint)value;
break;
case 1:
inv.Value.CurrentPermissions = (uint)value;
break;
case 2:
inv.Value.GroupPermissions = (uint)value;
break;
case 3:
inv.Value.EveryonePermissions = (uint)value;
break;
case 4:
inv.Value.NextPermissions = (uint)value;
break;
}
}
}
}
}
}
} }
public LSL_String llGetInventoryCreator(string item) public LSL_String llGetInventoryCreator(string item)