Merge branch 'master' of ssh://3dhosting.de/var/git/careminster

avinationmerge
Kitto Flora 2010-03-19 13:27:12 -04:00
commit 0e36994fe7
8 changed files with 220 additions and 295 deletions

View File

@ -915,7 +915,7 @@ namespace OpenSim.Region.CoreModules.World.Land
foreach (List<SceneObjectGroup> ol in returns.Values) foreach (List<SceneObjectGroup> ol in returns.Values)
{ {
if (m_scene.Permissions.CanUseObjectReturn(this, type, remote_client, ol)) if (m_scene.Permissions.CanReturnObjects(this, remote_client.AgentId, ol))
m_scene.returnObjects(ol.ToArray(), remote_client.AgentId); m_scene.returnObjects(ol.ToArray(), remote_client.AgentId);
} }
} }

View File

@ -200,7 +200,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED
m_scene.Permissions.OnMoveObject += CanMoveObject; //MAYBE FULLY IMPLEMENTED m_scene.Permissions.OnMoveObject += CanMoveObject; //MAYBE FULLY IMPLEMENTED
m_scene.Permissions.OnObjectEntry += CanObjectEntry; m_scene.Permissions.OnObjectEntry += CanObjectEntry;
m_scene.Permissions.OnReturnObject += CanReturnObject; //NOT YET IMPLEMENTED m_scene.Permissions.OnReturnObjects += CanReturnObjects; //NOT YET IMPLEMENTED
m_scene.Permissions.OnRezObject += CanRezObject; //MAYBE FULLY IMPLEMENTED m_scene.Permissions.OnRezObject += CanRezObject; //MAYBE FULLY IMPLEMENTED
m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand; m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand;
m_scene.Permissions.OnRunScript += CanRunScript; //NOT YET IMPLEMENTED m_scene.Permissions.OnRunScript += CanRunScript; //NOT YET IMPLEMENTED
@ -230,7 +230,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; //NOT YET IMPLEMENTED m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; //NOT YET IMPLEMENTED
m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED
m_scene.Permissions.OnUseObjectReturn += CanUseObjectReturn; //NOT YET IMPLEMENTED
m_scene.AddCommand(this, "bypass permissions", m_scene.AddCommand(this, "bypass permissions",
"bypass permissions <true / false>", "bypass permissions <true / false>",
@ -1258,12 +1257,15 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return false; return false;
} }
private bool CanReturnObject(UUID objectID, UUID returnerID, Scene scene) private bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene)
{ {
if (objects.Count == 0)
return false;
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue; if (m_bypassPermissions) return m_bypassPermissionsValue;
return GenericObjectPermission(returnerID, objectID, false); return GenericObjectPermission(user, objects[0].UUID, false);
} }
private bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition, Scene scene) private bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition, Scene scene)
@ -1730,67 +1732,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return GenericObjectPermission(agentID, prim, false); return GenericObjectPermission(agentID, prim, false);
} }
private bool CanUseObjectReturn(ILandObject parcel, uint type, IClientAPI client, List<SceneObjectGroup> retlist, Scene scene)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
long powers = 0;
if (parcel.LandData.GroupID != UUID.Zero)
client.GetGroupPowers(parcel.LandData.GroupID);
switch (type)
{
case (uint)ObjectReturnType.Owner:
// Don't let group members return owner's objects, ever
//
if (parcel.LandData.IsGroupOwned)
{
if ((powers & (long)GroupPowers.ReturnGroupOwned) != 0)
return true;
}
else
{
if (parcel.LandData.OwnerID != client.AgentId)
return false;
}
return GenericParcelOwnerPermission(client.AgentId, parcel, (ulong)GroupPowers.ReturnGroupOwned);
case (uint)ObjectReturnType.Group:
if (parcel.LandData.OwnerID != client.AgentId)
{
// If permissionis granted through a group...
//
if ((powers & (long)GroupPowers.ReturnGroupSet) != 0)
{
foreach (SceneObjectGroup g in new List<SceneObjectGroup>(retlist))
{
// check for and remove group owned objects unless
// the user also has permissions to return those
//
if (g.OwnerID == g.GroupID &&
((powers & (long)GroupPowers.ReturnGroupOwned) == 0))
{
retlist.Remove(g);
}
}
// And allow the operation
//
return true;
}
}
return GenericParcelOwnerPermission(client.AgentId, parcel, (ulong)GroupPowers.ReturnGroupSet);
case (uint)ObjectReturnType.Other:
if ((powers & (long)GroupPowers.ReturnNonGroup) != 0)
return true;
return GenericParcelOwnerPermission(client.AgentId, parcel, (ulong)GroupPowers.ReturnNonGroup);
case (uint)ObjectReturnType.List:
break;
}
return GenericParcelOwnerPermission(client.AgentId, parcel, 0);
// Is it correct to be less restrictive for lists of objects to be returned?
}
private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) { private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) {
//m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType);
switch (scriptType) { switch (scriptType) {

View File

@ -1581,9 +1581,10 @@ namespace OpenSim.Region.Framework.Scenes
if (remoteClient != null) if (remoteClient != null)
{ {
permissionToTake = permissionToTake =
Permissions.CanReturnObject( Permissions.CanReturnObjects(
grp.UUID, null,
remoteClient.AgentId); remoteClient.AgentId,
new List<SceneObjectGroup>() {grp});
permissionToDelete = permissionToTake; permissionToDelete = permissionToTake;
if (permissionToDelete) if (permissionToDelete)

View File

@ -48,7 +48,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene);
public delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene); public delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene);
public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene); public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene);
public delegate bool ReturnObjectHandler(UUID objectID, UUID returnerID, Scene scene); public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene);
public delegate bool InstantMessageHandler(UUID user, UUID target, Scene startScene); public delegate bool InstantMessageHandler(UUID user, UUID target, Scene startScene);
public delegate bool InventoryTransferHandler(UUID user, UUID target, Scene startScene); public delegate bool InventoryTransferHandler(UUID user, UUID target, Scene startScene);
public delegate bool ViewScriptHandler(UUID script, UUID objectID, UUID user, Scene scene); public delegate bool ViewScriptHandler(UUID script, UUID objectID, UUID user, Scene scene);
@ -81,7 +81,6 @@ namespace OpenSim.Region.Framework.Scenes
public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID); public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID);
public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID); public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID);
public delegate bool TeleportHandler(UUID userID, Scene scene); public delegate bool TeleportHandler(UUID userID, Scene scene);
public delegate bool UseObjectReturnHandler(ILandObject landData, uint type, IClientAPI client, List<SceneObjectGroup> retlist, Scene scene);
#endregion #endregion
public class ScenePermissions public class ScenePermissions
@ -107,7 +106,7 @@ namespace OpenSim.Region.Framework.Scenes
public event EditObjectInventoryHandler OnEditObjectInventory; public event EditObjectInventoryHandler OnEditObjectInventory;
public event MoveObjectHandler OnMoveObject; public event MoveObjectHandler OnMoveObject;
public event ObjectEntryHandler OnObjectEntry; public event ObjectEntryHandler OnObjectEntry;
public event ReturnObjectHandler OnReturnObject; public event ReturnObjectsHandler OnReturnObjects;
public event InstantMessageHandler OnInstantMessage; public event InstantMessageHandler OnInstantMessage;
public event InventoryTransferHandler OnInventoryTransfer; public event InventoryTransferHandler OnInventoryTransfer;
public event ViewScriptHandler OnViewScript; public event ViewScriptHandler OnViewScript;
@ -140,7 +139,6 @@ namespace OpenSim.Region.Framework.Scenes
public event CopyUserInventoryHandler OnCopyUserInventory; public event CopyUserInventoryHandler OnCopyUserInventory;
public event DeleteUserInventoryHandler OnDeleteUserInventory; public event DeleteUserInventoryHandler OnDeleteUserInventory;
public event TeleportHandler OnTeleport; public event TeleportHandler OnTeleport;
public event UseObjectReturnHandler OnUseObjectReturn;
#endregion #endregion
#region Object Permission Checks #region Object Permission Checks
@ -377,15 +375,15 @@ namespace OpenSim.Region.Framework.Scenes
#endregion #endregion
#region RETURN OBJECT #region RETURN OBJECT
public bool CanReturnObject(UUID objectID, UUID returnerID) public bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects)
{ {
ReturnObjectHandler handler = OnReturnObject; ReturnObjectsHandler handler = OnReturnObjects;
if (handler != null) if (handler != null)
{ {
Delegate[] list = handler.GetInvocationList(); Delegate[] list = handler.GetInvocationList();
foreach (ReturnObjectHandler h in list) foreach (ReturnObjectsHandler h in list)
{ {
if (h(objectID, returnerID, m_scene) == false) if (h(land, user, objects, m_scene) == false)
return false; return false;
} }
} }
@ -949,20 +947,5 @@ namespace OpenSim.Region.Framework.Scenes
} }
return true; return true;
} }
public bool CanUseObjectReturn(ILandObject landData, uint type , IClientAPI client, List<SceneObjectGroup> retlist)
{
UseObjectReturnHandler handler = OnUseObjectReturn;
if (handler != null)
{
Delegate[] list = handler.GetInvocationList();
foreach (UseObjectReturnHandler h in list)
{
if (h(landData, type, client, retlist, m_scene) == false)
return false;
}
}
return true;
}
} }
} }

View File

@ -922,7 +922,7 @@ namespace OpenSim.Region.RegionCombinerModule
VirtualRegion.Permissions.OnIssueEstateCommand += BigRegion.PermissionModule.CanIssueEstateCommand; //FULLY IMPLEMENTED VirtualRegion.Permissions.OnIssueEstateCommand += BigRegion.PermissionModule.CanIssueEstateCommand; //FULLY IMPLEMENTED
VirtualRegion.Permissions.OnMoveObject += BigRegion.PermissionModule.CanMoveObject; //MAYBE FULLY IMPLEMENTED VirtualRegion.Permissions.OnMoveObject += BigRegion.PermissionModule.CanMoveObject; //MAYBE FULLY IMPLEMENTED
VirtualRegion.Permissions.OnObjectEntry += BigRegion.PermissionModule.CanObjectEntry; VirtualRegion.Permissions.OnObjectEntry += BigRegion.PermissionModule.CanObjectEntry;
VirtualRegion.Permissions.OnReturnObject += BigRegion.PermissionModule.CanReturnObject; //NOT YET IMPLEMENTED VirtualRegion.Permissions.OnReturnObjects += BigRegion.PermissionModule.CanReturnObjects; //NOT YET IMPLEMENTED
VirtualRegion.Permissions.OnRezObject += BigRegion.PermissionModule.CanRezObject; //MAYBE FULLY IMPLEMENTED VirtualRegion.Permissions.OnRezObject += BigRegion.PermissionModule.CanRezObject; //MAYBE FULLY IMPLEMENTED
VirtualRegion.Permissions.OnRunConsoleCommand += BigRegion.PermissionModule.CanRunConsoleCommand; VirtualRegion.Permissions.OnRunConsoleCommand += BigRegion.PermissionModule.CanRunConsoleCommand;
VirtualRegion.Permissions.OnRunScript += BigRegion.PermissionModule.CanRunScript; //NOT YET IMPLEMENTED VirtualRegion.Permissions.OnRunScript += BigRegion.PermissionModule.CanRunScript; //NOT YET IMPLEMENTED
@ -948,7 +948,6 @@ namespace OpenSim.Region.RegionCombinerModule
VirtualRegion.Permissions.OnEditUserInventory += BigRegion.PermissionModule.CanEditUserInventory; //NOT YET IMPLEMENTED VirtualRegion.Permissions.OnEditUserInventory += BigRegion.PermissionModule.CanEditUserInventory; //NOT YET IMPLEMENTED
VirtualRegion.Permissions.OnDeleteUserInventory += BigRegion.PermissionModule.CanDeleteUserInventory; //NOT YET IMPLEMENTED VirtualRegion.Permissions.OnDeleteUserInventory += BigRegion.PermissionModule.CanDeleteUserInventory; //NOT YET IMPLEMENTED
VirtualRegion.Permissions.OnTeleport += BigRegion.PermissionModule.CanTeleport; //NOT YET IMPLEMENTED VirtualRegion.Permissions.OnTeleport += BigRegion.PermissionModule.CanTeleport; //NOT YET IMPLEMENTED
VirtualRegion.Permissions.OnUseObjectReturn += BigRegion.PermissionModule.CanUseObjectReturn; //NOT YET IMPLEMENTED
} }
#region console commands #region console commands

