From 6ef9d4da901a346c232458317cca6268da888e2e Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 18 Aug 2008 00:39:10 +0000 Subject: Formatting cleanup. --- .../Region/Environment/Interfaces/ICommander.cs | 2 - .../Environment/Interfaces/IRegionDataStore.cs | 4 +- .../Environment/Interfaces/ITerrainChannel.cs | 2 +- OpenSim/Region/Environment/ModuleLoader.cs | 2 +- .../TextureDownload/UserTextureDownloadService.cs | 8 +- .../Modules/Avatar/Friends/FriendsModule.cs | 6 +- .../Modules/Avatar/Groups/GroupsModule.cs | 10 +- .../DynamicTexture/DynamicTextureModule.cs | 8 +- .../Modules/Scripting/EMailModules/EmailModule.cs | 52 +- .../Modules/World/Archiver/ArchiveConstants.cs | 22 +- .../Modules/World/Archiver/ArchiveReadRequest.cs | 86 +- .../World/Archiver/ArchiveWriteRequestExecution.cs | 38 +- .../Archiver/ArchiveWriteRequestPreparation.cs | 54 +- .../Modules/World/Archiver/AssetsArchiver.cs | 42 +- .../Modules/World/Archiver/AssetsDearchiver.cs | 46 +- .../Modules/World/Archiver/AssetsRequest.cs | 10 +- .../Modules/World/Archiver/TarArchiveReader.cs | 12 +- .../Modules/World/Archiver/TarArchiveWriter.cs | 6 +- .../Modules/World/Estate/EstateManagementModule.cs | 18 +- .../Modules/World/Land/LandManagementModule.cs | 85 +- .../Environment/Modules/World/Land/LandObject.cs | 4 +- .../Environment/Modules/World/NPC/NPCAvatar.cs | 8 +- .../Modules/World/Permissions/PermissionsModule.cs | 2 +- .../Modules/World/Serialiser/SceneXmlLoader.cs | 14 +- .../Environment/Modules/World/Sun/SunModule.cs | 10 +- .../Modules/World/Terrain/FileLoaders/BMP.cs | 6 +- .../Modules/World/Terrain/FileLoaders/GIF.cs | 6 +- .../Terrain/FileLoaders/GenericSystemDrawing.cs | 12 +- .../Modules/World/Terrain/FileLoaders/JPEG.cs | 10 +- .../Modules/World/Terrain/FileLoaders/LLRAW.cs | 20 +- .../Modules/World/Terrain/FileLoaders/PNG.cs | 6 +- .../Modules/World/Terrain/FileLoaders/RAW32.cs | 14 +- .../Modules/World/Terrain/FileLoaders/TIFF.cs | 6 +- .../Modules/World/Terrain/FileLoaders/Terragen.cs | 10 +- .../Modules/World/Terrain/ITerrainModule.cs | 6 +- .../Modules/World/Terrain/TerrainModule.cs | 16 +- .../Modules/World/WorldMap/MapImageModule.cs | 12 +- .../Modules/World/WorldMap/WorldMapModule.cs | 35 +- OpenSim/Region/Environment/Scenes/EntityBase.cs | 4 +- OpenSim/Region/Environment/Scenes/EventManager.cs | 32 +- OpenSim/Region/Environment/Scenes/InnerScene.cs | 42 +- .../Region/Environment/Scenes/Scene.Inventory.cs | 73 +- OpenSim/Region/Environment/Scenes/Scene.cs | 82 +- .../Scenes/SceneCommunicationService.cs | 8 +- .../Environment/Scenes/SceneExternalChecks.cs | 1571 ++++++++++---------- .../Scenes/SceneObjectGroup.Inventory.cs | 8 +- .../Region/Environment/Scenes/SceneObjectGroup.cs | 78 +- .../Scenes/SceneObjectPart.Inventory.cs | 24 +- .../Region/Environment/Scenes/SceneObjectPart.cs | 98 +- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 26 +- .../Region/Environment/Scenes/SimStatsReporter.cs | 2 +- OpenSim/Region/Environment/Scenes/UndoState.cs | 8 +- 52 files changed, 1370 insertions(+), 1396 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Interfaces/ICommander.cs b/OpenSim/Region/Environment/Interfaces/ICommander.cs index f2260c3..c4102af 100644 --- a/OpenSim/Region/Environment/Interfaces/ICommander.cs +++ b/OpenSim/Region/Environment/Interfaces/ICommander.cs @@ -27,8 +27,6 @@ namespace OpenSim.Region.Environment.Interfaces { - - public interface ICommander { void ProcessConsoleCommand(string function, string[] args); diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs index ad5983c..4e716a2 100644 --- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs +++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Interfaces /// /// void StoreObject(SceneObjectGroup obj, LLUUID regionUUID); - + /// /// Entirely removes the object, including inventory /// @@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment.Interfaces /// /// void RemoveObject(LLUUID uuid, LLUUID regionUUID); - + /// /// Store a prim's inventory /// diff --git a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs index aa34c45..4bcb14b 100644 --- a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs +++ b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs @@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Interfaces /// /// float[] GetFloatsSerialised(); - + double[,] GetDoubles(); bool Tainted(int x, int y); ITerrainChannel MakeCopy(); diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs index 3f8b9ff..09f2dda 100644 --- a/OpenSim/Region/Environment/ModuleLoader.cs +++ b/OpenSim/Region/Environment/ModuleLoader.cs @@ -320,7 +320,7 @@ namespace OpenSim.Region.Environment public void UnloadModule(IRegionModule rm) { rm.Close(); - + m_loadedModules.Remove(rm); } } diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs index 10ef766..e6ee75f 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs @@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// True if the service has been closed, probably because a user with texture requests still queued /// logged out. @@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload public void TextureCallback(LLUUID textureID, AssetBase texture) { //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); - + // There may still be texture requests pending for a logged out client if (closed) return; @@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload internal void Close() { closed = true; - + lock (m_textureSenders) { foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) @@ -257,7 +257,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload m_textureSenders.Clear(); } - + // XXX: It might be possible to also remove pending texture requests from the asset cache queues, // though this might also be more trouble than it's worth. } diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs index c5a4a96..4a98622 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs @@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends client.OnTerminateFriendship += OnTerminateFriendship; doFriendListUpdateOnline(client.AgentId); - + } private void doFriendListUpdateOnline(LLUUID AgentId) @@ -386,7 +386,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends { m_rootAgents.Add(avatar.UUID, avatar.RegionHandle); m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); - + List updateme = new List(); lock (StoredFriendListUpdates) { @@ -546,7 +546,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); - + //LLUUID[] Agents = new LLUUID[1]; //Agents[0] = msg.toAgentID; diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs index a83730e..eaa5013 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs @@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage; lock (m_groupUUIDGroup) { - + GroupData OpenSimulatorGroup = new GroupData(); OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester"; OpenSimulatorGroup.GroupID = opensimulatorGroupID; @@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups } } - + lock (m_groupmap) { if (!m_groupmap.ContainsKey(client.AgentId)) @@ -159,8 +159,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups updateGroups[0] = OpenSimulatorGroup; client.SendGroupMembership(updateGroups); - - } private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) @@ -275,6 +273,4 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups GC.Collect(); } } - - -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs index a3452ab..15ce584 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture SceneObjectPart part = scene.GetSceneObjectPart(PrimID); byte[] assetData; AssetBase oldAsset = null; - + if (BlendWithOldTexture) { LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; @@ -228,7 +228,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture assetData = new byte[data.Length]; Array.Copy(data, assetData, data.Length); } - + // Create a new asset for user AssetBase asset = new AssetBase(); asset.FullID = LLUUID.Random(); @@ -244,7 +244,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture // mostly keep the values from before LLObject.TextureEntry tmptex = part.Shape.Textures; - + // remove the old asset from the cache LLUUID oldID = tmptex.DefaultTexture.TextureID; scene.AssetCache.ExpireAsset(oldID); @@ -298,4 +298,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs index 1162c25..bcf3e76 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs @@ -68,14 +68,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules { m_Config = config; IConfig SMTPConfig; - + //FIXME: RegionName is correct?? //m_RegionName = scene.RegionInfo.RegionName; IConfig startupConfig = m_Config.Configs["Startup"]; m_Enabled = (startupConfig.GetString("emailmodule", "DefaultEmailModule") == "DefaultEmailModule"); - + //Load SMTP SERVER config try { @@ -85,16 +85,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules m_Enabled = false; return; } - + if (!SMTPConfig.GetBoolean("enabled", false)) { m_log.InfoFormat("[SMTP] module disabled in configuration"); m_Enabled = false; return; } - + m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); - SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); + SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); @@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); } } - + m_log.Info("[EMAIL] Activated DefaultEmailModule"); } } @@ -146,9 +146,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules { get { return true; } } - + /// - /// + /// /// /// private void DelayInSeconds(int seconds) @@ -156,11 +156,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); DateTime EndDelay = DateTime.Now.Add(DiffDelay); while (DateTime.Now < EndDelay) - { + { ;//Do nothing!! } } - + private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) { lock (m_Scenes) @@ -187,7 +187,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules { ObjectAbsolutePosition = part.AbsolutePosition.ToString(); ObjectName = part.Name; - ObjectRegionName = m_ObjectRegionName; + ObjectRegionName = m_ObjectRegionName; return; } ObjectAbsolutePosition = part.AbsolutePosition.ToString(); @@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules ObjectRegionName = m_ObjectRegionName; return; } - + /// /// SendMail function utilized by llEMail /// @@ -206,14 +206,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules public void SendEmail(LLUUID objectID, string address, string subject, string body) { //Check if address is empty - if (address == string.Empty) + if (address == string.Empty) return; - + //FIXED:Check the email is correct form in REGEX - string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" - + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" - + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" - + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" + string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" + + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" + + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" + + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" + @"[a-zA-Z]{2,}))$"; Regex EMailreStrict = new Regex(EMailpatternStrict); bool isEMailStrictMatch = EMailreStrict.IsMatch(address); @@ -226,9 +226,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules if ((subject.Length + body.Length) > 1024) { m_log.Error("[EMAIL] subject + body > 1024 Byte"); - return; + return; } - + try { string LastObjectName = string.Empty; @@ -242,21 +242,21 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules //From emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); //To - Only One - emailMessage.AddToAddress(new EmailAddress(address)); + emailMessage.AddToAddress(new EmailAddress(address)); //Subject emailMessage.Subject = subject; //TEXT Body resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + - LastObjectPosition+"\r\n\r\n\r\n" + body); + LastObjectPosition+"\r\n\r\n\r\n" + body); //HTML Body - emailMessage.HtmlPart = new HtmlAttachment("

" + + emailMessage.HtmlPart = new HtmlAttachment("

" + "
Object-Name: " + LastObjectName + "
Region: " + LastObjectRegionName + "
Local-Position: " + LastObjectPosition + "


" +body+"\r\n

"); - + //Set SMTP SERVER config SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); //Authentication @@ -272,9 +272,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules return; } } - + /// - /// + /// /// /// /// diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs index a5688ef..a76ff0d 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs @@ -39,33 +39,33 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// The location of the archive control file ///
public static readonly string CONTROL_FILE_PATH = "archive.xml"; - + /// /// Path for the assets held in an archive /// public static readonly string ASSETS_PATH = "assets/"; - + /// /// Path for the assets metadata file /// //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; - + /// /// Path for the prims file /// public static readonly string OBJECTS_PATH = "objects/"; - + /// /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. /// public static readonly string TERRAINS_PATH = "terrains/"; - + /// /// Extensions used for asset types in the archive /// public static readonly IDictionary ASSET_TYPE_TO_EXTENSION = new Dictionary(); public static readonly IDictionary EXTENSION_TO_ASSET_TYPE = new Dictionary(); - + static ArchiveConstants() { ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Animation] = "_animation.bvh"; @@ -79,11 +79,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = "_lostandfoundfolder.txt"; // Not sure if we'll ever see this ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = "_bytecode.lso"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = "_script.lsl"; - ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; + ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = "_object.xml"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = "_rootfolder.txt"; // Not sure if we'll ever see this // disable warning: we know Script is obsolete, but need to support it -// anyhow +// anyhow #pragma warning disable 0612 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = "_script.txt"; // Not sure if we'll ever see this #pragma warning restore 0612 @@ -93,8 +93,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = "_sound.wav"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = "_texture.jp2"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = "_texture.tga"; - ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this - + ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this + EXTENSION_TO_ASSET_TYPE["_animation.bvh"] = (sbyte)AssetType.Animation; EXTENSION_TO_ASSET_TYPE["_bodypart.txt"] = (sbyte)AssetType.Bodypart; EXTENSION_TO_ASSET_TYPE["_callingcard.txt"] = (sbyte)AssetType.CallingCard; @@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver EXTENSION_TO_ASSET_TYPE["_object.xml"] = (sbyte)AssetType.Object; EXTENSION_TO_ASSET_TYPE["_rootfolder.txt"] = (sbyte)AssetType.RootFolder; // disable warning: we know Script is obsolete, but need to support it -// anyhow +// anyhow #pragma warning disable 0612 EXTENSION_TO_ASSET_TYPE["_script.txt"] = (sbyte)AssetType.Script; #pragma warning restore 0612 diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 1340f8b..87106fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs @@ -53,7 +53,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver private Scene m_scene; private string m_loadPath; - + /// /// Used to cache lookups for valid uuids. /// @@ -68,15 +68,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver } private void DearchiveRegion() - { - TarArchiveReader archive + { + TarArchiveReader archive = new TarArchiveReader( - new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); + new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache); List serialisedSceneObjects = new List(); string filePath = "ERROR"; - + int successfulAssetRestores = 0; int failedAssetRestores = 0; @@ -111,30 +111,30 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver //m_log.Debug("[ARCHIVER]: Reached end of archive"); archive.Close(); - + m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores); - + if (failedAssetRestores > 0) m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); - m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); + m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); m_scene.DeleteAllSceneObjects(); - + // Reload serialized prims m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); IRegionSerialiser serialiser = m_scene.RequestModuleInterface(); - ICollection sceneObjects = new List(); + ICollection sceneObjects = new List(); foreach (string serialisedSceneObject in serialisedSceneObjects) - { + { SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); - + // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned // on the same region server and multiple examples a single object archive to be imported // to the same scene (when this is possible). sceneObject.ResetIDs(); - + // Try to retain the original creator/owner/lastowner if their uuid is present on this grid // otherwise, use the master avatar uuid instead LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; @@ -144,41 +144,41 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { if (!resolveUserUuid(part.CreatorID)) part.CreatorID = masterAvatarId; - + if (!resolveUserUuid(part.OwnerID)) part.OwnerID = masterAvatarId; - + if (!resolveUserUuid(part.LastOwnerID)) - part.LastOwnerID = masterAvatarId; - + part.LastOwnerID = masterAvatarId; + // And zap any troublesome sit target information part.SitTargetOrientation = new Quaternion(0,0,0,1); part.SitTargetPosition = new Vector3(0,0,0); - } - + } + if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) - { + { sceneObjects.Add(sceneObject); } - } - + } + m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count); - + int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count; - + if (ignoredObjects > 0) m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); - + m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); - + m_log.Debug("[ARCHIVER]: Starting scripts"); - + foreach (SceneObjectGroup sceneObject in sceneObjects) { sceneObject.CreateScriptInstances(0, true); - } + } } - + /// /// Look up the given user id to check whether it's one that is valid for this grid. /// @@ -194,13 +194,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver else m_validUserUuids.Add(uuid, false); } - + if (m_validUserUuids[uuid]) return true; else - return false; + return false; } - + /// /// Load an asset /// @@ -212,20 +212,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver // Right now we're nastily obtaining the lluuid from the filename string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); string extension = filename.Substring(filename.LastIndexOf("_")); - string uuid = filename.Remove(filename.Length - extension.Length); - + string uuid = filename.Remove(filename.Length - extension.Length); + if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) { sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; - + //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); - + AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); asset.Type = assetType; asset.Data = data; - + m_scene.AssetCache.AddAsset(asset); - + return true; } else @@ -233,11 +233,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_log.ErrorFormat( "[ARCHIVER]: Tried to dearchive data with path {0} with an unknown type extension {1}", assetPath, extension); - + return false; } } - + /// /// Load terrain data /// @@ -249,13 +249,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver private bool LoadTerrain(string terrainPath, byte[] data) { ITerrainModule terrainModule = m_scene.RequestModuleInterface(); - + MemoryStream ms = new MemoryStream(data); terrainModule.LoadFromStream(terrainPath, ms); ms.Close(); - + m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath); - + return true; } } diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs index 0341a70..26d4797 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs @@ -61,8 +61,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public ArchiveWriteRequestExecution( List sceneObjects, - ITerrainModule terrainModule, - IRegionSerialiser serialiser, + ITerrainModule terrainModule, + IRegionSerialiser serialiser, string sceneName, string savePath) { @@ -79,37 +79,37 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); } - + m_log.InfoFormat( "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); TarArchiveWriter archive = new TarArchiveWriter(); - + // Write out control file archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile()); - + // Write out terrain string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName); - MemoryStream ms = new MemoryStream(); + MemoryStream ms = new MemoryStream(); m_terrainModule.SaveToStream(terrainPath, ms); - archive.AddFile(terrainPath, ms.ToArray()); + archive.AddFile(terrainPath, ms.ToArray()); ms.Close(); - + // Write out scene object metadata foreach (SceneObjectGroup sceneObject in m_sceneObjects) { //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); - + LLVector3 position = sceneObject.AbsolutePosition; - + string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); - string filename + string filename = string.Format( "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", - ArchiveConstants.OBJECTS_PATH, sceneObject.Name, - Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), + ArchiveConstants.OBJECTS_PATH, sceneObject.Name, + Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), sceneObject.UUID); - + archive.AddFile(filename, serializedObject); } @@ -120,8 +120,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); - } - + } + /// /// Create the control file for this archive /// @@ -136,13 +136,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver xtw.WriteAttributeString("major_version", "0"); xtw.WriteAttributeString("minor_version", "1"); xtw.WriteEndElement(); - + xtw.Flush(); xtw.Close(); - + String s = sw.ToString(); sw.Close(); - + return s; } } diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs index 327808a..20e15ab 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -52,14 +52,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver protected Scene m_scene; protected string m_savePath; - + /// /// Used for identifying uuids embedded in scripts /// - protected static readonly Regex m_uuidRegex + protected static readonly Regex m_uuidRegex = new Regex( - "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", - RegexOptions.Compiled); + "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", + RegexOptions.Compiled); /// /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate @@ -93,9 +93,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver Monitor.Pulse(this); } } - + /// - /// Get an asset synchronously, potentially using an asynchronous callback. If the + /// Get an asset synchronously, potentially using an asynchronous callback. If the /// asynchronous callback is used, we will wait for it to complete. /// /// @@ -118,11 +118,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver Monitor.Wait(this); m_waitingForObjectAsset = false; } - } - + } + return m_requestedObjectAsset; } - + /// /// Record the asset uuids embedded within the given script. /// @@ -138,16 +138,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); MatchCollection uuidMatches = m_uuidRegex.Matches(script); //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); - + foreach (Match uuidMatch in uuidMatches) { LLUUID uuid = new LLUUID(uuidMatch.Value); //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); assetUuids[uuid] = 1; } - } + } } - + /// /// Record the uuids referenced by the given wearable asset /// @@ -159,25 +159,25 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); wearableAsset.Decode(); - + //m_log.DebugFormat( // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); - + foreach (LLUUID uuid in wearableAsset.Textures.Values) { //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); assetUuids[uuid] = 1; } } - + /// /// Get all the asset uuids associated with a given object. This includes both those directly associated with /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained /// within this object). /// /// - /// - protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary assetUuids) + /// + protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary assetUuids) { AssetBase objectAsset = GetAsset(sceneObjectUuid); @@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver string xml = Helpers.FieldToUTF8String(objectAsset.Data); SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); GetSceneObjectAssetUuids(sog, assetUuids); - } + } } /// @@ -209,10 +209,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver try { LLObject.TextureEntry textureEntry = part.Shape.Textures; - + // Get the prim's default texture. This will be used for faces which don't have their own texture assetUuids[textureEntry.DefaultTexture.TextureID] = 1; - + // XXX: Not a great way to iterate through face textures, but there's no // other method available to tell how many faces there actually are //int i = 0; @@ -224,15 +224,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver assetUuids[texture.TextureID] = 1; } } - + foreach (TaskInventoryItem tii in part.TaskInventory.Values) { //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); - + if (!assetUuids.ContainsKey(tii.AssetID)) { assetUuids[tii.AssetID] = 1; - + if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type)) { GetWearableAssetUuids(tii.AssetID, assetUuids); @@ -275,20 +275,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver if (entity is SceneObjectGroup) sceneObjects.Add((SceneObjectGroup)entity); } - + foreach (SceneObjectGroup sceneObject in sceneObjects) { GetSceneObjectAssetUuids(sceneObject, assetUuids); } m_log.DebugFormat( - "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", + "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", sceneObjects.Count, assetUuids.Count); // Asynchronously request all the assets required to perform this archive operation - ArchiveWriteRequestExecution awre + ArchiveWriteRequestExecution awre = new ArchiveWriteRequestExecution( - sceneObjects, + sceneObjects, m_scene.RequestModuleInterface(), m_scene.RequestModuleInterface(), m_scene.RegionInfo.RegionName, diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs index 2704224..708bed3 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs @@ -41,17 +41,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public class AssetsArchiver { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// Archive assets /// protected IDictionary m_assets; - + public AssetsArchiver(IDictionary assets) { m_assets = assets; } - + /// /// Archive the assets given to this archiver to the given archive. /// @@ -70,44 +70,44 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { StringWriter sw = new StringWriter(); XmlTextWriter xtw = new XmlTextWriter(sw); - + xtw.Formatting = Formatting.Indented; xtw.WriteStartDocument(); - + xtw.WriteStartElement("assets"); - + foreach (LLUUID uuid in m_assets.Keys) { AssetBase asset = m_assets[uuid]; - + if (asset != null) { xtw.WriteStartElement("asset"); - + string extension = string.Empty; - + if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) { extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; - } - + } + xtw.WriteElementString("filename", uuid.ToString() + extension); - + xtw.WriteElementString("name", asset.Name); xtw.WriteElementString("description", asset.Description); xtw.WriteElementString("asset-type", asset.Type.ToString()); - + xtw.WriteEndElement(); } } - + xtw.WriteEndElement(); - + xtw.WriteEndDocument(); - + archive.AddFile("assets.xml", sw.ToString()); } - + /// /// Write asset data files to the given archive /// @@ -116,18 +116,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar //archive.AddDir("assets"); - + foreach (LLUUID uuid in m_assets.Keys) { AssetBase asset = m_assets[uuid]; - + string extension = string.Empty; - + if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) { extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; } - + archive.AddFile( ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, asset.Data); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs index 284a39e..17abb24 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs @@ -43,9 +43,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public class AssetsDearchiver { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); - + /// /// Store for asset data we received before we get the metadata /// @@ -55,17 +55,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// Asset metadata. Is null if asset metadata isn't yet available. /// protected Dictionary m_metadata; - + /// /// Cache to which dearchived assets will be added /// protected AssetCache m_cache; - + public AssetsDearchiver(AssetCache cache) { m_cache = cache; } - + /// /// Add asset data to the dearchiver /// @@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ResolveAssetData(assetFilename, data); } } - + /// /// Add asset metadata xml /// @@ -90,39 +90,39 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public void AddAssetMetadata(string xml) { m_metadata = new Dictionary(); - + StringReader sr = new StringReader(xml); XmlTextReader reader = new XmlTextReader(sr); - + reader.ReadStartElement("assets"); reader.Read(); - + while (reader.Name.Equals("asset")) { reader.Read(); - + AssetMetadata metadata = new AssetMetadata(); - + string filename = reader.ReadElementString("filename"); m_log.DebugFormat("[DEARCHIVER]: Reading node {0}", filename); - + metadata.Name = reader.ReadElementString("name"); metadata.Description = reader.ReadElementString("description"); metadata.AssetType = Convert.ToSByte(reader.ReadElementString("asset-type")); - + m_metadata[filename] = metadata; - + // Read asset end tag reader.ReadEndElement(); - + reader.Read(); } - + m_log.DebugFormat("[DEARCHIVER]: Resolved {0} items of asset metadata", m_metadata.Count); - + ResolvePendingAssetData(); } - + /// /// Resolve asset data that we collected before receiving the metadata /// @@ -133,7 +133,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ResolveAssetData(filename, m_assetDataAwaitingMetadata[filename]); } } - + /// /// Resolve a new piece of asset data against stored metadata /// @@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver { // Right now we're nastily obtaining the lluuid from the filename string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); - + if (m_metadata.ContainsKey(filename)) { AssetMetadata metadata = m_metadata[filename]; - + if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(metadata.AssetType)) { string extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[metadata.AssetType]; @@ -166,11 +166,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver else { m_log.ErrorFormat( - "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", + "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", assetPath); } } - + /// /// Metadata for an asset /// diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs index 6ffbcbb..2164f7e 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs @@ -43,12 +43,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver class AssetsRequest { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// uuids to request /// protected ICollection m_uuids; - + /// /// Callback used when all the assets requested have been received. /// @@ -58,7 +58,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// Assets retrieved in this request /// protected Dictionary m_assets = new Dictionary(); - + /// /// Maintain a list of assets that could not be found. This will be passed back to the requester. /// @@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_assetCache = assetCache; m_repliesRequired = uuids.Count; } - + protected internal void Execute() { // We can stop here if there are no assets to fetch @@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver m_assets[assetID] = asset; else m_notFoundAssetUuids.Add(assetID); - + //m_log.DebugFormat( // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs index 585d1d4..4e000cc 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs @@ -69,9 +69,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver public byte[] ReadEntry(out string filePath) { filePath = String.Empty; - + TarHeader header = ReadHeader(); - + if (null == header) return null; @@ -98,14 +98,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// /// A tar header struct. null if we have reached the end of the archive. protected TarHeader ReadHeader() - { + { byte[] header = m_br.ReadBytes(512); - + // If we've reached the end of the archive we'll be in null block territory, which means - // the next byte will be 0 + // the next byte will be 0 if (header[0] == 0) return null; - + TarHeader tarHeader = new TarHeader(); tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs index f70a93d..83b9250 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs @@ -54,10 +54,10 @@ namespace OpenSim.Region.Environment // Directories are signalled by a final / if (!dirName.EndsWith("/")) dirName += "/"; - + AddFile(dirName, new byte[0]); } - + /// /// Add a file to the tar archive /// @@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment if (data.Length % 512 != 0) { int paddingRequired = 512 - (data.Length % 512); - + //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired); byte[] padding = new byte[paddingRequired]; diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 1e622be..28347d0 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs @@ -223,7 +223,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) { EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; - + bool alreadyInList = false; for (int i = 0; i < banlistcheck.Length; i++) @@ -407,8 +407,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; args.simName = m_scene.RegionInfo.RegionName; - - + remote_client.SendRegionInfoToEstateMenu(args); } @@ -416,6 +415,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate { remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant); } + private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) { Dictionary SceneData = new Dictionary(); @@ -472,7 +472,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate continue; } } - + SceneReport.Add(lsri); } } @@ -481,7 +481,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate } } remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); - + if (uuidNameLookupList.Count > 0) LookupUUID(uuidNameLookupList); } @@ -502,7 +502,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate private void LookupUUIDsAsync(List uuidLst) { LLUUID[] uuidarr = new LLUUID[0]; - + lock (uuidLst) { uuidarr = uuidLst.ToArray(); @@ -539,7 +539,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate if (EstateManagers[i] == remoteClient.AgentId) estatemanager = true; } - + args.isEstateManager = estatemanager; args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; @@ -729,11 +729,11 @@ namespace OpenSim.Region.Environment.Modules.World.Estate client.OnLandStatRequest += HandleLandStatRequest; sendRegionHandshake(client); } - + public uint GetRegionFlags() { Simulator.RegionFlags flags = Simulator.RegionFlags.None; - + // Fully implemented // if (m_scene.RegionInfo.RegionSettings.AllowDamage) diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 9b1b9b5..00994fb 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs @@ -47,14 +47,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private static readonly string remoteParcelRequestPath = "0009/"; - + private LandChannel landChannel; private Scene m_scene; - - private readonly int[,] landIDList = new int[64, 64]; private readonly Dictionary landList = new Dictionary(); @@ -115,8 +113,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - - public void PostInitialise() { } @@ -153,8 +149,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } - - public bool AllowedForcefulBans { get { return m_allowedForcefulBans; } @@ -185,11 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land public List ParcelsNearPoint(LLVector3 position) { List parcelsNear = new List(); - int x; - for (x = -4; x <= 4; x += 4) + for (int x = -4; x <= 4; x += 4) { - int y; - for (y = -4; y <= 4; y += 4) + for (int y = -4; y <= 4; y += 4) { ILandObject check = GetLandObject(position.X + x, position.Y + y); if (check != null) @@ -286,7 +278,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); - if (over != null) { if (force) @@ -387,6 +378,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land Console.WriteLine("INVALID LOCAL LAND ID"); } } + /// /// Creates a basic Parcel object without an owner (a zeroed key) /// @@ -406,13 +398,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land new_land.landData.LocalID = lastLandLocalID; landList.Add(lastLandLocalID, new_land.Copy()); - bool[,] landBitmap = new_land.getLandBitmap(); - int x; - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { if (landBitmap[x, y]) { @@ -431,11 +420,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land /// Land.localID of the peice of land to remove. public void removeLandObject(int local_id) { - int x; - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { if (landIDList[x, y] == local_id) { @@ -451,12 +438,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land private void performFinalLandJoin(ILandObject master, ILandObject slave) { - int x; bool[,] landBitmapSlave = slave.getLandBitmap(); - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { if (landBitmapSlave[x, y]) { @@ -519,6 +504,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } return landList[landIDList[x / 4, y / 4]]; } + #endregion #region Parcel Modification @@ -601,7 +587,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land ResetAllLandPrimCounts(); lock (m_scene.Entities) { - foreach (EntityBase obj in m_scene.Entities.Values) + foreach (EntityBase obj in m_scene.Entities.Values) { if (obj != null) { @@ -647,11 +633,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land { int totalX = end_x - start_x; int totalY = end_y - start_y; - int y; - for (y = 0; y < totalY; y++) + for (int y = 0; y < totalY; y++) { - int x; - for (x = 0; x < totalX; x++) + for (int x = 0; x < totalX; x++) { ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); if (tempLandObject == null) return; @@ -690,9 +674,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land ILandObject result = AddLandObject(newLand); UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); result.sendLandUpdateToAvatarsOverMe(); - - - return; } /// @@ -730,7 +711,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land ILandObject masterLandObject = selectedLandObjects[0]; selectedLandObjects.RemoveAt(0); - if (selectedLandObjects.Count < 1) { return; @@ -753,12 +733,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land performFinalLandJoin(masterLandObject, slaveLandObject); } - SetPrimsTainted(); masterLandObject.sendLandUpdateToAvatarsOverMe(); - - return; } #endregion @@ -777,17 +754,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land int byteArrayCount = 0; int sequenceID = 0; - int y; - for (y = 0; y < 64; y++) + for (int y = 0; y < 64; y++) { - int x; - for (x = 0; x < 64; x++) + for (int x = 0; x < 64; x++) { byte tempByte = 0; //This represents the byte for the current 4x4 ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); - if (currentParcelBlock != null) { if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) @@ -813,7 +787,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); } - //Now for border control ILandObject westParcel = null; @@ -864,14 +837,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land { //Get the land objects within the bounds List temp = new List(); - int x; - int i; int inc_x = end_x - start_x; int inc_y = end_y - start_y; - for (x = 0; x < inc_x; x++) + for (int x = 0; x < inc_x; x++) { - int y; - for (y = 0; y < inc_y; y++) + for (int y = 0; y < inc_y; y++) { ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); @@ -892,12 +862,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land requestResult = LandChannel.LAND_RESULT_MULTIPLE; } - for (i = 0; i < temp.Count; i++) + for (int i = 0; i < temp.Count; i++) { temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); } - SendParcelOverlay(remote_client); } @@ -921,7 +890,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) { - landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); } @@ -954,7 +922,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land landList[local_id].sendLandUpdateToClient(remote_client); } } - } public void handleParcelReclaim(int local_id, IClientAPI remote_client) @@ -972,7 +939,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land landList[local_id].sendLandUpdateToClient(remote_client); } } - } #endregion @@ -1076,7 +1042,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land { selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); } - } public void NoLandDataFromStorage() @@ -1093,11 +1058,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land obj.setParcelObjectMaxOverride(overrideDel); } } + public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) { } #region CAPS handler + private void OnRegisterCaps(LLUUID agentID, Caps caps) { string capsBase = "/CAPS/" + caps.CapsObjectPath; @@ -1109,7 +1076,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land return RemoteParcelRequest(request, path, param, agentID, caps); })); } - + // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x @@ -1171,11 +1138,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land { m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); } - + LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); response.parcel_id = parcelID; m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); - + return LLSDHelpers.SerialiseLLSDReply(response); } @@ -1191,7 +1158,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land uint x, y; Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); - + LandData landData; if (regionHandle == m_scene.RegionInfo.RegionHandle) landData = this.GetLandObject(x, y).landData; diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 305e236..6388a1c 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs @@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land return newLand; } - + static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; @@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } #endregion - + #region Packet Request Handling public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 7b05027..09f12b2 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -305,7 +305,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public event RegionHandleRequest OnRegionHandleRequest; public event ParcelInfoRequest OnParcelInfoRequest; - + #pragma warning restore 67 #endregion @@ -368,7 +368,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { get { return 0; } } - + public ulong GetGroupPowers(LLUUID groupID) { return 0; @@ -820,13 +820,13 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time) - { + { } public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID, byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, byte mediaLoop) - { + { } public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary parameters) diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 6107f48..071e3af 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs @@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); - + if (m_bypassPermissions) m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); else diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs index 0df19d9..22c9b29 100644 --- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs +++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs @@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Scenes public class SceneXmlLoader { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) { XmlDocument doc = new XmlDocument(); @@ -114,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes doc.Load(reader); reader.Close(); rootNode = doc.FirstChild; - + // This is to deal with neighbouring regions that are still surrounding the group xml with the // tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or // when some other changes forces all regions to upgrade). @@ -127,13 +127,13 @@ namespace OpenSim.Region.Environment.Scenes // There is only ever one prim. This oddity should be removeable post 0.5.9 return new SceneObjectGroup(aPrimNode.OuterXml); } - + return null; } else { return new SceneObjectGroup(rootNode.OuterXml); - } + } } /// @@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Scenes reader.Close(); XmlNode rootNode = doc.FirstChild; - ICollection sceneObjects = new List(); + ICollection sceneObjects = new List(); foreach (XmlNode aPrimNode in rootNode.ChildNodes) { SceneObjectGroup obj = CreatePrimFromXml2(scene, aPrimNode.OuterXml); @@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Scenes { SceneObjectGroup obj = new SceneObjectGroup(xmlData); - if (scene.AddRestoredSceneObject(obj, true, false)) + if (scene.AddRestoredSceneObject(obj, true, false)) return obj; else return null; @@ -254,7 +254,7 @@ namespace OpenSim.Region.Environment.Scenes if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) continue; } - + stream.WriteLine(g.ToXmlString2()); primCount++; } diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 5682de3..9690433 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs @@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Modules private LLVector3 Position = new LLVector3(0,0,0); private LLVector3 Velocity = new LLVector3(0,0,0); private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); - + private long LindenHourOffset = 0; private bool sunFixed = false; @@ -111,7 +111,7 @@ namespace OpenSim.Region.Environment.Modules private float GetLindenEstateHourFromCurrentTime() { float ticksleftover = ((float)CurrentTime) % ((float)SecondsPerSunCycle); - + float hour = (24 * (ticksleftover / SecondsPerSunCycle)) + 6; return hour; @@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Modules float hour = (24 * (ticksleftover / SecondsPerSunCycle)); float offsethours = 0; - + if (LindenHour - 6 > hour) { offsethours = hour + ((LindenHour-6) - hour); @@ -142,7 +142,7 @@ namespace OpenSim.Region.Environment.Modules offsethours = hour - (hour - (LindenHour - 6)); } //m_log.Debug("[OFFSET]: " + hour + " - " + LindenHour + " - " + offsethours.ToString()); - + LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length)); m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString()); @@ -422,7 +422,7 @@ namespace OpenSim.Region.Environment.Modules } } } - + public void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) { if (m_scene.RegionInfo.RegionHandle == regionHandle) diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs index 34bbf78..48da96d 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Bmp); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Png); - } + } /// /// The human readable version of the file format(s) this loader handles @@ -73,4 +73,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return "BMP"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs index 0cd9000..accffd2 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Gif); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Gif); - } + } public override string ToString() { return "GIF"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs index 4d213e0..983ad29 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs @@ -58,19 +58,19 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders /// A terrain channel generated from the image. public virtual ITerrainChannel LoadFile(string filename) { - return LoadBitmap(new Bitmap(filename)); + return LoadBitmap(new Bitmap(filename)); } public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) { throw new NotImplementedException(); } - + public virtual ITerrainChannel LoadStream(Stream stream) { return LoadBitmap(new Bitmap(stream)); } - + protected virtual ITerrainChannel LoadBitmap(Bitmap bitmap) { ITerrainChannel retval = new TerrainChannel(bitmap.Width, bitmap.Height); @@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } } - return retval; + return retval; } /// @@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Png); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Png); - } + } #endregion diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs index 9886b81..35576c7 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders { throw new NotImplementedException(); } - + public ITerrainChannel LoadStream(Stream stream) { throw new NotImplementedException(); - } + } public void SaveFile(string filename, ITerrainChannel map) { @@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Jpeg); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateBitmapFromMap(map); colours.Save(stream, ImageFormat.Jpeg); - } + } #endregion @@ -109,4 +109,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return bmp; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs index 21fba2b..5f13d01 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders FileInfo file = new FileInfo(filename); FileStream s = file.Open(FileMode.Open, FileAccess.Read); ITerrainChannel retval = LoadStream(s); - + s.Close(); return retval; @@ -113,7 +113,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders // i.e. eat X upto where we start while (currFileXOffset < offsetX) { - bs.ReadBytes(sectionWidth * 13); + bs.ReadBytes(sectionWidth * 13); currFileXOffset++; } @@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return retval; } - + public ITerrainChannel LoadStream(Stream s) - { + { TerrainChannel retval = new TerrainChannel(); - + BinaryReader bs = new BinaryReader(s); int y; for (y = 0; y < retval.Height; y++) @@ -160,8 +160,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } } - bs.Close(); - + bs.Close(); + return retval; } @@ -173,7 +173,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders s.Close(); } - + public void SaveStream(Stream s, ITerrainChannel map) { BinaryWriter binStream = new BinaryWriter(s); @@ -224,9 +224,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } } - binStream.Close(); + binStream.Close(); } - + public string FileExtension { get { return ".raw"; } diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs index cf95486..19e181e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Png); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Png); - } + } public override string ToString() { return "PNG"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs index bb8b0f7..758821a 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs @@ -112,11 +112,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return retval; } - + public ITerrainChannel LoadStream(Stream s) { TerrainChannel retval = new TerrainChannel(); - + BinaryReader bs = new BinaryReader(s); int y; for (y = 0; y < retval.Height; y++) @@ -129,10 +129,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } bs.Close(); - + return retval; } - + public void SaveFile(string filename, ITerrainChannel map) { FileInfo file = new FileInfo(filename); @@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders s.Close(); } - + public void SaveStream(Stream s, ITerrainChannel map) { BinaryWriter bs = new BinaryWriter(s); @@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } } - bs.Close(); + bs.Close(); } #endregion @@ -166,4 +166,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return "RAW32"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs index 3f98f40..95b43b0 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders colours.Save(filename, ImageFormat.Tiff); } - + /// /// Exports a stream using a System.Drawing exporter. /// @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders Bitmap colours = CreateGrayscaleBitmapFromMap(map); colours.Save(stream, ImageFormat.Tiff); - } + } public override string ToString() { return "TIFF"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs index 5dc2aa5..2bf029e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs @@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return retval; } - + public ITerrainChannel LoadStream(Stream s) { TerrainChannel retval = new TerrainChannel(); - + BinaryReader bs = new BinaryReader(s); bool eof = false; @@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders } bs.Close(); - + return retval; } @@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders { throw new NotImplementedException(); } - + public void SaveStream(Stream stream, ITerrainChannel map) { throw new NotImplementedException(); @@ -138,4 +138,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders return "Terragen"; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs index e255515..beeff03 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs @@ -33,7 +33,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain { void LoadFromFile(string filename); void SaveToFile(string filename); - + /// /// Load a terrain from a stream. /// @@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain /// /// void LoadFromStream(string filename, Stream stream); - + /// /// Save a terrain to a stream. /// @@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain /// /// void SaveToStream(string filename, Stream stream); - + void InstallPlugin(string name, ITerrainEffect plug); } } diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs index 8fbc62e..4a62446 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs @@ -221,7 +221,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); } } - + /// /// Loads a terrain file from a stream and installs it in the scene. /// @@ -281,7 +281,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented."); throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); } - } + } #region Plugin Loading Methods @@ -450,7 +450,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain m_tainted = false; m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); m_scene.SaveTerrain(); - + // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. //m_scene.CreateTerrainTexture(true); } @@ -517,11 +517,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain // fixup and height deltas that don't respect them if (respectEstateSettings && LimitChannelChanges(x, y)) { - // this has been vetoed, so update + // this has been vetoed, so update // what we are going to send to the client serialised = m_channel.GetFloatsSerialised(); } - + SendToClients(serialised, x, y); shouldTaint = true; } @@ -580,9 +580,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain private void SendToClients(float[] serialised, int x, int y) { m_scene.ForEachClient( - delegate(IClientAPI controller) + delegate(IClientAPI controller) { controller.SendLayerData( - x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); + x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); } ); } @@ -647,7 +647,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain { // Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area. // for now check a point in the centre of the region - + if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(127, 127, 0))) { InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs index a331d37..9b8dc75 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs @@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap { int tc = System.Environment.TickCount; m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain"); - + double[,] hm = whichScene.Heightmap.GetDoubles(); bool ShadowDebugContinue = true; //Color prim = Color.FromArgb(120, 120, 120); @@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap //X // . // - // Shade the terrain for shadows + // Shade the terrain for shadows if ((x - 1 > 0) && (y - 1 > 0)) { hfvalue = (float)hm[x, y]; @@ -268,7 +268,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap else if (hfdiff < -0.3f) { // We have to desaturate and blacken the land at the same time - // we use floats, colors use bytes, so shrink are space down to + // we use floats, colors use bytes, so shrink are space down to // 0-255 @@ -368,8 +368,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap return mapbmp; } - - + + private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp) { int tc = 0; @@ -570,4 +570,4 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs index 2a7af87..2430822 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs @@ -54,13 +54,13 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly string m_mapLayerPath = "0001/"; - - //private IConfig m_config; + + //private IConfig m_config; private Scene m_scene; private List cachedMapBlocks = new List(); private int cachedTime = 0; private byte[] myMapImageJPEG; - + //private int CacheRegionsDistance = 256; #region IRegionModule Members @@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } public void PostInitialise() { - + } public void Close() @@ -102,10 +102,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } #endregion - - - - public void OnRegisterCaps(LLUUID agentID, Caps caps) { @@ -117,9 +113,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return MapLayerRequest(request, path, param, - agentID, caps); + agentID, caps); })); - } /// @@ -138,12 +133,12 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap //{ //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", //request, path, param,agentID.ToString()); - + // this is here because CAPS map requests work even beyond the 10,000 limit. ScenePresence avatarPresence = null; m_scene.TryGetAvatar(agentID, out avatarPresence); - + if (avatarPresence != null) { bool lookup = false; @@ -168,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); - + lock (cachedMapBlocks) cachedMapBlocks = mapBlocks; @@ -262,18 +257,16 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap MemoryStream imgstream = new MemoryStream(); Bitmap mapTexture = new Bitmap(1,1); System.Drawing.Image image = (System.Drawing.Image)mapTexture; - - + try { // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data - imgstream = new MemoryStream(); - + // non-async because we know we have the asset immediately. AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); - + // Decode image to System.Drawing.Image image = OpenJPEG.DecodeToImage(mapasset.Data); @@ -293,7 +286,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap myEncoderParameter = new EncoderParameter(myEncoder, 95L); myEncoderParameters.Param[0] = myEncoderParameter; - + // Save bitmap to stream mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); @@ -332,16 +325,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // From msdn private static ImageCodecInfo GetEncoderInfo(String mimeType) { - int j; ImageCodecInfo[] encoders; encoders = ImageCodecInfo.GetImageEncoders(); - for (j = 0; j < encoders.Length; ++j) + for (int j = 0; j < encoders.Length; ++j) { if (encoders[j].MimeType == mimeType) return encoders[j]; } return null; } - } } diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index bc3e06c..40caabc 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs @@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Scenes get { return m_name; } set { m_name = value; } } - + /// /// Signals whether this group was in a scene but has since been deleted from it. /// @@ -71,7 +71,7 @@ namespace OpenSim.Region.Environment.Scenes { get { return m_isDeleted; } } - protected bool m_isDeleted; + protected bool m_isDeleted; protected LLVector3 m_pos; diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs index 2b1adee..1dd2273 100644 --- a/OpenSim/Region/Environment/Scenes/EventManager.cs +++ b/OpenSim/Region/Environment/Scenes/EventManager.cs @@ -131,13 +131,10 @@ namespace OpenSim.Region.Environment.Scenes public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; - public delegate void SignificantClientMovement(IClientAPI remote_client); public event SignificantClientMovement OnSignificantClientMovement; - - public delegate void NewGridInstantMessage(GridInstantMessage message); public event NewGridInstantMessage OnGridInstantMessageToIMModule; @@ -163,7 +160,7 @@ namespace OpenSim.Region.Environment.Scenes public event ScriptAtTargetEvent OnScriptAtTargetEvent; public delegate void ScriptNotAtTargetEvent(uint localID); - + public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; public delegate void ScriptColliding(uint localID, ColliderArgs colliders); @@ -172,8 +169,6 @@ namespace OpenSim.Region.Environment.Scenes public event ScriptColliding OnScriptColliding; public event ScriptColliding OnScriptCollidingEnd; - - public delegate void OnMakeChildAgentDelegate(ScenePresence presence); public event OnMakeChildAgentDelegate OnMakeChildAgent; @@ -289,7 +284,6 @@ namespace OpenSim.Region.Environment.Scenes public int transactionID = 0; public int amountDebited = 0; - public LandBuyArgs(LLUUID pagentId, LLUUID pgroupId, bool pfinal, bool pgroupOwned, bool premoveContribution, int pparcelLocalID, int pparcelArea, int pparcelPrice, bool pauthenticated) @@ -306,8 +300,6 @@ namespace OpenSim.Region.Environment.Scenes } } - - public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e); public delegate void LandBuy(Object sender, LandBuyArgs e); @@ -377,7 +369,6 @@ namespace OpenSim.Region.Environment.Scenes private ScriptColliding handlerColliding = null; private ScriptColliding handlerCollidingEnd = null; - private SunLindenHour handlerSunGetLindenHour = null; public void TriggerOnScriptChangedEvent(uint localID, uint change) @@ -491,7 +482,6 @@ namespace OpenSim.Region.Environment.Scenes if (handlerObjectBeingRemovedFromScene != null) { handlerObjectBeingRemovedFromScene(obj); - } } @@ -641,7 +631,6 @@ namespace OpenSim.Region.Environment.Scenes { handlerGridInstantMessageToFriends(message); } - } } @@ -698,7 +687,8 @@ namespace OpenSim.Region.Environment.Scenes handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel); } } - public void TriggerLandBuy (Object sender, LandBuyArgs e) + + public void TriggerLandBuy(Object sender, LandBuyArgs e) { handlerLandBuy = OnLandBuy; if (handlerLandBuy != null) @@ -706,6 +696,7 @@ namespace OpenSim.Region.Environment.Scenes handlerLandBuy(sender, e); } } + public void TriggerValidateLandBuy(Object sender, LandBuyArgs e) { handlerValidateLandBuy = OnValidateLandBuy; @@ -741,6 +732,7 @@ namespace OpenSim.Region.Environment.Scenes handlerRequestChangeWaterHeight(height); } } + public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) { handlerAvatarKill = OnAvatarKilled; @@ -756,7 +748,6 @@ namespace OpenSim.Region.Environment.Scenes if (handlerSignificantClientMovement != null) { handlerSignificantClientMovement(client); - } } @@ -787,7 +778,6 @@ namespace OpenSim.Region.Environment.Scenes } } - public void TriggerNoticeNoLandDataFromStorage() { handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; @@ -818,26 +808,24 @@ namespace OpenSim.Region.Environment.Scenes } } - - public void TriggerRequestParcelPrimCountUpdate() { handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; if (handlerRequestParcelPrimCountUpdate != null) { handlerRequestParcelPrimCountUpdate(); - } } + public void TriggerParcelPrimCountTainted() { handlerParcelPrimCountTainted = OnParcelPrimCountTainted; if (handlerParcelPrimCountTainted != null) { handlerParcelPrimCountTainted(); - } } + // this lets us keep track of nasty script events like timer, etc. public void TriggerTimerEvent(uint objLocalID, double Interval) { @@ -845,9 +833,7 @@ namespace OpenSim.Region.Environment.Scenes if (handlerScriptTimerEvent != null) { handlerScriptTimerEvent(objLocalID, Interval); - } - } public void TriggerEstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) @@ -875,19 +861,19 @@ namespace OpenSim.Region.Environment.Scenes if (handlerCollidingStart != null) handlerCollidingStart(localId, colliders); } + public void TriggerScriptColliding(uint localId, ColliderArgs colliders) { - handlerColliding = OnScriptColliding; if (handlerColliding != null) handlerColliding(localId, colliders); } + public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) { handlerCollidingEnd = OnScriptCollidingEnd; if (handlerCollidingEnd != null) handlerCollidingEnd(localId, colliders); } - } } diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 3021891..6695dbf 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -96,7 +96,7 @@ namespace OpenSim.Region.Environment.Scenes // Then we've got to remove the previous // event handler - if (_PhyScene != null) + if (_PhyScene != null) _PhyScene.OnPhysicsCrash -= physicsBasedCrash; _PhyScene = value; @@ -194,7 +194,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// true if the object was added, false if an object with the same uuid was already in the scene - /// + /// protected internal bool AddRestoredSceneObject( SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) { @@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Scenes { part.LocalId = m_parentScene.PrimIDAllocate(); } - + sceneObject.UpdateParentIDs(); if (!alreadyPersisted) @@ -213,10 +213,10 @@ namespace OpenSim.Region.Environment.Scenes sceneObject.ForceInventoryPersistence(); sceneObject.HasGroupChanged = true; } - + return AddSceneObject(sceneObject, attachToBackup); } - + /// /// Add a newly created object to the scene. This will both update the scene, and send information about the /// new object to all clients interested in the scene. @@ -228,12 +228,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// true if the object was added, false if an object with the same uuid was already in the scene - /// + /// protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) - { + { // Ensure that we persist this new scene object sceneObject.HasGroupChanged = true; - + return AddSceneObject(sceneObject, attachToBackup); } @@ -252,7 +252,7 @@ namespace OpenSim.Region.Environment.Scenes { sceneObject.ApplyPhysics(m_parentScene.m_physicalPrim); sceneObject.ScheduleGroupForFullUpdate(); - + lock (Entities) { if (!Entities.ContainsKey(sceneObject.UUID)) @@ -261,8 +261,8 @@ namespace OpenSim.Region.Environment.Scenes Entities.Add(sceneObject.UUID, sceneObject); m_numPrim += sceneObject.Children.Count; - if (attachToBackup) - sceneObject.AttachToBackup(); + if (attachToBackup) + sceneObject.AttachToBackup(); return true; } @@ -342,7 +342,7 @@ namespace OpenSim.Region.Environment.Scenes "[INNER SCENE]: Failed to update {0}, {1} - {2}", entity.Name, entity.UUID, e); } } - + m_updateList.Clear(); } } @@ -555,7 +555,7 @@ namespace OpenSim.Region.Environment.Scenes protected internal void AddScenePresence(ScenePresence presence) { bool child = presence.IsChildAgent; - + if (child) { m_numChildAgents++; @@ -598,7 +598,7 @@ namespace OpenSim.Region.Environment.Scenes { if (!ScenePresences.Remove(agentID)) { - m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); + m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); } // else // { @@ -774,7 +774,7 @@ namespace OpenSim.Region.Environment.Scenes /// Get a scene object group that contains the prim with the given uuid /// /// - /// null if no scene object group containing that prim is found + /// null if no scene object group containing that prim is found private SceneObjectGroup GetGroupByPrim(LLUUID fullID) { List EntityList = GetEntities(); @@ -823,7 +823,7 @@ namespace OpenSim.Region.Environment.Scenes protected internal SceneObjectPart GetSceneObjectPart(uint localID) { SceneObjectGroup group = GetGroupByPrim(localID); - + if (group != null) return group.GetChildPart(localID); else @@ -834,7 +834,7 @@ namespace OpenSim.Region.Environment.Scenes /// Get a part contained in this scene. /// /// - /// null if the part was not found + /// null if the part was not found protected internal SceneObjectPart GetSceneObjectPart(LLUUID fullID) { SceneObjectGroup group = GetGroupByPrim(fullID); @@ -1089,7 +1089,7 @@ namespace OpenSim.Region.Environment.Scenes group.SendGroupTerseUpdate(); return; } - + if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) { group.UpdateSinglePosition(pos, localID); @@ -1119,7 +1119,7 @@ namespace OpenSim.Region.Environment.Scenes if (!m_parentScene.ExternalChecks.ExternalChecksCanObjectEntry(group.UUID,pos) && !group.RootPart.IsAttachment) { group.SendGroupTerseUpdate(); - + return; } if (m_parentScene.ExternalChecks.ExternalChecksCanMoveObject(group.UUID, remoteClient.AgentId) || group.RootPart.IsAttachment) @@ -1397,14 +1397,14 @@ namespace OpenSim.Region.Environment.Scenes if (sendEvents) parenPrim.TriggerScriptChangedEvent(Changed.LINK); } - else + else { // The link set has prims remaining. This path is taken // when a subset of a link set's prims are selected // and the root prim is part of that selection // List parts = new List(parenPrim.Children.Values); - + List unlink_ids = new List(); foreach (SceneObjectPart unlink_part in parts) unlink_ids.Add(unlink_part.LocalId); diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index fe66dd5..0148d76 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -242,9 +242,9 @@ namespace OpenSim.Region.Environment.Scenes // Retrieve item TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); - + if (null == item) - { + { m_log.ErrorFormat( "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update " + " but the item does not exist in this inventory", @@ -338,7 +338,6 @@ namespace OpenSim.Region.Environment.Scenes item.CreationDate = Util.UnixTimeSinceEpoch(); else item.CreationDate = itemUpd.CreationDate; - // TODO: Check if folder changed and move item //item.NextPermissions = itemUpd.Folder; @@ -577,7 +576,7 @@ namespace OpenSim.Region.Environment.Scenes asset.Type = assetType; asset.FullID = LLUUID.Random(); asset.Data = (data == null) ? new byte[1] : data; - + return asset; } @@ -958,7 +957,7 @@ namespace OpenSim.Region.Environment.Scenes agentItem.Folder = folderId; AddInventoryItem(remoteClient, agentItem); } - + /// /// ClientMoveTaskInventoryItem /// @@ -981,13 +980,13 @@ namespace OpenSim.Region.Environment.Scenes } TaskInventoryItem taskItem = part.GetInventoryItem(itemId); - + if (null == taskItem) { m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed" + " because the inventory item could not be found", itemId, primLocalId); - + return; } @@ -997,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes MoveTaskInventoryItem(remoteClient, folderId, part, itemId); } - + /// /// MoveTaskInventoryItem /// @@ -1029,7 +1028,7 @@ namespace OpenSim.Region.Environment.Scenes AddInventoryItem(avatarId, agentItem); } } - + /// /// Copy a task (prim) inventory item to another task (prim) /// @@ -1049,7 +1048,7 @@ namespace OpenSim.Region.Environment.Scenes return; } - + SceneObjectPart destPart = GetSceneObjectPart(destId); if (destPart == null) @@ -1060,7 +1059,7 @@ namespace OpenSim.Region.Environment.Scenes destId); return; } - + if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) { // object cannot copy items to an object owned by a different owner @@ -1076,7 +1075,7 @@ namespace OpenSim.Region.Environment.Scenes } TaskInventoryItem destTaskItem = new TaskInventoryItem(); - + destTaskItem.ItemID = LLUUID.Random(); destTaskItem.CreatorID = srcTaskItem.CreatorID; destTaskItem.AssetID = srcTaskItem.AssetID; @@ -1091,7 +1090,7 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; destTaskItem.NextPermissions = srcTaskItem.NextPermissions; destTaskItem.Flags = srcTaskItem.Flags; - + if (destPart.OwnerID != part.OwnerID) { if (ExternalChecks.ExternalChecksPropagatePermissions()) @@ -1112,20 +1111,20 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.Name = srcTaskItem.Name; destTaskItem.InvType = srcTaskItem.InvType; destTaskItem.Type = srcTaskItem.Type; - + destPart.AddInventoryItem(destTaskItem); if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) part.RemoveInventoryItem(itemId); ScenePresence avatar; - + if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) { destPart.GetProperties(avatar.ControllingClient); } } - + public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List items) { CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); @@ -1139,7 +1138,7 @@ namespace OpenSim.Region.Environment.Scenes } LLUUID newFolderID = LLUUID.Random(); - + profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); foreach (LLUUID itemID in items) @@ -1346,7 +1345,7 @@ namespace OpenSim.Region.Environment.Scenes part.AddInventoryItem(taskItem); part.GetProperties(remoteClient); - + part.CreateScriptInstance(taskItem, 0, false); } } @@ -1370,7 +1369,7 @@ namespace OpenSim.Region.Environment.Scenes return; } - + SceneObjectPart destPart = GetSceneObjectPart(destId); if (destPart == null) @@ -1381,7 +1380,7 @@ namespace OpenSim.Region.Environment.Scenes destId); return; } - + // Must own the object, and have modify rights if (srcPart.OwnerID != destPart.OwnerID) return; @@ -1395,14 +1394,14 @@ namespace OpenSim.Region.Environment.Scenes "[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 - + // 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; @@ -1417,7 +1416,7 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; destTaskItem.NextPermissions = srcTaskItem.NextPermissions; destTaskItem.Flags = srcTaskItem.Flags; - + if (destPart.OwnerID != srcPart.OwnerID) { if (ExternalChecks.ExternalChecksPropagatePermissions()) @@ -1438,22 +1437,22 @@ namespace OpenSim.Region.Environment.Scenes destTaskItem.Name = srcTaskItem.Name; destTaskItem.InvType = srcTaskItem.InvType; destTaskItem.Type = srcTaskItem.Type; - + destPart.AddInventoryItemExclusive(destTaskItem); if (running > 0) { destPart.CreateScriptInstance(destTaskItem, 0, false); } - + ScenePresence avatar; - + if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) { destPart.GetProperties(avatar.ControllingClient); } } - + /// /// Called when an object is removed from the environment into inventory. /// @@ -1566,7 +1565,7 @@ namespace OpenSim.Region.Environment.Scenes private bool InventoryDeQueueAndDelete() { DeleteToInventoryHolder x = null; - + try { lock (m_inventoryDeletes) @@ -1580,13 +1579,13 @@ namespace OpenSim.Region.Environment.Scenes return true; } } - } + } catch(Exception e) { // We can't put the object group details in here since the root part may have disappeared (which is where these sit). // FIXME: This needs to be fixed. m_log.ErrorFormat( - "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", + "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", (x != null ? x.remoteClient.Name : "unavailable"), (x != null ? x.remoteClient.AgentId : "unavailable"), e.ToString()); } @@ -1745,7 +1744,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + AssetBase asset = CreateAsset( objectGroup.GetPartName(objectGroup.LocalId), objectGroup.GetPartDescription(objectGroup.LocalId), @@ -1792,7 +1791,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) { SceneObjectGroup objectGroup = grp; @@ -2057,7 +2056,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// public virtual SceneObjectGroup RezObject( - SceneObjectPart sourcePart, TaskInventoryItem item, + SceneObjectPart sourcePart, TaskInventoryItem item, LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) { // Rez object @@ -2142,10 +2141,10 @@ namespace OpenSim.Region.Environment.Scenes return rootPart.ParentGroup; } } - + return null; } - + public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) { string message = ""; @@ -2218,7 +2217,7 @@ namespace OpenSim.Region.Environment.Scenes item.AssetType = asset.Type; item.InvType = (int)InventoryType.Object; item.Folder = folderID; - + if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) { uint perms = returnobjects[i].GetEffectivePermissions(); diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index e8a8a78..474f062 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -74,11 +74,11 @@ namespace OpenSim.Region.Environment.Scenes public InnerScene m_innerScene; /// - /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is + /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is /// dispenced. - /// + /// private uint m_lastAllocatedLocalId = 720000; - + private readonly Mutex _primAllocateMutex = new Mutex(false); private int m_timePhase = 24; @@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Scenes public override void Close() { m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); - + // Kick all ROOT agents with the message, 'The simulator is going down' ForEachScenePresence(delegate(ScenePresence avatar) { @@ -765,7 +765,7 @@ namespace OpenSim.Region.Environment.Scenes if (m_frame % m_update_backup == 0) { UpdateStorageBackup(); - + } if (m_frame % m_update_terrain == 0) @@ -1112,7 +1112,7 @@ namespace OpenSim.Region.Environment.Scenes //X // . // - // Shade the terrain for shadows + // Shade the terrain for shadows if ((x - 1 > 0) && (y - 1 > 0)) { hfvalue = (float)hm[x, y]; @@ -1133,7 +1133,7 @@ namespace OpenSim.Region.Environment.Scenes else if (hfdiff < -0.3f) { // We have to desaturate and blacken the land at the same time - // we use floats, colors use bytes, so shrink are space down to + // we use floats, colors use bytes, so shrink are space down to // 0-255 @@ -1429,13 +1429,13 @@ namespace OpenSim.Region.Environment.Scenes public void LazySaveGeneratedMaptile(byte[] data, bool temporary) { // Overwrites the local Asset cache with new maptile data - // Assets are single write, this causes the asset server to ignore this update, + // Assets are single write, this causes the asset server to ignore this update, // but the local asset cache does not // this is on purpose! The net result of this is the region always has the most up to date - // map tile while protecting the (grid) asset database from bloat caused by a new asset each + // map tile while protecting the (grid) asset database from bloat caused by a new asset each // time a mapimage is generated! - + LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; int lastMapRefresh = 0; @@ -1711,7 +1711,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// true if the object was added, false if an object with the same uuid was already in the scene - /// + /// public bool AddRestoredSceneObject( SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) { @@ -1739,15 +1739,15 @@ namespace OpenSim.Region.Environment.Scenes lock (Entities) { ICollection entities = new List(Entities.Values); - + foreach (EntityBase e in entities) { if (e is SceneObjectGroup) DeleteSceneObject((SceneObjectGroup)e); } - } + } } - + /// /// Delete the given object from the scene. /// @@ -1791,8 +1791,8 @@ namespace OpenSim.Region.Environment.Scenes public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset) { - m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); - + m_log.InfoFormat("[SCENE]: Loading prims in xml format to region {0} from {1}", RegionInfo.RegionName); + m_serialiser.LoadPrimsFromXml(this, fileName, newIdsFlag, loadOffset); } @@ -1805,29 +1805,29 @@ namespace OpenSim.Region.Environment.Scenes public void LoadPrimsFromXml2(string fileName) { - m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); - + m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from {1}", RegionInfo.RegionName, fileName); + m_serialiser.LoadPrimsFromXml2(this, fileName); } public void LoadPrimsFromXml2(TextReader reader, bool startScripts) { - m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); - + m_log.InfoFormat("[SCENE]: Loading prims in xml2 format to region {0} from stream", RegionInfo.RegionName); + m_serialiser.LoadPrimsFromXml2(this, reader, startScripts); } public void SavePrimsToXml2(string fileName) { m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to {1}", RegionInfo.RegionName, fileName); - + m_serialiser.SavePrimsToXml2(this, fileName); } public void SavePrimsToXml2(TextWriter stream, LLVector3 min, LLVector3 max) { m_log.InfoFormat("[SCENE]: Saving prims in xml2 format for region {0} to stream", RegionInfo.RegionName); - + m_serialiser.SavePrimsToXml2(this, stream, min, max); } @@ -1835,7 +1835,7 @@ namespace OpenSim.Region.Environment.Scenes { m_log.InfoFormat( "[SCENE]: Saving prims with name {0} in xml2 format for region {1} to {2}", primName, RegionInfo.RegionName, fileName); - + List entityList = GetEntities(); List primList = new List(); @@ -1860,7 +1860,7 @@ namespace OpenSim.Region.Environment.Scenes public void LoadPrimsFromArchive(string filePath) { m_log.InfoFormat("[SCENE]: Loading archive to region {0} from {1}", RegionInfo.RegionName, filePath); - + m_archiver.DearchiveRegion(filePath); } @@ -1871,7 +1871,7 @@ namespace OpenSim.Region.Environment.Scenes public void SavePrimsToArchive(string filePath) { m_log.InfoFormat("[SCENE]: Writing archive for region {0} to {1}", RegionInfo.RegionName, filePath); - + m_archiver.ArchiveRegion(filePath); } @@ -1986,7 +1986,7 @@ namespace OpenSim.Region.Environment.Scenes m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor"); if (XMLMethod == 0) { - SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); + SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); AddRestoredSceneObject(sceneObject, true, false); SceneObjectPart RootPrim = GetSceneObjectPart(primID); @@ -1999,7 +1999,7 @@ namespace OpenSim.Region.Environment.Scenes { DeleteSceneObject(grp); } - + m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar"); return false; @@ -2075,7 +2075,7 @@ namespace OpenSim.Region.Environment.Scenes else { m_log.DebugFormat( - "[SCENE]: Adding new {0} agent {1} {2} in {3}", + "[SCENE]: Adding new {0} agent {1} {2} in {3}", (child ? "child" : "root"), client.Name, client.AgentId, RegionInfo.RegionName); CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); @@ -2156,7 +2156,7 @@ namespace OpenSim.Region.Environment.Scenes client.OnScriptReset += ProcessScriptReset; client.OnGetScriptRunning += GetScriptRunning; client.OnSetScriptRunning += SetScriptRunning; - + client.OnRegionHandleRequest += RegionHandleRequest; client.OnUnackedTerrain += TerrainUnAcked; @@ -2310,7 +2310,7 @@ namespace OpenSim.Region.Environment.Scenes public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) { appearance = null; // VS needs this line, mono doesn't - + try { if (m_AvatarFactory == null || @@ -2323,10 +2323,10 @@ namespace OpenSim.Region.Environment.Scenes catch (Exception e) { m_log.ErrorFormat( - "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", + "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", client.Name, client.AgentId, e); appearance = new AvatarAppearance(); - } + } } /// @@ -2341,13 +2341,13 @@ namespace OpenSim.Region.Environment.Scenes { childagentYN = avatar.IsChildAgent; } - + try { m_log.DebugFormat( - "[SCENE]: Removing {0} agent {1} from region {2}", + "[SCENE]: Removing {0} agent {1} from region {2}", (childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName); - + if (avatar.IsChildAgent) { m_innerScene.removeUserCount(false); @@ -2378,7 +2378,7 @@ namespace OpenSim.Region.Environment.Scenes // We don't know which count to remove it from // Avatar is already disposed :/ } - + m_eventManager.TriggerOnRemovePresence(agentID); Broadcast(delegate(IClientAPI client) { @@ -2717,7 +2717,7 @@ namespace OpenSim.Region.Environment.Scenes { m_innerScene.removeUserCount(true); } - + // Tell a single agent to disconnect from the region. presence.ControllingClient.SendShutdownConnectionNotice(); @@ -3827,9 +3827,9 @@ namespace OpenSim.Region.Environment.Scenes { //should be doing this by parcel, but as its only for testing // The use of Thread.Sleep here causes the following compiler error under mono 1.2.4 - // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist + // OpenSim/Region/Environment/Scenes/Scene.cs(3675,17): error CS0103: The name `Thread' does not exist // in the context of `<>c__CompilerGenerated17' - // MW said it was okay to comment the body of this method out for now since the code is experimental + // MW said it was okay to comment the body of this method out for now since the code is experimental // and will be replaced anyway // ForEachClient(delegate(IClientAPI client) // { @@ -3840,7 +3840,7 @@ namespace OpenSim.Region.Environment.Scenes // client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); // }); } - + public void RegionHandleRequest(IClientAPI client, LLUUID regionID) { RegionInfo info; @@ -3860,4 +3860,4 @@ namespace OpenSim.Region.Environment.Scenes client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); } } -} +} diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 35a7434..adad7d3 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -60,7 +60,7 @@ namespace OpenSim.Region.Environment.Scenes public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; public event LogOffUser OnLogOffUser; public event GetLandData OnGetLandData; - + private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; @@ -70,7 +70,7 @@ namespace OpenSim.Region.Environment.Scenes private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; private LogOffUser handlerLogOffUser = null; - private GetLandData handlerGetLandData = null; // OnGetLandData + private GetLandData handlerGetLandData = null; // OnGetLandData public KillObjectDelegate KillObject; public string _debugRegionName = String.Empty; @@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Scenes } return null; } - + #endregion #region Inform Client of Neighbours @@ -582,7 +582,7 @@ namespace OpenSim.Region.Environment.Scenes LLVector3 lookAt, uint flags) { bool destRegionUp = false; - + if (regionHandle == m_regionInfo.RegionHandle) { // Teleport within the same region diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index 0b2cc9e..a0e0a37 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -45,534 +45,553 @@ namespace OpenSim.Region.Environment.Scenes #region Object Permission Checks - public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); - private List GenerateClientFlagsCheckFunctions = new List(); + public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); + private List GenerateClientFlagsCheckFunctions = new List(); - public void addGenerateClientFlags(GenerateClientFlags delegateFunc) - { - if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) - GenerateClientFlagsCheckFunctions.Add(delegateFunc); - } - public void removeGenerateClientFlags(GenerateClientFlags delegateFunc) - { - if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) - GenerateClientFlagsCheckFunctions.Remove(delegateFunc); - } + public void addGenerateClientFlags(GenerateClientFlags delegateFunc) + { + if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) + GenerateClientFlagsCheckFunctions.Add(delegateFunc); + } - public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) - { - SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); - - if (part == null) - return 0; - - uint perms=part.GetEffectiveObjectFlags() | - (uint)LLObject.ObjectFlags.ObjectModify | - (uint)LLObject.ObjectFlags.ObjectCopy | - (uint)LLObject.ObjectFlags.ObjectMove | - (uint)LLObject.ObjectFlags.ObjectTransfer | - (uint)LLObject.ObjectFlags.ObjectYouOwner | - (uint)LLObject.ObjectFlags.ObjectAnyOwner | - (uint)LLObject.ObjectFlags.ObjectOwnerModify | - (uint)LLObject.ObjectFlags.ObjectYouOfficer; - - foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) - { - perms &= check(userID, objectID); - } - return perms; - } + public void removeGenerateClientFlags(GenerateClientFlags delegateFunc) + { + if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) + GenerateClientFlagsCheckFunctions.Remove(delegateFunc); + } - public delegate void SetBypassPermissions(bool value); - private List SetBypassPermissionsCheckFunctions = new List(); + public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) + { + SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); - public void addSetBypassPermissions(SetBypassPermissions delegateFunc) - { - if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) - SetBypassPermissionsCheckFunctions.Add(delegateFunc); - } - public void removeSetBypassPermissions(SetBypassPermissions delegateFunc) - { - if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) - SetBypassPermissionsCheckFunctions.Remove(delegateFunc); - } + if (part == null) + return 0; + + uint perms=part.GetEffectiveObjectFlags() | + (uint)LLObject.ObjectFlags.ObjectModify | + (uint)LLObject.ObjectFlags.ObjectCopy | + (uint)LLObject.ObjectFlags.ObjectMove | + (uint)LLObject.ObjectFlags.ObjectTransfer | + (uint)LLObject.ObjectFlags.ObjectYouOwner | + (uint)LLObject.ObjectFlags.ObjectAnyOwner | + (uint)LLObject.ObjectFlags.ObjectOwnerModify | + (uint)LLObject.ObjectFlags.ObjectYouOfficer; - public void ExternalChecksSetBypassPermissions(bool value) + foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions) { - foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) - { - check(value); - } + perms &= check(userID, objectID); } + return perms; + } - public delegate bool BypassPermissions(); - private List BypassPermissionsCheckFunctions = new List(); + public delegate void SetBypassPermissions(bool value); + private List SetBypassPermissionsCheckFunctions = new List(); - public void addBypassPermissions(BypassPermissions delegateFunc) - { - if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) - BypassPermissionsCheckFunctions.Add(delegateFunc); - } - public void removeBypassPermissions(BypassPermissions delegateFunc) + public void addSetBypassPermissions(SetBypassPermissions delegateFunc) + { + if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) + SetBypassPermissionsCheckFunctions.Add(delegateFunc); + } + + public void removeSetBypassPermissions(SetBypassPermissions delegateFunc) + { + if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc)) + SetBypassPermissionsCheckFunctions.Remove(delegateFunc); + } + + public void ExternalChecksSetBypassPermissions(bool value) + { + foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) { - if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) - BypassPermissionsCheckFunctions.Remove(delegateFunc); + check(value); } + } - public bool ExternalChecksBypassPermissions() + public delegate bool BypassPermissions(); + private List BypassPermissionsCheckFunctions = new List(); + + public void addBypassPermissions(BypassPermissions delegateFunc) + { + if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) + BypassPermissionsCheckFunctions.Add(delegateFunc); + } + + public void removeBypassPermissions(BypassPermissions delegateFunc) + { + if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) + BypassPermissionsCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksBypassPermissions() + { + foreach (BypassPermissions check in BypassPermissionsCheckFunctions) { - foreach (BypassPermissions check in BypassPermissionsCheckFunctions) + if (check() == false) { - if (check() == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool PropagatePermissions(); - private List PropagatePermissionsCheckFunctions = new List(); + public delegate bool PropagatePermissions(); + private List PropagatePermissionsCheckFunctions = new List(); - public void addPropagatePermissions(PropagatePermissions delegateFunc) - { - if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) - PropagatePermissionsCheckFunctions.Add(delegateFunc); - } - public void removePropagatePermissions(PropagatePermissions delegateFunc) - { - if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) - PropagatePermissionsCheckFunctions.Remove(delegateFunc); - } + public void addPropagatePermissions(PropagatePermissions delegateFunc) + { + if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) + PropagatePermissionsCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksPropagatePermissions() + public void removePropagatePermissions(PropagatePermissions delegateFunc) + { + if (PropagatePermissionsCheckFunctions.Contains(delegateFunc)) + PropagatePermissionsCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksPropagatePermissions() + { + foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) { - foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) + if (check() == false) { - if (check() == false) - { - return false; - } + return false; } - return true; } + return true; + } - #region REZ OBJECT - public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); - private List CanRezObjectCheckFunctions = new List(); + #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 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) + public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) + { + foreach (CanRezObject check in CanRezObjectCheckFunctions) { - foreach (CanRezObject check in CanRezObjectCheckFunctions) + if (check(objectCount, owner,objectPosition, m_scene) == false) { - if (check(objectCount, owner,objectPosition, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region DELETE OBJECT - public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); - private List CanDeleteObjectCheckFunctions = new List(); + #region DELETE OBJECT + public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); + private List CanDeleteObjectCheckFunctions = new List(); - public void addCheckDeleteObject(CanDeleteObject delegateFunc) - { - if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) - CanDeleteObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckDeleteObject(CanDeleteObject delegateFunc) - { - if (CanDeleteObjectCheckFunctions.Contains(delegateFunc)) - CanDeleteObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckDeleteObject(CanDeleteObject delegateFunc) + { + if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) + CanDeleteObjectCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) + public void removeCheckDeleteObject(CanDeleteObject delegateFunc) + { + if (CanDeleteObjectCheckFunctions.Contains(delegateFunc)) + CanDeleteObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) + { + foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) { - foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) + if (check(objectID,deleter,m_scene) == false) { - if (check(objectID,deleter,m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region TAKE OBJECT - public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); - private List CanTakeObjectCheckFunctions = new List(); + #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 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 AvatarTakingUUID) + public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) + { + foreach (CanTakeObject check in CanTakeObjectCheckFunctions) { - foreach (CanTakeObject check in CanTakeObjectCheckFunctions) + if (check(objectID, AvatarTakingUUID, m_scene) == false) { - if (check(objectID, AvatarTakingUUID, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region TAKE COPY OBJECT - public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); - private List CanTakeCopyObjectCheckFunctions = new List(); + #region TAKE COPY OBJECT + public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); + private List CanTakeCopyObjectCheckFunctions = new List(); - public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) - { - if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) - CanTakeCopyObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc) - { - if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) - CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) + { + if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) + CanTakeCopyObjectCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) + public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc) + { + if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) + CanTakeCopyObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) + { + foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) { - foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) + if (check(objectID,userID,m_scene) == false) { - if (check(objectID,userID,m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region DUPLICATE OBJECT - public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); - private List CanDuplicateObjectCheckFunctions = new List(); + #region DUPLICATE OBJECT + public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); + private List CanDuplicateObjectCheckFunctions = new List(); - public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) - { - if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) - CanDuplicateObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc) - { - if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) - CanDuplicateObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) + { + if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) + CanDuplicateObjectCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) + public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc) + { + if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) + CanDuplicateObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) + { + foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) { - foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) + if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) { - if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region EDIT OBJECT - public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); - private List CanEditObjectCheckFunctions = new List(); + #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 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) + public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) + { + foreach (CanEditObject check in CanEditObjectCheckFunctions) { - foreach (CanEditObject check in CanEditObjectCheckFunctions) + if (check(objectID, editorID, m_scene) == false) { - if (check(objectID, editorID, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region MOVE OBJECT - public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); - private List CanMoveObjectCheckFunctions = new List(); + #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 void addCheckMoveObject(CanMoveObject delegateFunc) + { + if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) + CanMoveObjectCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) + public void removeCheckMoveObject(CanMoveObject delegateFunc) + { + if (CanMoveObjectCheckFunctions.Contains(delegateFunc)) + CanMoveObjectCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) + { + foreach (CanMoveObject check in CanMoveObjectCheckFunctions) { - foreach (CanMoveObject check in CanMoveObjectCheckFunctions) + if (check(objectID,moverID,m_scene) == false) { - if (check(objectID,moverID,m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region OBJECT ENTRY - public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); - private List CanObjectEntryCheckFunctions = new List(); + #region OBJECT ENTRY + public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); + private List CanObjectEntryCheckFunctions = new List(); - public void addCheckObjectEntry(CanObjectEntry delegateFunc) - { - if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) - CanObjectEntryCheckFunctions.Add(delegateFunc); - } - public void removeCheckObjectEntry(CanObjectEntry delegateFunc) - { - if (CanObjectEntryCheckFunctions.Contains(delegateFunc)) - CanObjectEntryCheckFunctions.Remove(delegateFunc); - } + public void addCheckObjectEntry(CanObjectEntry delegateFunc) + { + if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) + CanObjectEntryCheckFunctions.Add(delegateFunc); + } + + public void removeCheckObjectEntry(CanObjectEntry delegateFunc) + { + if (CanObjectEntryCheckFunctions.Contains(delegateFunc)) + CanObjectEntryCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) + public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) + { + foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) { - foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) + if (check(objectID, newPoint, m_scene) == false) { - if (check(objectID, newPoint, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region RETURN OBJECT - public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); - private List CanReturnObjectCheckFunctions = new List(); + #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 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) + public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) + { + foreach (CanReturnObject check in CanReturnObjectCheckFunctions) { - foreach (CanReturnObject check in CanReturnObjectCheckFunctions) + if (check(objectID,returnerID,m_scene) == false) { - if (check(objectID,returnerID,m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region INSTANT MESSAGE - public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); - private List CanInstantMessageCheckFunctions = new List(); + #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 void addCheckInstantMessage(CanInstantMessage delegateFunc) + { + if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) + CanInstantMessageCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) + public void removeCheckInstantMessage(CanInstantMessage delegateFunc) + { + if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) + CanInstantMessageCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) + { + foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) { - foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) + if (check(user, target, m_scene) == false) { - if (check(user, target, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } + + #endregion - #endregion + #region INVENTORY TRANSFER + public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); + private List CanInventoryTransferCheckFunctions = new List(); - #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 addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) - { - if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) - CanInventoryTransferCheckFunctions.Add(delegateFunc); - } - public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) + public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) { if (CanInventoryTransferCheckFunctions.Contains(delegateFunc)) CanInventoryTransferCheckFunctions.Remove(delegateFunc); } - public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) + public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) + { + foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) { - foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) + if (check(user, target, m_scene) == false) { - if (check(user, target, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region VIEW SCRIPT - public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); - private List CanViewScriptCheckFunctions = new List(); + #region VIEW SCRIPT + public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + private List CanViewScriptCheckFunctions = new List(); - public void addCheckViewScript(CanViewScript delegateFunc) - { - if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) - CanViewScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckViewScript(CanViewScript delegateFunc) - { - if (CanViewScriptCheckFunctions.Contains(delegateFunc)) - CanViewScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckViewScript(CanViewScript delegateFunc) + { + if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) + CanViewScriptCheckFunctions.Add(delegateFunc); + } + + public void removeCheckViewScript(CanViewScript delegateFunc) + { + if (CanViewScriptCheckFunctions.Contains(delegateFunc)) + CanViewScriptCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) + public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) + { + foreach (CanViewScript check in CanViewScriptCheckFunctions) { - foreach (CanViewScript check in CanViewScriptCheckFunctions) + if (check(script, objectID, user, m_scene) == false) { - if (check(script, objectID, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); - private List CanViewNotecardCheckFunctions = new List(); + public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); + private List CanViewNotecardCheckFunctions = new List(); - public void addCheckViewNotecard(CanViewNotecard delegateFunc) - { - if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) - CanViewNotecardCheckFunctions.Add(delegateFunc); - } - public void removeCheckViewNotecard(CanViewNotecard delegateFunc) - { - if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) - CanViewNotecardCheckFunctions.Remove(delegateFunc); - } + public void addCheckViewNotecard(CanViewNotecard delegateFunc) + { + if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) + CanViewNotecardCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) + public void removeCheckViewNotecard(CanViewNotecard delegateFunc) + { + if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) + CanViewNotecardCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) + { + foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) { - foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) + if (check(script, objectID, user, m_scene) == false) { - if (check(script, objectID, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region EDIT SCRIPT - public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); - private List CanEditScriptCheckFunctions = new List(); + #region EDIT SCRIPT + public delegate bool CanEditScript(LLUUID script, LLUUID objectID, 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 void addCheckEditScript(CanEditScript delegateFunc) + { + if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) + CanEditScriptCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) + public void removeCheckEditScript(CanEditScript delegateFunc) + { + if (CanEditScriptCheckFunctions.Contains(delegateFunc)) + CanEditScriptCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) + { + foreach (CanEditScript check in CanEditScriptCheckFunctions) { - foreach (CanEditScript check in CanEditScriptCheckFunctions) + if (check(script, objectID, user, m_scene) == false) { - if (check(script, objectID, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); - private List CanEditNotecardCheckFunctions = new List(); + public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); + private List CanEditNotecardCheckFunctions = new List(); - public void addCheckEditNotecard(CanEditNotecard delegateFunc) - { - if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) - CanEditNotecardCheckFunctions.Add(delegateFunc); - } - public void removeCheckEditNotecard(CanEditNotecard delegateFunc) - { - if (CanEditNotecardCheckFunctions.Contains(delegateFunc)) - CanEditNotecardCheckFunctions.Remove(delegateFunc); - } + public void addCheckEditNotecard(CanEditNotecard delegateFunc) + { + if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) + CanEditNotecardCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) + public void removeCheckEditNotecard(CanEditNotecard delegateFunc) + { + if (CanEditNotecardCheckFunctions.Contains(delegateFunc)) + CanEditNotecardCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) { foreach (CanEditNotecard check in CanEditNotecardCheckFunctions) { @@ -584,388 +603,402 @@ namespace OpenSim.Region.Environment.Scenes return true; } - #endregion + #endregion - #region RUN SCRIPT (When Script Placed in Object) - public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); - private List CanRunScriptCheckFunctions = new List(); + #region RUN SCRIPT (When Script Placed in Object) + public delegate bool CanRunScript(LLUUID script, LLUUID objectID, 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 void addCheckRunScript(CanRunScript delegateFunc) + { + if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) + CanRunScriptCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) + public void removeCheckRunScript(CanRunScript delegateFunc) + { + if (CanRunScriptCheckFunctions.Contains(delegateFunc)) + CanRunScriptCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) + { + foreach (CanRunScript check in CanRunScriptCheckFunctions) { - foreach (CanRunScript check in CanRunScriptCheckFunctions) + if (check(script, objectID, user, m_scene) == false) { - if (check(script, objectID, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region START SCRIPT (When Script run box is Checked after placed in object) - public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); - private List CanStartScriptCheckFunctions = new List(); + #region START SCRIPT (When Script run box is Checked after placed in object) + public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); + private List CanStartScriptCheckFunctions = new List(); - public void addCheckStartScript(CanStartScript delegateFunc) - { - if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) - CanStartScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckStartScript(CanStartScript delegateFunc) - { - if (CanStartScriptCheckFunctions.Contains(delegateFunc)) - CanStartScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckStartScript(CanStartScript delegateFunc) + { + if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) + CanStartScriptCheckFunctions.Add(delegateFunc); + } + + public void removeCheckStartScript(CanStartScript delegateFunc) + { + if (CanStartScriptCheckFunctions.Contains(delegateFunc)) + CanStartScriptCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) + public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) + { + foreach (CanStartScript check in CanStartScriptCheckFunctions) { - foreach (CanStartScript check in CanStartScriptCheckFunctions) + if (check(script, user, m_scene) == false) { - if (check(script, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } #endregion - #region STOP SCRIPT (When Script run box is unchecked after placed in object) - public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); - private List CanStopScriptCheckFunctions = new List(); + #region STOP SCRIPT (When Script run box is unchecked after placed in object) + public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); + private List CanStopScriptCheckFunctions = new List(); + + public void addCheckStopScript(CanStopScript delegateFunc) + { + if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) + CanStopScriptCheckFunctions.Add(delegateFunc); + } - public void addCheckStopScript(CanStopScript delegateFunc) - { - if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) - CanStopScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckStopScript(CanStopScript delegateFunc) - { - if (CanStopScriptCheckFunctions.Contains(delegateFunc)) - CanStopScriptCheckFunctions.Remove(delegateFunc); - } + public void removeCheckStopScript(CanStopScript delegateFunc) + { + if (CanStopScriptCheckFunctions.Contains(delegateFunc)) + CanStopScriptCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) + public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) + { + foreach (CanStopScript check in CanStopScriptCheckFunctions) { - foreach (CanStopScript check in CanStopScriptCheckFunctions) + if (check(script, user, m_scene) == false) { - if (check(script, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region RESET SCRIPT - public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); - private List CanResetScriptCheckFunctions = new List(); + #region RESET SCRIPT + public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); + private List CanResetScriptCheckFunctions = new List(); - public void addCheckResetScript(CanResetScript delegateFunc) - { - if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) - CanResetScriptCheckFunctions.Add(delegateFunc); - } - public void removeCheckResetScript(CanResetScript delegateFunc) - { - if (CanResetScriptCheckFunctions.Contains(delegateFunc)) - CanResetScriptCheckFunctions.Remove(delegateFunc); - } + public void addCheckResetScript(CanResetScript delegateFunc) + { + if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) + CanResetScriptCheckFunctions.Add(delegateFunc); + } + + public void removeCheckResetScript(CanResetScript delegateFunc) + { + if (CanResetScriptCheckFunctions.Contains(delegateFunc)) + CanResetScriptCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) + public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) + { + foreach (CanResetScript check in CanResetScriptCheckFunctions) { - foreach (CanResetScript check in CanResetScriptCheckFunctions) + if (check(script, user, m_scene) == false) { - if (check(script, user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region TERRAFORM LAND - public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); - private List CanTerraformLandCheckFunctions = new List(); + #region TERRAFORM LAND + public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); + private List CanTerraformLandCheckFunctions = new List(); - public void addCheckTerraformLand(CanTerraformLand delegateFunc) - { - if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) - CanTerraformLandCheckFunctions.Add(delegateFunc); - } - public void removeCheckTerraformLand(CanTerraformLand delegateFunc) - { - if (CanTerraformLandCheckFunctions.Contains(delegateFunc)) - CanTerraformLandCheckFunctions.Remove(delegateFunc); - } + public void addCheckTerraformLand(CanTerraformLand delegateFunc) + { + if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) + CanTerraformLandCheckFunctions.Add(delegateFunc); + } + + public void removeCheckTerraformLand(CanTerraformLand delegateFunc) + { + if (CanTerraformLandCheckFunctions.Contains(delegateFunc)) + CanTerraformLandCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) + public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) + { + foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) { - foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) + if (check(user, pos, m_scene) == false) { - if (check(user, pos, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region RUN CONSOLE COMMAND - public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); - private List CanRunConsoleCommandCheckFunctions = new List(); + #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 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) + public bool ExternalChecksCanRunConsoleCommand(LLUUID user) + { + foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) { - foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) + if (check(user, m_scene) == false) { - if (check(user, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - #endregion + #endregion - #region CAN ISSUE ESTATE COMMAND - public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); - private List CanIssueEstateCommandCheckFunctions = new List(); + #region CAN ISSUE ESTATE COMMAND + public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); + private List CanIssueEstateCommandCheckFunctions = new List(); - public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) - { - if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) - CanIssueEstateCommandCheckFunctions.Add(delegateFunc); - } - public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) - { - if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) - CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); - } + public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) + { + if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) + CanIssueEstateCommandCheckFunctions.Add(delegateFunc); + } + + public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) + { + if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) + CanIssueEstateCommandCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) + public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) + { + foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) { - foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) + if (check(user, m_scene, ownerCommand) == false) { - if (check(user, m_scene, ownerCommand) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - #region CAN BE GODLIKE - public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); - private List CanBeGodLikeCheckFunctions = new List(); + #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 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) + public bool ExternalChecksCanBeGodLike(LLUUID user) + { + foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) { - foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) + if (check(user, m_scene) == false) { - if (check(user, m_scene) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - #region EDIT PARCEL - public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanEditParcelCheckFunctions = new List(); + #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 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) + public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) + { + foreach (CanEditParcel check in CanEditParcelCheckFunctions) { - foreach (CanEditParcel check in CanEditParcelCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - #region SELL PARCEL - public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanSellParcelCheckFunctions = new List(); + #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 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) + public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) + { + foreach (CanSellParcel check in CanSellParcelCheckFunctions) { - foreach (CanSellParcel check in CanSellParcelCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - #region ABANDON PARCEL - public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanAbandonParcelCheckFunctions = new List(); + #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 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) + public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) + { + foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) { - foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } - #endregion + return true; + } + #endregion - public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); - private List CanReclaimParcelCheckFunctions = new List(); + public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); + private List CanReclaimParcelCheckFunctions = new List(); - public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) - { - if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) - CanReclaimParcelCheckFunctions.Add(delegateFunc); - } - public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc) - { - if (CanReclaimParcelCheckFunctions.Contains(delegateFunc)) - CanReclaimParcelCheckFunctions.Remove(delegateFunc); - } + public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) + { + if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) + CanReclaimParcelCheckFunctions.Add(delegateFunc); + } + + public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc) + { + if (CanReclaimParcelCheckFunctions.Contains(delegateFunc)) + CanReclaimParcelCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) + { + foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) { - foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } - public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); - private List CanBuyLandCheckFunctions = new List(); + return true; + } + public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); + private List CanBuyLandCheckFunctions = new List(); - public void addCheckCanBuyLand(CanBuyLand delegateFunc) - { - if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) - CanBuyLandCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanBuyLand(CanBuyLand delegateFunc) - { - if (CanBuyLandCheckFunctions.Contains(delegateFunc)) - CanBuyLandCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanBuyLand(CanBuyLand delegateFunc) + { + if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) + CanBuyLandCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanBuyLand(CanBuyLand delegateFunc) + { + if (CanBuyLandCheckFunctions.Contains(delegateFunc)) + CanBuyLandCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) + public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) + { + foreach (CanBuyLand check in CanBuyLandCheckFunctions) { - foreach (CanBuyLand check in CanBuyLandCheckFunctions) + if (check(user, parcel, m_scene) == false) { - if (check(user, parcel, m_scene) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); - private List CanLinkObjectCheckFunctions = new List(); + public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); + private List CanLinkObjectCheckFunctions = new List(); - public void addCheckCanLinkObject(CanLinkObject delegateFunc) - { - if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) - CanLinkObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanLinkObject(CanLinkObject delegateFunc) - { - if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) - CanLinkObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanLinkObject(CanLinkObject delegateFunc) + { + if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) + CanLinkObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanLinkObject(CanLinkObject delegateFunc) + { + if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) + CanLinkObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) + public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) { foreach (CanLinkObject check in CanLinkObjectCheckFunctions) { @@ -977,137 +1010,141 @@ namespace OpenSim.Region.Environment.Scenes return true; } - public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); - private List CanDelinkObjectCheckFunctions = new List(); + public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); + private List CanDelinkObjectCheckFunctions = new List(); - public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) - { - if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) - CanDelinkObjectCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) - { - if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) - CanDelinkObjectCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) + { + if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) + CanDelinkObjectCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) + { + if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) + CanDelinkObjectCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) + public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) + { + foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) { - foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) + if (check(user, objectID) == false) { - if (check(user, objectID) == false) - { - return false; - } + return false; } - return true; } + return true; + } #endregion - public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); - private List CanCreateInventoryCheckFunctions = new List(); + public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); + private List CanCreateInventoryCheckFunctions = new List(); - public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) - { - if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) - CanCreateInventoryCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc) - { - if (CanCreateInventoryCheckFunctions.Contains(delegateFunc)) - CanCreateInventoryCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) + { + if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) + CanCreateInventoryCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc) + { + if (CanCreateInventoryCheckFunctions.Contains(delegateFunc)) + CanCreateInventoryCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) + public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) + { + foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) { - foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) + if (check(invType, objectID, userID) == false) { - if (check(invType, objectID, userID) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); - private List CanCopyInventoryCheckFunctions = new List(); + public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); + private List CanCopyInventoryCheckFunctions = new List(); - public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) - { - if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) - CanCopyInventoryCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) - { - if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) - CanCopyInventoryCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) + { + if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) + CanCopyInventoryCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) + { + if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) + CanCopyInventoryCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + { + foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) { - foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) + if (check(itemID, objectID, userID) == false) { - if (check(itemID, objectID, userID) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); - private List CanDeleteInventoryCheckFunctions = new List(); + public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); + private List CanDeleteInventoryCheckFunctions = new List(); - public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) - { - if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) - CanDeleteInventoryCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc) - { - if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) - CanDeleteInventoryCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) + { + if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) + CanDeleteInventoryCheckFunctions.Add(delegateFunc); + } - public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc) + { + if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) + CanDeleteInventoryCheckFunctions.Remove(delegateFunc); + } + + public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) + { + foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) { - foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) + if (check(itemID, objectID, userID) == false) { - if (check(itemID, objectID, userID) == false) - { - return false; - } + return false; } - return true; } + return true; + } - public delegate bool CanTeleport(LLUUID userID); - private List CanTeleportCheckFunctions = new List(); + public delegate bool CanTeleport(LLUUID userID); + private List CanTeleportCheckFunctions = new List(); - public void addCheckCanTeleport(CanTeleport delegateFunc) - { - if (!CanTeleportCheckFunctions.Contains(delegateFunc)) - CanTeleportCheckFunctions.Add(delegateFunc); - } - public void removeCheckCanTeleport(CanTeleport delegateFunc) - { - if (CanTeleportCheckFunctions.Contains(delegateFunc)) - CanTeleportCheckFunctions.Remove(delegateFunc); - } + public void addCheckCanTeleport(CanTeleport delegateFunc) + { + if (!CanTeleportCheckFunctions.Contains(delegateFunc)) + CanTeleportCheckFunctions.Add(delegateFunc); + } + + public void removeCheckCanTeleport(CanTeleport delegateFunc) + { + if (CanTeleportCheckFunctions.Contains(delegateFunc)) + CanTeleportCheckFunctions.Remove(delegateFunc); + } - public bool ExternalChecksCanTeleport(LLUUID userID) + public bool ExternalChecksCanTeleport(LLUUID userID) + { + foreach (CanTeleport check in CanTeleportCheckFunctions) { - foreach (CanTeleport check in CanTeleportCheckFunctions) + if (check(userID) == false) { - if (check(userID) == false) - { - return false; - } + return false; } - return true; } + return true; + } } } - diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index cc4891f..032d673 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs @@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment.Scenes private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// - /// Force all task inventories of prims in the scene object to persist + /// Force all task inventories of prims in the scene object to persist /// public void ForceInventoryPersistence() { @@ -49,9 +49,9 @@ namespace OpenSim.Region.Environment.Scenes { part.ForceInventoryPersistence(); } - } + } } - + /// /// Start the scripts contained in all the prims in this group. /// @@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment.Scenes // taskItem.SalePrice = item.SalePrice; // taskItem.SaleType = item.SaleType; taskItem.CreationDate = (uint)item.CreationDate; - + part.AddInventoryItem(taskItem); return true; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 2a1b8c5..9c3d6a7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Scenes /// since the group's last persistent backup /// public bool HasGroupChanged = false; - + public float scriptScore = 0f; private LLVector3 lastPhysGroupPos; @@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Scenes private bool m_scriptListens_notAtTarget = false; #region Properties - + /// /// The name of an object grouping is always the same as its root part /// @@ -123,7 +123,7 @@ namespace OpenSim.Region.Environment.Scenes { get { return RootPart.Name; } set { RootPart.Name = value; } - } + } /// /// Added because the Parcel code seems to use it @@ -445,13 +445,13 @@ namespace OpenSim.Region.Environment.Scenes } more = !reader.EOF; } - + reader.Close(); sr.Close(); UpdateParentIDs(); } - + /// /// /// @@ -468,14 +468,14 @@ namespace OpenSim.Region.Environment.Scenes newPart.LinkNum = 0; m_parts.Add(newPart.UUID, newPart); SetPartAsRoot(newPart); - + // one of these is a proxy. if (shape.PCode != (byte)PCode.None && shape.PCode != (byte)PCode.ParticleSystem) AttachToBackup(); //ApplyPhysics(scene.m_physicalPrim); } - + /// /// /// @@ -754,7 +754,7 @@ namespace OpenSim.Region.Environment.Scenes m_rootPart.ScheduleFullUpdate(); m_rootPart.ClearUndoState(); } - + public void DetachToInventoryPrep() { ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar); @@ -873,11 +873,11 @@ namespace OpenSim.Region.Environment.Scenes return m_scene.MaxUndoCount; return 5; } - - // justincc: I don't believe this hack is needed any longer, especially since the physics + + // justincc: I don't believe this hack is needed any longer, especially since the physics // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false // this method was preventing proper reload of scene objects. - // dahlia: I had to uncomment it, without it meshing was failing on some prims and objects + // dahlia: I had to uncomment it, without it meshing was failing on some prims and objects // at region startup public void ResetChildPrimPhysicsPositions() { @@ -926,20 +926,20 @@ namespace OpenSim.Region.Environment.Scenes /// public void DeleteGroup() { - // We need to keep track of this state in case this group is still queued for backup. + // We need to keep track of this state in case this group is still queued for backup. // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race // conditions where a user deletes an entity while it is being stored. Really, the update - // code needs a redesign. + // code needs a redesign. m_isDeleted = true; - - DetachFromBackup(this); + + DetachFromBackup(this); lock (m_parts) { foreach (SceneObjectPart part in m_parts.Values) { part.RemoveScriptInstances(); - + List avatars = Scene.GetScenePresences(); for (int i = 0; i < avatars.Count; i++) { @@ -951,12 +951,12 @@ namespace OpenSim.Region.Environment.Scenes avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); } } - + m_rootPart = null; - m_parts.Clear(); + m_parts.Clear(); } } - + public void FakeDeleteGroup() { foreach (SceneObjectPart part in m_parts.Values) @@ -1034,7 +1034,7 @@ namespace OpenSim.Region.Environment.Scenes lock (m_targets) m_targets.Clear(); } - + ScheduleGroupForFullUpdate(); } @@ -1067,7 +1067,7 @@ namespace OpenSim.Region.Environment.Scenes { part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_physicalPrim); } - + // Hack to get the physics scene geometries in the right spot ResetChildPrimPhysicsPositions(); } @@ -1102,14 +1102,14 @@ namespace OpenSim.Region.Environment.Scenes /// /// public void ProcessBackup(IRegionDataStore datastore) - { + { if (HasGroupChanged) { // don't backup while it's selected or you're asking for changes mid stream. if ((!IsSelected) && (RootPart != null)) { m_log.InfoFormat( - "[SCENE]: Storing object {0}, {1} in {2}", + "[SCENE]: Storing object {0}, {1} in {2}", Name, UUID, m_scene.RegionInfo.RegionName); SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); @@ -1236,7 +1236,7 @@ namespace OpenSim.Region.Environment.Scenes dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); } - + // Now we've made a copy that replaces this one, we need to // switch the owner to the person who did the copying // Second Life copies an object and duplicates the first one in it's place @@ -1267,7 +1267,7 @@ namespace OpenSim.Region.Environment.Scenes dupe.UpdateParentIDs(); dupe.HasGroupChanged = true; dupe.AttachToBackup(); - + ScheduleGroupForFullUpdate(); } @@ -1673,7 +1673,7 @@ namespace OpenSim.Region.Environment.Scenes { return true; } - + return false; } @@ -1695,7 +1695,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + return false; } @@ -2042,7 +2042,7 @@ namespace OpenSim.Region.Environment.Scenes public void UpdatePrimFlags(uint localID, ushort type, bool inUse, byte[] data) { SceneObjectPart selectionPart = GetChildPart(localID); - + if (selectionPart != null) { lock (m_parts) @@ -2164,7 +2164,7 @@ namespace OpenSim.Region.Environment.Scenes m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); } //if (part.UUID != m_rootPart.UUID) - + HasGroupChanged = true; ScheduleGroupForFullUpdate(); @@ -2332,10 +2332,10 @@ namespace OpenSim.Region.Environment.Scenes } AbsolutePosition = pos; - + HasGroupChanged = true; } - + //we need to do a terse update even if the move wasn't allowed // so that the position is reset in the client (the object snaps back) ScheduleGroupForTerseUpdate(); @@ -2349,7 +2349,7 @@ namespace OpenSim.Region.Environment.Scenes public void UpdateSinglePosition(LLVector3 pos, uint localID) { SceneObjectPart part = GetChildPart(localID); - + if (part != null) { if (part.UUID == m_rootPart.UUID) @@ -2360,7 +2360,7 @@ namespace OpenSim.Region.Environment.Scenes { part.UpdateOffSet(pos); } - + HasGroupChanged = true; } } @@ -2398,7 +2398,7 @@ namespace OpenSim.Region.Environment.Scenes } AbsolutePosition = newPos; - + HasGroupChanged = true; ScheduleGroupForTerseUpdate(); } @@ -2426,7 +2426,7 @@ namespace OpenSim.Region.Environment.Scenes m_rootPart.RotationOffset.Z); m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); } - + HasGroupChanged = true; ScheduleGroupForTerseUpdate(); } @@ -2447,7 +2447,7 @@ namespace OpenSim.Region.Environment.Scenes m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); } AbsolutePosition = pos; - + HasGroupChanged = true; ScheduleGroupForTerseUpdate(); } @@ -2684,7 +2684,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + /// /// Set the user group to which this scene object belongs. /// @@ -2698,10 +2698,10 @@ namespace OpenSim.Region.Environment.Scenes { part.SetGroup(GroupID, client); } - + HasGroupChanged = true; } - + ScheduleGroupForFullUpdate(); } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 480c030..0ac20e2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Scenes private string m_inventoryFileName = String.Empty; private int m_inventoryFileNameSerial = 0; - + /// /// Serial count for inventory file , used to tell if inventory has changed /// no need for this to be part of Database backup @@ -53,13 +53,13 @@ namespace OpenSim.Region.Environment.Scenes /// /// Holds in memory prim inventory /// - protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); + protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); /// /// Tracks whether inventory has changed since the last persistent backup /// protected bool HasInventoryChanged; - + /// /// Force the task inventory of this prim to persist at the next update sweep /// @@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Scenes { if (i.InvType == (int)InventoryType.LSL) RemoveScriptInstance(i.ItemID); - + RemoveInventoryItem(i.ItemID); break; } @@ -316,7 +316,7 @@ namespace OpenSim.Region.Environment.Scenes AddInventoryItem(item.Name, item); } - + /// /// Add an item to this prim's inventory. /// @@ -329,7 +329,7 @@ namespace OpenSim.Region.Environment.Scenes { item.ParentID = UUID; item.ParentPartID = UUID; - + lock (m_taskInventory) { m_taskInventory.Add(item.ItemID, item); @@ -339,7 +339,7 @@ namespace OpenSim.Region.Environment.Scenes m_inventorySerial++; //m_inventorySerial += 2; HasInventoryChanged = true; - ParentGroup.HasGroupChanged = true; + ParentGroup.HasGroupChanged = true; } /// @@ -369,10 +369,10 @@ namespace OpenSim.Region.Environment.Scenes /// /// null if the item does not exist public TaskInventoryItem GetInventoryItem(LLUUID itemId) - { + { TaskInventoryItem item; m_taskInventory.TryGetValue(itemId, out item); - + return item; } @@ -450,12 +450,12 @@ namespace OpenSim.Region.Environment.Scenes } } - + if (scriptcount <= 0) { RemFlag(LLObject.ObjectFlags.Scripted); } - + ScheduleFullUpdate(); return type; @@ -603,7 +603,7 @@ namespace OpenSim.Region.Environment.Scenes public void ProcessInventoryBackup(IRegionDataStore datastore) { if (HasInventoryChanged) - { + { lock (TaskInventory) { datastore.StorePrimInventory(UUID, TaskInventory.Values); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 1432912..517114f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Scenes public uint AttachmentPoint = (byte)0; [XmlIgnore] public PhysicsVector RotationAxis = new PhysicsVector(1f,1f,1f); - + [XmlIgnore] public bool Undoing = false; @@ -196,11 +196,11 @@ namespace OpenSim.Region.Environment.Scenes protected LLVector3 m_velocity; // TODO: Those have to be changed into persistent properties at some later point, - // or sit-camera on vehicles will break on sim-crossing. + // or sit-camera on vehicles will break on sim-crossing. private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f); private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f); private bool m_forceMouselook = false; - + #endregion Fields #region Constructors @@ -352,13 +352,13 @@ namespace OpenSim.Region.Environment.Scenes private uint _everyoneMask = (uint)PermissionMask.None; private uint _nextOwnerMask = (uint)PermissionMask.All; private LLObject.ObjectFlags _flags = LLObject.ObjectFlags.None; - + public LLUUID CreatorID { - get + get { return _creatorID; } - set + set { _creatorID = value; } @@ -390,26 +390,26 @@ namespace OpenSim.Region.Environment.Scenes { get { return (uint)_flags; } set { _flags = (LLObject.ObjectFlags)value; } - } - + } + public LLUUID UUID { get { return m_uuid; } set { m_uuid = value; } } - + public uint LocalId { get { return m_localId; } set { m_localId = value; } } - + public virtual string Name { get { return m_name; } set { m_name = value; } } - + public byte Material { get { return (byte) m_material; } @@ -607,13 +607,13 @@ namespace OpenSim.Region.Environment.Scenes /// public LLVector3 AngularVelocity { - get - { + get + { if ((PhysActor != null) && PhysActor.IsPhysical) { m_angularVelocity.FromBytes(PhysActor.RotationalVelocity.GetBytes(), 0); } - return m_angularVelocity; + return m_angularVelocity; } set { m_angularVelocity = value; } } @@ -631,7 +631,7 @@ namespace OpenSim.Region.Environment.Scenes get { return m_description; } set { m_description = value; } } - + public Color Color { get { return m_color; } @@ -702,7 +702,7 @@ namespace OpenSim.Region.Environment.Scenes // set of attributes on shape change. For instance, // changing the lighting on a shape shouldn't cause // this. - if (m_shape != null) + if (m_shape != null) shape_changed = true; m_shape = value; @@ -740,7 +740,7 @@ namespace OpenSim.Region.Environment.Scenes } #endregion - + //--------------- @@ -771,7 +771,7 @@ namespace OpenSim.Region.Environment.Scenes get { return m_parentGroup; } } - + public scriptEvents ScriptEvents { @@ -802,8 +802,8 @@ namespace OpenSim.Region.Environment.Scenes public LLQuaternion SitTargetOrientationLL { - get - { + get + { return new LLQuaternion( m_sitTargetOrientation.x, m_sitTargetOrientation.y, @@ -830,97 +830,97 @@ namespace OpenSim.Region.Environment.Scenes } } - public uint ParentID + public uint ParentID { get { return _parentID; } set { _parentID = value; } } - public int CreationDate + public int CreationDate { get { return _creationDate; } set { _creationDate = value; } } - public uint Category + public uint Category { get { return _category; } set { _category = value; } } - public int SalePrice + public int SalePrice { get { return _salePrice; } set { _salePrice = value; } } - public byte ObjectSaleType + public byte ObjectSaleType { get { return _objectSaleType; } set { _objectSaleType = value; } } - public int OwnershipCost + public int OwnershipCost { get { return _ownershipCost; } set { _ownershipCost = value; } } - public LLUUID GroupID + public LLUUID GroupID { get { return _groupID; } set { _groupID = value; } } - public LLUUID OwnerID + public LLUUID OwnerID { get { return _ownerID; } set { _ownerID = value; } } - public LLUUID LastOwnerID + public LLUUID LastOwnerID { get { return _lastOwnerID; } set { _lastOwnerID = value; } } - public uint BaseMask + public uint BaseMask { get { return _baseMask; } set { _baseMask = value; } } - public uint OwnerMask + public uint OwnerMask { get { return _ownerMask; } set { _ownerMask = value; } } - public uint GroupMask + public uint GroupMask { get { return _groupMask; } set { _groupMask = value; } } - public uint EveryoneMask + public uint EveryoneMask { get { return _everyoneMask; } set { _everyoneMask = value; } } - public uint NextOwnerMask + public uint NextOwnerMask { get { return _nextOwnerMask; } set { _nextOwnerMask = value; } } - public libsecondlife.LLObject.ObjectFlags Flags + public libsecondlife.LLObject.ObjectFlags Flags { get { return _flags; } set { _flags = value; } } - public LLUUID SitTargetAvatar + public LLUUID SitTargetAvatar { get { return m_sitTargetAvatar; } set { m_sitTargetAvatar = value; } @@ -929,8 +929,8 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] public virtual LLUUID RegionID { - get - { + get + { if (ParentGroup != null && ParentGroup.Scene != null) return ParentGroup.Scene.RegionInfo.RegionID; else @@ -943,9 +943,9 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] public LLUUID ParentUUID { - get + get { - if (ParentGroup != null) + if (ParentGroup != null) { _parentUUID = ParentGroup.UUID; } @@ -953,7 +953,7 @@ namespace OpenSim.Region.Environment.Scenes } set { _parentUUID = value; } } - + #endregion Public Properties with only Get #region Private Methods @@ -2460,7 +2460,7 @@ namespace OpenSim.Region.Environment.Scenes return; } } - + if (m_parentGroup.GetSceneMaxUndo() > 0) @@ -2914,7 +2914,7 @@ namespace OpenSim.Region.Environment.Scenes ScaleOffset = Math.Abs(ScaleOffset); Vector3 offset = returnresult.normal * ScaleOffset; returnresult.ipoint = AXpos + offset; - + ///pos = (intersectionpoint + offset); } else @@ -3354,27 +3354,27 @@ namespace OpenSim.Region.Environment.Scenes public void SetCameraAtOffset(LLVector3 v) { m_cameraAtOffset = v; } - + public void SetCameraEyeOffset(LLVector3 v) { m_cameraEyeOffset = v; } - + public void SetForceMouselook(bool force) { m_forceMouselook = force; } - + public LLVector3 GetCameraAtOffset() { return m_cameraAtOffset; } - + public LLVector3 GetCameraEyeOffset() { return m_cameraEyeOffset; } - + public bool GetForceMouselook() { return m_forceMouselook; } - + #endregion Public Methods } } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index cad2496..5669af6 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1198,7 +1198,7 @@ namespace OpenSim.Region.Environment.Scenes RemoveFromPhysicalScene(); } } - + cameraAtOffset = part.GetCameraAtOffset(); cameraEyeOffset = part.GetCameraEyeOffset(); forceMouselook = part.GetForceMouselook(); @@ -1347,7 +1347,7 @@ namespace OpenSim.Region.Environment.Scenes RemoveAnimation(animID); } - + public LLUUID[] GetAnimationArray() { LLUUID[] animIDs; @@ -1696,7 +1696,7 @@ namespace OpenSim.Region.Environment.Scenes /// - /// Do everything required once a client completes its movement into a region + /// Do everything required once a client completes its movement into a region /// public void SendInitialData() { @@ -1898,7 +1898,7 @@ namespace OpenSim.Region.Environment.Scenes { if (IsChildAgent) return; - + LLVector3 pos2 = AbsolutePosition; LLVector3 vel = Velocity; @@ -1968,9 +1968,9 @@ namespace OpenSim.Region.Environment.Scenes // This means we need to remove the current caps handler here and possibly compensate later, // in case both scenes are being hosted on the same region server. Messy m_scene.RemoveCapsHandler(UUID); - newpos = newpos + (vel); + newpos = newpos + (vel); - CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); + CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); if (userInfo != null) { userInfo.DropInventory(); @@ -1978,11 +1978,11 @@ namespace OpenSim.Region.Environment.Scenes else { m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); - } - + } + bool crossingSuccessful = m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, - m_physicsActor.Flying); + m_physicsActor.Flying); if (crossingSuccessful) { AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); @@ -1998,8 +1998,8 @@ namespace OpenSim.Region.Environment.Scenes m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, capsPath); MakeChildAgent(); - CrossAttachmentsIntoNewRegion(neighbourHandle); - + CrossAttachmentsIntoNewRegion(neighbourHandle); + m_scene.SendKillObject(m_localId); m_scene.NotifyMyCoarseLocationChange(); // the user may change thier profile information in other region, @@ -2010,7 +2010,7 @@ namespace OpenSim.Region.Environment.Scenes else { // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing - m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); + m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); m_scene.AddCapsHandler(UUID); } } @@ -2825,7 +2825,7 @@ namespace OpenSim.Region.Environment.Scenes } } } - + LastCommands = allflags; } diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index f46aba4..0e551cb 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs @@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.Scenes m_report.Interval = statsUpdatesEveryMS; m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); m_report.Enabled = true; - + if (StatsManager.SimExtraStats != null) OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; } diff --git a/OpenSim/Region/Environment/Scenes/UndoState.cs b/OpenSim/Region/Environment/Scenes/UndoState.cs index 5d1f6a0..fdbfa8c 100644 --- a/OpenSim/Region/Environment/Scenes/UndoState.cs +++ b/OpenSim/Region/Environment/Scenes/UndoState.cs @@ -41,7 +41,7 @@ namespace OpenSim.Region.Environment.Scenes Rotation = rot; Scale = scale; } - + public UndoState(SceneObjectPart part) { if (part != null) @@ -50,7 +50,7 @@ namespace OpenSim.Region.Environment.Scenes { Position = part.AbsolutePosition; Rotation = part.RotationOffset; - + } else { @@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Scenes if (part != null) { part.Undoing = true; - + if (part.ParentID == 0) { part.ParentGroup.AbsolutePosition = Position; @@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Scenes part.ScheduleTerseUpdate(); } part.Undoing = false; - + } } -- cgit v1.1