From b16abc8166c29585cb76cc55c3bdd76e5833cb4f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 5 Jan 2017 19:07:37 +0000 Subject: Massive tab and trailing space cleanup --- .../Avatar/Attachments/AttachmentsModule.cs | 78 ++++----- .../Attachments/Tests/AttachmentsModuleTests.cs | 6 +- .../Avatar/AvatarFactory/AvatarFactoryModule.cs | 42 ++--- .../Tests/AvatarFactoryModuleTests.cs | 16 +- .../Avatar/BakedTextures/XBakesModule.cs | 14 +- .../Region/CoreModules/Avatar/Chat/ChatModule.cs | 30 ++-- .../Avatar/Chat/Tests/ChatModuleTests.cs | 52 +++--- .../Avatar/Commands/UserCommandsModule.cs | 8 +- .../CoreModules/Avatar/Friends/FriendsModule.cs | 16 +- .../Avatar/Friends/FriendsRequestHandler.cs | 2 +- .../CoreModules/Avatar/Friends/HGFriendsModule.cs | 14 +- .../CoreModules/Avatar/Friends/HGStatusNotifier.cs | 2 +- .../Avatar/Friends/Tests/FriendModuleTests.cs | 2 +- .../CoreModules/Avatar/Gestures/GesturesModule.cs | 14 +- .../Region/CoreModules/Avatar/Gods/GodsModule.cs | 10 +- .../CoreModules/Avatar/Groups/GroupsModule.cs | 2 +- .../InstantMessage/HGMessageTransferModule.cs | 6 +- .../Avatar/InstantMessage/InstantMessageModule.cs | 4 +- .../Avatar/InstantMessage/MessageTransferModule.cs | 6 +- .../Avatar/InstantMessage/MuteListModule.cs | 4 +- .../Avatar/InstantMessage/OfflineMessageModule.cs | 2 +- .../Archiver/InventoryArchiveReadRequest.cs | 160 +++++++++--------- .../Inventory/Archiver/InventoryArchiveUtils.cs | 38 ++--- .../Inventory/Archiver/InventoryArchiverModule.cs | 2 +- .../Tests/InventoryArchiveLoadPathTests.cs | 114 ++++++------- .../Archiver/Tests/InventoryArchiveLoadTests.cs | 84 +++++----- .../Archiver/Tests/InventoryArchiveSaveTests.cs | 60 +++---- .../Archiver/Tests/InventoryArchiveTestCase.cs | 74 ++++----- .../Inventory/Transfer/InventoryTransferModule.cs | 44 ++--- .../Transfer/Tests/InventoryTransferModuleTests.cs | 178 ++++++++++----------- .../Region/CoreModules/Avatar/Lure/HGLureModule.cs | 6 +- .../Avatar/Profile/BasicProfileModule.cs | 2 +- .../Avatar/UserProfiles/UserProfileModule.cs | 60 +++---- 33 files changed, 576 insertions(+), 576 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index d5c81ce..f4a8a6b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -61,7 +61,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments /// A value of 0 will apply no pause. The pause is specified in milliseconds. /// public int ThrottlePer100PrimsRezzed { get; set; } - + private Scene m_scene; private IInventoryAccessModule m_invAccessModule; @@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments /// Are attachments enabled? /// public bool Enabled { get; private set; } - + public string Name { get { return "Attachments Module"; } } public Type ReplaceableInterface { get { return null; } } @@ -87,14 +87,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments Enabled = true; } } - + public void AddRegion(Scene scene) { m_scene = scene; if (Enabled) { // Only register module with scene if it is enabled. All callers check for a null attachments module. - // Ideally, there should be a null attachments module for when this core attachments module has been + // Ideally, there should be a null attachments module for when this core attachments module has been // disabled. Registering only when enabled allows for other attachments module implementations. m_scene.RegisterModuleInterface(this); m_scene.EventManager.OnNewClient += SubscribeToClientEvents; @@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments private void HandleScriptStateChange(uint localID, bool started) { SceneObjectGroup sog = m_scene.GetGroupByPrim(localID); - if (sog != null && sog.IsAttachment) + if (sog != null && sog.IsAttachment) { if (!started) { @@ -198,21 +198,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } } } - - public void RemoveRegion(Scene scene) + + public void RemoveRegion(Scene scene) { m_scene.UnregisterModuleInterface(this); if (Enabled) m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; } - + public void RegionLoaded(Scene scene) { m_invAccessModule = m_scene.RequestModuleInterface(); } - - public void Close() + + public void Close() { RemoveRegion(m_scene); } @@ -270,7 +270,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); // m_log.DebugFormat( -// "[ATTACHMENTS MODULE]: Copying script state with {0} bytes for object {1} for {2} in {3}", +// "[ATTACHMENTS MODULE]: Copying script state with {0} bytes for object {1} for {2} in {3}", // ad.AttachmentObjectStates[i].Length, so.Name, sp.Name, m_scene.Name); so.SetState(ad.AttachmentObjectStates[i++], m_scene); @@ -295,7 +295,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments { if (DebugLevel > 0) m_log.DebugFormat( - "[ATTACHMENTS MODULE]: Not doing simulator-side attachment rez for {0} in {1} as their viewer has already rezzed attachments", + "[ATTACHMENTS MODULE]: Not doing simulator-side attachment rez for {0} in {1} as their viewer has already rezzed attachments", m_scene.Name, sp.Name); return; @@ -357,7 +357,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down // But they're not used anyway, the item is being looked up for now, so let's proceed. - //if (UUID.Zero == assetID) + //if (UUID.Zero == assetID) //{ // m_log.DebugFormat("[ATTACHMENT]: Cannot rez attachment in point {0} with itemID {1}", p, itemID); // continue; @@ -434,7 +434,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments UpdateDetachedObject(sp, so, String.Empty); sp.ClearAttachments(); } - } + } } public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent) @@ -445,7 +445,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (DebugLevel > 0) m_log.DebugFormat( "[ATTACHMENTS MODULE]: Deleting attachments from scene {0} for {1}, silent = {2}", - m_scene.RegionInfo.RegionName, sp.Name, silent); + m_scene.RegionInfo.RegionName, sp.Name, silent); foreach (SceneObjectGroup sop in sp.GetAttachments()) { @@ -454,7 +454,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments sp.ClearAttachments(); } - + public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, bool addToInventory, bool append) { @@ -505,7 +505,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should // be removed when that functionality is implemented in opensim attachmentPt &= 0x7f; - + // If the attachment point isn't the same as the one previously used // set it's offset position = 0 so that it appears on the attachment point // and not in a weird location somewhere unknown. @@ -583,7 +583,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (addToInventory && sp.PresenceType != PresenceType.Npc) UpdateUserInventoryWithAttachment(sp, group, attachmentPt, append); - + AttachToAgent(sp, group, attachmentPt, attachPos, silent); if (resumeScripts) @@ -616,11 +616,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt) - { - return RezSingleAttachmentFromInventory(sp, itemID, AttachmentPt, null); - } + { + return RezSingleAttachmentFromInventory(sp, itemID, AttachmentPt, null); + } - public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt, XmlDocument doc) + public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt, XmlDocument doc) { if (!Enabled) return null; @@ -631,8 +631,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments (AttachmentPoint)AttachmentPt, itemID, sp.Name, m_scene.Name); // We check the attachments in the avatar appearance here rather than the objects attached to the - // ScenePresence itself so that we can ignore calls by viewer 2/3 to attach objects on startup. We are - // already doing this in ScenePresence.MakeRootAgent(). Simulator-side attaching needs to be done + // ScenePresence itself so that we can ignore calls by viewer 2/3 to attach objects on startup. We are + // already doing this in ScenePresence.MakeRootAgent(). Simulator-side attaching needs to be done // because pre-outfit folder viewers (most version 1 viewers) require it. bool alreadyOn = false; List existingAttachments = sp.Appearance.GetAttachments(); @@ -668,7 +668,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (DebugLevel > 0) m_log.DebugFormat( - "[ATTACHMENTS MODULE]: Rezzing {0} attachments from inventory for {1} in {2}", + "[ATTACHMENTS MODULE]: Rezzing {0} attachments from inventory for {1} in {2}", rezlist.Count, sp.Name, m_scene.Name); foreach (KeyValuePair rez in rezlist) @@ -727,7 +727,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID); so.RootPart.Shape.LastAttachPoint = (byte)so.AttachmentPoint; - + sp.RemoveAttachment(so); so.FromItemID = UUID.Zero; @@ -744,7 +744,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } rootPart.RemFlag(PrimFlags.TemporaryOnRez); - + so.ApplyPhysics(); rootPart.Rezzed = DateTime.Now; @@ -804,7 +804,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (DebugLevel > 0) m_log.DebugFormat( - "[ATTACHMENTS MODULE]: Detaching object {0} {1} (FromItemID {2}) for {3} in {4}", + "[ATTACHMENTS MODULE]: Detaching object {0} {1} (FromItemID {2}) for {3} in {4}", so.Name, so.LocalId, so.FromItemID, sp.Name, m_scene.Name); // Scripts MUST be snapshotted before the object is @@ -827,14 +827,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments UpdateDetachedObject(sp, so, scriptedState); } } - + public void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos) { if (!Enabled) return; sog.UpdateGroupPosition(pos); - sog.HasGroupChanged = true; + sog.HasGroupChanged = true; } #endregion @@ -843,7 +843,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // This is public but is not part of the IAttachmentsModule interface. // RegionCombiner module needs to poke at it to deliver client events. - // This breaks the encapsulation of the module and should get fixed somehow. + // This breaks the encapsulation of the module and should get fixed somehow. public void SubscribeToClientEvents(IClientAPI client) { client.OnRezSingleAttachmentFromInv += Client_OnRezSingleAttachmentFromInv; @@ -856,7 +856,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // This is public but is not part of the IAttachmentsModule interface. // RegionCombiner module needs to poke at it to deliver client events. - // This breaks the encapsulation of the module and should get fixed somehow. + // This breaks the encapsulation of the module and should get fixed somehow. public void UnsubscribeFromClientEvents(IClientAPI client) { client.OnRezSingleAttachmentFromInv -= Client_OnRezSingleAttachmentFromInv; @@ -936,7 +936,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments /// Attach this scene object to the given avatar. /// /// - /// This isn't publicly available since attachments should always perform the corresponding inventory + /// This isn't publicly available since attachments should always perform the corresponding inventory /// operation (to show the attach in user inventory and update the asset with positional information). /// /// @@ -997,7 +997,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // Fudge below is an extremely unhelpful comment. It's probably here so that the scheduled full update // will succeed, as that will not update if an attachment is selected. - so.IsSelected = false; // fudge.... + so.IsSelected = false; // fudge.... so.ScheduleGroupForFullUpdate(); } @@ -1041,7 +1041,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments /// /// /// This involves triggering the detach event and getting the script state (which also stops the script) - /// This MUST be done outside sp.AttachmentsSyncLock, since otherwise there is a chance of deadlock if a + /// This MUST be done outside sp.AttachmentsSyncLock, since otherwise there is a chance of deadlock if a /// running script is performing attachment operations. /// /// @@ -1088,7 +1088,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // Remove the object from the scene so no more updates // are sent. Doing this before the below changes will ensure // updates can't cause "HUD artefacts" - + m_scene.DeleteSceneObject(so, false, false); // Prepare sog for storage @@ -1125,7 +1125,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments itemID, rezGroupID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, false, false, sp.UUID, true); else - objatt = m_invAccessModule.RezObject(sp.ControllingClient, + objatt = m_invAccessModule.RezObject(sp.ControllingClient, null, rezGroupID, assetID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, false, false, sp.UUID, true); @@ -1139,7 +1139,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } else if (itemID == UUID.Zero) { - // We need to have a FromItemID for multiple attachments on a single attach point to appear. This is + // We need to have a FromItemID for multiple attachments on a single attach point to appear. This is // true on Singularity 1.8.5 and quite possibly other viewers as well. As NPCs don't have an inventory // we will satisfy this requirement by inserting a random UUID. objatt.FromItemID = UUID.Random(); @@ -1185,7 +1185,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } if (tainted) - objatt.HasGroupChanged = true; + objatt.HasGroupChanged = true; if (ThrottlePer100PrimsRezzed > 0) { diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 16f1952..941853c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs @@ -485,7 +485,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests // Test wearing a second attachment at the same position // Until multiple attachments at one point is implemented, this will remove the first attachment - // This test relies on both attachments having the same default attachment point (in this case LeftHand + // This test relies on both attachments having the same default attachment point (in this case LeftHand // since none other has been set). { scene.AttachmentsModule.RezSingleAttachmentFromInventory(sp, attItem2.ID, (uint)AttachmentPoint.Default); @@ -975,8 +975,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests // Both these operations will occur on different threads and will wait for each other. // We have to do this via ThreadPool directly since FireAndForget has been switched to sync for the V1 // test protocol, where we are trying to avoid unpredictable async operations in regression tests. - tc.OnTestClientSendRegionTeleport - += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) + tc.OnTestClientSendRegionTeleport + += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) => ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null); m_numberOfAttachEventsFired = 0; diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 67256ee..0826a08 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory m_savetime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime))); m_sendtime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime))); m_reusetextures = appearanceConfig.GetBoolean("ReuseTextures",m_reusetextures); - + // m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime); } @@ -166,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory } /// - /// Set appearance data (texture asset IDs and slider settings) + /// Set appearance data (texture asset IDs and slider settings) /// /// /// @@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { changed = sp.Appearance.SetVisualParams(visualParams); } - + // Process the baked texture array if (textureEntry != null) { @@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory WearableCacheItem[] items = sp.Appearance.WearableCacheItems; //foreach (WearableCacheItem item in items) //{ - + //} return items; } @@ -468,7 +468,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory } sp.Appearance.WearableCacheItems = wearableCache; - + if (missing.Count > 0) { foreach (UUID id in missing) @@ -493,7 +493,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++) { int j = AvatarAppearance.BAKE_INDICES[iter]; - m_log.Debug("[UpdateBCache] {" + iter + "/" + + m_log.Debug("[UpdateBCache] {" + iter + "/" + sp.Appearance.WearableCacheItems[j].TextureIndex + "}: c-" + sp.Appearance.WearableCacheItems[j].CacheId + ", t-" + sp.Appearance.WearableCacheItems[j].TextureID); @@ -588,7 +588,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory wearableCacheValid = false; } } - + wearableCacheValid = (wearableCacheValid && (hits >= AvatarAppearance.BAKE_INDICES.Length - 1)); if (wearableCacheValid) m_log.Debug("[ValidateBakedCache] have valid local cache"); @@ -601,7 +601,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory if (!wearableCacheValid) { hits = 0; - // only use external bake module on login condition check + // only use external bake module on login condition check // ScenePresence ssp = null; // if (sp is ScenePresence) { @@ -816,7 +816,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory foreach (KeyValuePair kvp in saves) { // We have to load the key and value into local parameters to avoid a race condition if we loop - // around and load kvp with a different value before FireAndForget has launched its thread. + // around and load kvp with a different value before FireAndForget has launched its thread. UUID avatarID = kvp.Key; long sendTime = kvp.Value; @@ -869,13 +869,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory m_scene.AvatarService.SetAppearance(agentid, sp.Appearance); - // Trigger this here because it's the final step in the set/queue/save process for appearance setting. + // Trigger this here because it's the final step in the set/queue/save process for appearance setting. // Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes). m_scene.EventManager.TriggerAvatarAppearanceChanged(sp); } /// - /// For a given set of appearance items, check whether the items are valid and add their asset IDs to + /// For a given set of appearance items, check whether the items are valid and add their asset IDs to /// appearance data. /// /// @@ -893,7 +893,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory if (appearance.Wearables[i][j].ItemID == UUID.Zero) { m_log.WarnFormat( - "[AVFACTORY]: Wearable item {0}:{1} for user {2} unexpectedly UUID.Zero. Ignoring.", + "[AVFACTORY]: Wearable item {0}:{1} for user {2} unexpectedly UUID.Zero. Ignoring.", i, j, userID); continue; @@ -967,7 +967,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // case WearableType.Skin: // //case WearableType.Underpants: // TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); -// +// // m_log.WarnFormat("[AVFACTORY]: {0} Default Wearables, passing existing values.", (WearableType)i); // resetwearable = true; // break; @@ -975,7 +975,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // } // continue; // } -// +// // InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID); // baseItem = invService.GetItem(baseItem); // @@ -1002,7 +1002,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // // TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); // resetwearable = true; -// +// // } // } // } @@ -1011,7 +1011,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // if (appearance.Wearables[(int) WearableType.Eyes] == null) // { // m_log.WarnFormat("[AVFACTORY]: {0} Eyes are Null, passing existing values.", (WearableType.Eyes)); -// +// // TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance); // resetwearable = true; // } @@ -1213,7 +1213,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory m_log.WarnFormat("[AVFACTORY]: Client_OnRequestWearables unable to find presence for {0}", client.AgentId); }, null, "AvatarFactoryModule.OnClientRequestWearables"); } - + /// /// Set appearance data (texture asset IDs and slider settings) received from a client /// @@ -1299,12 +1299,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { UUID texture = UUID.Zero; int index = request.BakedTextureIndex; - + if (m_reusetextures) { // this is the most insanely dumb way to do this... however it seems to // actually work. if the appearance has been reset because wearables have - // changed then the texture entries are zero'd out until the bakes are + // changed then the texture entries are zero'd out until the bakes are // uploaded. on login, if the textures exist in the cache (eg if you logged // into the simulator recently, then the appearance will pull those and send // them back in the packet and you won't have to rebake. if the textures aren't @@ -1320,7 +1320,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // m_log.WarnFormat("[AVFACTORY]: reuse texture {0} for index {1}",texture,index); } - + CachedTextureResponseArg response = new CachedTextureResponseArg(); response.BakedTextureIndex = index; response.BakedTextureID = texture; @@ -1328,7 +1328,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory cachedTextureResponse.Add(response); } - + // m_log.WarnFormat("[AVFACTORY]: serial is {0}",serial); // The serial number appears to be used to match requests and responses // in the texture transaction. We just send back the serial number diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs index dd93449..33489d1 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly // to the AssetService, which will then store temporary and local assets permanently CoreAssetCache assetCache = new CoreAssetCache(); - + AvatarFactoryModule afm = new AvatarFactoryModule(); TestScene scene = new SceneHelpers(assetCache).SetupScene(); SceneHelpers.SetupSceneModules(scene, afm); @@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // TODO: Use the actual BunchOfCaps functionality once we slot in the CapabilitiesModules AssetBase bakedTextureAsset; - bakedTextureAsset + bakedTextureAsset = new AssetBase( bakedTextureID, "Test Baked Texture", (sbyte)AssetType.Texture, userId.ToString()); bakedTextureAsset.Data = new byte[] { 2 }; // Not necessary to have a genuine JPEG2000 asset here yet @@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // This is the alpha texture eyesFace.TextureID = bakedTextureID; afm.SetAppearance(sp, bakedTextureEntry, visualParams, null); - + Assert.That(rebakeRequestsReceived, Is.EqualTo(0)); AssetBase eyesBake = scene.AssetService.Get(bakedTextureID.ToString()); @@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory /// Test appearance setting where the baked texture UUID are library alpha textures. /// /// - /// For a mesh avatar, it appears these 'baked textures' are used. So these should not trigger a request to + /// For a mesh avatar, it appears these 'baked textures' are used. So these should not trigger a request to /// rebake. /// [Test] @@ -113,14 +113,14 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly // to the AssetService, which will then store temporary and local assets permanently CoreAssetCache assetCache = new CoreAssetCache(); - + AvatarFactoryModule afm = new AvatarFactoryModule(); TestScene scene = new SceneHelpers(assetCache).SetupScene(); SceneHelpers.SetupSceneModules(scene, afm); ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId); AssetBase libraryAsset; - libraryAsset + libraryAsset = new AssetBase( alphaTextureID, "Default Alpha Layer Texture", (sbyte)AssetType.Texture, userId.ToString()); libraryAsset.Data = new byte[] { 2 }; // Not necessary to have a genuine JPEG2000 asset here yet @@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // This is the alpha texture eyesFace.TextureID = alphaTextureID; afm.SetAppearance(sp, bakedTextureEntry, visualParams, null); - + Assert.That(rebakeRequestsReceived, Is.EqualTo(0)); } @@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly // to the AssetService, which will then store temporary and local assets permanently CoreAssetCache assetCache = new CoreAssetCache(); - + AvatarFactoryModule afm = new AvatarFactoryModule(); TestScene scene = new SceneHelpers(assetCache).SetupScene(); SceneHelpers.SetupSceneModules(scene, afm); diff --git a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs index 6d97251..27e84b0 100644 --- a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs @@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures private UTF8Encoding enc = new UTF8Encoding(); private string m_URL = String.Empty; private static XmlSerializer m_serializer = new XmlSerializer(typeof(AssetBase)); - private static bool m_enabled = false; + private static bool m_enabled = false; private static IServiceAuth m_Auth; @@ -64,18 +64,18 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures return; m_URL = config.GetString("URL", String.Empty); - if (m_URL == String.Empty) - return; + if (m_URL == String.Empty) + return; - m_enabled = true; + m_enabled = true; m_Auth = ServiceAuth.Create(configSource, "XBakes"); } public void AddRegion(Scene scene) { - if (!m_enabled) - return; + if (!m_enabled) + return; // m_log.InfoFormat("[XBakes]: Enabled for region {0}", scene.RegionInfo.RegionName); m_Scene = scene; @@ -177,7 +177,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures int numberWears = 0; MemoryStream reqStream; - + using (MemoryStream bakeStream = new MemoryStream()) using (XmlTextWriter bakeWriter = new XmlTextWriter(bakeStream, null)) { diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 5164289..53800bb 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs @@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat m_enabled = false; return; } - + m_whisperdistance = m_config.GetInt("whisper_distance", m_whisperdistance); m_saydistance = m_config.GetInt("say_distance", m_saydistance); m_shoutdistance = m_config.GetInt("shout_distance", m_shoutdistance); @@ -123,7 +123,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat } } } - + public virtual void Close() { } @@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat { } - public virtual Type ReplaceableInterface + public virtual Type ReplaceableInterface { get { return null; } } @@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat return; } - switch (sourceType) + switch (sourceType) { case ChatSourceType.Agent: ScenePresence avatar = (scene as Scene).GetScenePresence(c.Sender.AgentId); @@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat } destination = UUID.Zero; // Avatars cant "SayTo" ownerID = c.Sender.AgentId; - + hidePos = fromPos; break; @@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat message = message.Substring(0, 1000); // m_log.DebugFormat( -// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}", +// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}", // fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType); HashSet receiverIDs = new HashSet(); @@ -317,13 +317,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat } } }); - + scene.EventManager.TriggerOnChatToClients( fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully); } static protected Vector3 CenterOfRegion = new Vector3(128, 128, 30); - + public virtual void OnChatBroadcast(Object sender, OSChatMessage c) { if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return; @@ -341,7 +341,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat // broadcast chat works by redistributing every incoming chat // message to each avatar in the scene. string fromName = c.From; - + UUID fromID = UUID.Zero; UUID ownerID = UUID.Zero; ChatSourceType sourceType = ChatSourceType.Object; @@ -353,15 +353,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat ownerID = c.Sender.AgentId; sourceType = ChatSourceType.Agent; } - else if (c.SenderUUID != UUID.Zero) + else if (c.SenderUUID != UUID.Zero) { fromID = c.SenderUUID; ownerID = ((SceneObjectPart)c.SenderObject).OwnerID; } - + // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); HashSet receiverIDs = new HashSet(); - + if (c.Scene != null) { ((Scene)c.Scene).ForEachRootClient @@ -374,7 +374,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat (null != c.SenderObject) && (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) return; - + client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID, (byte)sourceType, (byte)ChatAudibleLevel.Fully); receiverIDs.Add(client.AgentId); @@ -400,7 +400,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat /// /// /// - /// true if the message was sent to the receiver, false if it was not sent due to failing a + /// true if the message was sent to the receiver, false if it was not sent due to failing a /// precondition protected virtual bool TrySendChatMessage( ScenePresence presence, Vector3 fromPos, Vector3 regionPos, @@ -430,7 +430,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat presence.ControllingClient.SendChatMessage( message, (byte) type, fromPos, fromName, fromAgentID, ownerID, (byte)src, (byte)ChatAudibleLevel.Fully); - + return true; } diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs index a720ad9..5457dc3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests { [TestFixture] public class ChatModuleTests : OpenSimTestCase - { + { [TestFixtureSetUp] public void FixtureInit() { @@ -66,14 +66,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests } private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB) - { - // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the + { + // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the // CapabilitiesModule complain when it can't set up HTTP endpoints. BaseHttpServer httpServer = new BaseHttpServer(99999); MainServer.AddHttpServer(httpServer); MainServer.Instance = httpServer; - // We need entity transfer modules so that when sp2 logs into the east region, the region calls + // We need entity transfer modules so that when sp2 logs into the east region, the region calls // EntityTransferModuleto set up a child agent on the west region. // XXX: However, this is not an entity transfer so is misleading. EntityTransferModule etmA = new EntityTransferModule(); @@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests modulesConfig.Set("SimulationServices", lscm.Name); SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); - SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule()); + SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule()); SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule()); } @@ -111,8 +111,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests Vector3 sp2Position = new Vector3(250, 128, 20); SceneHelpers sh = new SceneHelpers(); - TestScene sceneWest = sh.SetupScene("sceneWest", TestHelpers.ParseTail(0x1), 1000, 1000); - TestScene sceneEast = sh.SetupScene("sceneEast", TestHelpers.ParseTail(0x2), 1001, 1000); + TestScene sceneWest = sh.SetupScene("sceneWest", TestHelpers.ParseTail(0x1), 1000, 1000); + TestScene sceneEast = sh.SetupScene("sceneEast", TestHelpers.ParseTail(0x2), 1001, 1000); SetupNeighbourRegions(sceneWest, sceneEast); @@ -124,12 +124,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // physics is irrelevant to this test. sp1.Flying = true; - // When sp1 logs in to sceneEast, it sets up a child agent in sceneWest and informs the sp2 client to + // When sp1 logs in to sceneEast, it sets up a child agent in sceneWest and informs the sp2 client to // make the connection. For this test, will simplify this chain by making the connection directly. ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneWest, sp1Uuid); TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; - sp1.AbsolutePosition = sp1Position; + sp1.AbsolutePosition = sp1Position; ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneWest, sp2Uuid); TestClient sp2Client = (TestClient)sp2.ControllingClient; @@ -138,7 +138,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneEast, sp2Uuid); TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; - sp2.AbsolutePosition = sp2Position; + sp2.AbsolutePosition = sp2Position; // We must update the scenes in order to make the root new root agents trigger position updates in their // children. @@ -147,19 +147,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // Check child positions are correct. Assert.AreEqual( - new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), + new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), sp1ChildClient.SceneAgent.AbsolutePosition); Assert.AreEqual( - new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z), + new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z), sp2ChildClient.SceneAgent.AbsolutePosition); string receivedSp1ChatMessage = ""; string receivedSp2ChatMessage = ""; - sp1ChildClient.OnReceivedChatMessage + sp1ChildClient.OnReceivedChatMessage += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; - sp2ChildClient.OnReceivedChatMessage + sp2ChildClient.OnReceivedChatMessage += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); @@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // Check child position is correct. Assert.AreEqual( - new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), + new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), sp1ChildClient.SceneAgent.AbsolutePosition); TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); @@ -202,8 +202,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests Vector3 sp2Position = new Vector3(128, 6, 20); SceneHelpers sh = new SceneHelpers(); - TestScene sceneNorth = sh.SetupScene("sceneNorth", TestHelpers.ParseTail(0x1), 1000, 1000); - TestScene sceneSouth = sh.SetupScene("sceneSouth", TestHelpers.ParseTail(0x2), 1000, 1001); + TestScene sceneNorth = sh.SetupScene("sceneNorth", TestHelpers.ParseTail(0x1), 1000, 1000); + TestScene sceneSouth = sh.SetupScene("sceneSouth", TestHelpers.ParseTail(0x2), 1000, 1001); SetupNeighbourRegions(sceneNorth, sceneSouth); @@ -215,12 +215,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // physics is irrelevant to this test. sp1.Flying = true; - // When sp1 logs in to sceneEast, it sets up a child agent in sceneNorth and informs the sp2 client to + // When sp1 logs in to sceneEast, it sets up a child agent in sceneNorth and informs the sp2 client to // make the connection. For this test, will simplify this chain by making the connection directly. ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneSouth, sp1Uuid); TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; - sp1.AbsolutePosition = sp1Position; + sp1.AbsolutePosition = sp1Position; ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneSouth, sp2Uuid); TestClient sp2Client = (TestClient)sp2.ControllingClient; @@ -229,7 +229,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneNorth, sp2Uuid); TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; - sp2.AbsolutePosition = sp2Position; + sp2.AbsolutePosition = sp2Position; // We must update the scenes in order to make the root new root agents trigger position updates in their // children. @@ -238,19 +238,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // Check child positions are correct. Assert.AreEqual( - new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), + new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), sp1ChildClient.SceneAgent.AbsolutePosition); Assert.AreEqual( - new Vector3(sp2Position.X, sp2Position.Y + sceneSouth.RegionInfo.RegionSizeY, sp2Position.Z), + new Vector3(sp2Position.X, sp2Position.Y + sceneSouth.RegionInfo.RegionSizeY, sp2Position.Z), sp2ChildClient.SceneAgent.AbsolutePosition); string receivedSp1ChatMessage = ""; string receivedSp2ChatMessage = ""; - sp1ChildClient.OnReceivedChatMessage + sp1ChildClient.OnReceivedChatMessage += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; - sp2ChildClient.OnReceivedChatMessage + sp2ChildClient.OnReceivedChatMessage += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); @@ -266,13 +266,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests // Check child position is correct. Assert.AreEqual( - new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), + new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), sp1ChildClient.SceneAgent.AbsolutePosition); TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); TestUserOutOfRange(sp2Client, "lentils", ref receivedSp1ChatMessage); } - + private void TestUserInRange(TestClient speakClient, string testMessage, ref string receivedMessage) { receivedMessage = ""; diff --git a/OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs b/OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs index 764adf9..cf65c47 100644 --- a/OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs @@ -62,19 +62,19 @@ namespace OpenSim.Region.CoreModules.Avatars.Commands private Dictionary m_scenes = new Dictionary(); public string Name { get { return "User Commands Module"; } } - + public Type ReplaceableInterface { get { return null; } } - + public void Initialise(IConfigSource source) { // m_log.DebugFormat("[USER COMMANDS MODULE]: INITIALIZED MODULE"); } - + public void PostInitialise() { // m_log.DebugFormat("[USER COMMANDS MODULE]: POST INITIALIZED MODULE"); } - + public void Close() { // m_log.DebugFormat("[USER COMMANDS MODULE]: CLOSED MODULE"); diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index aaa331b..7980de3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends m_Enabled = true; m_log.DebugFormat("[FRIENDS MODULE]: {0} enabled.", Name); } - } + } } protected virtual void InitModule(IConfigSource config) @@ -570,7 +570,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends protected virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im) { if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered) - { + { // we got a friendship offer UUID principalID = new UUID(im.fromAgentID); UUID friendID = new UUID(im.toAgentID); @@ -605,7 +605,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends im.imSessionID = im.fromAgentID; im.fromAgentName = GetFriendshipRequesterName(agentID); - // Try the local sim + // Try the local sim if (LocalFriendshipOffered(friendID, im)) return true; @@ -648,7 +648,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends ccm.CreateCallingCard(client.AgentId, friendID, UUID.Zero); } - // Update the local cache. + // Update the local cache. RecacheFriends(client); // @@ -704,7 +704,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends } } } - + public void RemoveFriendship(IClientAPI client, UUID exfriendID) { if (!DeleteFriendship(client.AgentId, exfriendID)) @@ -732,7 +732,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); m_FriendsSimConnector.FriendshipTerminated(region, client.AgentId, exfriendID); } - } + } } public void FindFriend(IClientAPI remoteClient,UUID HunterID ,UUID PreyID) @@ -740,7 +740,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends UUID requester = remoteClient.AgentId; if(requester != HunterID) // only allow client agent to be the hunter (?) return; - + FriendInfo[] friends = GetFriendsFromCache(requester); if (friends.Length == 0) return; @@ -773,7 +773,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends } PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { PreyID.ToString() }); - + if (friendSessions == null || friendSessions.Length == 0) return; diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs index c421740..81aa882 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs @@ -127,7 +127,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends UserAccount account = m_FriendsModule.UserAccountService.GetUserAccount(UUID.Zero, fromID); string name = (account == null) ? "Unknown" : account.FirstName + " " + account.LastName; - GridInstantMessage im = new GridInstantMessage(m_FriendsModule.Scene, fromID, name, toID, + GridInstantMessage im = new GridInstantMessage(m_FriendsModule.Scene, fromID, name, toID, (byte)InstantMessageDialog.FriendshipOffered, message, false, Vector3.Zero); // !! HACK diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index 9954749..ac05a6e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs @@ -539,8 +539,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // m_log.DebugFormat("[HGFRIENDS MODULE] HG Friendship! thisUUI={0}; friendUUI={1}; foreignThisFriendService={2}; foreignFriendFriendService={3}", // agentUUI, friendUUI, agentFriendService, friendFriendService); - } - + } + // Delete any previous friendship relations DeletePreviousRelations(agentID, friendID); @@ -641,11 +641,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends FriendsService.Delete(a1, f.Friend); // and also the converse FriendsService.Delete(f.Friend, a1.ToString()); - } + } } } } - + finfos = GetFriendsFromCache(a1); if (finfos != null) { @@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends FriendsService.Delete(a2, f.Friend); // and also the converse FriendsService.Delete(f.Friend, a2.ToString()); - } + } } } } @@ -783,7 +783,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends m_log.DebugFormat("[HGFRIENDS MODULE]: Forwading friendship from {0} to {1} @ {2}", agentID, friendID, friendsURL); GridRegion region = new GridRegion(); region.ServerURI = friendsURL; - + string name = im.fromAgentName; if (m_uMan.IsLocalGridUser(agentID)) { @@ -815,7 +815,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends } m_HGFriendsConnector.FriendshipOffered(region, agentID, friendID, im.message, name); - + return true; } } diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs index 1fa4dd6..3fae271 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs @@ -32,7 +32,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends { if (kvp.Key != "local") { - // For the others, call the user agent service + // For the others, call the user agent service List ids = new List(); foreach (FriendInfo f in kvp.Value) ids.Add(f.Friend); diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs index e6fd54e..3d9bd35 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs @@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends.Tests // so that different services and simulator can share the data in standalone mode. This is pretty horrible // effectively the statics are global variables. NullFriendsData.Clear(); - + IConfigSource config = new IniConfigSource(); config.AddConfig("Modules"); // Not strictly necessary since FriendsModule assumes it is the default (!) diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index 4efcd3b..03e2c5a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs @@ -42,11 +42,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures { [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GesturesModule")] public class GesturesModule : INonSharedRegionModule - { + { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + protected Scene m_scene; - + public void Initialise(IConfigSource source) { } @@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures m_scene.EventManager.OnNewClient -= OnNewClient; m_scene = null; } - + public void Close() {} public string Name { get { return "Gestures Module"; } } @@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures client.OnActivateGesture += ActivateGesture; client.OnDeactivateGesture += DeactivateGesture; } - + public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId) { IInventoryService invService = m_scene.InventoryService; @@ -92,7 +92,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures item.Flags |= 1; invService.UpdateItem(item); } - else + else m_log.WarnFormat( "[GESTURES]: Unable to find gesture {0} to activate for {1}", gestureId, client.Name); } @@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures item.Flags &= ~(uint)1; invService.UpdateItem(item); } - else + else m_log.ErrorFormat( "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); } diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index db02379..8d3c10d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs @@ -112,19 +112,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods client.OnGodKickUser += KickUser; client.OnRequestGodlikePowers += RequestGodlikePowers; } - + public void UnsubscribeFromClientEvents(IClientAPI client) { client.OnGodKickUser -= KickUser; client.OnRequestGodlikePowers -= RequestGodlikePowers; } - + private void OnRegisterCaps(UUID agentID, Caps caps) { string uri = "/CAPS/" + UUID.Random(); caps.RegisterHandler( - "UntrustedSimulatorMessage", + "UntrustedSimulatorMessage", new RestStreamHandler("POST", uri, HandleUntrustedSimulatorMessage, "UntrustedSimulatorMessage", null)); } @@ -176,7 +176,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods if (godLike && sp.GodLevel < 200 && DialogModule != null) DialogModule.SendAlertToUser(agentID, "Request for god powers denied"); } - + /// /// Kicks or freezes User specified from the simulator. This logs them off of the grid /// @@ -261,7 +261,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods if(sp.IsDeleted || sp.IsChildAgent) return; sp.ControllingClient.Kick(reason); - sp.Scene.CloseAgent(sp.UUID, true); + sp.Scene.CloseAgent(sp.UUID, true); } private void OnIncomingInstantMessage(GridInstantMessage msg) diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs index 543410e..7f91a61 100644 --- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs @@ -145,7 +145,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups return; // m_log.Debug("[GROUPS]: Shutting down group module."); - + lock (m_ClientMap) { m_ClientMap.Clear(); diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs index 63b3dba..16e2ec3 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs @@ -144,11 +144,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage foreach (Scene scene in m_Scenes) { // m_log.DebugFormat( -// "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}", +// "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}", // toAgentID.ToString(), scene.RegionInfo.RegionName); - ScenePresence sp = scene.GetScenePresence(toAgentID); + ScenePresence sp = scene.GetScenePresence(toAgentID); if (sp != null && !sp.IsChildAgent && !sp.IsDeleted) - { + { // Local message // m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); sp.ControllingClient.SendInstantMessage(im); diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index 7d54a00..71c0a8a 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage /// Is this module enabled? /// protected bool m_enabled = false; - + protected readonly List m_scenes = new List(); #region Region Module interface @@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage "InstantMessageModule") return; } - + m_enabled = true; } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 6b120fb..efb9421 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs @@ -207,10 +207,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage protected virtual XmlRpcResponse processXMLRPCGridInstantMessage(XmlRpcRequest request, IPEndPoint remoteClient) { bool successful = false; - + // TODO: For now, as IMs seem to be a bit unreliable on OSGrid, catch all exception that // happen here and aren't caught and log them. - try + try { // various rational defaults UUID fromAgentID = UUID.Zero; @@ -475,7 +475,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage /// /// - /// Pass in 0 the first time this method is called. It will be called recursively with the last + /// Pass in 0 the first time this method is called. It will be called recursively with the last /// regionhandle tried /// private void SendGridInstantMessageViaXMLRPCAsyncMain(GridInstantMessage im, MessageResultNotification result) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs index 315d372..2d57193 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs @@ -118,11 +118,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { get { return null; } } - + public void Close() { } - + private void OnNewClient(IClientAPI client) { client.OnMuteListRequest += OnMuteListRequest; diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 369d480..d1f6054 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { get { return null; } } - + public void Close() { } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 4a06fd1..3838316 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// bumps here should be compatible. /// public static int MAX_MAJOR_VERSION = 1; - + protected TarArchiveReader archive; private UserAccount m_userInfo; @@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// ID of this request /// protected UUID m_id; - + /// /// Do we want to merge this load with existing inventory? /// @@ -82,41 +82,41 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// The stream from which the inventory archive will be loaded. /// private Stream m_loadStream; - + /// /// Has the control file been loaded for this archive? /// public bool ControlFileLoaded { get; private set; } - + /// /// Do we want to enforce the check. IAR versions before 0.2 and 1.1 do not guarantee this order, so we can't /// enforce. /// public bool EnforceControlFileCheck { get; private set; } - + protected bool m_assetsLoaded; protected bool m_inventoryNodesLoaded; - + protected int m_successfulAssetRestores; protected int m_failedAssetRestores; - protected int m_successfulItemRestores; - + protected int m_successfulItemRestores; + /// /// Root destination folder for the IAR load. /// protected InventoryFolderBase m_rootDestinationFolder; - + /// /// Inventory nodes loaded from the iar. /// - protected HashSet m_loadedNodes = new HashSet(); - + protected HashSet m_loadedNodes = new HashSet(); + /// /// In order to load identically named folders, we need to keep track of the folders that we have already /// resolved. /// - Dictionary m_resolvedFolders = new Dictionary(); - + Dictionary m_resolvedFolders = new Dictionary(); + /// /// Record the creator id that should be associated with an asset. This is used to adjust asset creator ids /// after OSP resolution (since OSP creators are only stored in the item @@ -163,9 +163,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver m_invPath = invPath; m_loadStream = loadStream; m_module = module; - + // FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things - // (I thought they weren't). We will need to bump the version number and perform this check on all + // (I thought they weren't). We will need to bump the version number and perform this check on all // subsequent IAR versions only ControlFileLoaded = true; } @@ -188,19 +188,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver Exception reportedException = null; string filePath = "ERROR"; - + List folderCandidates = InventoryArchiveUtils.FindFoldersByPath( m_InventoryService, m_userInfo.PrincipalID, m_invPath); - + if (folderCandidates.Count == 0) { // Possibly provide an option later on to automatically create this folder if it does not exist m_log.ErrorFormat("[INVENTORY ARCHIVER]: Inventory path {0} does not exist", m_invPath); - + return m_loadedNodes; } - + m_rootDestinationFolder = folderCandidates[0]; archive = new TarArchiveReader(m_loadStream); byte[] data; @@ -211,7 +211,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (filePath == ArchiveConstants.CONTROL_FILE_PATH) { LoadControlFile(filePath, data); - } + } else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) { LoadAssetFile(filePath, data); @@ -221,17 +221,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver LoadInventoryFile(filePath, entryType, data); } } - + archive.Close(); m_log.DebugFormat( - "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures", + "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures", m_successfulAssetRestores, m_failedAssetRestores); //Alicia: When this is called by LibraryModule or Tests, m_module will be null as event is not required if(m_module != null) m_module.TriggerInventoryArchiveLoaded(m_id, true, m_userInfo, m_invPath, m_loadStream, reportedException, m_successfulItemRestores); - + return m_loadedNodes; } catch(Exception Ex) @@ -268,8 +268,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// /// The last user inventory folder created or found for the archive path public InventoryFolderBase ReplicateArchivePathToUserInventory( - string iarPath, - InventoryFolderBase rootDestFolder, + string iarPath, + InventoryFolderBase rootDestFolder, Dictionary resolvedFolders, HashSet loadedNodes) { @@ -277,27 +277,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // m_log.DebugFormat( // "[INVENTORY ARCHIVER]: Loading folder {0} {1}", rootDestFolder.Name, rootDestFolder.ID); - - InventoryFolderBase destFolder + + InventoryFolderBase destFolder = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders); - + // m_log.DebugFormat( -// "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]", +// "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]", // iarPath, iarPathExisting); - + string iarPathToCreate = iarPath.Substring(iarPathExisting.Length); CreateFoldersForPath(destFolder, iarPathExisting, iarPathToCreate, resolvedFolders, loadedNodes); - + return destFolder; } /// /// Resolve a destination folder /// - /// + /// /// We require here a root destination folder (usually the root of the user's inventory) and the archive /// path. We also pass in a list of previously resolved folders in case we've found this one previously. - /// + /// /// /// The item archive path to resolve. The portion of the path passed back is that /// which corresponds to the resolved desintation folder. @@ -321,7 +321,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver while (archivePath.Length > 0) { // m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath); - + if (resolvedFolders.ContainsKey(archivePath)) { // m_log.DebugFormat( @@ -332,13 +332,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver { if (m_merge) { - // TODO: Using m_invPath is totally wrong - what we need to do is strip the uuid from the + // TODO: Using m_invPath is totally wrong - what we need to do is strip the uuid from the // iar name and try to find that instead. string plainPath = ArchiveConstants.ExtractPlainPathFromIarPath(archivePath); List folderCandidates = InventoryArchiveUtils.FindFoldersByPath( m_InventoryService, m_userInfo.PrincipalID, plainPath); - + if (folderCandidates.Count != 0) { InventoryFolderBase destFolder = folderCandidates[0]; @@ -346,7 +346,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver return destFolder; } } - + // Don't include the last slash so find the penultimate one int penultimateSlashIndex = archivePath.LastIndexOf("/", archivePath.Length - 2); @@ -365,10 +365,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } } } - + return rootDestFolder; } - + /// /// Create a set of folders for the given path. /// @@ -388,10 +388,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// Track the inventory nodes created. /// protected void CreateFoldersForPath( - InventoryFolderBase destFolder, + InventoryFolderBase destFolder, string iarPathExisting, - string iarPathToReplicate, - Dictionary resolvedFolders, + string iarPathToReplicate, + Dictionary resolvedFolders, HashSet loadedNodes) { string[] rawDirsToCreate = iarPathToReplicate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); @@ -402,7 +402,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (!rawDirsToCreate[i].Contains(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR)) continue; - + int identicalNameIdentifierIndex = rawDirsToCreate[i].LastIndexOf( ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR); @@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver newFolderName = InventoryArchiveUtils.UnescapeArchivePath(newFolderName); UUID newFolderId = UUID.Random(); - destFolder + destFolder = new InventoryFolderBase( newFolderId, newFolderName, m_userInfo.PrincipalID, (short)FolderType.None, destFolder.ID, 1); @@ -427,7 +427,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver loadedNodes.Add(destFolder); } } - + /// /// Load an item from the archive /// @@ -438,7 +438,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver protected InventoryItemBase LoadItem(byte[] data, InventoryFolderBase loadFolder) { InventoryItemBase item = UserInventoryItemSerializer.Deserialize(data); - + // Don't use the item ID that's in the file item.ID = UUID.Random(); @@ -446,7 +446,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (UUID.Zero != ospResolvedId) // The user exists in this grid { // m_log.DebugFormat("[INVENTORY ARCHIVER]: Found creator {0} via OSPA resolution", ospResolvedId); - + // item.CreatorIdAsUuid = ospResolvedId; // Don't preserve the OSPA in the creator id (which actually gets persisted to the @@ -474,7 +474,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (!m_InventoryService.AddItem(item)) m_log.WarnFormat("[INVENTORY ARCHIVER]: Unable to save item {0} in folder {1}", item.Name, item.Folder); - + return item; } @@ -519,7 +519,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver data = SceneObjectSerializer.ModifySerializedObject(assetId, data, sog => { bool modified = false; - + foreach (SceneObjectPart sop in sog.Parts) { if (string.IsNullOrEmpty(sop.CreatorData)) @@ -528,10 +528,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver modified = true; } } - + return modified; }); - + if (data == null) return false; } @@ -568,7 +568,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver int majorVersion = int.Parse(archiveElement.Attribute("major_version").Value); int minorVersion = int.Parse(archiveElement.Attribute("minor_version").Value); string version = string.Format("{0}.{1}", majorVersion, minorVersion); - + if (majorVersion > MAX_MAJOR_VERSION) { throw new Exception( @@ -576,38 +576,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver "The IAR you are trying to load has major version number of {0} but this version of OpenSim can only load IARs with major version number {1} and below", majorVersion, MAX_MAJOR_VERSION)); } - - ControlFileLoaded = true; - m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version); + + ControlFileLoaded = true; + m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version); } - + /// /// Load inventory file /// /// /// - /// + /// protected void LoadInventoryFile(string path, TarArchiveReader.TarEntryType entryType, byte[] data) { if (!ControlFileLoaded) throw new Exception( string.Format( - "The IAR you are trying to load does not list {0} before {1}. Aborting load", + "The IAR you are trying to load does not list {0} before {1}. Aborting load", ArchiveConstants.CONTROL_FILE_PATH, ArchiveConstants.INVENTORY_PATH)); - + if (m_assetsLoaded) throw new Exception( string.Format( - "The IAR you are trying to load does not list all {0} before {1}. Aborting load", - ArchiveConstants.INVENTORY_PATH, ArchiveConstants.ASSETS_PATH)); - + "The IAR you are trying to load does not list all {0} before {1}. Aborting load", + ArchiveConstants.INVENTORY_PATH, ArchiveConstants.ASSETS_PATH)); + path = path.Substring(ArchiveConstants.INVENTORY_PATH.Length); - + // Trim off the file portion if we aren't already dealing with a directory path if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY != entryType) path = path.Remove(path.LastIndexOf("/") + 1); - - InventoryFolderBase foundFolder + + InventoryFolderBase foundFolder = ReplicateArchivePathToUserInventory( path, m_rootDestinationFolder, m_resolvedFolders, m_loadedNodes); @@ -618,17 +618,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (item != null) { m_successfulItemRestores++; - - // If we aren't loading the folder containing the item then well need to update the + + // If we aren't loading the folder containing the item then well need to update the // viewer separately for that item. if (!m_loadedNodes.Contains(foundFolder)) m_loadedNodes.Add(item); } } - - m_inventoryNodesLoaded = true; + + m_inventoryNodesLoaded = true; } - + /// /// Load asset file /// @@ -639,15 +639,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (!ControlFileLoaded) throw new Exception( string.Format( - "The IAR you are trying to load does not list {0} before {1}. Aborting load", + "The IAR you are trying to load does not list {0} before {1}. Aborting load", ArchiveConstants.CONTROL_FILE_PATH, ArchiveConstants.ASSETS_PATH)); - + if (!m_inventoryNodesLoaded) throw new Exception( string.Format( - "The IAR you are trying to load does not list all {0} before {1}. Aborting load", - ArchiveConstants.INVENTORY_PATH, ArchiveConstants.ASSETS_PATH)); - + "The IAR you are trying to load does not list all {0} before {1}. Aborting load", + ArchiveConstants.INVENTORY_PATH, ArchiveConstants.ASSETS_PATH)); + if (LoadAsset(path, data)) m_successfulAssetRestores++; else @@ -655,10 +655,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if ((m_successfulAssetRestores) % 50 == 0) m_log.DebugFormat( - "[INVENTORY ARCHIVER]: Loaded {0} assets...", - m_successfulAssetRestores); - - m_assetsLoaded = true; - } + "[INVENTORY ARCHIVER]: Loaded {0} assets...", + m_successfulAssetRestores); + + m_assetsLoaded = true; + } } } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs index dbaf2aa..b66aad5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs @@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// The path to the required folder. /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. /// - /// The folder found. Please note that if there are multiple folders with the same name then an + /// The folder found. Please note that if there are multiple folders with the same name then an /// unspecified one will be returned. If no such folder eixsts then null is returned public static InventoryFolderBase FindFolderByPath( IInventoryService inventoryService, UUID userId, string path) @@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// The path to the required folder. /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. /// - /// The folder found. Please note that if there are multiple folders with the same name then an + /// The folder found. Please note that if there are multiple folders with the same name then an /// unspecified one will be returned. If no such folder eixsts then null is returned public static InventoryFolderBase FindFolderByPath( IInventoryService inventoryService, InventoryFolderBase startFolder, string path) @@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver return FindFoldersByPath(inventoryService, rootFolder, path); } - + /// /// Find a set of folders given a PATH_DELIMITER delimited path starting from this folder /// @@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver IInventoryService inventoryService, InventoryFolderBase startFolder, string path) { List foundFolders = new List(); - + if (path == string.Empty) { foundFolders.Add(startFolder); @@ -189,17 +189,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver foundFolders.Add(startFolder); return foundFolders; } - + // If the path isn't just / then trim any starting extraneous slashes path = path.TrimStart(new char[] { PATH_DELIMITER }); - + // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Adjusted path in FindFolderByPath() is [{0}]", path); string[] components = SplitEscapedPath(path); components[0] = UnescapePath(components[0]); //string[] components = path.Split(new string[] { PATH_DELIMITER.ToString() }, 2, StringSplitOptions.None); - + InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); // m_log.DebugFormat( @@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// /// FIXME: Delimitors which occur in names themselves are not currently escapable. /// - /// + /// /// /// Inventory service to query /// @@ -301,7 +301,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// /// FIXME: Delimitors which occur in names themselves are not currently escapable. /// - /// + /// /// Inventory service to query /// The folder from which the path starts /// The path to the required item. @@ -313,10 +313,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // If the path isn't just / then trim any starting extraneous slashes path = path.TrimStart(new char[] { PATH_DELIMITER }); - + string[] components = SplitEscapedPath(path); components[0] = UnescapePath(components[0]); - + //string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); if (components.Length == 1) @@ -324,15 +324,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // m_log.DebugFormat( // "FOUND SINGLE COMPONENT [{0}]. Looking for this in [{1}] {2}", // components[0], startFolder.Name, startFolder.ID); - + List items = inventoryService.GetFolderItems(startFolder.Owner, startFolder.ID); // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Found {0} items in FindItemByPath()", items.Count); - + foreach (InventoryItemBase item in items) { // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Inspecting item {0} {1}", item.Name, item.ID); - + if (item.Name == components[0]) foundItems.Add(item); } @@ -342,7 +342,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // m_log.DebugFormat("FOUND COMPONENTS [{0}] and [{1}]", components[0], components[1]); InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); - + foreach (InventoryFolderBase folder in contents.Folders) { if (folder.Name == components[0]) @@ -365,9 +365,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver public static string[] SplitEscapedPath(string path) { // m_log.DebugFormat("SPLITTING PATH {0}", path); - + bool singleEscapeChar = false; - + for (int i = 0; i < path.Length; i++) { if (path[i] == ESCAPE_CHARACTER && !singleEscapeChar) @@ -395,7 +395,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver public static string UnescapePath(string path) { // m_log.DebugFormat("ESCAPING PATH {0}", path); - + StringBuilder sb = new StringBuilder(); bool singleEscapeChar = false; @@ -418,7 +418,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } // m_log.DebugFormat("ESCAPED PATH TO {0}", sb); - + return sb.ToString(); } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 8847414..be59eb5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -172,7 +172,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver public string Name { get { return "Inventory Archiver Module"; } } - #endregion + #endregion /// /// Trigger the inventory archive saved event. diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs index c2e645f..f559c2e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs @@ -56,23 +56,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + SerialiserModule serialiserModule = new SerialiserModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule(); - + // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene Scene scene = new SceneHelpers().SetupScene(); - + SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood"); UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); - archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); + archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); InventoryItemBase foundItem1 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); - - Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); + + Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); // Now try loading to a root child folder UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA", false); @@ -90,9 +90,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests InventoryItemBase foundItem3 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC/" + m_item1Name); - Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); + Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); } - + /// /// Test that things work when the load path specified starts with a slash /// @@ -101,22 +101,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + SerialiserModule serialiserModule = new SerialiserModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule(); Scene scene = new SceneHelpers().SetupScene(); SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); - + UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password"); archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream); InventoryItemBase foundItem1 = InventoryArchiveUtils.FindItemByPath( scene.InventoryService, m_uaMT.PrincipalID, "/Objects/" + m_item1Name); - + Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1 in TestLoadIarFolderStartsWithSlash()"); } - + [Test] public void TestLoadIarPathWithEscapedChars() { @@ -137,7 +137,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests string userLastName = "Stirrup"; UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood"); - + // Create asset SceneObjectGroup object1; SceneObjectPart part1; @@ -168,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests item1.Name = itemName; item1.AssetID = asset1.FullID; item1.ID = item1Id; - InventoryFolderBase objsFolder + InventoryFolderBase objsFolder = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, userId, "Objects")[0]; item1.Folder = objsFolder.ID; scene.AddInventoryItem(item1); @@ -189,16 +189,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests InventoryItemBase foundItem1 = InventoryArchiveUtils.FindItemByPath( scene.InventoryService, userId, "Scripts/Objects/" + humanEscapedItemName); - + Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); // Assert.That( -// foundItem1.CreatorId, Is.EqualTo(userUuid), +// foundItem1.CreatorId, Is.EqualTo(userUuid), // "Loaded item non-uuid creator doesn't match that of the loading user"); Assert.That( - foundItem1.Name, Is.EqualTo(itemName), + foundItem1.Name, Is.EqualTo(itemName), "Loaded item name doesn't match saved name"); } - + /// /// Test replication of an archive path to the user's inventory. /// @@ -207,21 +207,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + Scene scene = new SceneHelpers().SetupScene(); UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); - + Dictionary foldersCreated = new Dictionary(); HashSet nodesLoaded = new HashSet(); - + string folder1Name = "1"; string folder2aName = "2a"; string folder2bName = "2b"; - + string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1Name, UUID.Random()); string folder2aArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2aName, UUID.Random()); string folder2bArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2bName, UUID.Random()); - + string iarPath1 = string.Join("", new string[] { folder1ArchiveName, folder2aArchiveName }); string iarPath2 = string.Join("", new string[] { folder1ArchiveName, folder2bArchiveName }); @@ -229,42 +229,42 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // Test replication of path1 new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) .ReplicateArchivePathToUserInventory( - iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID), + iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID), foldersCreated, nodesLoaded); - + List folder1Candidates = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); Assert.That(folder1Candidates.Count, Is.EqualTo(1)); - + InventoryFolderBase folder1 = folder1Candidates[0]; - List folder2aCandidates + List folder2aCandidates = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName); Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); } - + { // Test replication of path2 new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) .ReplicateArchivePathToUserInventory( - iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID), + iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID), foldersCreated, nodesLoaded); - + List folder1Candidates = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); Assert.That(folder1Candidates.Count, Is.EqualTo(1)); - - InventoryFolderBase folder1 = folder1Candidates[0]; - - List folder2aCandidates + + InventoryFolderBase folder1 = folder1Candidates[0]; + + List folder2aCandidates = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName); Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); - - List folder2bCandidates + + List folder2bCandidates = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2bName); Assert.That(folder2bCandidates.Count, Is.EqualTo(1)); } } - + /// /// Test replication of a partly existing archive path to the user's inventory. This should create /// a duplicate path without the merge option. @@ -274,31 +274,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests { TestHelpers.InMethod(); //log4net.Config.XmlConfigurator.Configure(); - + Scene scene = new SceneHelpers().SetupScene(); UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); - + string folder1ExistingName = "a"; string folder2Name = "b"; - - InventoryFolderBase folder1 + + InventoryFolderBase folder1 = UserInventoryHelpers.CreateInventoryFolder( scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false); - + string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); - + string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) .ReplicateArchivePathToUserInventory( - itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), + itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), new Dictionary(), new HashSet()); - List folder1PostCandidates + List folder1PostCandidates = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); Assert.That(folder1PostCandidates.Count, Is.EqualTo(2)); - + // FIXME: Temporarily, we're going to do something messy to make sure we pick up the created folder. InventoryFolderBase folder1Post = null; foreach (InventoryFolderBase folder in folder1PostCandidates) @@ -311,11 +311,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests } // Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID)); - List folder2PostCandidates + List folder2PostCandidates = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1Post, "b"); Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); } - + /// /// Test replication of a partly existing archive path to the user's inventory. This should create /// a merged path. @@ -325,33 +325,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + Scene scene = new SceneHelpers().SetupScene(); UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); - + string folder1ExistingName = "a"; string folder2Name = "b"; - - InventoryFolderBase folder1 + + InventoryFolderBase folder1 = UserInventoryHelpers.CreateInventoryFolder( scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false); - + string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); - + string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, folder1ExistingName, (Stream)null, true) .ReplicateArchivePathToUserInventory( - itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), + itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), new Dictionary(), new HashSet()); - List folder1PostCandidates + List folder1PostCandidates = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); Assert.That(folder1PostCandidates.Count, Is.EqualTo(1)); Assert.That(folder1PostCandidates[0].ID, Is.EqualTo(folder1.ID)); - List folder2PostCandidates + List folder2PostCandidates = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1PostCandidates[0], "b"); Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs index 57b4f80..d0bdc91 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests { [TestFixture] public class InventoryArchiveLoadTests : InventoryArchiveTestCase - { + { protected TestScene m_scene; protected InventoryArchiverModule m_archiverModule; @@ -55,12 +55,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests public override void SetUp() { base.SetUp(); - + SerialiserModule serialiserModule = new SerialiserModule(); m_archiverModule = new InventoryArchiverModule(); m_scene = new SceneHelpers().SetupScene(); - SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); + SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); } [Test] @@ -68,35 +68,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); - + UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password"); - m_archiverModule.DearchiveInventory(UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream); - + m_archiverModule.DearchiveInventory(UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream); + InventoryItemBase coaItem = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_coaItemName); - - Assert.That(coaItem, Is.Not.Null, "Didn't find loaded item 1"); - + + Assert.That(coaItem, Is.Not.Null, "Didn't find loaded item 1"); + string assetXml = AssetHelpers.ReadAssetAsString(m_scene.AssetService, coaItem.AssetID); - - CoalescedSceneObjects coa; + + CoalescedSceneObjects coa; bool readResult = CoalescedSceneObjectsSerializer.TryFromXml(assetXml, out coa); - + Assert.That(readResult, Is.True); Assert.That(coa.Count, Is.EqualTo(2)); - + List coaObjects = coa.Objects; Assert.That(coaObjects[0].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000120"))); Assert.That(coaObjects[0].AbsolutePosition, Is.EqualTo(new Vector3(15, 30, 45))); - + Assert.That(coaObjects[1].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000140"))); - Assert.That(coaObjects[1].AbsolutePosition, Is.EqualTo(new Vector3(25, 50, 75))); - } + Assert.That(coaObjects[1].AbsolutePosition, Is.EqualTo(new Vector3(25, 50, 75))); + } /// /// Test case where a creator account exists for the creator UUID embedded in item metadata and serialized /// objects. - /// + /// [Test] public void TestLoadIarCreatorAccountPresent() { @@ -105,26 +105,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood"); - m_archiverModule.DearchiveInventory(UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/", "meowfood", m_iarStream); + m_archiverModule.DearchiveInventory(UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/", "meowfood", m_iarStream); InventoryItemBase foundItem1 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_item1Name); Assert.That( - foundItem1.CreatorId, Is.EqualTo(m_uaLL1.PrincipalID.ToString()), - "Loaded item non-uuid creator doesn't match original"); + foundItem1.CreatorId, Is.EqualTo(m_uaLL1.PrincipalID.ToString()), + "Loaded item non-uuid creator doesn't match original"); Assert.That( - foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL1.PrincipalID), + foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL1.PrincipalID), "Loaded item uuid creator doesn't match original"); Assert.That(foundItem1.Owner, Is.EqualTo(m_uaLL1.PrincipalID), "Loaded item owner doesn't match inventory reciever"); - - AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); + + AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); string xmlData = Utils.BytesToString(asset1.Data); SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); - - Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL1.PrincipalID)); + + Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL1.PrincipalID)); } - + // /// // /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where // /// an account exists with the same name as the creator, though not the same id. @@ -137,24 +137,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // // UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood"); // UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire"); -// -// m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); +// +// m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); // InventoryItemBase foundItem1 // = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); // // Assert.That( -// foundItem1.CreatorId, Is.EqualTo(m_uaLL2.PrincipalID.ToString()), -// "Loaded item non-uuid creator doesn't match original"); +// foundItem1.CreatorId, Is.EqualTo(m_uaLL2.PrincipalID.ToString()), +// "Loaded item non-uuid creator doesn't match original"); // Assert.That( -// foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL2.PrincipalID), +// foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL2.PrincipalID), // "Loaded item uuid creator doesn't match original"); // Assert.That(foundItem1.Owner, Is.EqualTo(m_uaMT.PrincipalID), // "Loaded item owner doesn't match inventory reciever"); -// -// AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); +// +// AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); // string xmlData = Utils.BytesToString(asset1.Data); // SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); -// +// // Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL2.PrincipalID)); // } @@ -167,26 +167,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password"); m_archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "password", m_iarStream); InventoryItemBase foundItem1 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); - + Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); Assert.That( - foundItem1.CreatorId, Is.EqualTo(m_uaMT.PrincipalID.ToString()), + foundItem1.CreatorId, Is.EqualTo(m_uaMT.PrincipalID.ToString()), "Loaded item non-uuid creator doesn't match that of the loading user"); Assert.That( - foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaMT.PrincipalID), + foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaMT.PrincipalID), "Loaded item uuid creator doesn't match that of the loading user"); - - AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); + + AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); string xmlData = Utils.BytesToString(asset1.Data); SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); - - Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaMT.PrincipalID)); + + Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaMT.PrincipalID)); } } } \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs index 7265405..bd112b4 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs @@ -50,19 +50,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests { protected TestScene m_scene; protected InventoryArchiverModule m_archiverModule; - + [SetUp] public override void SetUp() { base.SetUp(); - + SerialiserModule serialiserModule = new SerialiserModule(); m_archiverModule = new InventoryArchiverModule(); m_scene = new SceneHelpers().SetupScene(); - SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); + SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); } - + /// /// Test that the IAR has the required files in the right order. /// @@ -73,20 +73,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests public void TestOrder() { TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - +// log4net.Config.XmlConfigurator.Configure(); + MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes); - TarArchiveReader tar = new TarArchiveReader(archiveReadStream); + TarArchiveReader tar = new TarArchiveReader(archiveReadStream); string filePath; TarArchiveReader.TarEntryType tarEntryType; - + byte[] data = tar.ReadEntry(out filePath, out tarEntryType); Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); - + InventoryArchiveReadRequest iarr = new InventoryArchiveReadRequest(UUID.Random(), null, null, null, null, null, null, (Stream)null, false); iarr.LoadControlFile(filePath, data); - + Assert.That(iarr.ControlFileLoaded, Is.True); } @@ -119,22 +119,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // InventoryArchiveUtils. bool gotObjectsFolder = false; - string objectsFolderName + string objectsFolderName = string.Format( - "{0}{1}", - ArchiveConstants.INVENTORY_PATH, + "{0}{1}", + ArchiveConstants.INVENTORY_PATH, InventoryArchiveWriteRequest.CreateArchiveFolderName( UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, userId, "Objects"))); string filePath; TarArchiveReader.TarEntryType tarEntryType; - + while (tar.ReadEntry(out filePath, out tarEntryType) != null) { // Console.WriteLine("Got {0}", filePath); // Lazily, we only bother to look for the system objects folder created when we call CreateUserWithInventory() - // XXX: But really we need to stop all that stuff being created in tests or check for such folders + // XXX: But really we need to stop all that stuff being created in tests or check for such folders // more thoroughly if (filePath == objectsFolderName) gotObjectsFolder = true; @@ -157,19 +157,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword); // Create base folder - InventoryFolderBase f1 + InventoryFolderBase f1 = UserInventoryHelpers.CreateInventoryFolder(m_scene.InventoryService, userId, "f1", true); - + // Create item1 - SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, userId, "My Little Dog Object", 0x5); + SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, userId, "My Little Dog Object", 0x5); InventoryItemBase i1 = UserInventoryHelpers.AddInventoryItem(m_scene, so1, 0x50, 0x60, "f1"); // Create embedded folder - InventoryFolderBase f1_1 + InventoryFolderBase f1_1 = UserInventoryHelpers.CreateInventoryFolder(m_scene.InventoryService, userId, "f1/f1.1", true); // Create embedded item - SceneObjectGroup so1_1 = SceneHelpers.CreateSceneObject(1, userId, "My Little Cat Object", 0x6); + SceneObjectGroup so1_1 = SceneHelpers.CreateSceneObject(1, userId, "My Little Cat Object", 0x6); InventoryItemBase i2 = UserInventoryHelpers.AddInventoryItem(m_scene, so1_1, 0x500, 0x600, "f1/f1.1"); MemoryStream archiveWriteStream = new MemoryStream(); @@ -188,18 +188,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // InventoryArchiveUtils. bool gotf1 = false, gotf1_1 = false, gotso1 = false, gotso2 = false; - string f1FileName + string f1FileName = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, InventoryArchiveWriteRequest.CreateArchiveFolderName(f1)); - string f1_1FileName + string f1_1FileName = string.Format("{0}{1}", f1FileName, InventoryArchiveWriteRequest.CreateArchiveFolderName(f1_1)); - string so1FileName + string so1FileName = string.Format("{0}{1}", f1FileName, InventoryArchiveWriteRequest.CreateArchiveItemName(i1)); string so2FileName = string.Format("{0}{1}", f1_1FileName, InventoryArchiveWriteRequest.CreateArchiveItemName(i2)); string filePath; TarArchiveReader.TarEntryType tarEntryType; - + while (tar.ReadEntry(out filePath, out tarEntryType) != null) { // Console.WriteLine("Got {0}", filePath); @@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // TODO: Test presence of more files and contents of files. } - + /// /// Test saving a single inventory item to an IAR /// (subject to change since there is no fixed format yet). @@ -239,10 +239,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests string userPassword = "troll"; UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword); - + // Create asset UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); - SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50); + SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50); UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); @@ -255,7 +255,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests item1.Name = item1Name; item1.AssetID = asset1.FullID; item1.ID = item1Id; - InventoryFolderBase objsFolder + InventoryFolderBase objsFolder = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, userId, "Objects")[0]; item1.Folder = objsFolder.ID; m_scene.AddInventoryItem(item1); @@ -285,7 +285,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests TarArchiveReader.TarEntryType tarEntryType; // Console.WriteLine("Reading archive"); - + while (tar.ReadEntry(out filePath, out tarEntryType) != null) { Console.WriteLine("Got {0}", filePath); @@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // { // gotControlFile = true; // } - + if (filePath.StartsWith(ArchiveConstants.INVENTORY_PATH) && filePath.EndsWith(".xml")) { // string fileName = filePath.Remove(0, "Objects/".Length); diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs index 519c697..0b65829 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs @@ -49,35 +49,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests public class InventoryArchiveTestCase : OpenSimTestCase { protected ManualResetEvent mre = new ManualResetEvent(false); - + /// /// A raw array of bytes that we'll use to create an IAR memory stream suitable for isolated use in each test. /// protected byte[] m_iarStreamBytes; - + /// /// Stream of data representing a common IAR for load tests. /// protected MemoryStream m_iarStream; - - protected UserAccount m_uaMT - = new UserAccount { + + protected UserAccount m_uaMT + = new UserAccount { PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"), FirstName = "Mr", LastName = "Tiddles" }; - + protected UserAccount m_uaLL1 - = new UserAccount { + = new UserAccount { PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"), FirstName = "Lord", - LastName = "Lucan" }; - + LastName = "Lucan" }; + protected UserAccount m_uaLL2 - = new UserAccount { + = new UserAccount { PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000777"), FirstName = "Lord", - LastName = "Lucan" }; - + LastName = "Lucan" }; + protected string m_item1Name = "Ray Gun Item"; protected string m_coaItemName = "Coalesced Item"; @@ -105,72 +105,72 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests base.SetUp(); m_iarStream = new MemoryStream(m_iarStreamBytes); } - + protected void ConstructDefaultIarBytesForTestLoad() { // log4net.Config.XmlConfigurator.Configure(); - + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); Scene scene = new SceneHelpers().SetupScene(); - SceneHelpers.SetupSceneModules(scene, archiverModule); - + SceneHelpers.SetupSceneModules(scene, archiverModule); + UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); MemoryStream archiveWriteStream = new MemoryStream(); - + // Create scene object asset UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); - SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50); + SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50); UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); - scene.AssetService.Store(asset1); + scene.AssetService.Store(asset1); // Create scene object item InventoryItemBase item1 = new InventoryItemBase(); item1.Name = m_item1Name; - item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020"); + item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020"); item1.AssetID = asset1.FullID; item1.GroupID = UUID.Random(); item1.CreatorId = m_uaLL1.PrincipalID.ToString(); item1.Owner = m_uaLL1.PrincipalID; - item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; + item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; scene.AddInventoryItem(item1); - + // Create coalesced objects asset SceneObjectGroup cobj1 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120); cobj1.AbsolutePosition = new Vector3(15, 30, 45); - + SceneObjectGroup cobj2 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140); - cobj2.AbsolutePosition = new Vector3(25, 50, 75); - + cobj2.AbsolutePosition = new Vector3(25, 50, 75); + CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2); - + AssetBase coaAsset = AssetHelpers.CreateAsset(0x160, coa); - scene.AssetService.Store(coaAsset); - + scene.AssetService.Store(coaAsset); + // Create coalesced objects inventory item InventoryItemBase coaItem = new InventoryItemBase(); coaItem.Name = m_coaItemName; - coaItem.ID = UUID.Parse("00000000-0000-0000-0000-000000000180"); + coaItem.ID = UUID.Parse("00000000-0000-0000-0000-000000000180"); coaItem.AssetID = coaAsset.FullID; coaItem.GroupID = UUID.Random(); coaItem.CreatorId = m_uaLL1.PrincipalID.ToString(); coaItem.Owner = m_uaLL1.PrincipalID; - coaItem.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; - scene.AddInventoryItem(coaItem); - + coaItem.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; + scene.AddInventoryItem(coaItem); + archiverModule.ArchiveInventory( - UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream); - + UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream); + m_iarStreamBytes = archiveWriteStream.ToArray(); } - + protected void SaveCompleted( - UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, + UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, Exception reportedException, int SaveCount, int FilterCount) { mre.Set(); - } + } } } \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 46da5a9..5d7f25c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -149,10 +149,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer private void OnInstantMessage(IClientAPI client, GridInstantMessage im) { // m_log.DebugFormat( -// "[INVENTORY TRANSFER]: {0} IM type received from client {1}. From={2} ({3}), To={4}", +// "[INVENTORY TRANSFER]: {0} IM type received from client {1}. From={2} ({3}), To={4}", // (InstantMessageDialog)im.dialog, client.Name, // im.fromAgentID, im.fromAgentName, im.toAgentID); - + Scene scene = FindClientScene(client.AgentId); if (scene == null) // Something seriously wrong here. @@ -164,31 +164,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer if (im.binaryBucket.Length < 17) // Invalid return; - + UUID recipientID = new UUID(im.toAgentID); ScenePresence user = scene.GetScenePresence(recipientID); UUID copyID; // First byte is the asset type AssetType assetType = (AssetType)im.binaryBucket[0]; - + if (AssetType.Folder == assetType) { UUID folderID = new UUID(im.binaryBucket, 1); - + m_log.DebugFormat( "[INVENTORY TRANSFER]: Inserting original folder {0} into agent {1}'s inventory", folderID, new UUID(im.toAgentID)); - + InventoryFolderBase folderCopy = scene.GiveInventoryFolder(client, recipientID, client.AgentId, folderID, UUID.Zero); - + if (folderCopy == null) { client.SendAgentAlertMessage("Can't find folder to give. Nothing given.", false); return; } - + // The outgoing binary bucket should contain only the byte which signals an asset folder is // being copied and the following bytes for the copied folder's UUID copyID = folderCopy.ID; @@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer im.binaryBucket = new byte[1 + copyIDBytes.Length]; im.binaryBucket[0] = (byte)AssetType.Folder; Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length); - + if (user != null) user.ControllingClient.SendBulkUpdateInventory(folderCopy); @@ -225,10 +225,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer client.SendAgentAlertMessage(message, false); return; } - + copyID = itemCopy.ID; Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16); - + if (user != null) user.ControllingClient.SendBulkUpdateInventory(itemCopy); @@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer else { if (m_TransferModule != null) - m_TransferModule.SendInstantMessage(im, delegate(bool success) + m_TransferModule.SendInstantMessage(im, delegate(bool success) { if (!success) client.SendAlertMessage("User not online. Inventory has been saved"); @@ -308,8 +308,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer } // XXX: This code was placed here to try and accomodate RLV which moves given folders named #RLV/~ - // to the requested folder, which in this case is #RLV. However, it is the viewer that appears to be - // response from renaming the #RLV/~example folder to ~example. For some reason this is not yet + // to the requested folder, which in this case is #RLV. However, it is the viewer that appears to be + // response from renaming the #RLV/~example folder to ~example. For some reason this is not yet // happening, possibly because we are not sending the correct inventory update messages with the correct // transaction IDs else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) @@ -380,7 +380,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer InventoryItemBase item = invService.GetItem(client.AgentId, inventoryID); InventoryFolderBase folder = null; UUID? previousParentFolderID = null; - + if (item != null && trashFolder != null) { previousParentFolderID = item.Folder; @@ -404,18 +404,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer client.SendBulkUpdateInventory(folder); } } - + if ((null == item && null == folder) | null == trashFolder) { string reason = String.Empty; - + if (trashFolder == null) reason += " Trash folder not found."; if (item == null) reason += " Item not found."; if (folder == null) reason += " Folder not found."; - + client.SendAgentAlertMessage("Unable to delete "+ "received inventory" + reason, false); } @@ -471,12 +471,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer { if (im.binaryBucket.Length < 17) // Invalid return; - + UUID recipientID = new UUID(im.toAgentID); // First byte is the asset type AssetType assetType = (AssetType)im.binaryBucket[0]; - + if (AssetType.Folder == assetType) { UUID folderID = new UUID(im.binaryBucket, 1); @@ -505,12 +505,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer { if (im.binaryBucket.Length < 1) // Invalid return; - + UUID recipientID = new UUID(im.toAgentID); // Bucket is the asset type AssetType assetType = (AssetType)im.binaryBucket[0]; - + if (AssetType.Folder == assetType) { UUID folderID = new UUID(im.imSessionID); diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs index 7ddc396..82ed091 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs @@ -44,9 +44,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests { [TestFixture] public class InventoryTransferModuleTests : OpenSimTestCase - { - protected TestScene m_scene; - + { + protected TestScene m_scene; + [SetUp] public override void SetUp() { @@ -56,9 +56,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests config.AddConfig("Messaging"); config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule"); - m_scene = new SceneHelpers().SetupScene(); + m_scene = new SceneHelpers().SetupScene(); SceneHelpers.SetupSceneModules(m_scene, config, new InventoryTransferModule()); - } + } [Test] public void TestAcceptGivenItem() @@ -69,9 +69,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests UUID itemId = TestHelpers.ParseTail(0x100); UUID assetId = TestHelpers.ParseTail(0x200); - UserAccount ua1 + UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); - UserAccount ua2 + UserAccount ua2 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); @@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests TestClient receiverClient = (TestClient)receiverSp.ControllingClient; // Create the object to test give - InventoryItemBase originalItem + InventoryItemBase originalItem = UserInventoryHelpers.CreateInventoryItem( m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); @@ -89,35 +89,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests byte[] itemIdBytes = itemId.GetBytes(); Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); - GridInstantMessage giveIm + GridInstantMessage giveIm = new GridInstantMessage( - m_scene, - giverSp.UUID, - giverSp.Name, - receiverSp.UUID, + m_scene, + giverSp.UUID, + giverSp.Name, + receiverSp.UUID, (byte)InstantMessageDialog.InventoryOffered, false, - "inventory offered msg", + "inventory offered msg", initialSessionId, - false, + false, Vector3.Zero, giveImBinaryBucket, true); giverClient.HandleImprovedInstantMessage(giveIm); - // These details might not all be correct. - GridInstantMessage acceptIm + // These details might not all be correct. + GridInstantMessage acceptIm = new GridInstantMessage( - m_scene, - receiverSp.UUID, - receiverSp.Name, - giverSp.UUID, - (byte)InstantMessageDialog.InventoryAccepted, + m_scene, + receiverSp.UUID, + receiverSp.Name, + giverSp.UUID, + (byte)InstantMessageDialog.InventoryAccepted, false, - "inventory accepted msg", + "inventory accepted msg", initialSessionId, - false, + false, Vector3.Zero, null, true); @@ -133,7 +133,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); // Test for item successfully making it into the receiver's inventory - InventoryItemBase receivedItem + InventoryItemBase receivedItem = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Objects/givenObj"); Assert.That(receivedItem, Is.Not.Null); @@ -148,7 +148,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests Assert.That(originalItemAfterDelete, Is.Not.Null); // TODO: Test scenario where giver deletes their item first. - } + } /// /// Test user rejection of a given item. @@ -165,9 +165,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests UUID itemId = TestHelpers.ParseTail(0x100); UUID assetId = TestHelpers.ParseTail(0x200); - UserAccount ua1 + UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); - UserAccount ua2 + UserAccount ua2 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); @@ -177,7 +177,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests TestClient receiverClient = (TestClient)receiverSp.ControllingClient; // Create the object to test give - InventoryItemBase originalItem + InventoryItemBase originalItem = UserInventoryHelpers.CreateInventoryItem( m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); @@ -188,36 +188,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests byte[] itemIdBytes = itemId.GetBytes(); Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); - GridInstantMessage giveIm + GridInstantMessage giveIm = new GridInstantMessage( - m_scene, - giverSp.UUID, - giverSp.Name, - receiverSp.UUID, + m_scene, + giverSp.UUID, + giverSp.Name, + receiverSp.UUID, (byte)InstantMessageDialog.InventoryOffered, false, - "inventory offered msg", + "inventory offered msg", initialSessionId, - false, + false, Vector3.Zero, giveImBinaryBucket, true); giverClient.HandleImprovedInstantMessage(giveIm); - // These details might not all be correct. + // These details might not all be correct. // Session ID is now the created item ID (!) - GridInstantMessage rejectIm + GridInstantMessage rejectIm = new GridInstantMessage( - m_scene, - receiverSp.UUID, - receiverSp.Name, - giverSp.UUID, - (byte)InstantMessageDialog.InventoryDeclined, + m_scene, + receiverSp.UUID, + receiverSp.Name, + giverSp.UUID, + (byte)InstantMessageDialog.InventoryDeclined, false, - "inventory declined msg", + "inventory declined msg", new UUID(receivedIm.imSessionID), - false, + false, Vector3.Zero, null, true); @@ -233,7 +233,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); // Test for item successfully making it into the receiver's inventory - InventoryItemBase receivedItem + InventoryItemBase receivedItem = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Trash/givenObj"); InventoryFolderBase trashFolder @@ -250,7 +250,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, giverSp.UUID, "Objects/givenObj"); Assert.That(originalItemAfterDelete, Is.Not.Null); - } + } [Test] public void TestAcceptGivenFolder() @@ -261,9 +261,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests UUID initialSessionId = TestHelpers.ParseTail(0x10); UUID folderId = TestHelpers.ParseTail(0x100); - UserAccount ua1 + UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); - UserAccount ua2 + UserAccount ua2 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); @@ -272,7 +272,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests ScenePresence receiverSp = SceneHelpers.AddScenePresence(m_scene, ua2); TestClient receiverClient = (TestClient)receiverSp.ControllingClient; - InventoryFolderBase originalFolder + InventoryFolderBase originalFolder = UserInventoryHelpers.CreateInventoryFolder( m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); @@ -281,35 +281,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests byte[] itemIdBytes = folderId.GetBytes(); Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); - GridInstantMessage giveIm + GridInstantMessage giveIm = new GridInstantMessage( - m_scene, - giverSp.UUID, - giverSp.Name, - receiverSp.UUID, + m_scene, + giverSp.UUID, + giverSp.Name, + receiverSp.UUID, (byte)InstantMessageDialog.InventoryOffered, false, - "inventory offered msg", + "inventory offered msg", initialSessionId, - false, + false, Vector3.Zero, giveImBinaryBucket, true); giverClient.HandleImprovedInstantMessage(giveIm); - // These details might not all be correct. - GridInstantMessage acceptIm + // These details might not all be correct. + GridInstantMessage acceptIm = new GridInstantMessage( - m_scene, - receiverSp.UUID, - receiverSp.Name, - giverSp.UUID, - (byte)InstantMessageDialog.InventoryAccepted, + m_scene, + receiverSp.UUID, + receiverSp.Name, + giverSp.UUID, + (byte)InstantMessageDialog.InventoryAccepted, false, - "inventory accepted msg", + "inventory accepted msg", initialSessionId, - false, + false, Vector3.Zero, null, true); @@ -325,7 +325,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); // Test for item successfully making it into the receiver's inventory - InventoryFolderBase receivedFolder + InventoryFolderBase receivedFolder = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "f1"); Assert.That(receivedFolder, Is.Not.Null); @@ -340,7 +340,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests Assert.That(originalFolderAfterDelete, Is.Not.Null); // TODO: Test scenario where giver deletes their item first. - } + } /// /// Test user rejection of a given item. @@ -357,9 +357,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests UUID initialSessionId = TestHelpers.ParseTail(0x10); UUID folderId = TestHelpers.ParseTail(0x100); - UserAccount ua1 + UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); - UserAccount ua2 + UserAccount ua2 = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); @@ -369,7 +369,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests TestClient receiverClient = (TestClient)receiverSp.ControllingClient; // Create the folder to test give - InventoryFolderBase originalFolder + InventoryFolderBase originalFolder = UserInventoryHelpers.CreateInventoryFolder( m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); @@ -381,36 +381,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests byte[] itemIdBytes = folderId.GetBytes(); Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); - GridInstantMessage giveIm + GridInstantMessage giveIm = new GridInstantMessage( - m_scene, - giverSp.UUID, - giverSp.Name, - receiverSp.UUID, + m_scene, + giverSp.UUID, + giverSp.Name, + receiverSp.UUID, (byte)InstantMessageDialog.InventoryOffered, false, - "inventory offered msg", + "inventory offered msg", initialSessionId, - false, + false, Vector3.Zero, giveImBinaryBucket, true); giverClient.HandleImprovedInstantMessage(giveIm); - // These details might not all be correct. + // These details might not all be correct. // Session ID is now the created item ID (!) - GridInstantMessage rejectIm + GridInstantMessage rejectIm = new GridInstantMessage( - m_scene, - receiverSp.UUID, - receiverSp.Name, - giverSp.UUID, - (byte)InstantMessageDialog.InventoryDeclined, + m_scene, + receiverSp.UUID, + receiverSp.Name, + giverSp.UUID, + (byte)InstantMessageDialog.InventoryDeclined, false, - "inventory declined msg", + "inventory declined msg", new UUID(receivedIm.imSessionID), - false, + false, Vector3.Zero, null, true); @@ -426,7 +426,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); // Test for folder successfully making it into the receiver's inventory - InventoryFolderBase receivedFolder + InventoryFolderBase receivedFolder = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "Trash/f1"); InventoryFolderBase trashFolder @@ -443,6 +443,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, giverSp.UUID, "f1"); Assert.That(originalFolderAfterDelete, Is.Not.Null); - } + } } } \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs index 24286a4..10781e9 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs @@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure { m_Enabled = true; - m_ThisGridURL = Util.GetConfigVarFromSections(config, "GatekeeperURI", + m_ThisGridURL = Util.GetConfigVarFromSections(config, "GatekeeperURI", new string[] { "Startup", "Hypergrid", "Messaging" }, String.Empty); // Legacy. Remove soon! m_ThisGridURL = config.Configs["Messaging"].GetString("Gatekeeper", m_ThisGridURL); @@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure void OnIncomingInstantMessage(GridInstantMessage im) { - if (im.dialog == (byte)InstantMessageDialog.RequestTeleport + if (im.dialog == (byte)InstantMessageDialog.RequestTeleport || im.dialog == (byte)InstantMessageDialog.GodLikeRequestTeleport) { UUID sessionID = new UUID(im.imSessionID); @@ -195,7 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message); m_PendingLures.Add(sessionID, m, 7200); // 2 hours - + if (m_TransferModule != null) { m_TransferModule.SendInstantMessage(m, diff --git a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs index 0b1dbc7..1e1caca 100644 --- a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs @@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile { if (!m_Enabled) return; - + lock (m_Scenes) { if (!m_Scenes.Contains(scene)) diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index df5265c..138c0f7 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles /// /// The configuration /// - public IConfigSource Config + public IConfigSource Config { get; set; @@ -97,7 +97,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles /// /// The profile server URI. /// - public string ProfileServerUri + public string ProfileServerUri { get; set; @@ -120,13 +120,13 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles /// /// true if enabled; otherwise, false. /// - public bool Enabled + public bool Enabled { get; set; } - public string MyGatekeeper + public string MyGatekeeper { get; private set; } @@ -135,7 +135,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles /// /// This is called to initialize the region module. For shared modules, this is called exactly once, after /// creating the single (shared) instance. For non-shared modules, this is called once on each instance, after - /// the instace for the region has been created. + /// the instace for the region has been created. /// /// /// Source. @@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles Enabled = false; return; } - + m_allowUserProfileWebURLs = profileConfig.GetBoolean("AllowUserProfileWebURLs", m_allowUserProfileWebURLs); m_log.Debug("[PROFILES]: Full Profiles Enabled"); @@ -212,7 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles /// This will be called once for every scene loaded. In a shared module this will be multiple times in one /// instance, while a nonshared module instance will only be called once. This method is called after AddRegion /// has been called in all modules for that scene, providing an opportunity to request another module's - /// interface, or hook an event from another module. + /// interface, or hook an event from another module. /// /// /// Scene. @@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles /// module has registered the interface by then, this module will be activated, else it will remain inactive, /// letting the other module take over. This should return non-null ONLY in modules that are intended to be /// easily replaceable, e.g. stub implementations that the developer expects to be replaced by third party - /// provided modules. + /// provided modules. /// /// /// The replaceable interface. @@ -248,7 +248,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles } /// - /// The name of the module + /// The name of the module /// /// /// Gets the module name. @@ -451,7 +451,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles } public void ClassifiedInfoRequest(UUID queryClassifiedID, IClientAPI remoteClient) - { + { UUID target = remoteClient.AgentId; UserClassifiedAdd ad = new UserClassifiedAdd(); ad.ClassifiedId = queryClassifiedID; @@ -459,7 +459,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles lock (m_classifiedCache) { if (m_classifiedCache.ContainsKey(queryClassifiedID)) - { + { target = m_classifiedCache[queryClassifiedID]; m_classifiedInterest[queryClassifiedID] --; @@ -870,7 +870,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles string theirGatekeeperURI; GetUserGatekeeperURI(targetID, out theirGatekeeperURI); - + object Pick = (object)pick; if (!rpc.JsonRpcRequest (ref Pick, "pickinforequest", serverURI, UUID.Random ().ToString ())) { remoteClient.SendAgentAlertMessage ( @@ -880,11 +880,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles pick = (UserProfilePick)Pick; if(foreign) cacheForeignImage(targetID, pick.SnapshotId); - + Vector3 globalPos = new Vector3(Vector3.Zero); Vector3.TryParse(pick.GlobalPos, out globalPos); - - if (!string.IsNullOrWhiteSpace(MyGatekeeper) && pick.Gatekeeper != MyGatekeeper) + + if (!string.IsNullOrWhiteSpace(MyGatekeeper) && pick.Gatekeeper != MyGatekeeper) { // Setup the illusion string region = string.Format("{0} {1}",pick.Gatekeeper,pick.SimName); @@ -896,7 +896,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles } else { - // we have a proxy on map + // we have a proxy on map ulong oriHandle; uint oriX; uint oriY; @@ -909,7 +909,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles } else { - // this is a fail on large regions + // this is a fail on large regions uint gtmp = (uint)globalPos.X >> 8; globalPos.X -= (gtmp << 8); @@ -975,7 +975,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles /// Enabled. /// public void PickInfoUpdate(IClientAPI remoteClient, UUID pickID, UUID creatorID, bool topPick, string name, string desc, UUID snapshotID, int sortOrder, bool enabled) - { + { m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString()); UserProfilePick pick = new UserProfilePick(); @@ -1012,7 +1012,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles else { m_log.WarnFormat( - "[PROFILES]: PickInfoUpdate found no parcel info at {0},{1} in {2}", + "[PROFILES]: PickInfoUpdate found no parcel info at {0},{1} in {2}", avaPos.X, avaPos.Y, p.Scene.Name); } @@ -1146,7 +1146,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); return; } - note = (UserProfileNotes) Note; + note = (UserProfileNotes) Note; remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); } @@ -1225,10 +1225,10 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles { m_log.InfoFormat("[PROFILES]: UserPreferences update error"); remoteClient.SendAgentAlertMessage("Error updating preferences", false); - return; + return; } } - + /// /// Users the preferences request. /// @@ -1256,7 +1256,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles pref = (UserPreferences) Pref; remoteClient.SendUserInfoReply(pref.IMViaEmail, pref.Visible, pref.EMail); - + } #endregion User Preferences @@ -1437,7 +1437,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles { props.AboutText ="Profile not available at this time. User may still be unknown to this grid"; } - + if(!m_allowUserProfileWebURLs) props.WebUrl =""; @@ -1568,7 +1568,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles { m_log.Debug( string.Format( - "[PROFILES]: Request using the OpenProfile API for user {0} to {1} failed", + "[PROFILES]: Request using the OpenProfile API for user {0} to {1} failed", properties.UserId, serverURI), e); @@ -1586,7 +1586,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles return false; } } - + properties = (UserProfileProperties)Prop; if(foreign) { @@ -1704,7 +1704,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles { bool local; local = UserManagementModule.IsLocalGridUser(userID); - + if (!local) { serverURI = UserManagementModule.GetUserServerURL(userID, "GatekeeperURI"); @@ -1761,13 +1761,13 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles string imageIDstr = imageID.ToString(); - + if(m_assetCache != null && m_assetCache.Check(imageIDstr)) return; if(Scene.AssetService.Get(imageIDstr) != null) return; - + Scene.AssetService.Get(string.Format("{0}/{1}", assetServerURI, imageIDstr)); } @@ -1876,7 +1876,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles if (mret.ContainsKey("error")) return false; - + // get params... OSD.DeserializeMembers(ref parameters, (OSDMap) mret["result"]); return true; -- cgit v1.1