Merge branch 'master' into careminster
commit
643cc7a0ee
|
@ -107,6 +107,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
[XmlIgnore]
|
||||
public bool DIE_AT_EDGE;
|
||||
|
||||
[XmlIgnore]
|
||||
public Dictionary<int, string> m_CollisionFilter;
|
||||
|
||||
// TODO: This needs to be persisted in next XML version update!
|
||||
[XmlIgnore]
|
||||
public readonly int[] PayPrice = {-2,-2,-2,-2,-2};
|
||||
|
@ -456,6 +459,15 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<int, string> CollisionFilter
|
||||
{
|
||||
get { return m_CollisionFilter; }
|
||||
set
|
||||
{
|
||||
m_CollisionFilter = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ulong RegionHandle
|
||||
{
|
||||
|
@ -1883,20 +1895,52 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
if (m_parentGroup.Scene == null)
|
||||
return;
|
||||
|
||||
#region collision Filter
|
||||
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
|
||||
if (obj != null)
|
||||
{
|
||||
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);
|
||||
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
|
||||
{
|
||||
string data = "";
|
||||
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
|
||||
//If it is 1, it is to accept ONLY collisions from this object
|
||||
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);
|
||||
}
|
||||
//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
|
||||
{
|
||||
|
@ -1908,19 +1952,52 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
if (av.LocalId == localId)
|
||||
{
|
||||
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);
|
||||
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
|
||||
{
|
||||
string data = "";
|
||||
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
|
||||
//If it is 1, it is to accept ONLY collisions from this avatar
|
||||
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);
|
||||
}
|
||||
//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)
|
||||
{
|
||||
|
@ -1954,41 +2031,105 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
if (m_parentGroup.Scene == null)
|
||||
return;
|
||||
|
||||
#region collision Filter
|
||||
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
|
||||
if (obj != null)
|
||||
{
|
||||
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);
|
||||
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
|
||||
{
|
||||
string data = "";
|
||||
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
|
||||
//If it is 1, it is to accept ONLY collisions from this object
|
||||
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);
|
||||
}
|
||||
//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
|
||||
{
|
||||
ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences();
|
||||
|
||||
|
||||
for (int i = 0; i < avlist.Length; i++)
|
||||
{
|
||||
ScenePresence av = avlist[i];
|
||||
|
||||
if (av.LocalId == localId)
|
||||
{
|
||||
DetectedObject detobj = new DetectedObject();
|
||||
detobj.keyUUID = av.UUID;
|
||||
detobj.nameStr = av.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);
|
||||
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
|
||||
{
|
||||
string data = "";
|
||||
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
|
||||
//If it is 1, it is to accept ONLY collisions from this avatar
|
||||
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);
|
||||
}
|
||||
//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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2006,6 +2147,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_parentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0)
|
||||
|
@ -2024,19 +2166,52 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
return;
|
||||
if (m_parentGroup.Scene == null)
|
||||
return;
|
||||
#region collision Filter
|
||||
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
|
||||
if (obj != null)
|
||||
{
|
||||
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);
|
||||
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
|
||||
{
|
||||
string data = "";
|
||||
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
|
||||
//If it is 1, it is to accept ONLY collisions from this object
|
||||
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);
|
||||
}
|
||||
//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
|
||||
{
|
||||
|
@ -2048,19 +2223,52 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
if (av.LocalId == localId)
|
||||
{
|
||||
DetectedObject detobj = new DetectedObject();
|
||||
detobj.keyUUID = av.UUID;
|
||||
detobj.nameStr = av.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);
|
||||
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
|
||||
{
|
||||
string data = "";
|
||||
m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
|
||||
//If it is 1, it is to accept ONLY collisions from this avatar
|
||||
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);
|
||||
}
|
||||
//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)
|
||||
|
|
|
@ -2812,7 +2812,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
public void llCollisionFilter(string name, string id, int accept)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
NotImplemented("llCollisionFilter");
|
||||
m_host.CollisionFilter.Clear();
|
||||
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)
|
||||
|
@ -8323,11 +8331,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
public void llSetInventoryPermMask(string item, int mask, int value)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
NotImplemented("llSetInventoryPermMask");
|
||||
m_host.AddScriptLPS(1);
|
||||
if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false))
|
||||
{
|
||||
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)
|
||||
|
|
|
@ -1987,5 +1987,82 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
return (int)pws;
|
||||
}
|
||||
public void osSetSpeed(string UUID, float SpeedModifier)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
|
||||
m_host.AddScriptLPS(1);
|
||||
ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
|
||||
avatar.SpeedModifier = SpeedModifier;
|
||||
}
|
||||
public void osKickAvatar(string FirstName,string SurName,string alert)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
|
||||
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
|
||||
{
|
||||
foreach (ScenePresence presence in World.GetAvatars())
|
||||
{
|
||||
if ((presence.Firstname == FirstName) &&
|
||||
presence.Lastname == SurName)
|
||||
{
|
||||
// kick client...
|
||||
if (alert != null)
|
||||
presence.ControllingClient.Kick(alert);
|
||||
|
||||
// ...and close on our side
|
||||
presence.Scene.IncomingCloseAgent(presence.UUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void osCauseDamage(string avatar, double damage)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osCauseDamage");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
UUID avatarId = new UUID(avatar);
|
||||
Vector3 pos = m_host.GetWorldPosition();
|
||||
|
||||
ScenePresence presence = World.GetScenePresence(avatarId);
|
||||
if (presence != null)
|
||||
{
|
||||
LandData land = World.GetLandData((float)pos.X, (float)pos.Y);
|
||||
if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage)
|
||||
{
|
||||
float health = presence.Health;
|
||||
health -= (float)damage;
|
||||
presence.setHealthWithUpdate(health);
|
||||
if (health <= 0)
|
||||
{
|
||||
float healthliveagain = 100;
|
||||
presence.ControllingClient.SendAgentAlertMessage("You died!", true);
|
||||
presence.setHealthWithUpdate(healthliveagain);
|
||||
presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void osCauseHealing(string avatar, double healing)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osCauseHealing");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
UUID avatarId = new UUID(avatar);
|
||||
ScenePresence presence = World.GetScenePresence(avatarId);
|
||||
Vector3 pos = m_host.GetWorldPosition();
|
||||
bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z));
|
||||
if (result)
|
||||
{
|
||||
if (presence != null)
|
||||
{
|
||||
float health = presence.Health;
|
||||
health += (float)healing;
|
||||
if (health >= 100)
|
||||
{
|
||||
health = 100;
|
||||
}
|
||||
presence.setHealthWithUpdate(health);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,5 +165,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
|||
LSL_List osGetRegionStats();
|
||||
|
||||
int osGetSimulatorMemory();
|
||||
void osKickAvatar(string FirstName,string SurName,string alert);
|
||||
void osSetSpeed(string UUID, float SpeedModifier);
|
||||
void osCauseHealing(string avatar, double healing);
|
||||
void osCauseDamage(string avatar, double damage);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -647,5 +647,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
{
|
||||
return m_OSSL_Functions.osGetSimulatorMemory();
|
||||
}
|
||||
public void osKickAvatar(string FirstName,string SurName,string alert)
|
||||
{
|
||||
m_OSSL_Functions.osKickAvatar( FirstName, SurName, alert);
|
||||
}
|
||||
public void osSetSpeed(string UUID, float SpeedModifier)
|
||||
{
|
||||
m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier);
|
||||
}
|
||||
public void osCauseDamage(string avatar, double damage)
|
||||
{
|
||||
m_OSSL_Functions.osCauseDamage(avatar, damage);
|
||||
}
|
||||
public void osCauseHealing(string avatar, double healing)
|
||||
{
|
||||
m_OSSL_Functions.osCauseHealing(avatar, healing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue