From d470d30c09fde202f708a9c8af763f5d16e18bfb Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Sun, 6 Jul 2008 14:02:22 +0000 Subject: Copyright notices and formatting cleanup. --- .../Region/Environment/Interfaces/IEmailModule.cs | 20 +++--- .../Region/Environment/Interfaces/IScriptModule.cs | 2 +- .../Modules/Scripting/EMailModules/EmailModule.cs | 51 +++++++++---- .../Region/Environment/Scenes/Scene.Inventory.cs | 84 +++++++++++----------- .../Scenes/SceneObjectPart.Inventory.cs | 2 +- .../Region/Environment/Scenes/SceneObjectPart.cs | 4 -- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 4 +- 7 files changed, 95 insertions(+), 72 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Interfaces/IEmailModule.cs b/OpenSim/Region/Environment/Interfaces/IEmailModule.cs index aae5d9c..3726ba5 100644 --- a/OpenSim/Region/Environment/Interfaces/IEmailModule.cs +++ b/OpenSim/Region/Environment/Interfaces/IEmailModule.cs @@ -31,18 +31,18 @@ using libsecondlife; namespace OpenSim.Region.Environment.Interfaces { - public class Email - { - public string time; - public string sender; - public string subject; - public string message; - public int numLeft; - } + public class Email + { + public string time; + public string sender; + public string subject; + public string message; + public int numLeft; + } public interface IEmailModule : IRegionModule { - void SendEmail(LLUUID objectID, string address, string subject, string body); - Email GetNextEmail(LLUUID objectID, string sender, string subject); + void SendEmail(LLUUID objectID, string address, string subject, string body); + Email GetNextEmail(LLUUID objectID, string sender, string subject); } } diff --git a/OpenSim/Region/Environment/Interfaces/IScriptModule.cs b/OpenSim/Region/Environment/Interfaces/IScriptModule.cs index 7aecaf7..8d3868e 100644 --- a/OpenSim/Region/Environment/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Environment/Interfaces/IScriptModule.cs @@ -33,6 +33,6 @@ namespace OpenSim.Region.Environment.Interfaces { public interface IScriptModule : IRegionModule { - bool GetScriptRunning(LLUUID objectID, LLUUID itemID); + bool GetScriptRunning(LLUUID objectID, LLUUID itemID); } } diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs index 5d33b04..77b2d29 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs @@ -1,3 +1,30 @@ +/* + * 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.Reflection; using System.Collections.Generic; @@ -24,9 +51,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules // Scenes by Region Handle private Dictionary m_Scenes = - new Dictionary(); + new Dictionary(); - private bool m_Enabled = false; + private bool m_Enabled = false; public void Initialise(Scene scene, IConfigSource config) { @@ -34,8 +61,8 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules IConfig startupConfig = m_Config.Configs["Startup"]; - m_Enabled = (startupConfig.GetString("emailmodule", - "DefaultEmailModule") == "DefaultEmailModule"); + m_Enabled = (startupConfig.GetString("emailmodule", + "DefaultEmailModule") == "DefaultEmailModule"); // It's a go! if (m_Enabled) @@ -79,12 +106,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules } public void SendEmail(LLUUID objectID, string address, string subject, string body) - { - } - - public Email GetNextEmail(LLUUID objectID, string sender, string subject) - { - return null; - } - } + { + } + + public Email GetNextEmail(LLUUID objectID, string sender, string subject) + { + return null; + } + } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 53681f8..d87b930 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -995,7 +995,7 @@ namespace OpenSim.Region.Environment.Scenes else { CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(avatarId); - if(profile == null || profile.RootFolder == null) + if (profile == null || profile.RootFolder == null) { m_log.ErrorFormat( "[PRIM INVENTORY]: " + @@ -1040,7 +1040,7 @@ namespace OpenSim.Region.Environment.Scenes return; } - if(part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) + if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) { // object cannot copy items to an object owned by a different owner // unless llAllowInventoryDrop has been called @@ -1049,7 +1049,7 @@ namespace OpenSim.Region.Environment.Scenes } // must have both move and modify permission to put an item in an object - if((part.OwnerMask & ((uint)PermissionMask.Move | (uint)PermissionMask.Modify)) == 0 ) + if ((part.OwnerMask & ((uint)PermissionMask.Move | (uint)PermissionMask.Modify)) == 0) { return; } @@ -1099,7 +1099,7 @@ namespace OpenSim.Region.Environment.Scenes ScenePresence avatar; - if(TryGetAvatar(srcTaskItem.OwnerID, out avatar)) + if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) { destPart.GetProperties(avatar.ControllingClient); } @@ -1108,7 +1108,7 @@ namespace OpenSim.Region.Environment.Scenes public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List items) { CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); - if(profile == null || profile.RootFolder == null) + if (profile == null || profile.RootFolder == null) { m_log.ErrorFormat( "[PRIM INVENTORY]: " + @@ -1325,8 +1325,8 @@ namespace OpenSim.Region.Environment.Scenes /// /// public void RezScript(LLUUID srcId, SceneObjectPart srcPart, LLUUID destId, int pin, int running, int start_param) - { - TaskInventoryItem srcTaskItem = srcPart.GetInventoryItem(srcId); + { + TaskInventoryItem srcTaskItem = srcPart.GetInventoryItem(srcId); if (srcTaskItem == null) { @@ -1348,29 +1348,29 @@ namespace OpenSim.Region.Environment.Scenes destId); return; } - + // Must own the object, and have modify rights - if(srcPart.OwnerID != destPart.OwnerID) + if (srcPart.OwnerID != destPart.OwnerID) return; - if((destPart.OwnerMask & (uint)PermissionMask.Modify) == 0) + if ((destPart.OwnerMask & (uint)PermissionMask.Modify) == 0) return; - if (destPart.ScriptAccessPin != pin) - { - m_log.WarnFormat( - "[PRIM INVENTORY]: " + - "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}", - srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin); - // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - - // "Object: Task Object trying to illegally load script onto task Other_Object!" - // How do we shout from in here? - return; - } - - TaskInventoryItem destTaskItem = new TaskInventoryItem(); - - destTaskItem.ItemID = LLUUID.Random(); + if (destPart.ScriptAccessPin != pin) + { + m_log.WarnFormat( + "[PRIM INVENTORY]: " + + "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}", + srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin); + // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - + // "Object: Task Object trying to illegally load script onto task Other_Object!" + // How do we shout from in here? + return; + } + + TaskInventoryItem destTaskItem = new TaskInventoryItem(); + + destTaskItem.ItemID = LLUUID.Random(); destTaskItem.CreatorID = srcTaskItem.CreatorID; destTaskItem.AssetID = srcTaskItem.AssetID; destTaskItem.GroupID = destPart.GroupID; @@ -1405,25 +1405,25 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.Name = srcTaskItem.Name; destTaskItem.InvType = srcTaskItem.InvType; destTaskItem.Type = srcTaskItem.Type; - + destPart.AddInventoryItemExclusive(destTaskItem); - if (running > 0) - { - if (ExternalChecks.ExternalChecksCanRunScript(destTaskItem.AssetID, destPart.UUID, destPart.OwnerID)) - { + if (running > 0) + { + if (ExternalChecks.ExternalChecksCanRunScript(destTaskItem.AssetID, destPart.UUID, destPart.OwnerID)) + { destPart.CreateScriptInstance(destTaskItem, 0, false); - } - } - - ScenePresence avatar; - - if(TryGetAvatar(srcTaskItem.OwnerID, out avatar)) + } + } + + ScenePresence avatar; + + if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) { destPart.GetProperties(avatar.ControllingClient); } - } - + } + /// /// Called when an object is removed from the environment into inventory. /// @@ -1497,7 +1497,7 @@ namespace OpenSim.Region.Environment.Scenes m_inventoryTicker.Elapsed += InventoryRunDeleteTimer; } - lock(m_inventoryDeletes) + lock (m_inventoryDeletes) { DeleteToInventoryHolder dtis = new DeleteToInventoryHolder(); dtis.DeRezPacket = DeRezPacket; @@ -2246,7 +2246,7 @@ namespace OpenSim.Region.Environment.Scenes public void GetScriptRunning(IClientAPI controllingClient, LLUUID objectID, LLUUID itemID) { IScriptModule scriptModule = RequestModuleInterface(); - if(scriptModule == null) + if (scriptModule == null) return; controllingClient.SendScriptRunningReply(objectID, itemID, @@ -2256,10 +2256,10 @@ namespace OpenSim.Region.Environment.Scenes public void SetScriptRunning(IClientAPI controllingClient, LLUUID objectID, LLUUID itemID, bool running) { SceneObjectPart part = GetSceneObjectPart(objectID); - if(part == null) + if (part == null) return; - if(running) + if (running) EventManager.TriggerStartScript(part.LocalId, itemID); else EventManager.TriggerStopScript(part.LocalId, itemID); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index fea131e..2db309a 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -292,7 +292,7 @@ namespace OpenSim.Region.Environment.Scenes public void AddInventoryItemExclusive(TaskInventoryItem item) { List il = new List(m_taskInventory.Values); - foreach(TaskInventoryItem i in il) + foreach (TaskInventoryItem i in il) { if (i.Name == item.Name) { diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 5b92a8d..2b40ad2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -1,5 +1,3 @@ -#region Header - /* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. @@ -27,8 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#endregion Header - using System; using System.Collections.Generic; using System.Drawing; diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 3daa680..22ca159 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1093,8 +1093,8 @@ namespace OpenSim.Region.Environment.Scenes ); //look for prims with explicit sit targets that are available - foreach(SceneObjectPart part in partArray) { - + foreach (SceneObjectPart part in partArray) + { // Is a sit target available? Vector3 avSitOffSet = part.GetSitTargetPosition(); Quaternion avSitOrientation = part.GetSitTargetOrientation(); -- cgit v1.1