From f9c6cc36e153baeddc873b6c69698dcfa63161f0 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 9 May 2008 16:24:28 +0000 Subject: Update svn properties. --- .../Environment/Scenes/SceneExternalChecks.cs | 1210 ++++++++++---------- .../Modules/Python/Properties/AssemblyInfo.cs | 72 +- OpenSim/Region/Modules/Python/PythonAPI/Console.cs | 42 +- OpenSim/Region/Modules/Python/PythonModule.cs | 96 +- 4 files changed, 710 insertions(+), 710 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index 4e579b6..e7e4caf 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs @@ -1,605 +1,605 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSim Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework; -using OpenSim.Region.Environment.Interfaces; - -namespace OpenSim.Region.Environment.Scenes -{ - public class SceneExternalChecks - { - private Scene m_scene; - - public SceneExternalChecks(Scene scene) - { - m_scene = scene; - } - - #region Object Permission Checks - - #region REZ OBJECT - public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); - private List CanRezObjectCheckFunctions = new List(); - - public void addCheckRezObject(CanRezObject delegateFunc) - { - if(!CanRezObjectCheckFunctions.Contains(delegateFunc)) - CanRezObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckRezObject(CanRezObject delegateFunc) - { - if (CanRezObjectCheckFunctions.Contains(delegateFunc)) - CanRezObjectCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) - { - foreach (CanRezObject check in CanRezObjectCheckFunctions) - { - if (check(objectCount, owner,objectPosition, m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region DEREZ OBJECT - public delegate bool CanDeRezObject(LLUUID objectID, LLUUID deleter, Scene scene); - private List CanDeRezObjectCheckFunctions = new List(); - - public void addCheckDeRezObject(CanDeRezObject delegateFunc) - { - if (!CanDeRezObjectCheckFunctions.Contains(delegateFunc)) - CanDeRezObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckDeRezObject(CanDeRezObject delegateFunc) - { - if (CanDeRezObjectCheckFunctions.Contains(delegateFunc)) - CanDeRezObjectCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanDeRezObject(LLUUID objectID, LLUUID deleter) - { - foreach (CanDeRezObject check in CanDeRezObjectCheckFunctions) - { - if (check(objectID,deleter,m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region TAKE OBJECT - public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); - private List CanTakeObjectCheckFunctions = new List(); - - public void addCheckTakeObject(CanTakeObject delegateFunc) - { - if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) - CanTakeObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckTakeObject(CanTakeObject delegateFunc) - { - if (CanTakeObjectCheckFunctions.Contains(delegateFunc)) - CanTakeObjectCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID stealer) - { - foreach (CanTakeObject check in CanTakeObjectCheckFunctions) - { - if (check(objectID, stealer, m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region COPY OBJECT - public delegate bool CanCopyObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); - private List CanCopyObjectCheckFunctions = new List(); - - public void addCheckCopyObject(CanCopyObject delegateFunc) - { - if (!CanCopyObjectCheckFunctions.Contains(delegateFunc)) - CanCopyObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckCopyObject(CanCopyObject delegateFunc) - { - if (CanCopyObjectCheckFunctions.Contains(delegateFunc)) - CanCopyObjectCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanCopyObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) - { - foreach (CanCopyObject check in CanCopyObjectCheckFunctions) - { - if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region EDIT OBJECT - public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); - private List CanEditObjectCheckFunctions = new List(); - - public void addCheckEditObject(CanEditObject delegateFunc) - { - if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) - CanEditObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditObject(CanEditObject delegateFunc) - { - if (CanEditObjectCheckFunctions.Contains(delegateFunc)) - CanEditObjectCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) - { - foreach (CanEditObject check in CanEditObjectCheckFunctions) - { - if (check(objectID, editorID, m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region MOVE OBJECT - public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); - private List CanMoveObjectCheckFunctions = new List(); - - public void addCheckMoveObject(CanMoveObject delegateFunc) - { - if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) - CanMoveObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckMoveObject(CanMoveObject delegateFunc) - { - if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) - CanMoveObjectCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) - { - foreach (CanMoveObject check in CanMoveObjectCheckFunctions) - { - if (check(objectID,moverID,m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region RETURN OBJECT - public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); - private List CanReturnObjectCheckFunctions = new List(); - - public void addCheckReturnObject(CanReturnObject delegateFunc) - { - if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) - CanReturnObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckReturnObject(CanReturnObject delegateFunc) - { - if (CanReturnObjectCheckFunctions.Contains(delegateFunc)) - CanReturnObjectCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) - { - foreach (CanReturnObject check in CanReturnObjectCheckFunctions) - { - if (check(objectID,returnerID,m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #endregion - - #region Misc Permission Checks - - #region INSTANT MESSAGE - public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); - private List CanInstantMessageCheckFunctions = new List(); - - public void addCheckInstantMessage(CanInstantMessage delegateFunc) - { - if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) - CanInstantMessageCheckFunctions.Add(delegateFunc); - } - public void removeCheckInstantMessage(CanInstantMessage delegateFunc) - { - if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) - CanInstantMessageCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) - { - foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) - { - if (check(user,target,m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region INVENTORY TRANSFER - public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); - private List CanInventoryTransferCheckFunctions = new List(); - - public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) - { - if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) - CanInventoryTransferCheckFunctions.Add(delegateFunc); - } - public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) - { - if (CanInventoryTransferCheckFunctions.Contains(delegateFunc)) - CanInventoryTransferCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) - { - foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) - { - if (check(user, target, m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region EDIT SCRIPT - public delegate bool CanEditScript(LLUUID script, LLUUID user, Scene scene); - private List CanEditScriptCheckFunctions = new List(); - - public void addCheckEditScript(CanEditScript delegateFunc) - { - if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) - CanEditScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditScript(CanEditScript delegateFunc) - { - if (CanEditScriptCheckFunctions.Contains(delegateFunc)) - CanEditScriptCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanEditScript(LLUUID script, LLUUID user) - { - foreach (CanEditScript check in CanEditScriptCheckFunctions) - { - if (check(script, user, m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region RUN SCRIPT - public delegate bool CanRunScript(LLUUID script, LLUUID user, Scene scene); - private List CanRunScriptCheckFunctions = new List(); - - public void addCheckRunScript(CanRunScript delegateFunc) - { - if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) - CanRunScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckRunScript(CanRunScript delegateFunc) - { - if (CanRunScriptCheckFunctions.Contains(delegateFunc)) - CanRunScriptCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanRunScript(LLUUID script, LLUUID user) - { - foreach (CanRunScript check in CanRunScriptCheckFunctions) - { - if (check(script, user, m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region TERRAFORM LAND - public delegate bool CanTerraformLandCommand(LLUUID user, LLVector3 position, Scene requestFromScene); - private List CanTerraformLandCommandCheckFunctions = new List(); - - public void addCheckTerraformLandCommand(CanTerraformLandCommand delegateFunc) - { - if (!CanTerraformLandCommandCheckFunctions.Contains(delegateFunc)) - CanTerraformLandCommandCheckFunctions.Add(delegateFunc); - } - public void removeCheckTerraformLandCommand(CanTerraformLandCommand delegateFunc) - { - if (CanTerraformLandCommandCheckFunctions.Contains(delegateFunc)) - CanTerraformLandCommandCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) - { - foreach (CanTerraformLandCommand check in CanTerraformLandCommandCheckFunctions) - { - if (check(user, pos, m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region RUN CONSOLE COMMAND - public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); - private List CanRunConsoleCommandCheckFunctions = new List(); - - public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) - { - if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) - CanRunConsoleCommandCheckFunctions.Add(delegateFunc); - } - public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) - { - if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) - CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanRunConsoleCommand(LLUUID user) - { - foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) - { - if (check(user, m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region CAN BE GODLIKE - public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); - private List CanBeGodLikeCheckFunctions = new List(); - - public void addCheckBeGodLike(CanBeGodLike delegateFunc) - { - if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) - CanBeGodLikeCheckFunctions.Add(delegateFunc); - } - public void removeCheckBeGodLike(CanBeGodLike delegateFunc) - { - if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) - CanBeGodLikeCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanBeGodLike(LLUUID user) - { - foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) - { - if (check(user, m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #endregion - - #region Parcel and Estate Permission Checks - #region EDIT ESTATE TERRAIN - public delegate bool CanEditEstateTerrain(LLUUID user, Scene scene); - private List CanEditEstateTerrainCheckFunctions = new List(); - - public void addCheckEditEstateTerrain(CanEditEstateTerrain delegateFunc) - { - if (!CanEditEstateTerrainCheckFunctions.Contains(delegateFunc)) - CanEditEstateTerrainCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditEstateTerrain(CanEditEstateTerrain delegateFunc) - { - if (CanEditEstateTerrainCheckFunctions.Contains(delegateFunc)) - CanEditEstateTerrainCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanEditEstateTerrain(LLUUID user) - { - foreach (CanEditEstateTerrain check in CanEditEstateTerrainCheckFunctions) - { - if (check(user, m_scene) == false) - { - return false; - } - } - return true; - } - - #endregion - - #region RESTART SIM - public delegate bool CanRestartSim(LLUUID user, Scene scene); - private List CanRestartSimCheckFunctions = new List(); - - public void addCheckRestartSim(CanRestartSim delegateFunc) - { - if (!CanRestartSimCheckFunctions.Contains(delegateFunc)) - CanRestartSimCheckFunctions.Add(delegateFunc); - } - public void removeCheckRestartSim(CanRestartSim delegateFunc) - { - if (CanRestartSimCheckFunctions.Contains(delegateFunc)) - CanRestartSimCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanRestartSim(LLUUID user) - { - foreach (CanRestartSim check in CanRestartSimCheckFunctions) - { - if (check(user, m_scene) == false) - { - return false; - } - } - return true; - } - #endregion - - #region EDIT PARCEL - public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanEditParcelCheckFunctions = new List(); - - public void addCheckEditParcel(CanEditParcel delegateFunc) - { - if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) - CanEditParcelCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditParcel(CanEditParcel delegateFunc) - { - if (CanEditParcelCheckFunctions.Contains(delegateFunc)) - CanEditParcelCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) - { - foreach (CanEditParcel check in CanEditParcelCheckFunctions) - { - if (check(user, parcel, m_scene) == false) - { - return false; - } - } - return true; - } - #endregion - - #region SELL PARCEL - public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanSellParcelCheckFunctions = new List(); - - public void addCheckSellParcel(CanSellParcel delegateFunc) - { - if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) - CanSellParcelCheckFunctions.Add(delegateFunc); - } - public void removeCheckSellParcel(CanSellParcel delegateFunc) - { - if (CanSellParcelCheckFunctions.Contains(delegateFunc)) - CanSellParcelCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) - { - foreach (CanSellParcel check in CanSellParcelCheckFunctions) - { - if (check(user, parcel, m_scene) == false) - { - return false; - } - } - return true; - } - #endregion - - #region ABANDON PARCEL - public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanAbandonParcelCheckFunctions = new List(); - - public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) - { - if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) - CanAbandonParcelCheckFunctions.Add(delegateFunc); - } - public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc) - { - if (CanAbandonParcelCheckFunctions.Contains(delegateFunc)) - CanAbandonParcelCheckFunctions.Remove(delegateFunc); - } - - public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) - { - foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) - { - if (check(user, parcel, m_scene) == false) - { - return false; - } - } - return true; - } - #endregion - #endregion - - - } -} +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSim Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using OpenSim.Framework; +using OpenSim.Region.Environment.Interfaces; + +namespace OpenSim.Region.Environment.Scenes +{ + public class SceneExternalChecks + { + private Scene m_scene; + + public SceneExternalChecks(Scene scene) + { + m_scene = scene; + } + + #region Object Permission Checks + + #region REZ OBJECT + public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); + private List CanRezObjectCheckFunctions = new List(); + + public void addCheckRezObject(CanRezObject delegateFunc) + { + if(!CanRezObjectCheckFunctions.Contains(delegateFunc)) + CanRezObjectCheckFunctions.Add(delegateFunc); + } + public void removeCheckRezObject(CanRezObject delegateFunc) + { + if (CanRezObjectCheckFunctions.Contains(delegateFunc)) + CanRezObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) + { + foreach (CanRezObject check in CanRezObjectCheckFunctions) + { + if (check(objectCount, owner,objectPosition, m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region DEREZ OBJECT + public delegate bool CanDeRezObject(LLUUID objectID, LLUUID deleter, Scene scene); + private List CanDeRezObjectCheckFunctions = new List(); + + public void addCheckDeRezObject(CanDeRezObject delegateFunc) + { + if (!CanDeRezObjectCheckFunctions.Contains(delegateFunc)) + CanDeRezObjectCheckFunctions.Add(delegateFunc); + } + public void removeCheckDeRezObject(CanDeRezObject delegateFunc) + { + if (CanDeRezObjectCheckFunctions.Contains(delegateFunc)) + CanDeRezObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanDeRezObject(LLUUID objectID, LLUUID deleter) + { + foreach (CanDeRezObject check in CanDeRezObjectCheckFunctions) + { + if (check(objectID,deleter,m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region TAKE OBJECT + public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); + private List CanTakeObjectCheckFunctions = new List(); + + public void addCheckTakeObject(CanTakeObject delegateFunc) + { + if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) + CanTakeObjectCheckFunctions.Add(delegateFunc); + } + public void removeCheckTakeObject(CanTakeObject delegateFunc) + { + if (CanTakeObjectCheckFunctions.Contains(delegateFunc)) + CanTakeObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID stealer) + { + foreach (CanTakeObject check in CanTakeObjectCheckFunctions) + { + if (check(objectID, stealer, m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region COPY OBJECT + public delegate bool CanCopyObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); + private List CanCopyObjectCheckFunctions = new List(); + + public void addCheckCopyObject(CanCopyObject delegateFunc) + { + if (!CanCopyObjectCheckFunctions.Contains(delegateFunc)) + CanCopyObjectCheckFunctions.Add(delegateFunc); + } + public void removeCheckCopyObject(CanCopyObject delegateFunc) + { + if (CanCopyObjectCheckFunctions.Contains(delegateFunc)) + CanCopyObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanCopyObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) + { + foreach (CanCopyObject check in CanCopyObjectCheckFunctions) + { + if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region EDIT OBJECT + public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); + private List CanEditObjectCheckFunctions = new List(); + + public void addCheckEditObject(CanEditObject delegateFunc) + { + if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) + CanEditObjectCheckFunctions.Add(delegateFunc); + } + public void removeCheckEditObject(CanEditObject delegateFunc) + { + if (CanEditObjectCheckFunctions.Contains(delegateFunc)) + CanEditObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) + { + foreach (CanEditObject check in CanEditObjectCheckFunctions) + { + if (check(objectID, editorID, m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region MOVE OBJECT + public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); + private List CanMoveObjectCheckFunctions = new List(); + + public void addCheckMoveObject(CanMoveObject delegateFunc) + { + if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) + CanMoveObjectCheckFunctions.Add(delegateFunc); + } + public void removeCheckMoveObject(CanMoveObject delegateFunc) + { + if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) + CanMoveObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) + { + foreach (CanMoveObject check in CanMoveObjectCheckFunctions) + { + if (check(objectID,moverID,m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region RETURN OBJECT + public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); + private List CanReturnObjectCheckFunctions = new List(); + + public void addCheckReturnObject(CanReturnObject delegateFunc) + { + if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) + CanReturnObjectCheckFunctions.Add(delegateFunc); + } + public void removeCheckReturnObject(CanReturnObject delegateFunc) + { + if (CanReturnObjectCheckFunctions.Contains(delegateFunc)) + CanReturnObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) + { + foreach (CanReturnObject check in CanReturnObjectCheckFunctions) + { + if (check(objectID,returnerID,m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #endregion + + #region Misc Permission Checks + + #region INSTANT MESSAGE + public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); + private List CanInstantMessageCheckFunctions = new List(); + + public void addCheckInstantMessage(CanInstantMessage delegateFunc) + { + if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) + CanInstantMessageCheckFunctions.Add(delegateFunc); + } + public void removeCheckInstantMessage(CanInstantMessage delegateFunc) + { + if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) + CanInstantMessageCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) + { + foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) + { + if (check(user,target,m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region INVENTORY TRANSFER + public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); + private List CanInventoryTransferCheckFunctions = new List(); + + public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) + { + if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) + CanInventoryTransferCheckFunctions.Add(delegateFunc); + } + public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) + { + if (CanInventoryTransferCheckFunctions.Contains(delegateFunc)) + CanInventoryTransferCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) + { + foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) + { + if (check(user, target, m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region EDIT SCRIPT + public delegate bool CanEditScript(LLUUID script, LLUUID user, Scene scene); + private List CanEditScriptCheckFunctions = new List(); + + public void addCheckEditScript(CanEditScript delegateFunc) + { + if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) + CanEditScriptCheckFunctions.Add(delegateFunc); + } + public void removeCheckEditScript(CanEditScript delegateFunc) + { + if (CanEditScriptCheckFunctions.Contains(delegateFunc)) + CanEditScriptCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanEditScript(LLUUID script, LLUUID user) + { + foreach (CanEditScript check in CanEditScriptCheckFunctions) + { + if (check(script, user, m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region RUN SCRIPT + public delegate bool CanRunScript(LLUUID script, LLUUID user, Scene scene); + private List CanRunScriptCheckFunctions = new List(); + + public void addCheckRunScript(CanRunScript delegateFunc) + { + if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) + CanRunScriptCheckFunctions.Add(delegateFunc); + } + public void removeCheckRunScript(CanRunScript delegateFunc) + { + if (CanRunScriptCheckFunctions.Contains(delegateFunc)) + CanRunScriptCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanRunScript(LLUUID script, LLUUID user) + { + foreach (CanRunScript check in CanRunScriptCheckFunctions) + { + if (check(script, user, m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region TERRAFORM LAND + public delegate bool CanTerraformLandCommand(LLUUID user, LLVector3 position, Scene requestFromScene); + private List CanTerraformLandCommandCheckFunctions = new List(); + + public void addCheckTerraformLandCommand(CanTerraformLandCommand delegateFunc) + { + if (!CanTerraformLandCommandCheckFunctions.Contains(delegateFunc)) + CanTerraformLandCommandCheckFunctions.Add(delegateFunc); + } + public void removeCheckTerraformLandCommand(CanTerraformLandCommand delegateFunc) + { + if (CanTerraformLandCommandCheckFunctions.Contains(delegateFunc)) + CanTerraformLandCommandCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) + { + foreach (CanTerraformLandCommand check in CanTerraformLandCommandCheckFunctions) + { + if (check(user, pos, m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region RUN CONSOLE COMMAND + public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); + private List CanRunConsoleCommandCheckFunctions = new List(); + + public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) + { + if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) + CanRunConsoleCommandCheckFunctions.Add(delegateFunc); + } + public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) + { + if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) + CanRunConsoleCommandCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanRunConsoleCommand(LLUUID user) + { + foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) + { + if (check(user, m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region CAN BE GODLIKE + public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); + private List CanBeGodLikeCheckFunctions = new List(); + + public void addCheckBeGodLike(CanBeGodLike delegateFunc) + { + if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) + CanBeGodLikeCheckFunctions.Add(delegateFunc); + } + public void removeCheckBeGodLike(CanBeGodLike delegateFunc) + { + if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) + CanBeGodLikeCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanBeGodLike(LLUUID user) + { + foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) + { + if (check(user, m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #endregion + + #region Parcel and Estate Permission Checks + #region EDIT ESTATE TERRAIN + public delegate bool CanEditEstateTerrain(LLUUID user, Scene scene); + private List CanEditEstateTerrainCheckFunctions = new List(); + + public void addCheckEditEstateTerrain(CanEditEstateTerrain delegateFunc) + { + if (!CanEditEstateTerrainCheckFunctions.Contains(delegateFunc)) + CanEditEstateTerrainCheckFunctions.Add(delegateFunc); + } + public void removeCheckEditEstateTerrain(CanEditEstateTerrain delegateFunc) + { + if (CanEditEstateTerrainCheckFunctions.Contains(delegateFunc)) + CanEditEstateTerrainCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanEditEstateTerrain(LLUUID user) + { + foreach (CanEditEstateTerrain check in CanEditEstateTerrainCheckFunctions) + { + if (check(user, m_scene) == false) + { + return false; + } + } + return true; + } + + #endregion + + #region RESTART SIM + public delegate bool CanRestartSim(LLUUID user, Scene scene); + private List CanRestartSimCheckFunctions = new List(); + + public void addCheckRestartSim(CanRestartSim delegateFunc) + { + if (!CanRestartSimCheckFunctions.Contains(delegateFunc)) + CanRestartSimCheckFunctions.Add(delegateFunc); + } + public void removeCheckRestartSim(CanRestartSim delegateFunc) + { + if (CanRestartSimCheckFunctions.Contains(delegateFunc)) + CanRestartSimCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanRestartSim(LLUUID user) + { + foreach (CanRestartSim check in CanRestartSimCheckFunctions) + { + if (check(user, m_scene) == false) + { + return false; + } + } + return true; + } + #endregion + + #region EDIT PARCEL + public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); + private List CanEditParcelCheckFunctions = new List(); + + public void addCheckEditParcel(CanEditParcel delegateFunc) + { + if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) + CanEditParcelCheckFunctions.Add(delegateFunc); + } + public void removeCheckEditParcel(CanEditParcel delegateFunc) + { + if (CanEditParcelCheckFunctions.Contains(delegateFunc)) + CanEditParcelCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) + { + foreach (CanEditParcel check in CanEditParcelCheckFunctions) + { + if (check(user, parcel, m_scene) == false) + { + return false; + } + } + return true; + } + #endregion + + #region SELL PARCEL + public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); + private List CanSellParcelCheckFunctions = new List(); + + public void addCheckSellParcel(CanSellParcel delegateFunc) + { + if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) + CanSellParcelCheckFunctions.Add(delegateFunc); + } + public void removeCheckSellParcel(CanSellParcel delegateFunc) + { + if (CanSellParcelCheckFunctions.Contains(delegateFunc)) + CanSellParcelCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) + { + foreach (CanSellParcel check in CanSellParcelCheckFunctions) + { + if (check(user, parcel, m_scene) == false) + { + return false; + } + } + return true; + } + #endregion + + #region ABANDON PARCEL + public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); + private List CanAbandonParcelCheckFunctions = new List(); + + public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) + { + if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) + CanAbandonParcelCheckFunctions.Add(delegateFunc); + } + public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc) + { + if (CanAbandonParcelCheckFunctions.Contains(delegateFunc)) + CanAbandonParcelCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) + { + foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) + { + if (check(user, parcel, m_scene) == false) + { + return false; + } + } + return true; + } + #endregion + #endregion + + + } +} diff --git a/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs b/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs index e4d7852..0839267 100644 --- a/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/Modules/Python/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Python")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Python")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5bd55f67-385d-4a43-893a-b5d2ea43f07d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Python")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Python")] +[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5bd55f67-385d-4a43-893a-b5d2ea43f07d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenSim/Region/Modules/Python/PythonAPI/Console.cs b/OpenSim/Region/Modules/Python/PythonAPI/Console.cs index 0d23dc6..3fe1f91 100644 --- a/OpenSim/Region/Modules/Python/PythonAPI/Console.cs +++ b/OpenSim/Region/Modules/Python/PythonAPI/Console.cs @@ -1,21 +1,21 @@ -using System; -using System.Reflection; -using log4net; - -namespace OpenSim.Region.Modules.Python.PythonAPI -{ - class Console - { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - public void WriteLine(string txt) - { - m_log.Info(txt); - } - - public void WriteLine(string txt, params Object[] e) - { - m_log.Info(String.Format(txt, e)); - } - } -} +using System; +using System.Reflection; +using log4net; + +namespace OpenSim.Region.Modules.Python.PythonAPI +{ + class Console + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + public void WriteLine(string txt) + { + m_log.Info(txt); + } + + public void WriteLine(string txt, params Object[] e) + { + m_log.Info(String.Format(txt, e)); + } + } +} diff --git a/OpenSim/Region/Modules/Python/PythonModule.cs b/OpenSim/Region/Modules/Python/PythonModule.cs index 142a7df..48e0a59 100644 --- a/OpenSim/Region/Modules/Python/PythonModule.cs +++ b/OpenSim/Region/Modules/Python/PythonModule.cs @@ -1,48 +1,48 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Security.Policy; -using System.Text; -using IronPython.Hosting; -using log4net; -using Nini.Config; -using OpenSim.Region.Environment.Interfaces; -using OpenSim.Region.Environment.Scenes; - -namespace OpenSim.Region.Modules.Python -{ - class PythonModule : IRegionModule - { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private PythonEngine m_python; - - public void Initialise(Scene scene, IConfigSource source) - { - - } - - public void PostInitialise() - { - /* - m_log.Info("[PYTHON] Initialising IronPython engine."); - m_python = new PythonEngine(); - m_python.AddToPath(System.Environment.CurrentDirectory + System.IO.Path.DirectorySeparatorChar + "Python"); - */ - } - - public void Close() - { - - } - - public string Name - { - get { return "PythonModule"; } - } - - public bool IsSharedModule - { - get { return true; } - } - } -} +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Security.Policy; +using System.Text; +using IronPython.Hosting; +using log4net; +using Nini.Config; +using OpenSim.Region.Environment.Interfaces; +using OpenSim.Region.Environment.Scenes; + +namespace OpenSim.Region.Modules.Python +{ + class PythonModule : IRegionModule + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private PythonEngine m_python; + + public void Initialise(Scene scene, IConfigSource source) + { + + } + + public void PostInitialise() + { + /* + m_log.Info("[PYTHON] Initialising IronPython engine."); + m_python = new PythonEngine(); + m_python.AddToPath(System.Environment.CurrentDirectory + System.IO.Path.DirectorySeparatorChar + "Python"); + */ + } + + public void Close() + { + + } + + public string Name + { + get { return "PythonModule"; } + } + + public bool IsSharedModule + { + get { return true; } + } + } +} -- cgit v1.1