View File

@ -135,9 +135,9 @@ namespace OpenSim.Region.RegionCombinerModule
return m_rootScene.Permissions.CanObjectEntry(objectid, enteringregion, newpoint); return m_rootScene.Permissions.CanObjectEntry(objectid, enteringregion, newpoint);
} }
public bool CanReturnObject(UUID objectid, UUID returnerid, Scene scene) public bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene)
{ {
return m_rootScene.Permissions.CanReturnObject(objectid, returnerid); return m_rootScene.Permissions.CanReturnObjects(land, user, objects);
} }
public bool CanRezObject(int objectcount, UUID owner, Vector3 objectposition, Scene scene) public bool CanRezObject(int objectcount, UUID owner, Vector3 objectposition, Scene scene)
@ -265,11 +265,6 @@ namespace OpenSim.Region.RegionCombinerModule
return m_rootScene.Permissions.CanTeleport(userid); return m_rootScene.Permissions.CanTeleport(userid);
} }
public bool CanUseObjectReturn(ILandObject landdata, uint type, IClientAPI client, List<SceneObjectGroup> retlist, Scene scene)
{
return m_rootScene.Permissions.CanUseObjectReturn(landdata, type, client, retlist);
}
#endregion #endregion
} }
} }

View File

@ -221,8 +221,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public List<SceneObjectPart> GetLinkParts(int linkType) public List<SceneObjectPart> GetLinkParts(int linkType)
{ {
List<SceneObjectPart> ret = new List<SceneObjectPart>(); List<SceneObjectPart> ret = new List<SceneObjectPart>();
if (m_host == null || m_host.ParentGroup == null || m_host.ParentGroup.IsDeleted) if (m_host == null || m_host.ParentGroup == null || m_host.ParentGroup.IsDeleted)
return ret; return ret;
ret.Add(m_host); ret.Add(m_host);
@ -1115,6 +1115,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return detectedParams.TouchUV; return detectedParams.TouchUV;
} }
[DebuggerNonUserCode]
public virtual void llDie() public virtual void llDie()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
@ -1190,8 +1191,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
public void llSetStatus(int status, int value) public void llSetStatus(int status, int value)
{ {
if (m_host == null || m_host.ParentGroup == null || m_host.ParentGroup.IsDeleted) if (m_host == null || m_host.ParentGroup == null || m_host.ParentGroup.IsDeleted)
return; return;
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
@ -1367,7 +1368,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void SetScale(SceneObjectPart part, LSL_Vector scale) protected void SetScale(SceneObjectPart part, LSL_Vector scale)
{ {
// TODO: this needs to trigger a persistance save as well // TODO: this needs to trigger a persistance save as well
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
@ -1426,8 +1427,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void SetColor(SceneObjectPart part, LSL_Vector color, int face) protected void SetColor(SceneObjectPart part, LSL_Vector color, int face)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
Primitive.TextureEntry tex = part.Shape.Textures; Primitive.TextureEntry tex = part.Shape.Textures;
@ -1471,8 +1472,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
public void SetTexGen(SceneObjectPart part, int face,int style) public void SetTexGen(SceneObjectPart part, int face,int style)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
Primitive.TextureEntry tex = part.Shape.Textures; Primitive.TextureEntry tex = part.Shape.Textures;
@ -1504,8 +1505,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
public void SetGlow(SceneObjectPart part, int face, float glow) public void SetGlow(SceneObjectPart part, int face, float glow)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
Primitive.TextureEntry tex = part.Shape.Textures; Primitive.TextureEntry tex = part.Shape.Textures;
@ -1532,8 +1533,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
Shininess sval = new Shininess(); Shininess sval = new Shininess();
@ -1584,8 +1585,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
public void SetFullBright(SceneObjectPart part, int face, bool bright) public void SetFullBright(SceneObjectPart part, int face, bool bright)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
Primitive.TextureEntry tex = part.Shape.Textures; Primitive.TextureEntry tex = part.Shape.Textures;
@ -1654,8 +1655,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void SetAlpha(SceneObjectPart part, double alpha, int face) protected void SetAlpha(SceneObjectPart part, double alpha, int face)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
Primitive.TextureEntry tex = part.Shape.Textures; Primitive.TextureEntry tex = part.Shape.Textures;
@ -1702,8 +1703,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// <param name="Force"></param> /// <param name="Force"></param>
protected void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, protected void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction,
float wind, float tension, LSL_Vector Force) float wind, float tension, LSL_Vector Force)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
if (flexi) if (flexi)
@ -1737,8 +1738,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// <param name="radius"></param> /// <param name="radius"></param>
/// <param name="falloff"></param> /// <param name="falloff"></param>
protected void SetPointLight(SceneObjectPart part, bool light, LSL_Vector color, float intensity, float radius, float falloff) protected void SetPointLight(SceneObjectPart part, bool light, LSL_Vector color, float intensity, float radius, float falloff)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
if (light) if (light)
@ -1823,8 +1824,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void SetTexture(SceneObjectPart part, string texture, int face) protected void SetTexture(SceneObjectPart part, string texture, int face)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
UUID textureID=new UUID(); UUID textureID=new UUID();
@ -1871,8 +1872,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void ScaleTexture(SceneObjectPart part, double u, double v, int face) protected void ScaleTexture(SceneObjectPart part, double u, double v, int face)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
Primitive.TextureEntry tex = part.Shape.Textures; Primitive.TextureEntry tex = part.Shape.Textures;
@ -1910,8 +1911,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void OffsetTexture(SceneObjectPart part, double u, double v, int face) protected void OffsetTexture(SceneObjectPart part, double u, double v, int face)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
Primitive.TextureEntry tex = part.Shape.Textures; Primitive.TextureEntry tex = part.Shape.Textures;
@ -1949,8 +1950,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void RotateTexture(SceneObjectPart part, double rotation, int face) protected void RotateTexture(SceneObjectPart part, double rotation, int face)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
Primitive.TextureEntry tex = part.Shape.Textures; Primitive.TextureEntry tex = part.Shape.Textures;
@ -2022,8 +2023,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void SetPos(SceneObjectPart part, LSL_Vector targetPos) protected void SetPos(SceneObjectPart part, LSL_Vector targetPos)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
// Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos) // Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos)
@ -2119,8 +2120,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void SetRot(SceneObjectPart part, Quaternion rot) protected void SetRot(SceneObjectPart part, Quaternion rot)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
part.UpdateRotation(rot); part.UpdateRotation(rot);
@ -4016,7 +4017,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
bucket); bucket);
if (m_TransferModule != null) if (m_TransferModule != null)
m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
//This delay should only occur when giving inventory to avatars. //This delay should only occur when giving inventory to avatars.
ScriptSleep(3000); ScriptSleep(3000);
@ -4192,6 +4193,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ScenePresence presence = World.GetScenePresence(agentId); ScenePresence presence = World.GetScenePresence(agentId);
if (presence != null) if (presence != null)
{ {
// agent must not be a god
if (presence.GodLevel >= 200) return;
// agent must be over the owners land // agent must be over the owners land
if (m_host.OwnerID == World.LandChannel.GetLandObject( if (m_host.OwnerID == World.LandChannel.GetLandObject(
presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
@ -6662,9 +6666,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist) protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist)
{ {
ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return shapeBlock; return shapeBlock;
if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT && if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT &&
@ -6735,8 +6739,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void SetPrimitiveShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector taper_b, LSL_Vector topshear, byte fudge) protected void SetPrimitiveShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector taper_b, LSL_Vector topshear, byte fudge)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
ObjectShapePacket.ObjectDataBlock shapeBlock; ObjectShapePacket.ObjectDataBlock shapeBlock;
@ -6787,8 +6791,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void SetPrimitiveShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector dimple, byte fudge) protected void SetPrimitiveShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector dimple, byte fudge)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
ObjectShapePacket.ObjectDataBlock shapeBlock; ObjectShapePacket.ObjectDataBlock shapeBlock;
@ -6832,8 +6836,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void SetPrimitiveShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector holesize, LSL_Vector topshear, LSL_Vector profilecut, LSL_Vector taper_a, float revolutions, float radiusoffset, float skew, byte fudge) protected void SetPrimitiveShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector holesize, LSL_Vector topshear, LSL_Vector profilecut, LSL_Vector taper_a, float revolutions, float radiusoffset, float skew, byte fudge)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
ObjectShapePacket.ObjectDataBlock shapeBlock; ObjectShapePacket.ObjectDataBlock shapeBlock;
@ -6956,8 +6960,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void SetPrimitiveShapeParams(SceneObjectPart part, string map, int type) protected void SetPrimitiveShapeParams(SceneObjectPart part, string map, int type)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock(); ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
@ -6993,13 +6997,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
public void llSetPrimitiveParams(LSL_List rules) public void llSetPrimitiveParams(LSL_List rules)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
SetPrimParams(m_host, rules); SetPrimParams(m_host, rules);
} }
public void llSetLinkPrimitiveParams(int linknumber, LSL_List rules) public void llSetLinkPrimitiveParams(int linknumber, LSL_List rules)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
List<SceneObjectPart> parts = GetLinkParts(linknumber); List<SceneObjectPart> parts = GetLinkParts(linknumber);
@ -7014,8 +7018,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
protected void SetPrimParams(SceneObjectPart part, LSL_List rules) protected void SetPrimParams(SceneObjectPart part, LSL_List rules)
{ {
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return; return;
int idx = 0; int idx = 0;
@ -7848,96 +7852,96 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
break; break;
case (int)ScriptBaseClass.PRIM_BUMP_SHINY: case (int)ScriptBaseClass.PRIM_BUMP_SHINY:
if (remain < 1) if (remain < 1)
return res; return res;
face = (int)rules.GetLSLIntegerItem(idx++); face = (int)rules.GetLSLIntegerItem(idx++);
tex = part.Shape.Textures; tex = part.Shape.Textures;
int shiny; int shiny;
if (face == ScriptBaseClass.ALL_SIDES) if (face == ScriptBaseClass.ALL_SIDES)
{ {
for (face = 0; face < GetNumberOfSides(part); face++) for (face = 0; face < GetNumberOfSides(part); face++)
{ {
Shininess shinyness = tex.GetFace((uint)face).Shiny; Shininess shinyness = tex.GetFace((uint)face).Shiny;
if (shinyness == Shininess.High) if (shinyness == Shininess.High)
{ {
shiny = ScriptBaseClass.PRIM_SHINY_HIGH; shiny = ScriptBaseClass.PRIM_SHINY_HIGH;
} }
else if (shinyness == Shininess.Medium) else if (shinyness == Shininess.Medium)
{ {
shiny = ScriptBaseClass.PRIM_SHINY_MEDIUM; shiny = ScriptBaseClass.PRIM_SHINY_MEDIUM;
} }
else if (shinyness == Shininess.Low) else if (shinyness == Shininess.Low)
{ {
shiny = ScriptBaseClass.PRIM_SHINY_LOW; shiny = ScriptBaseClass.PRIM_SHINY_LOW;
} }
else else
{ {
shiny = ScriptBaseClass.PRIM_SHINY_NONE; shiny = ScriptBaseClass.PRIM_SHINY_NONE;
} }
res.Add(new LSL_Integer(shiny)); res.Add(new LSL_Integer(shiny));
res.Add(new LSL_Integer((int)tex.GetFace((uint)face).Bump)); res.Add(new LSL_Integer((int)tex.GetFace((uint)face).Bump));
} }
} }
else else
{ {
Shininess shinyness = tex.GetFace((uint)face).Shiny; Shininess shinyness = tex.GetFace((uint)face).Shiny;
if (shinyness == Shininess.High) if (shinyness == Shininess.High)
{ {
shiny = ScriptBaseClass.PRIM_SHINY_HIGH; shiny = ScriptBaseClass.PRIM_SHINY_HIGH;
} }
else if (shinyness == Shininess.Medium) else if (shinyness == Shininess.Medium)
{ {
shiny = ScriptBaseClass.PRIM_SHINY_MEDIUM; shiny = ScriptBaseClass.PRIM_SHINY_MEDIUM;
} }
else if (shinyness == Shininess.Low) else if (shinyness == Shininess.Low)
{ {
shiny = ScriptBaseClass.PRIM_SHINY_LOW; shiny = ScriptBaseClass.PRIM_SHINY_LOW;
} }
else else
{ {
shiny = ScriptBaseClass.PRIM_SHINY_NONE; shiny = ScriptBaseClass.PRIM_SHINY_NONE;
} }
res.Add(new LSL_Integer(shiny)); res.Add(new LSL_Integer(shiny));
res.Add(new LSL_Integer((int)tex.GetFace((uint)face).Bump)); res.Add(new LSL_Integer((int)tex.GetFace((uint)face).Bump));
} }
break; break;
case (int)ScriptBaseClass.PRIM_FULLBRIGHT: case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
if (remain < 1) if (remain < 1)
return res; return res;
face = (int)rules.GetLSLIntegerItem(idx++); face = (int)rules.GetLSLIntegerItem(idx++);
tex = part.Shape.Textures; tex = part.Shape.Textures;
int fullbright; int fullbright;
if (face == ScriptBaseClass.ALL_SIDES) if (face == ScriptBaseClass.ALL_SIDES)
{ {
for (face = 0; face < GetNumberOfSides(part); face++) for (face = 0; face < GetNumberOfSides(part); face++)
{ {
if (tex.GetFace((uint)face).Fullbright == true) if (tex.GetFace((uint)face).Fullbright == true)
{ {
fullbright = ScriptBaseClass.TRUE; fullbright = ScriptBaseClass.TRUE;
} }
else else
{ {
fullbright = ScriptBaseClass.FALSE; fullbright = ScriptBaseClass.FALSE;
} }
res.Add(new LSL_Integer(fullbright)); res.Add(new LSL_Integer(fullbright));
} }
} }
else else
{ {
if (tex.GetFace((uint)face).Fullbright == true) if (tex.GetFace((uint)face).Fullbright == true)
{ {
fullbright = ScriptBaseClass.TRUE; fullbright = ScriptBaseClass.TRUE;
} }
else else
{ {
fullbright = ScriptBaseClass.FALSE; fullbright = ScriptBaseClass.FALSE;
} }
res.Add(new LSL_Integer(fullbright)); res.Add(new LSL_Integer(fullbright));
} }
break; break;
case (int)ScriptBaseClass.PRIM_FLEXIBLE: case (int)ScriptBaseClass.PRIM_FLEXIBLE:
@ -7958,37 +7962,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
break; break;
case (int)ScriptBaseClass.PRIM_TEXGEN: case (int)ScriptBaseClass.PRIM_TEXGEN:
// (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR) // (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR)
if (remain < 1) if (remain < 1)
return res; return res;
face = (int)rules.GetLSLIntegerItem(idx++); face = (int)rules.GetLSLIntegerItem(idx++);
tex = part.Shape.Textures; tex = part.Shape.Textures;
if (face == ScriptBaseClass.ALL_SIDES) if (face == ScriptBaseClass.ALL_SIDES)
{ {
for (face = 0; face < GetNumberOfSides(part); face++) for (face = 0; face < GetNumberOfSides(part); face++)
{ {
if (tex.GetFace((uint)face).TexMapType == MappingType.Planar) if (tex.GetFace((uint)face).TexMapType == MappingType.Planar)
{ {
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TEXGEN_PLANAR)); res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TEXGEN_PLANAR));
} }
else else
{ {
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TEXGEN_DEFAULT)); res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TEXGEN_DEFAULT));
} }
} }
} }
else else
{ {
if (tex.GetFace((uint)face).TexMapType == MappingType.Planar) if (tex.GetFace((uint)face).TexMapType == MappingType.Planar)
{ {
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TEXGEN_PLANAR)); res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TEXGEN_PLANAR));
} }
else else
{ {
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TEXGEN_DEFAULT)); res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TEXGEN_DEFAULT));
} }
} }
break; break;
case (int)ScriptBaseClass.PRIM_POINT_LIGHT: case (int)ScriptBaseClass.PRIM_POINT_LIGHT:
@ -8006,26 +8010,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
res.Add(new LSL_Float(shape.LightFalloff)); // falloff res.Add(new LSL_Float(shape.LightFalloff)); // falloff
break; break;
case (int)ScriptBaseClass.PRIM_GLOW: case (int)ScriptBaseClass.PRIM_GLOW:
if (remain < 1) if (remain < 1)
return res; return res;
face = (int)rules.GetLSLIntegerItem(idx++); face = (int)rules.GetLSLIntegerItem(idx++);
tex = part.Shape.Textures; tex = part.Shape.Textures;
float primglow; float primglow;
if (face == ScriptBaseClass.ALL_SIDES) if (face == ScriptBaseClass.ALL_SIDES)
{ {
for (face = 0; face < GetNumberOfSides(part); face++) for (face = 0; face < GetNumberOfSides(part); face++)
{ {
primglow = tex.GetFace((uint)face).Glow; primglow = tex.GetFace((uint)face).Glow;
res.Add(new LSL_Float(primglow)); res.Add(new LSL_Float(primglow));
} }
} }
else else
{ {
primglow = tex.GetFace((uint)face).Glow; primglow = tex.GetFace((uint)face).Glow;
res.Add(new LSL_Float(primglow)); res.Add(new LSL_Float(primglow));
} }
break; break;
case (int)ScriptBaseClass.PRIM_TEXT: case (int)ScriptBaseClass.PRIM_TEXT:
Color4 textColor = part.GetTextColor(); Color4 textColor = part.GetTextColor();
@ -9187,7 +9191,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (quick_pay_buttons.Data.Length < 4) if (quick_pay_buttons.Data.Length < 4)
{ {
int x; int x;
for (x=quick_pay_buttons.Data.Length; x<= 4; x++) for (x=quick_pay_buttons.Data.Length; x<= 4; x++)
{ {
@ -9195,12 +9199,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
int[] nPrice = new int[5]; int[] nPrice = new int[5];
nPrice[0]=price; nPrice[0]=price;
nPrice[1] = (LSL_Integer)quick_pay_buttons.Data[0]; nPrice[1] = (LSL_Integer)quick_pay_buttons.Data[0];
nPrice[2] = (LSL_Integer)quick_pay_buttons.Data[1]; nPrice[2] = (LSL_Integer)quick_pay_buttons.Data[1];
nPrice[3] = (LSL_Integer)quick_pay_buttons.Data[2]; nPrice[3] = (LSL_Integer)quick_pay_buttons.Data[2];
nPrice[4] = (LSL_Integer)quick_pay_buttons.Data[3]; nPrice[4] = (LSL_Integer)quick_pay_buttons.Data[3];
m_host.ParentGroup.RootPart.PayPrice = nPrice; m_host.ParentGroup.RootPart.PayPrice = nPrice;
m_host.ParentGroup.HasGroupChanged = true; m_host.ParentGroup.HasGroupChanged = true;
} }

View File

@ -26,6 +26,7 @@
*/ */
using System; using System;
using System.Diagnostics; //for [DebuggerNonUserCode]
using System.Runtime.Remoting.Lifetime; using System.Runtime.Remoting.Lifetime;
using System.Threading; using System.Threading;
using System.Reflection; using System.Reflection;
@ -309,6 +310,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel); m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel);
} }
[DebuggerNonUserCode]
public void llDie() public void llDie()
{ {
m_LSL_Functions.llDie(); m_LSL_Functions.llDie();