diff options
author | Mic Bowman | 2011-08-19 14:49:16 -0700 |
---|---|---|
committer | Mic Bowman | 2011-08-19 14:49:16 -0700 |
commit | 384cb79a1a27c47bb3fdbdef6d601a3dcb9dfb0f (patch) | |
tree | 5e557eac5d4d3d4ad95b9e3e70a2a661e5745ec3 /OpenSim/Region/CoreModules | |
parent | BulletSim: add runtime setting of physics parameters. Update default values. (diff) | |
parent | Get rid of HttpServer.dll to avoid confusion since we use HttpServer_OpenSim.... (diff) | |
download | opensim-SC-384cb79a1a27c47bb3fdbdef6d601a3dcb9dfb0f.zip opensim-SC-384cb79a1a27c47bb3fdbdef6d601a3dcb9dfb0f.tar.gz opensim-SC-384cb79a1a27c47bb3fdbdef6d601a3dcb9dfb0f.tar.bz2 opensim-SC-384cb79a1a27c47bb3fdbdef6d601a3dcb9dfb0f.tar.xz |
Merge branch 'master' into bulletsim
Conflicts:
OpenSim/Region/Framework/Scenes/SceneManager.cs
Diffstat (limited to 'OpenSim/Region/CoreModules')
24 files changed, 721 insertions, 210 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index da39202..22c301b 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -357,8 +357,6 @@ namespace Flotsam.RegionModules.AssetCache | |||
357 | 357 | ||
358 | asset = (AssetBase)bformatter.Deserialize(stream); | 358 | asset = (AssetBase)bformatter.Deserialize(stream); |
359 | 359 | ||
360 | UpdateMemoryCache(id, asset); | ||
361 | |||
362 | m_DiskHits++; | 360 | m_DiskHits++; |
363 | } | 361 | } |
364 | catch (System.Runtime.Serialization.SerializationException e) | 362 | catch (System.Runtime.Serialization.SerializationException e) |
@@ -419,9 +417,15 @@ namespace Flotsam.RegionModules.AssetCache | |||
419 | 417 | ||
420 | if (m_MemoryCacheEnabled) | 418 | if (m_MemoryCacheEnabled) |
421 | asset = GetFromMemoryCache(id); | 419 | asset = GetFromMemoryCache(id); |
420 | |||
422 | if (asset == null && m_FileCacheEnabled) | 421 | if (asset == null && m_FileCacheEnabled) |
422 | { | ||
423 | asset = GetFromFileCache(id); | 423 | asset = GetFromFileCache(id); |
424 | 424 | ||
425 | if (m_MemoryCacheEnabled && asset != null) | ||
426 | UpdateMemoryCache(id, asset); | ||
427 | } | ||
428 | |||
425 | if (((m_LogLevel >= 1)) && (m_HitRateDisplay != 0) && (m_Requests % m_HitRateDisplay == 0)) | 429 | if (((m_LogLevel >= 1)) && (m_HitRateDisplay != 0) && (m_Requests % m_HitRateDisplay == 0)) |
426 | { | 430 | { |
427 | m_HitRateFile = (double)m_DiskHits / m_Requests * 100.0; | 431 | m_HitRateFile = (double)m_DiskHits / m_Requests * 100.0; |
@@ -589,33 +593,59 @@ namespace Flotsam.RegionModules.AssetCache | |||
589 | 593 | ||
590 | try | 594 | try |
591 | { | 595 | { |
592 | if (!Directory.Exists(directory)) | 596 | try |
593 | { | 597 | { |
594 | Directory.CreateDirectory(directory); | 598 | if (!Directory.Exists(directory)) |
599 | { | ||
600 | Directory.CreateDirectory(directory); | ||
601 | } | ||
602 | |||
603 | stream = File.Open(tempname, FileMode.Create); | ||
604 | BinaryFormatter bformatter = new BinaryFormatter(); | ||
605 | bformatter.Serialize(stream, asset); | ||
595 | } | 606 | } |
607 | catch (IOException e) | ||
608 | { | ||
609 | m_log.ErrorFormat( | ||
610 | "[FLOTSAM ASSET CACHE]: Failed to write asset {0} to temporary location {1} (final {2}) on cache in {3}. Exception {4} {5}.", | ||
611 | asset.ID, tempname, filename, directory, e.Message, e.StackTrace); | ||
596 | 612 | ||
597 | stream = File.Open(tempname, FileMode.Create); | 613 | return; |
598 | BinaryFormatter bformatter = new BinaryFormatter(); | 614 | } |
599 | bformatter.Serialize(stream, asset); | 615 | finally |
600 | stream.Close(); | 616 | { |
601 | 617 | if (stream != null) | |
602 | // Now that it's written, rename it so that it can be found. | 618 | stream.Close(); |
603 | File.Move(tempname, filename); | 619 | } |
604 | 620 | ||
605 | if (m_LogLevel >= 2) | 621 | try |
606 | m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Cache Stored :: {0}", asset.ID); | 622 | { |
607 | } | 623 | // Now that it's written, rename it so that it can be found. |
608 | catch (Exception e) | 624 | // |
609 | { | 625 | // File.Copy(tempname, filename, true); |
610 | m_log.ErrorFormat( | 626 | // File.Delete(tempname); |
611 | "[FLOTSAM ASSET CACHE]: Failed to write asset {0} to cache. Directory {1}, tempname {2}, filename {3}. Exception {4} {5}.", | 627 | // |
612 | asset.ID, directory, tempname, filename, e.Message, e.StackTrace); | 628 | // For a brief period, this was done as a separate copy and then temporary file delete operation to |
629 | // avoid an IOException caused by move if some competing thread had already written the file. | ||
630 | // However, this causes exceptions on Windows when other threads attempt to read a file | ||
631 | // which is still being copied. So instead, go back to moving the file and swallow any IOException. | ||
632 | // | ||
633 | // This situation occurs fairly rarely anyway. We assume in this that moves are atomic on the | ||
634 | // filesystem. | ||
635 | File.Move(tempname, filename); | ||
636 | |||
637 | if (m_LogLevel >= 2) | ||
638 | m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Cache Stored :: {0}", asset.ID); | ||
639 | } | ||
640 | catch (IOException) | ||
641 | { | ||
642 | // If we see an IOException here it's likely that some other competing thread has written the | ||
643 | // cache file first, so ignore. Other IOException errors (e.g. filesystem full) should be | ||
644 | // signally by the earlier temporary file writing code. | ||
645 | } | ||
613 | } | 646 | } |
614 | finally | 647 | finally |
615 | { | 648 | { |
616 | if (stream != null) | ||
617 | stream.Close(); | ||
618 | |||
619 | // Even if the write fails with an exception, we need to make sure | 649 | // Even if the write fails with an exception, we need to make sure |
620 | // that we release the lock on that file, otherwise it'll never get | 650 | // that we release the lock on that file, otherwise it'll never get |
621 | // cached | 651 | // cached |
@@ -629,13 +659,9 @@ namespace Flotsam.RegionModules.AssetCache | |||
629 | waitEvent.Set(); | 659 | waitEvent.Set(); |
630 | } | 660 | } |
631 | #else | 661 | #else |
632 | if (m_CurrentlyWriting.Contains(filename)) | 662 | m_CurrentlyWriting.Remove(filename); |
633 | { | ||
634 | m_CurrentlyWriting.Remove(filename); | ||
635 | } | ||
636 | #endif | 663 | #endif |
637 | } | 664 | } |
638 | |||
639 | } | 665 | } |
640 | } | 666 | } |
641 | 667 | ||
diff --git a/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs b/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs index 63b0c31..2ff1920 100644 --- a/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs +++ b/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs | |||
@@ -65,18 +65,18 @@ namespace OpenSim.Region.CoreModules.Asset.Tests | |||
65 | config.Configs["AssetCache"].Set("MemoryCacheEnabled", "true"); | 65 | config.Configs["AssetCache"].Set("MemoryCacheEnabled", "true"); |
66 | 66 | ||
67 | m_cache = new FlotsamAssetCache(); | 67 | m_cache = new FlotsamAssetCache(); |
68 | m_scene = SceneSetupHelpers.SetupScene(); | 68 | m_scene = SceneHelpers.SetupScene(); |
69 | SceneSetupHelpers.SetupSceneModules(m_scene, config, m_cache); | 69 | SceneHelpers.SetupSceneModules(m_scene, config, m_cache); |
70 | } | 70 | } |
71 | 71 | ||
72 | [Test] | 72 | [Test] |
73 | public void TestCacheAsset() | 73 | public void TestCacheAsset() |
74 | { | 74 | { |
75 | TestHelper.InMethod(); | 75 | TestHelpers.InMethod(); |
76 | // log4net.Config.XmlConfigurator.Configure(); | 76 | // log4net.Config.XmlConfigurator.Configure(); |
77 | 77 | ||
78 | AssetBase asset = AssetHelpers.CreateAsset(); | 78 | AssetBase asset = AssetHelpers.CreateAsset(); |
79 | asset.ID = TestHelper.ParseTail(0x1).ToString(); | 79 | asset.ID = TestHelpers.ParseTail(0x1).ToString(); |
80 | 80 | ||
81 | // Check we don't get anything before the asset is put in the cache | 81 | // Check we don't get anything before the asset is put in the cache |
82 | AssetBase retrievedAsset = m_cache.Get(asset.ID.ToString()); | 82 | AssetBase retrievedAsset = m_cache.Get(asset.ID.ToString()); |
@@ -93,11 +93,11 @@ namespace OpenSim.Region.CoreModules.Asset.Tests | |||
93 | [Test] | 93 | [Test] |
94 | public void TestExpireAsset() | 94 | public void TestExpireAsset() |
95 | { | 95 | { |
96 | TestHelper.InMethod(); | 96 | TestHelpers.InMethod(); |
97 | // log4net.Config.XmlConfigurator.Configure(); | 97 | // log4net.Config.XmlConfigurator.Configure(); |
98 | 98 | ||
99 | AssetBase asset = AssetHelpers.CreateAsset(); | 99 | AssetBase asset = AssetHelpers.CreateAsset(); |
100 | asset.ID = TestHelper.ParseTail(0x2).ToString(); | 100 | asset.ID = TestHelpers.ParseTail(0x2).ToString(); |
101 | 101 | ||
102 | m_cache.Store(asset); | 102 | m_cache.Store(asset); |
103 | 103 | ||
@@ -110,11 +110,11 @@ namespace OpenSim.Region.CoreModules.Asset.Tests | |||
110 | [Test] | 110 | [Test] |
111 | public void TestClearCache() | 111 | public void TestClearCache() |
112 | { | 112 | { |
113 | TestHelper.InMethod(); | 113 | TestHelpers.InMethod(); |
114 | // log4net.Config.XmlConfigurator.Configure(); | 114 | // log4net.Config.XmlConfigurator.Configure(); |
115 | 115 | ||
116 | AssetBase asset = AssetHelpers.CreateAsset(); | 116 | AssetBase asset = AssetHelpers.CreateAsset(); |
117 | asset.ID = TestHelper.ParseTail(0x2).ToString(); | 117 | asset.ID = TestHelpers.ParseTail(0x2).ToString(); |
118 | 118 | ||
119 | m_cache.Store(asset); | 119 | m_cache.Store(asset); |
120 | 120 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 1e09610..97a1be6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -101,7 +101,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
101 | /// <param name="silent"></param> | 101 | /// <param name="silent"></param> |
102 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) | 102 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) |
103 | { | 103 | { |
104 | m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); | 104 | // m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); |
105 | 105 | ||
106 | try | 106 | try |
107 | { | 107 | { |
@@ -226,9 +226,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
226 | public UUID RezSingleAttachmentFromInventory( | 226 | public UUID RezSingleAttachmentFromInventory( |
227 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus) | 227 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus) |
228 | { | 228 | { |
229 | m_log.DebugFormat( | 229 | // m_log.DebugFormat( |
230 | "[ATTACHMENTS MODULE]: Rezzing attachment to point {0} from item {1} for {2}", | 230 | // "[ATTACHMENTS MODULE]: Rezzing attachment to point {0} from item {1} for {2}", |
231 | (AttachmentPoint)AttachmentPt, itemID, remoteClient.Name); | 231 | // (AttachmentPoint)AttachmentPt, itemID, remoteClient.Name); |
232 | 232 | ||
233 | // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should | 233 | // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should |
234 | // be removed when that functionality is implemented in opensim | 234 | // be removed when that functionality is implemented in opensim |
@@ -261,7 +261,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
261 | false, false, remoteClient.AgentId, true); | 261 | false, false, remoteClient.AgentId, true); |
262 | 262 | ||
263 | // m_log.DebugFormat( | 263 | // m_log.DebugFormat( |
264 | // "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}", | 264 | // "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}", |
265 | // objatt.Name, remoteClient.Name, AttachmentPt); | 265 | // objatt.Name, remoteClient.Name, AttachmentPt); |
266 | 266 | ||
267 | if (objatt != null) | 267 | if (objatt != null) |
@@ -466,7 +466,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
466 | { | 466 | { |
467 | m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero); | 467 | m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero); |
468 | group.DetachToInventoryPrep(); | 468 | group.DetachToInventoryPrep(); |
469 | m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); | 469 | // m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); |
470 | 470 | ||
471 | // If an item contains scripts, it's always changed. | 471 | // If an item contains scripts, it's always changed. |
472 | // This ensures script state is saved on detach | 472 | // This ensures script state is saved on detach |
@@ -501,10 +501,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
501 | /// <summary> | 501 | /// <summary> |
502 | /// Update the attachment asset for the new sog details if they have changed. | 502 | /// Update the attachment asset for the new sog details if they have changed. |
503 | /// </summary> | 503 | /// </summary> |
504 | /// | 504 | /// <remarks> |
505 | /// This is essential for preserving attachment attributes such as permission. Unlike normal scene objects, | 505 | /// This is essential for preserving attachment attributes such as permission. Unlike normal scene objects, |
506 | /// these details are not stored on the region. | 506 | /// these details are not stored on the region. |
507 | /// | 507 | /// </remarks> |
508 | /// <param name="remoteClient"></param> | 508 | /// <param name="remoteClient"></param> |
509 | /// <param name="grp"></param> | 509 | /// <param name="grp"></param> |
510 | /// <param name="itemID"></param> | 510 | /// <param name="itemID"></param> |
@@ -566,8 +566,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
566 | /// <param name="silent"></param> | 566 | /// <param name="silent"></param> |
567 | protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent) | 567 | protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent) |
568 | { | 568 | { |
569 | m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}", Name, avatar.Name, | 569 | // m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}", |
570 | attachmentpoint, attachOffset, so.RootPart.AttachedPos); | 570 | // so.Name, avatar.Name, attachmentpoint, attachOffset, so.RootPart.AttachedPos); |
571 | 571 | ||
572 | so.DetachFromBackup(); | 572 | so.DetachFromBackup(); |
573 | 573 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs new file mode 100644 index 0000000..5bac4c6 --- /dev/null +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -0,0 +1,200 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using System.Text; | ||
32 | using System.Threading; | ||
33 | using System.Timers; | ||
34 | using Timer=System.Timers.Timer; | ||
35 | using Nini.Config; | ||
36 | using NUnit.Framework; | ||
37 | using OpenMetaverse; | ||
38 | using OpenSim.Framework; | ||
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Region.CoreModules.Avatar.Attachments; | ||
41 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; | ||
42 | using OpenSim.Region.CoreModules.World.Serialiser; | ||
43 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; | ||
44 | using OpenSim.Region.Framework.Scenes; | ||
45 | using OpenSim.Region.Framework.Interfaces; | ||
46 | using OpenSim.Tests.Common; | ||
47 | using OpenSim.Tests.Common.Mock; | ||
48 | |||
49 | namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | ||
50 | { | ||
51 | /// <summary> | ||
52 | /// Attachment tests | ||
53 | /// </summary> | ||
54 | [TestFixture] | ||
55 | public class AttachmentsModuleTests | ||
56 | { | ||
57 | public Scene scene; | ||
58 | public UUID agent1; | ||
59 | public static Random random; | ||
60 | public AgentCircuitData acd1; | ||
61 | public SceneObjectGroup sog1, sog2; | ||
62 | |||
63 | [SetUp] | ||
64 | public void Init() | ||
65 | { | ||
66 | // Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread. | ||
67 | Util.FireAndForgetMethod = FireAndForgetMethod.None; | ||
68 | |||
69 | IConfigSource config = new IniConfigSource(); | ||
70 | config.AddConfig("Modules"); | ||
71 | config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); | ||
72 | |||
73 | scene = SceneHelpers.SetupScene(); | ||
74 | SceneHelpers.SetupSceneModules(scene, config, new AttachmentsModule(), new BasicInventoryAccessModule()); | ||
75 | |||
76 | agent1 = UUID.Random(); | ||
77 | random = new Random(); | ||
78 | sog1 = NewSOG(UUID.Random(), scene, agent1); | ||
79 | sog2 = NewSOG(UUID.Random(), scene, agent1); | ||
80 | } | ||
81 | |||
82 | [TearDown] | ||
83 | public void TearDown() | ||
84 | { | ||
85 | // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple | ||
86 | // threads. Possibly, later tests should be rewritten not to worry about such things. | ||
87 | Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod; | ||
88 | } | ||
89 | |||
90 | [Test] | ||
91 | public void TestAddAttachments() | ||
92 | { | ||
93 | TestHelpers.InMethod(); | ||
94 | |||
95 | ScenePresence presence = SceneHelpers.AddScenePresence(scene, agent1); | ||
96 | presence.AddAttachment(sog1); | ||
97 | presence.AddAttachment(sog2); | ||
98 | |||
99 | Assert.That(presence.HasAttachments(), Is.True); | ||
100 | Assert.That(presence.ValidateAttachments(), Is.True); | ||
101 | } | ||
102 | |||
103 | [Test] | ||
104 | public void TestRemoveAttachments() | ||
105 | { | ||
106 | TestHelpers.InMethod(); | ||
107 | |||
108 | ScenePresence presence = SceneHelpers.AddScenePresence(scene, agent1); | ||
109 | presence.AddAttachment(sog1); | ||
110 | presence.AddAttachment(sog2); | ||
111 | presence.RemoveAttachment(sog1); | ||
112 | presence.RemoveAttachment(sog2); | ||
113 | Assert.That(presence.HasAttachments(), Is.False); | ||
114 | } | ||
115 | |||
116 | [Test] | ||
117 | public void TestRezAttachmentsOnAvatarEntrance() | ||
118 | { | ||
119 | TestHelpers.InMethod(); | ||
120 | // log4net.Config.XmlConfigurator.Configure(); | ||
121 | |||
122 | UUID userId = TestHelpers.ParseTail(0x1); | ||
123 | UUID attItemId = TestHelpers.ParseTail(0x2); | ||
124 | UUID attAssetId = TestHelpers.ParseTail(0x3); | ||
125 | string attName = "att"; | ||
126 | |||
127 | UserAccountHelpers.CreateUserWithInventory(scene, userId); | ||
128 | InventoryItemBase attItem | ||
129 | = UserInventoryHelpers.CreateInventoryItem( | ||
130 | scene, attName, attItemId, attAssetId, userId, InventoryType.Object); | ||
131 | |||
132 | AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId); | ||
133 | acd.Appearance = new AvatarAppearance(); | ||
134 | acd.Appearance.SetAttachment((int)AttachmentPoint.Chest, attItem.ID, attItem.AssetID); | ||
135 | ScenePresence presence = SceneHelpers.AddScenePresence(scene, acd); | ||
136 | |||
137 | Assert.That(presence.HasAttachments(), Is.True); | ||
138 | List<SceneObjectGroup> attachments = presence.Attachments; | ||
139 | |||
140 | Assert.That(attachments.Count, Is.EqualTo(1)); | ||
141 | Assert.That(attachments[0].Name, Is.EqualTo(attName)); | ||
142 | } | ||
143 | |||
144 | // I'm commenting this test because scene setup NEEDS InventoryService to | ||
145 | // be non-null | ||
146 | //[Test] | ||
147 | // public void T032_CrossAttachments() | ||
148 | // { | ||
149 | // TestHelpers.InMethod(); | ||
150 | // | ||
151 | // ScenePresence presence = scene.GetScenePresence(agent1); | ||
152 | // ScenePresence presence2 = scene2.GetScenePresence(agent1); | ||
153 | // presence2.AddAttachment(sog1); | ||
154 | // presence2.AddAttachment(sog2); | ||
155 | // | ||
156 | // ISharedRegionModule serialiser = new SerialiserModule(); | ||
157 | // SceneHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser); | ||
158 | // SceneHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser); | ||
159 | // | ||
160 | // Assert.That(presence.HasAttachments(), Is.False, "Presence has attachments before cross"); | ||
161 | // | ||
162 | // //Assert.That(presence2.CrossAttachmentsIntoNewRegion(region1, true), Is.True, "Cross was not successful"); | ||
163 | // Assert.That(presence2.HasAttachments(), Is.False, "Presence2 objects were not deleted"); | ||
164 | // Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects"); | ||
165 | // } | ||
166 | |||
167 | private SceneObjectGroup NewSOG(UUID uuid, Scene scene, UUID agent) | ||
168 | { | ||
169 | SceneObjectPart sop = new SceneObjectPart(); | ||
170 | sop.Name = RandomName(); | ||
171 | sop.Description = RandomName(); | ||
172 | sop.Text = RandomName(); | ||
173 | sop.SitName = RandomName(); | ||
174 | sop.TouchName = RandomName(); | ||
175 | sop.UUID = uuid; | ||
176 | sop.Shape = PrimitiveBaseShape.Default; | ||
177 | sop.Shape.State = 1; | ||
178 | sop.OwnerID = agent; | ||
179 | |||
180 | SceneObjectGroup sog = new SceneObjectGroup(sop); | ||
181 | sog.SetScene(scene); | ||
182 | |||
183 | return sog; | ||
184 | } | ||
185 | |||
186 | private static string RandomName() | ||
187 | { | ||
188 | StringBuilder name = new StringBuilder(); | ||
189 | int size = random.Next(5,12); | ||
190 | char ch; | ||
191 | for (int i = 0; i < size; i++) | ||
192 | { | ||
193 | ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ; | ||
194 | name.Append(ch); | ||
195 | } | ||
196 | |||
197 | return name.ToString(); | ||
198 | } | ||
199 | } | ||
200 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index e3e3452..4627701 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
104 | public void NewClient(IClientAPI client) | 104 | public void NewClient(IClientAPI client) |
105 | { | 105 | { |
106 | client.OnRequestWearables += SendWearables; | 106 | client.OnRequestWearables += SendWearables; |
107 | client.OnSetAppearance += SetAppearance; | 107 | client.OnSetAppearance += SetAppearanceFromClient; |
108 | client.OnAvatarNowWearing += AvatarIsWearing; | 108 | client.OnAvatarNowWearing += AvatarIsWearing; |
109 | } | 109 | } |
110 | 110 | ||
@@ -189,7 +189,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
189 | /// <param name="client"></param> | 189 | /// <param name="client"></param> |
190 | /// <param name="texture"></param> | 190 | /// <param name="texture"></param> |
191 | /// <param name="visualParam"></param> | 191 | /// <param name="visualParam"></param> |
192 | public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams) | 192 | public void SetAppearanceFromClient(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams) |
193 | { | 193 | { |
194 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); | 194 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); |
195 | if (sp == null) | 195 | if (sp == null) |
@@ -257,6 +257,85 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
257 | return true; | 257 | return true; |
258 | } | 258 | } |
259 | 259 | ||
260 | public bool SaveBakedTextures(UUID agentId) | ||
261 | { | ||
262 | ScenePresence sp = m_scene.GetScenePresence(agentId); | ||
263 | |||
264 | if (sp == null || sp.IsChildAgent) | ||
265 | return false; | ||
266 | |||
267 | AvatarAppearance appearance = sp.Appearance; | ||
268 | Primitive.TextureEntryFace[] faceTextures = appearance.Texture.FaceTextures; | ||
269 | |||
270 | m_log.DebugFormat( | ||
271 | "[AV FACTORY]: Permanently saving baked textures for {0} in {1}", | ||
272 | sp.Name, m_scene.RegionInfo.RegionName); | ||
273 | |||
274 | foreach (int i in Enum.GetValues(typeof(BakeType))) | ||
275 | { | ||
276 | BakeType bakeType = (BakeType)i; | ||
277 | |||
278 | if (bakeType == BakeType.Unknown) | ||
279 | continue; | ||
280 | |||
281 | // m_log.DebugFormat( | ||
282 | // "[AVFACTORY]: NPC avatar {0} has texture id {1} : {2}", | ||
283 | // acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); | ||
284 | |||
285 | int ftIndex = (int)AppearanceManager.BakeTypeToAgentTextureIndex(bakeType); | ||
286 | Primitive.TextureEntryFace bakedTextureFace = faceTextures[ftIndex]; | ||
287 | |||
288 | if (bakedTextureFace == null) | ||
289 | { | ||
290 | m_log.WarnFormat( | ||
291 | "[AV FACTORY]: No texture ID set for {0} for {1} in {2} not found when trying to save permanently", | ||
292 | bakeType, sp.Name, m_scene.RegionInfo.RegionName); | ||
293 | |||
294 | continue; | ||
295 | } | ||
296 | |||
297 | AssetBase asset = m_scene.AssetService.Get(bakedTextureFace.TextureID.ToString()); | ||
298 | |||
299 | if (asset != null) | ||
300 | { | ||
301 | asset.Temporary = false; | ||
302 | m_scene.AssetService.Store(asset); | ||
303 | } | ||
304 | else | ||
305 | { | ||
306 | m_log.WarnFormat( | ||
307 | "[AV FACTORY]: Baked texture id {0} not found for bake {1} for avatar {2} in {3} when trying to save permanently", | ||
308 | bakedTextureFace.TextureID, bakeType, sp.Name, m_scene.RegionInfo.RegionName); | ||
309 | } | ||
310 | } | ||
311 | |||
312 | // for (int i = 0; i < faceTextures.Length; i++) | ||
313 | // { | ||
314 | //// m_log.DebugFormat( | ||
315 | //// "[AVFACTORY]: NPC avatar {0} has texture id {1} : {2}", | ||
316 | //// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); | ||
317 | // | ||
318 | // if (faceTextures[i] == null) | ||
319 | // continue; | ||
320 | // | ||
321 | // AssetBase asset = m_scene.AssetService.Get(faceTextures[i].TextureID.ToString()); | ||
322 | // | ||
323 | // if (asset != null) | ||
324 | // { | ||
325 | // asset.Temporary = false; | ||
326 | // m_scene.AssetService.Store(asset); | ||
327 | // } | ||
328 | // else | ||
329 | // { | ||
330 | // m_log.WarnFormat( | ||
331 | // "[AV FACTORY]: Baked texture {0} for {1} in {2} not found when trying to save permanently", | ||
332 | // faceTextures[i].TextureID, sp.Name, m_scene.RegionInfo.RegionName); | ||
333 | // } | ||
334 | // } | ||
335 | |||
336 | return true; | ||
337 | } | ||
338 | |||
260 | #region UpdateAppearanceTimer | 339 | #region UpdateAppearanceTimer |
261 | 340 | ||
262 | /// <summary> | 341 | /// <summary> |
@@ -289,25 +368,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
289 | } | 368 | } |
290 | } | 369 | } |
291 | 370 | ||
292 | private void HandleAppearanceSend(UUID agentid) | 371 | private void SaveAppearance(UUID agentid) |
293 | { | ||
294 | ScenePresence sp = m_scene.GetScenePresence(agentid); | ||
295 | if (sp == null) | ||
296 | { | ||
297 | m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid); | ||
298 | return; | ||
299 | } | ||
300 | |||
301 | // m_log.WarnFormat("[AVFACTORY]: Handle appearance send for {0}", agentid); | ||
302 | |||
303 | // Send the appearance to everyone in the scene | ||
304 | sp.SendAppearanceToAllOtherAgents(); | ||
305 | |||
306 | // Send animations back to the avatar as well | ||
307 | sp.Animator.SendAnimPack(); | ||
308 | } | ||
309 | |||
310 | private void HandleAppearanceSave(UUID agentid) | ||
311 | { | 372 | { |
312 | // We must set appearance parameters in the en_US culture in order to avoid issues where values are saved | 373 | // We must set appearance parameters in the en_US culture in order to avoid issues where values are saved |
313 | // in a culture where decimal points are commas and then reloaded in a culture which just treats them as | 374 | // in a culture where decimal points are commas and then reloaded in a culture which just treats them as |
@@ -337,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
337 | { | 398 | { |
338 | if (kvp.Value < now) | 399 | if (kvp.Value < now) |
339 | { | 400 | { |
340 | Util.FireAndForget(delegate(object o) { HandleAppearanceSend(kvp.Key); }); | 401 | Util.FireAndForget(delegate(object o) { SendAppearance(kvp.Key); }); |
341 | m_sendqueue.Remove(kvp.Key); | 402 | m_sendqueue.Remove(kvp.Key); |
342 | } | 403 | } |
343 | } | 404 | } |
@@ -350,7 +411,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
350 | { | 411 | { |
351 | if (kvp.Value < now) | 412 | if (kvp.Value < now) |
352 | { | 413 | { |
353 | Util.FireAndForget(delegate(object o) { HandleAppearanceSave(kvp.Key); }); | 414 | Util.FireAndForget(delegate(object o) { SaveAppearance(kvp.Key); }); |
354 | m_savequeue.Remove(kvp.Key); | 415 | m_savequeue.Remove(kvp.Key); |
355 | } | 416 | } |
356 | } | 417 | } |
@@ -427,6 +488,24 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
427 | } | 488 | } |
428 | } | 489 | } |
429 | 490 | ||
491 | public bool SendAppearance(UUID agentId) | ||
492 | { | ||
493 | ScenePresence sp = m_scene.GetScenePresence(agentId); | ||
494 | if (sp == null) | ||
495 | { | ||
496 | m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentId); | ||
497 | return false; | ||
498 | } | ||
499 | |||
500 | // Send the appearance to everyone in the scene | ||
501 | sp.SendAppearanceToAllOtherAgents(); | ||
502 | |||
503 | // Send animations back to the avatar as well | ||
504 | sp.Animator.SendAnimPack(); | ||
505 | |||
506 | return true; | ||
507 | } | ||
508 | |||
430 | private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) | 509 | private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) |
431 | { | 510 | { |
432 | IInventoryService invService = m_scene.InventoryService; | 511 | IInventoryService invService = m_scene.InventoryService; |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs index 07de908..b831b31 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs | |||
@@ -44,21 +44,21 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
44 | [Test] | 44 | [Test] |
45 | public void TestSetAppearance() | 45 | public void TestSetAppearance() |
46 | { | 46 | { |
47 | TestHelper.InMethod(); | 47 | TestHelpers.InMethod(); |
48 | // log4net.Config.XmlConfigurator.Configure(); | 48 | // log4net.Config.XmlConfigurator.Configure(); |
49 | 49 | ||
50 | UUID userId = TestHelper.ParseTail(0x1); | 50 | UUID userId = TestHelpers.ParseTail(0x1); |
51 | 51 | ||
52 | AvatarFactoryModule afm = new AvatarFactoryModule(); | 52 | AvatarFactoryModule afm = new AvatarFactoryModule(); |
53 | TestScene scene = SceneSetupHelpers.SetupScene(); | 53 | TestScene scene = SceneHelpers.SetupScene(); |
54 | SceneSetupHelpers.SetupSceneModules(scene, afm); | 54 | SceneHelpers.SetupSceneModules(scene, afm); |
55 | TestClient tc = SceneSetupHelpers.AddClient(scene, userId); | 55 | IClientAPI tc = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; |
56 | 56 | ||
57 | byte[] visualParams = new byte[AvatarAppearance.VISUALPARAM_COUNT]; | 57 | byte[] visualParams = new byte[AvatarAppearance.VISUALPARAM_COUNT]; |
58 | for (byte i = 0; i < visualParams.Length; i++) | 58 | for (byte i = 0; i < visualParams.Length; i++) |
59 | visualParams[i] = i; | 59 | visualParams[i] = i; |
60 | 60 | ||
61 | afm.SetAppearance(tc, new Primitive.TextureEntry(TestHelper.ParseTail(0x10)), visualParams); | 61 | afm.SetAppearanceFromClient(tc, new Primitive.TextureEntry(TestHelpers.ParseTail(0x10)), visualParams); |
62 | 62 | ||
63 | ScenePresence sp = scene.GetScenePresence(userId); | 63 | ScenePresence sp = scene.GetScenePresence(userId); |
64 | 64 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs index aadeedb..19ef571 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs | |||
@@ -100,8 +100,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
100 | // log4net.Config.XmlConfigurator.Configure(); | 100 | // log4net.Config.XmlConfigurator.Configure(); |
101 | 101 | ||
102 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 102 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
103 | Scene scene = SceneSetupHelpers.SetupScene(); | 103 | Scene scene = SceneHelpers.SetupScene(); |
104 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule); | 104 | SceneHelpers.SetupSceneModules(scene, archiverModule); |
105 | 105 | ||
106 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); | 106 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); |
107 | 107 | ||
@@ -109,7 +109,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
109 | 109 | ||
110 | // Create scene object asset | 110 | // Create scene object asset |
111 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); | 111 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); |
112 | SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50); | 112 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50); |
113 | 113 | ||
114 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 114 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
115 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); | 115 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); |
@@ -127,10 +127,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
127 | scene.AddInventoryItem(item1); | 127 | scene.AddInventoryItem(item1); |
128 | 128 | ||
129 | // Create coalesced objects asset | 129 | // Create coalesced objects asset |
130 | SceneObjectGroup cobj1 = SceneSetupHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120); | 130 | SceneObjectGroup cobj1 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120); |
131 | cobj1.AbsolutePosition = new Vector3(15, 30, 45); | 131 | cobj1.AbsolutePosition = new Vector3(15, 30, 45); |
132 | 132 | ||
133 | SceneObjectGroup cobj2 = SceneSetupHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140); | 133 | SceneObjectGroup cobj2 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140); |
134 | cobj2.AbsolutePosition = new Vector3(25, 50, 75); | 134 | cobj2.AbsolutePosition = new Vector3(25, 50, 75); |
135 | 135 | ||
136 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2); | 136 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index ae3ab21..e409c8e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -61,14 +61,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
61 | SerialiserModule serialiserModule = new SerialiserModule(); | 61 | SerialiserModule serialiserModule = new SerialiserModule(); |
62 | m_archiverModule = new InventoryArchiverModule(); | 62 | m_archiverModule = new InventoryArchiverModule(); |
63 | 63 | ||
64 | m_scene = SceneSetupHelpers.SetupScene(); | 64 | m_scene = SceneHelpers.SetupScene(); |
65 | SceneSetupHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); | 65 | SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); |
66 | } | 66 | } |
67 | 67 | ||
68 | [Test] | 68 | [Test] |
69 | public void TestLoadCoalesecedItem() | 69 | public void TestLoadCoalesecedItem() |
70 | { | 70 | { |
71 | TestHelper.InMethod(); | 71 | TestHelpers.InMethod(); |
72 | // log4net.Config.XmlConfigurator.Configure(); | 72 | // log4net.Config.XmlConfigurator.Configure(); |
73 | 73 | ||
74 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password"); | 74 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password"); |
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
104 | [Test] | 104 | [Test] |
105 | public void TestOrder() | 105 | public void TestOrder() |
106 | { | 106 | { |
107 | TestHelper.InMethod(); | 107 | TestHelpers.InMethod(); |
108 | // log4net.Config.XmlConfigurator.Configure(); | 108 | // log4net.Config.XmlConfigurator.Configure(); |
109 | 109 | ||
110 | MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes); | 110 | MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes); |
@@ -129,7 +129,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
129 | [Test] | 129 | [Test] |
130 | public void TestSaveItemToIar() | 130 | public void TestSaveItemToIar() |
131 | { | 131 | { |
132 | TestHelper.InMethod(); | 132 | TestHelpers.InMethod(); |
133 | // log4net.Config.XmlConfigurator.Configure(); | 133 | // log4net.Config.XmlConfigurator.Configure(); |
134 | 134 | ||
135 | // Create user | 135 | // Create user |
@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
141 | 141 | ||
142 | // Create asset | 142 | // Create asset |
143 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); | 143 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); |
144 | SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50); | 144 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50); |
145 | 145 | ||
146 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 146 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
147 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); | 147 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); |
@@ -224,7 +224,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
224 | [Test] | 224 | [Test] |
225 | public void TestSaveItemToIarNoAssets() | 225 | public void TestSaveItemToIarNoAssets() |
226 | { | 226 | { |
227 | TestHelper.InMethod(); | 227 | TestHelpers.InMethod(); |
228 | // log4net.Config.XmlConfigurator.Configure(); | 228 | // log4net.Config.XmlConfigurator.Configure(); |
229 | 229 | ||
230 | // Create user | 230 | // Create user |
@@ -236,7 +236,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
236 | 236 | ||
237 | // Create asset | 237 | // Create asset |
238 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); | 238 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); |
239 | SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50); | 239 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50); |
240 | 240 | ||
241 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 241 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
242 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); | 242 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); |
@@ -325,7 +325,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
325 | [Test] | 325 | [Test] |
326 | public void TestLoadIarCreatorAccountPresent() | 326 | public void TestLoadIarCreatorAccountPresent() |
327 | { | 327 | { |
328 | TestHelper.InMethod(); | 328 | TestHelpers.InMethod(); |
329 | // log4net.Config.XmlConfigurator.Configure(); | 329 | // log4net.Config.XmlConfigurator.Configure(); |
330 | 330 | ||
331 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood"); | 331 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood"); |
@@ -357,7 +357,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
357 | [Test] | 357 | [Test] |
358 | public void TestLoadIarV0_1SameNameCreator() | 358 | public void TestLoadIarV0_1SameNameCreator() |
359 | { | 359 | { |
360 | TestHelper.InMethod(); | 360 | TestHelpers.InMethod(); |
361 | // log4net.Config.XmlConfigurator.Configure(); | 361 | // log4net.Config.XmlConfigurator.Configure(); |
362 | 362 | ||
363 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood"); | 363 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood"); |
@@ -390,7 +390,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
390 | [Test] | 390 | [Test] |
391 | public void TestLoadIarV0_1AbsentCreator() | 391 | public void TestLoadIarV0_1AbsentCreator() |
392 | { | 392 | { |
393 | TestHelper.InMethod(); | 393 | TestHelpers.InMethod(); |
394 | // log4net.Config.XmlConfigurator.Configure(); | 394 | // log4net.Config.XmlConfigurator.Configure(); |
395 | 395 | ||
396 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password"); | 396 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password"); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs index 127d5f8..417c20c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs | |||
@@ -57,13 +57,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
57 | [Test] | 57 | [Test] |
58 | public void TestSavePathToIarV0_1() | 58 | public void TestSavePathToIarV0_1() |
59 | { | 59 | { |
60 | TestHelper.InMethod(); | 60 | TestHelpers.InMethod(); |
61 | // log4net.Config.XmlConfigurator.Configure(); | 61 | // log4net.Config.XmlConfigurator.Configure(); |
62 | 62 | ||
63 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 63 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
64 | 64 | ||
65 | Scene scene = SceneSetupHelpers.SetupScene(); | 65 | Scene scene = SceneHelpers.SetupScene(); |
66 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule); | 66 | SceneHelpers.SetupSceneModules(scene, archiverModule); |
67 | 67 | ||
68 | // Create user | 68 | // Create user |
69 | string userFirstName = "Jock"; | 69 | string userFirstName = "Jock"; |
@@ -172,16 +172,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
172 | [Test] | 172 | [Test] |
173 | public void TestLoadIarToInventoryPaths() | 173 | public void TestLoadIarToInventoryPaths() |
174 | { | 174 | { |
175 | TestHelper.InMethod(); | 175 | TestHelpers.InMethod(); |
176 | // log4net.Config.XmlConfigurator.Configure(); | 176 | // log4net.Config.XmlConfigurator.Configure(); |
177 | 177 | ||
178 | SerialiserModule serialiserModule = new SerialiserModule(); | 178 | SerialiserModule serialiserModule = new SerialiserModule(); |
179 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 179 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
180 | 180 | ||
181 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene | 181 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene |
182 | Scene scene = SceneSetupHelpers.SetupScene(); | 182 | Scene scene = SceneHelpers.SetupScene(); |
183 | 183 | ||
184 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 184 | SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
185 | 185 | ||
186 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood"); | 186 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood"); |
187 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); | 187 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); |
@@ -217,13 +217,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
217 | [Test] | 217 | [Test] |
218 | public void TestLoadIarPathStartsWithSlash() | 218 | public void TestLoadIarPathStartsWithSlash() |
219 | { | 219 | { |
220 | TestHelper.InMethod(); | 220 | TestHelpers.InMethod(); |
221 | // log4net.Config.XmlConfigurator.Configure(); | 221 | // log4net.Config.XmlConfigurator.Configure(); |
222 | 222 | ||
223 | SerialiserModule serialiserModule = new SerialiserModule(); | 223 | SerialiserModule serialiserModule = new SerialiserModule(); |
224 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 224 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
225 | Scene scene = SceneSetupHelpers.SetupScene(); | 225 | Scene scene = SceneHelpers.SetupScene(); |
226 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 226 | SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
227 | 227 | ||
228 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password"); | 228 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password"); |
229 | archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream); | 229 | archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream); |
@@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
238 | [Test] | 238 | [Test] |
239 | public void TestLoadIarPathWithEscapedChars() | 239 | public void TestLoadIarPathWithEscapedChars() |
240 | { | 240 | { |
241 | TestHelper.InMethod(); | 241 | TestHelpers.InMethod(); |
242 | // log4net.Config.XmlConfigurator.Configure(); | 242 | // log4net.Config.XmlConfigurator.Configure(); |
243 | 243 | ||
244 | string itemName = "You & you are a mean/man/"; | 244 | string itemName = "You & you are a mean/man/"; |
@@ -247,8 +247,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
247 | 247 | ||
248 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 248 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
249 | 249 | ||
250 | Scene scene = SceneSetupHelpers.SetupScene(); | 250 | Scene scene = SceneHelpers.SetupScene(); |
251 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule); | 251 | SceneHelpers.SetupSceneModules(scene, archiverModule); |
252 | 252 | ||
253 | // Create user | 253 | // Create user |
254 | string userFirstName = "Jock"; | 254 | string userFirstName = "Jock"; |
@@ -323,10 +323,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
323 | [Test] | 323 | [Test] |
324 | public void TestNewIarPath() | 324 | public void TestNewIarPath() |
325 | { | 325 | { |
326 | TestHelper.InMethod(); | 326 | TestHelpers.InMethod(); |
327 | // log4net.Config.XmlConfigurator.Configure(); | 327 | // log4net.Config.XmlConfigurator.Configure(); |
328 | 328 | ||
329 | Scene scene = SceneSetupHelpers.SetupScene(); | 329 | Scene scene = SceneHelpers.SetupScene(); |
330 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); | 330 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); |
331 | 331 | ||
332 | Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); | 332 | Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); |
@@ -390,10 +390,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
390 | [Test] | 390 | [Test] |
391 | public void TestPartExistingIarPath() | 391 | public void TestPartExistingIarPath() |
392 | { | 392 | { |
393 | TestHelper.InMethod(); | 393 | TestHelpers.InMethod(); |
394 | //log4net.Config.XmlConfigurator.Configure(); | 394 | //log4net.Config.XmlConfigurator.Configure(); |
395 | 395 | ||
396 | Scene scene = SceneSetupHelpers.SetupScene(); | 396 | Scene scene = SceneHelpers.SetupScene(); |
397 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); | 397 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); |
398 | 398 | ||
399 | string folder1ExistingName = "a"; | 399 | string folder1ExistingName = "a"; |
@@ -441,10 +441,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
441 | [Test] | 441 | [Test] |
442 | public void TestMergeIarPath() | 442 | public void TestMergeIarPath() |
443 | { | 443 | { |
444 | TestHelper.InMethod(); | 444 | TestHelpers.InMethod(); |
445 | // log4net.Config.XmlConfigurator.Configure(); | 445 | // log4net.Config.XmlConfigurator.Configure(); |
446 | 446 | ||
447 | Scene scene = SceneSetupHelpers.SetupScene(); | 447 | Scene scene = SceneHelpers.SetupScene(); |
448 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); | 448 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); |
449 | 449 | ||
450 | string folder1ExistingName = "a"; | 450 | string folder1ExistingName = "a"; |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 457ee33..f5d49c5 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1065,10 +1065,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1065 | #endregion | 1065 | #endregion |
1066 | 1066 | ||
1067 | #region Enable Child Agent | 1067 | #region Enable Child Agent |
1068 | |||
1068 | /// <summary> | 1069 | /// <summary> |
1069 | /// This informs a single neighbouring region about agent "avatar". | 1070 | /// This informs a single neighbouring region about agent "avatar". |
1070 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. | 1071 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. |
1071 | /// </summary> | 1072 | /// </summary> |
1073 | /// <param name="sp"></param> | ||
1074 | /// <param name="region"></param> | ||
1072 | public void EnableChildAgent(ScenePresence sp, GridRegion region) | 1075 | public void EnableChildAgent(ScenePresence sp, GridRegion region) |
1073 | { | 1076 | { |
1074 | m_log.DebugFormat("[ENTITY TRANSFER]: Enabling child agent in new neighbour {0}", region.RegionName); | 1077 | m_log.DebugFormat("[ENTITY TRANSFER]: Enabling child agent in new neighbour {0}", region.RegionName); |
@@ -1126,6 +1129,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1126 | /// This informs all neighbouring regions about agent "avatar". | 1129 | /// This informs all neighbouring regions about agent "avatar". |
1127 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. | 1130 | /// Calls an asynchronous method to do so.. so it doesn't lag the sim. |
1128 | /// </summary> | 1131 | /// </summary> |
1132 | /// <param name="sp"></param> | ||
1129 | public void EnableChildAgents(ScenePresence sp) | 1133 | public void EnableChildAgents(ScenePresence sp) |
1130 | { | 1134 | { |
1131 | List<GridRegion> neighbours = new List<GridRegion>(); | 1135 | List<GridRegion> neighbours = new List<GridRegion>(); |
@@ -1312,7 +1316,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1312 | Utils.LongToUInts(reg.RegionHandle, out x, out y); | 1316 | Utils.LongToUInts(reg.RegionHandle, out x, out y); |
1313 | x = x / Constants.RegionSize; | 1317 | x = x / Constants.RegionSize; |
1314 | y = y / Constants.RegionSize; | 1318 | y = y / Constants.RegionSize; |
1315 | m_log.Debug("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); | 1319 | m_log.Debug("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint + ")"); |
1316 | 1320 | ||
1317 | string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); | 1321 | string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); |
1318 | 1322 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 4933147..65ba87b 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -964,8 +964,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
964 | } | 964 | } |
965 | } | 965 | } |
966 | } | 966 | } |
967 | else | ||
968 | { | ||
969 | m_log.WarnFormat( | ||
970 | "[InventoryAccessModule]: Could not find asset {0} for item {1} {2} for {3} in RezObject()", item.AssetID, item.Name, item.ID, remoteClient.Name); | ||
971 | } | ||
972 | |||
967 | return group; | 973 | return group; |
968 | } | 974 | } |
975 | else | ||
976 | { | ||
977 | m_log.WarnFormat( | ||
978 | "[InventoryAccessModule]: Could not find item {0} for {1} in RezObject()", | ||
979 | itemID, remoteClient.Name); | ||
980 | } | ||
969 | 981 | ||
970 | return null; | 982 | return null; |
971 | } | 983 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs index 733ad25..e74310c 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs | |||
@@ -65,8 +65,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
65 | config.AddConfig("Modules"); | 65 | config.AddConfig("Modules"); |
66 | config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); | 66 | config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); |
67 | 67 | ||
68 | m_scene = SceneSetupHelpers.SetupScene(); | 68 | m_scene = SceneHelpers.SetupScene(); |
69 | SceneSetupHelpers.SetupSceneModules(m_scene, config, m_iam); | 69 | SceneHelpers.SetupSceneModules(m_scene, config, m_iam); |
70 | 70 | ||
71 | // Create user | 71 | // Create user |
72 | string userFirstName = "Jock"; | 72 | string userFirstName = "Jock"; |
@@ -82,14 +82,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
82 | [Test] | 82 | [Test] |
83 | public void TestRezCoalescedObject() | 83 | public void TestRezCoalescedObject() |
84 | { | 84 | { |
85 | TestHelper.InMethod(); | 85 | TestHelpers.InMethod(); |
86 | // log4net.Config.XmlConfigurator.Configure(); | 86 | // log4net.Config.XmlConfigurator.Configure(); |
87 | 87 | ||
88 | // Create asset | 88 | // Create asset |
89 | SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20); | 89 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20); |
90 | object1.AbsolutePosition = new Vector3(15, 30, 45); | 90 | object1.AbsolutePosition = new Vector3(15, 30, 45); |
91 | 91 | ||
92 | SceneObjectGroup object2 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40); | 92 | SceneObjectGroup object2 = SceneHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40); |
93 | object2.AbsolutePosition = new Vector3(25, 50, 75); | 93 | object2.AbsolutePosition = new Vector3(25, 50, 75); |
94 | 94 | ||
95 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2); | 95 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2); |
@@ -138,11 +138,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
138 | [Test] | 138 | [Test] |
139 | public void TestRezObject() | 139 | public void TestRezObject() |
140 | { | 140 | { |
141 | TestHelper.InMethod(); | 141 | TestHelpers.InMethod(); |
142 | // log4net.Config.XmlConfigurator.Configure(); | 142 | // log4net.Config.XmlConfigurator.Configure(); |
143 | 143 | ||
144 | // Create asset | 144 | // Create asset |
145 | SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40); | 145 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40); |
146 | 146 | ||
147 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 147 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
148 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); | 148 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index a4861ec..b0b35e4 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -186,7 +186,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
186 | } | 186 | } |
187 | } | 187 | } |
188 | 188 | ||
189 | |||
190 | private string[] GetUserNames(UUID uuid) | 189 | private string[] GetUserNames(UUID uuid) |
191 | { | 190 | { |
192 | string[] returnstring = new string[2]; | 191 | string[] returnstring = new string[2]; |
@@ -292,6 +291,25 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
292 | return userID.ToString(); | 291 | return userID.ToString(); |
293 | } | 292 | } |
294 | 293 | ||
294 | public void AddUser(UUID uuid, string first, string last) | ||
295 | { | ||
296 | if (m_UserCache.ContainsKey(uuid)) | ||
297 | return; | ||
298 | |||
299 | UserData user = new UserData(); | ||
300 | user.Id = uuid; | ||
301 | user.FirstName = first; | ||
302 | user.LastName = last; | ||
303 | // user.ProfileURL = we should initialize this to the default | ||
304 | |||
305 | AddUserInternal(user); | ||
306 | } | ||
307 | |||
308 | public void AddUser(UUID uuid, string first, string last, string profileURL) | ||
309 | { | ||
310 | AddUser(uuid, profileURL + ";" + first + " " + last); | ||
311 | } | ||
312 | |||
295 | public void AddUser(UUID id, string creatorData) | 313 | public void AddUser(UUID id, string creatorData) |
296 | { | 314 | { |
297 | if (m_UserCache.ContainsKey(id)) | 315 | if (m_UserCache.ContainsKey(id)) |
@@ -299,18 +317,17 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
299 | 317 | ||
300 | // m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, craetorData {1}", id, creatorData); | 318 | // m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, craetorData {1}", id, creatorData); |
301 | 319 | ||
302 | UserData user = new UserData(); | ||
303 | user.Id = id; | ||
304 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id); | 320 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id); |
305 | 321 | ||
306 | if (account != null) | 322 | if (account != null) |
307 | { | 323 | { |
308 | user.FirstName = account.FirstName; | 324 | AddUser(id, account.FirstName, account.LastName); |
309 | user.LastName = account.LastName; | ||
310 | // user.ProfileURL = we should initialize this to the default | ||
311 | } | 325 | } |
312 | else | 326 | else |
313 | { | 327 | { |
328 | UserData user = new UserData(); | ||
329 | user.Id = id; | ||
330 | |||
314 | if (creatorData != null && creatorData != string.Empty) | 331 | if (creatorData != null && creatorData != string.Empty) |
315 | { | 332 | { |
316 | //creatorData = <endpoint>;<name> | 333 | //creatorData = <endpoint>;<name> |
@@ -338,17 +355,19 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
338 | user.FirstName = "Unknown"; | 355 | user.FirstName = "Unknown"; |
339 | user.LastName = "User"; | 356 | user.LastName = "User"; |
340 | } | 357 | } |
341 | } | ||
342 | 358 | ||
343 | lock (m_UserCache) | 359 | AddUserInternal(user); |
344 | m_UserCache[id] = user; | 360 | } |
345 | |||
346 | m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.HomeURL); | ||
347 | } | 361 | } |
348 | 362 | ||
349 | public void AddUser(UUID uuid, string first, string last, string profileURL) | 363 | void AddUserInternal(UserData user) |
350 | { | 364 | { |
351 | AddUser(uuid, profileURL + ";" + first + " " + last); | 365 | lock (m_UserCache) |
366 | m_UserCache[user.Id] = user; | ||
367 | |||
368 | m_log.DebugFormat( | ||
369 | "[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", | ||
370 | user.Id, user.FirstName, user.LastName, user.HomeURL); | ||
352 | } | 371 | } |
353 | 372 | ||
354 | //public void AddUser(UUID uuid, string userData) | 373 | //public void AddUser(UUID uuid, string userData) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index 6543845..d6063ad 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs | |||
@@ -93,7 +93,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
93 | lookat = ((ScenePresence)sp).Lookat; | 93 | lookat = ((ScenePresence)sp).Lookat; |
94 | } | 94 | } |
95 | } | 95 | } |
96 | m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); | 96 | |
97 | // m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); | ||
97 | m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat); | 98 | m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat); |
98 | } | 99 | } |
99 | 100 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 698fd56..72ae3363 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -211,11 +211,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
211 | return; | 211 | return; |
212 | } | 212 | } |
213 | } | 213 | } |
214 | else | 214 | // else |
215 | { | 215 | // { |
216 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: User {0} does not have InventoryServerURI. OH NOES!", userID); | 216 | // m_log.DebugFormat("[HG INVENTORY CONNECTOR]: User {0} does not have InventoryServerURI. OH NOES!", userID); |
217 | return; | 217 | // return; |
218 | } | 218 | // } |
219 | } | 219 | } |
220 | } | 220 | } |
221 | if (sp == null) | 221 | if (sp == null) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs index fa5b873..59a407f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); | 97 | // m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); |
98 | m_PresenceService.LogoutAgent(client.SessionId); | 98 | m_PresenceService.LogoutAgent(client.SessionId); |
99 | } | 99 | } |
100 | 100 | ||
diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs index c355b13..2399134 100644 --- a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs | |||
@@ -129,14 +129,12 @@ namespace OpenSim.Region.CoreModules.World | |||
129 | switch (cmd[1]) | 129 | switch (cmd[1]) |
130 | { | 130 | { |
131 | case "enable": | 131 | case "enable": |
132 | if (scene.LoginsDisabled) | ||
133 | MainConsole.Instance.Output(String.Format("Enabling logins for region {0}", scene.RegionInfo.RegionName)); | ||
134 | scene.LoginsDisabled = false; | 132 | scene.LoginsDisabled = false; |
133 | MainConsole.Instance.Output(String.Format("Logins are enabled for region {0}", scene.RegionInfo.RegionName)); | ||
135 | break; | 134 | break; |
136 | case "disable": | 135 | case "disable": |
137 | if (!scene.LoginsDisabled) | ||
138 | MainConsole.Instance.Output(String.Format("Disabling logins for region {0}", scene.RegionInfo.RegionName)); | ||
139 | scene.LoginsDisabled = true; | 136 | scene.LoginsDisabled = true; |
137 | MainConsole.Instance.Output(String.Format("Logins are disabled for region {0}", scene.RegionInfo.RegionName)); | ||
140 | break; | 138 | break; |
141 | case "status": | 139 | case "status": |
142 | if (scene.LoginsDisabled) | 140 | if (scene.LoginsDisabled) |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 6ba3459..b185d9b 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -68,8 +68,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
68 | SerialiserModule serialiserModule = new SerialiserModule(); | 68 | SerialiserModule serialiserModule = new SerialiserModule(); |
69 | TerrainModule terrainModule = new TerrainModule(); | 69 | TerrainModule terrainModule = new TerrainModule(); |
70 | 70 | ||
71 | m_scene = SceneSetupHelpers.SetupScene(); | 71 | m_scene = SceneHelpers.SetupScene(); |
72 | SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); | 72 | SceneHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); |
73 | } | 73 | } |
74 | 74 | ||
75 | private void LoadCompleted(Guid requestId, string errorMessage) | 75 | private void LoadCompleted(Guid requestId, string errorMessage) |
@@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
125 | [Test] | 125 | [Test] |
126 | public void TestSaveOar() | 126 | public void TestSaveOar() |
127 | { | 127 | { |
128 | TestHelper.InMethod(); | 128 | TestHelpers.InMethod(); |
129 | // log4net.Config.XmlConfigurator.Configure(); | 129 | // log4net.Config.XmlConfigurator.Configure(); |
130 | 130 | ||
131 | SceneObjectPart part1 = CreateSceneObjectPart1(); | 131 | SceneObjectPart part1 = CreateSceneObjectPart1(); |
@@ -217,7 +217,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
217 | [Test] | 217 | [Test] |
218 | public void TestSaveOarNoAssets() | 218 | public void TestSaveOarNoAssets() |
219 | { | 219 | { |
220 | TestHelper.InMethod(); | 220 | TestHelpers.InMethod(); |
221 | // log4net.Config.XmlConfigurator.Configure(); | 221 | // log4net.Config.XmlConfigurator.Configure(); |
222 | 222 | ||
223 | SceneObjectPart part1 = CreateSceneObjectPart1(); | 223 | SceneObjectPart part1 = CreateSceneObjectPart1(); |
@@ -300,7 +300,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
300 | [Test] | 300 | [Test] |
301 | public void TestLoadOar() | 301 | public void TestLoadOar() |
302 | { | 302 | { |
303 | TestHelper.InMethod(); | 303 | TestHelpers.InMethod(); |
304 | // log4net.Config.XmlConfigurator.Configure(); | 304 | // log4net.Config.XmlConfigurator.Configure(); |
305 | 305 | ||
306 | MemoryStream archiveWriteStream = new MemoryStream(); | 306 | MemoryStream archiveWriteStream = new MemoryStream(); |
@@ -409,7 +409,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
409 | [Test] | 409 | [Test] |
410 | public void TestLoadOarRegionSettings() | 410 | public void TestLoadOarRegionSettings() |
411 | { | 411 | { |
412 | TestHelper.InMethod(); | 412 | TestHelpers.InMethod(); |
413 | //log4net.Config.XmlConfigurator.Configure(); | 413 | //log4net.Config.XmlConfigurator.Configure(); |
414 | 414 | ||
415 | MemoryStream archiveWriteStream = new MemoryStream(); | 415 | MemoryStream archiveWriteStream = new MemoryStream(); |
@@ -505,7 +505,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
505 | //[Test] | 505 | //[Test] |
506 | public void TestMergeOar() | 506 | public void TestMergeOar() |
507 | { | 507 | { |
508 | TestHelper.InMethod(); | 508 | TestHelpers.InMethod(); |
509 | //XmlConfigurator.Configure(); | 509 | //XmlConfigurator.Configure(); |
510 | 510 | ||
511 | MemoryStream archiveWriteStream = new MemoryStream(); | 511 | MemoryStream archiveWriteStream = new MemoryStream(); |
@@ -524,8 +524,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
524 | SerialiserModule serialiserModule = new SerialiserModule(); | 524 | SerialiserModule serialiserModule = new SerialiserModule(); |
525 | TerrainModule terrainModule = new TerrainModule(); | 525 | TerrainModule terrainModule = new TerrainModule(); |
526 | 526 | ||
527 | Scene scene = SceneSetupHelpers.SetupScene(); | 527 | Scene scene = SceneHelpers.SetupScene(); |
528 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); | 528 | SceneHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); |
529 | 529 | ||
530 | m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); | 530 | m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); |
531 | 531 | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs index a3aa38d..e553ffa 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs | |||
@@ -64,8 +64,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
64 | { | 64 | { |
65 | m_pcm = new PrimCountModule(); | 65 | m_pcm = new PrimCountModule(); |
66 | LandManagementModule lmm = new LandManagementModule(); | 66 | LandManagementModule lmm = new LandManagementModule(); |
67 | m_scene = SceneSetupHelpers.SetupScene(); | 67 | m_scene = SceneHelpers.SetupScene(); |
68 | SceneSetupHelpers.SetupSceneModules(m_scene, lmm, m_pcm); | 68 | SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm); |
69 | 69 | ||
70 | int xParcelDivider = (int)Constants.RegionSize - 1; | 70 | int xParcelDivider = (int)Constants.RegionSize - 1; |
71 | 71 | ||
@@ -106,12 +106,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
106 | [Test] | 106 | [Test] |
107 | public void TestAddOwnerObject() | 107 | public void TestAddOwnerObject() |
108 | { | 108 | { |
109 | TestHelper.InMethod(); | 109 | TestHelpers.InMethod(); |
110 | // log4net.Config.XmlConfigurator.Configure(); | 110 | // log4net.Config.XmlConfigurator.Configure(); |
111 | 111 | ||
112 | IPrimCounts pc = m_lo.PrimCounts; | 112 | IPrimCounts pc = m_lo.PrimCounts; |
113 | 113 | ||
114 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 114 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
115 | m_scene.AddNewSceneObject(sog, false); | 115 | m_scene.AddNewSceneObject(sog, false); |
116 | 116 | ||
117 | Assert.That(pc.Owner, Is.EqualTo(3)); | 117 | Assert.That(pc.Owner, Is.EqualTo(3)); |
@@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
124 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 124 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
125 | 125 | ||
126 | // Add a second object and retest | 126 | // Add a second object and retest |
127 | SceneObjectGroup sog2 = SceneSetupHelpers.CreateSceneObject(2, m_userId, "b", 0x10); | 127 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); |
128 | m_scene.AddNewSceneObject(sog2, false); | 128 | m_scene.AddNewSceneObject(sog2, false); |
129 | 129 | ||
130 | Assert.That(pc.Owner, Is.EqualTo(5)); | 130 | Assert.That(pc.Owner, Is.EqualTo(5)); |
@@ -143,12 +143,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
143 | [Test] | 143 | [Test] |
144 | public void TestCopyOwnerObject() | 144 | public void TestCopyOwnerObject() |
145 | { | 145 | { |
146 | TestHelper.InMethod(); | 146 | TestHelpers.InMethod(); |
147 | // log4net.Config.XmlConfigurator.Configure(); | 147 | // log4net.Config.XmlConfigurator.Configure(); |
148 | 148 | ||
149 | IPrimCounts pc = m_lo.PrimCounts; | 149 | IPrimCounts pc = m_lo.PrimCounts; |
150 | 150 | ||
151 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 151 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
152 | m_scene.AddNewSceneObject(sog, false); | 152 | m_scene.AddNewSceneObject(sog, false); |
153 | m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity); | 153 | m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity); |
154 | 154 | ||
@@ -169,12 +169,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
169 | [Test] | 169 | [Test] |
170 | public void TestMoveOwnerObject() | 170 | public void TestMoveOwnerObject() |
171 | { | 171 | { |
172 | TestHelper.InMethod(); | 172 | TestHelpers.InMethod(); |
173 | // log4net.Config.XmlConfigurator.Configure(); | 173 | // log4net.Config.XmlConfigurator.Configure(); |
174 | 174 | ||
175 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 175 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
176 | m_scene.AddNewSceneObject(sog, false); | 176 | m_scene.AddNewSceneObject(sog, false); |
177 | SceneObjectGroup sog2 = SceneSetupHelpers.CreateSceneObject(2, m_userId, "b", 0x10); | 177 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); |
178 | m_scene.AddNewSceneObject(sog2, false); | 178 | m_scene.AddNewSceneObject(sog2, false); |
179 | 179 | ||
180 | // Move the first scene object to the eastern strip parcel | 180 | // Move the first scene object to the eastern strip parcel |
@@ -230,13 +230,13 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
230 | [Test] | 230 | [Test] |
231 | public void TestRemoveOwnerObject() | 231 | public void TestRemoveOwnerObject() |
232 | { | 232 | { |
233 | TestHelper.InMethod(); | 233 | TestHelpers.InMethod(); |
234 | // log4net.Config.XmlConfigurator.Configure(); | 234 | // log4net.Config.XmlConfigurator.Configure(); |
235 | 235 | ||
236 | IPrimCounts pc = m_lo.PrimCounts; | 236 | IPrimCounts pc = m_lo.PrimCounts; |
237 | 237 | ||
238 | m_scene.AddNewSceneObject(SceneSetupHelpers.CreateSceneObject(1, m_userId, "a", 0x1), false); | 238 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1), false); |
239 | SceneObjectGroup sogToDelete = SceneSetupHelpers.CreateSceneObject(3, m_userId, "b", 0x10); | 239 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); |
240 | m_scene.AddNewSceneObject(sogToDelete, false); | 240 | m_scene.AddNewSceneObject(sogToDelete, false); |
241 | m_scene.DeleteSceneObject(sogToDelete, false); | 241 | m_scene.DeleteSceneObject(sogToDelete, false); |
242 | 242 | ||
@@ -253,14 +253,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
253 | [Test] | 253 | [Test] |
254 | public void TestAddGroupObject() | 254 | public void TestAddGroupObject() |
255 | { | 255 | { |
256 | TestHelper.InMethod(); | 256 | TestHelpers.InMethod(); |
257 | // log4net.Config.XmlConfigurator.Configure(); | 257 | // log4net.Config.XmlConfigurator.Configure(); |
258 | 258 | ||
259 | m_lo.DeedToGroup(m_groupId); | 259 | m_lo.DeedToGroup(m_groupId); |
260 | 260 | ||
261 | IPrimCounts pc = m_lo.PrimCounts; | 261 | IPrimCounts pc = m_lo.PrimCounts; |
262 | 262 | ||
263 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); | 263 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); |
264 | sog.GroupID = m_groupId; | 264 | sog.GroupID = m_groupId; |
265 | m_scene.AddNewSceneObject(sog, false); | 265 | m_scene.AddNewSceneObject(sog, false); |
266 | 266 | ||
@@ -284,18 +284,18 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
284 | [Test] | 284 | [Test] |
285 | public void TestRemoveGroupObject() | 285 | public void TestRemoveGroupObject() |
286 | { | 286 | { |
287 | TestHelper.InMethod(); | 287 | TestHelpers.InMethod(); |
288 | // log4net.Config.XmlConfigurator.Configure(); | 288 | // log4net.Config.XmlConfigurator.Configure(); |
289 | 289 | ||
290 | m_lo.DeedToGroup(m_groupId); | 290 | m_lo.DeedToGroup(m_groupId); |
291 | 291 | ||
292 | IPrimCounts pc = m_lo.PrimCounts; | 292 | IPrimCounts pc = m_lo.PrimCounts; |
293 | 293 | ||
294 | SceneObjectGroup sogToKeep = SceneSetupHelpers.CreateSceneObject(1, m_userId, "a", 0x1); | 294 | SceneObjectGroup sogToKeep = SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1); |
295 | sogToKeep.GroupID = m_groupId; | 295 | sogToKeep.GroupID = m_groupId; |
296 | m_scene.AddNewSceneObject(sogToKeep, false); | 296 | m_scene.AddNewSceneObject(sogToKeep, false); |
297 | 297 | ||
298 | SceneObjectGroup sogToDelete = SceneSetupHelpers.CreateSceneObject(3, m_userId, "b", 0x10); | 298 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); |
299 | m_scene.AddNewSceneObject(sogToDelete, false); | 299 | m_scene.AddNewSceneObject(sogToDelete, false); |
300 | m_scene.DeleteSceneObject(sogToDelete, false); | 300 | m_scene.DeleteSceneObject(sogToDelete, false); |
301 | 301 | ||
@@ -313,12 +313,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
313 | [Test] | 313 | [Test] |
314 | public void TestAddOthersObject() | 314 | public void TestAddOthersObject() |
315 | { | 315 | { |
316 | TestHelper.InMethod(); | 316 | TestHelpers.InMethod(); |
317 | // log4net.Config.XmlConfigurator.Configure(); | 317 | // log4net.Config.XmlConfigurator.Configure(); |
318 | 318 | ||
319 | IPrimCounts pc = m_lo.PrimCounts; | 319 | IPrimCounts pc = m_lo.PrimCounts; |
320 | 320 | ||
321 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); | 321 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); |
322 | m_scene.AddNewSceneObject(sog, false); | 322 | m_scene.AddNewSceneObject(sog, false); |
323 | 323 | ||
324 | Assert.That(pc.Owner, Is.EqualTo(0)); | 324 | Assert.That(pc.Owner, Is.EqualTo(0)); |
@@ -334,13 +334,13 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
334 | [Test] | 334 | [Test] |
335 | public void TestRemoveOthersObject() | 335 | public void TestRemoveOthersObject() |
336 | { | 336 | { |
337 | TestHelper.InMethod(); | 337 | TestHelpers.InMethod(); |
338 | // log4net.Config.XmlConfigurator.Configure(); | 338 | // log4net.Config.XmlConfigurator.Configure(); |
339 | 339 | ||
340 | IPrimCounts pc = m_lo.PrimCounts; | 340 | IPrimCounts pc = m_lo.PrimCounts; |
341 | 341 | ||
342 | m_scene.AddNewSceneObject(SceneSetupHelpers.CreateSceneObject(1, m_otherUserId, "a", 0x1), false); | 342 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_otherUserId, "a", 0x1), false); |
343 | SceneObjectGroup sogToDelete = SceneSetupHelpers.CreateSceneObject(3, m_otherUserId, "b", 0x10); | 343 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_otherUserId, "b", 0x10); |
344 | m_scene.AddNewSceneObject(sogToDelete, false); | 344 | m_scene.AddNewSceneObject(sogToDelete, false); |
345 | m_scene.DeleteSceneObject(sogToDelete, false); | 345 | m_scene.DeleteSceneObject(sogToDelete, false); |
346 | 346 | ||
@@ -360,10 +360,10 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
360 | [Test] | 360 | [Test] |
361 | public void TestTaint() | 361 | public void TestTaint() |
362 | { | 362 | { |
363 | TestHelper.InMethod(); | 363 | TestHelpers.InMethod(); |
364 | IPrimCounts pc = m_lo.PrimCounts; | 364 | IPrimCounts pc = m_lo.PrimCounts; |
365 | 365 | ||
366 | SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 366 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
367 | m_scene.AddNewSceneObject(sog, false); | 367 | m_scene.AddNewSceneObject(sog, false); |
368 | 368 | ||
369 | m_pcm.TaintPrimCount(); | 369 | m_pcm.TaintPrimCount(); |
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs index aa14054..1d2141e 100644 --- a/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs | |||
@@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
173 | private Bitmap fetchTexture(UUID id) | 173 | private Bitmap fetchTexture(UUID id) |
174 | { | 174 | { |
175 | AssetBase asset = m_scene.AssetService.Get(id.ToString()); | 175 | AssetBase asset = m_scene.AssetService.Get(id.ToString()); |
176 | m_log.DebugFormat("Fetched texture {0}, found: {1}", id, asset != null); | 176 | m_log.DebugFormat("[TexturedMapTileRenderer]: Fetched texture {0}, found: {1}", id, asset != null); |
177 | if (asset == null) return null; | 177 | if (asset == null) return null; |
178 | 178 | ||
179 | ManagedImage managedImage; | 179 | ManagedImage managedImage; |
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs index d5b7082..4326606 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs | |||
@@ -53,17 +53,17 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests | |||
53 | public void SetUp() | 53 | public void SetUp() |
54 | { | 54 | { |
55 | m_module = new MoapModule(); | 55 | m_module = new MoapModule(); |
56 | m_scene = SceneSetupHelpers.SetupScene(); | 56 | m_scene = SceneHelpers.SetupScene(); |
57 | SceneSetupHelpers.SetupSceneModules(m_scene, m_module); | 57 | SceneHelpers.SetupSceneModules(m_scene, m_module); |
58 | } | 58 | } |
59 | 59 | ||
60 | [Test] | 60 | [Test] |
61 | public void TestClearMediaUrl() | 61 | public void TestClearMediaUrl() |
62 | { | 62 | { |
63 | TestHelper.InMethod(); | 63 | TestHelpers.InMethod(); |
64 | // log4net.Config.XmlConfigurator.Configure(); | 64 | // log4net.Config.XmlConfigurator.Configure(); |
65 | 65 | ||
66 | SceneObjectPart part = SceneSetupHelpers.AddSceneObject(m_scene); | 66 | SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene); |
67 | MediaEntry me = new MediaEntry(); | 67 | MediaEntry me = new MediaEntry(); |
68 | 68 | ||
69 | m_module.SetMediaEntry(part, 1, me); | 69 | m_module.SetMediaEntry(part, 1, me); |
@@ -84,11 +84,11 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests | |||
84 | [Test] | 84 | [Test] |
85 | public void TestSetMediaUrl() | 85 | public void TestSetMediaUrl() |
86 | { | 86 | { |
87 | TestHelper.InMethod(); | 87 | TestHelpers.InMethod(); |
88 | 88 | ||
89 | string homeUrl = "opensimulator.org"; | 89 | string homeUrl = "opensimulator.org"; |
90 | 90 | ||
91 | SceneObjectPart part = SceneSetupHelpers.AddSceneObject(m_scene); | 91 | SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene); |
92 | MediaEntry me = new MediaEntry() { HomeURL = homeUrl }; | 92 | MediaEntry me = new MediaEntry() { HomeURL = homeUrl }; |
93 | 93 | ||
94 | m_module.SetMediaEntry(part, 1, me); | 94 | m_module.SetMediaEntry(part, 1, me); |
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs index 4f752ab..d5b585a 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs | |||
@@ -236,14 +236,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
236 | public void Init() | 236 | public void Init() |
237 | { | 237 | { |
238 | m_serialiserModule = new SerialiserModule(); | 238 | m_serialiserModule = new SerialiserModule(); |
239 | m_scene = SceneSetupHelpers.SetupScene(); | 239 | m_scene = SceneHelpers.SetupScene(); |
240 | SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule); | 240 | SceneHelpers.SetupSceneModules(m_scene, m_serialiserModule); |
241 | } | 241 | } |
242 | 242 | ||
243 | [Test] | 243 | [Test] |
244 | public void TestDeserializeXml() | 244 | public void TestDeserializeXml() |
245 | { | 245 | { |
246 | TestHelper.InMethod(); | 246 | TestHelpers.InMethod(); |
247 | //log4net.Config.XmlConfigurator.Configure(); | 247 | //log4net.Config.XmlConfigurator.Configure(); |
248 | 248 | ||
249 | SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(xml); | 249 | SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(xml); |
@@ -259,7 +259,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
259 | [Test] | 259 | [Test] |
260 | public void TestSerializeXml() | 260 | public void TestSerializeXml() |
261 | { | 261 | { |
262 | TestHelper.InMethod(); | 262 | TestHelpers.InMethod(); |
263 | //log4net.Config.XmlConfigurator.Configure(); | 263 | //log4net.Config.XmlConfigurator.Configure(); |
264 | 264 | ||
265 | string rpName = "My Little Donkey"; | 265 | string rpName = "My Little Donkey"; |
@@ -334,7 +334,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
334 | [Test] | 334 | [Test] |
335 | public void TestDeserializeXml2() | 335 | public void TestDeserializeXml2() |
336 | { | 336 | { |
337 | TestHelper.InMethod(); | 337 | TestHelpers.InMethod(); |
338 | //log4net.Config.XmlConfigurator.Configure(); | 338 | //log4net.Config.XmlConfigurator.Configure(); |
339 | 339 | ||
340 | SceneObjectGroup so = m_serialiserModule.DeserializeGroupFromXml2(xml2); | 340 | SceneObjectGroup so = m_serialiserModule.DeserializeGroupFromXml2(xml2); |
@@ -350,7 +350,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
350 | [Test] | 350 | [Test] |
351 | public void TestSerializeXml2() | 351 | public void TestSerializeXml2() |
352 | { | 352 | { |
353 | TestHelper.InMethod(); | 353 | TestHelpers.InMethod(); |
354 | //log4net.Config.XmlConfigurator.Configure(); | 354 | //log4net.Config.XmlConfigurator.Configure(); |
355 | 355 | ||
356 | string rpName = "My Little Pony"; | 356 | string rpName = "My Little Pony"; |
diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs index c2ad7b8..ab8e1bf 100644 --- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs +++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs | |||
@@ -100,15 +100,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation | |||
100 | { | 100 | { |
101 | case Tree.Cypress1: | 101 | case Tree.Cypress1: |
102 | case Tree.Cypress2: | 102 | case Tree.Cypress2: |
103 | tree.Scale = new Vector3(4, 4, 10); | 103 | tree.Scale *= new Vector3(8, 8, 20); |
104 | break; | 104 | break; |
105 | 105 | ||
106 | // case... other tree types | 106 | // case... other tree types |
107 | // tree.Scale = new Vector3(?, ?, ?); | 107 | // tree.Scale *= new Vector3(?, ?, ?); |
108 | // break; | 108 | // break; |
109 | 109 | ||
110 | default: | 110 | default: |
111 | tree.Scale = new Vector3(4, 4, 4); | 111 | tree.Scale *= new Vector3(8, 8, 8); |
112 | break; | 112 | break; |
113 | } | 113 | } |
114 | } | 114 | } |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index fac2dab..710230a 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -46,6 +46,7 @@ using OpenSim.Framework.Servers; | |||
46 | using OpenSim.Framework.Servers.HttpServer; | 46 | using OpenSim.Framework.Servers.HttpServer; |
47 | using OpenSim.Region.Framework.Interfaces; | 47 | using OpenSim.Region.Framework.Interfaces; |
48 | using OpenSim.Region.Framework.Scenes; | 48 | using OpenSim.Region.Framework.Scenes; |
49 | using OpenSim.Region.CoreModules.World.Land; | ||
49 | using Caps=OpenSim.Framework.Capabilities.Caps; | 50 | using Caps=OpenSim.Framework.Capabilities.Caps; |
50 | using OSDArray=OpenMetaverse.StructuredData.OSDArray; | 51 | using OSDArray=OpenMetaverse.StructuredData.OSDArray; |
51 | using OSDMap=OpenMetaverse.StructuredData.OSDMap; | 52 | using OSDMap=OpenMetaverse.StructuredData.OSDMap; |
@@ -68,6 +69,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
68 | protected Scene m_scene; | 69 | protected Scene m_scene; |
69 | private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>(); | 70 | private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>(); |
70 | private int cachedTime = 0; | 71 | private int cachedTime = 0; |
72 | private int blacklistTimeout = 10*60*1000; // 10 minutes | ||
71 | private byte[] myMapImageJPEG; | 73 | private byte[] myMapImageJPEG; |
72 | protected volatile bool m_Enabled = false; | 74 | protected volatile bool m_Enabled = false; |
73 | private Dictionary<UUID, MapRequestState> m_openRequests = new Dictionary<UUID, MapRequestState>(); | 75 | private Dictionary<UUID, MapRequestState> m_openRequests = new Dictionary<UUID, MapRequestState>(); |
@@ -85,6 +87,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
85 | IConfig startupConfig = config.Configs["Startup"]; | 87 | IConfig startupConfig = config.Configs["Startup"]; |
86 | if (startupConfig.GetString("WorldMapModule", "WorldMap") == "WorldMap") | 88 | if (startupConfig.GetString("WorldMapModule", "WorldMap") == "WorldMap") |
87 | m_Enabled = true; | 89 | m_Enabled = true; |
90 | |||
91 | blacklistTimeout = startupConfig.GetInt("BlacklistTimeout", 10*60) * 1000; | ||
88 | } | 92 | } |
89 | 93 | ||
90 | public virtual void AddRegion (Scene scene) | 94 | public virtual void AddRegion (Scene scene) |
@@ -159,11 +163,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
159 | m_scene.EventManager.OnClientClosed += ClientLoggedOut; | 163 | m_scene.EventManager.OnClientClosed += ClientLoggedOut; |
160 | m_scene.EventManager.OnMakeChildAgent += MakeChildAgent; | 164 | m_scene.EventManager.OnMakeChildAgent += MakeChildAgent; |
161 | m_scene.EventManager.OnMakeRootAgent += MakeRootAgent; | 165 | m_scene.EventManager.OnMakeRootAgent += MakeRootAgent; |
166 | m_scene.EventManager.OnRegionUp += OnRegionUp; | ||
167 | |||
168 | StartThread(new object()); | ||
162 | } | 169 | } |
163 | 170 | ||
164 | // this has to be called with a lock on m_scene | 171 | // this has to be called with a lock on m_scene |
165 | protected virtual void RemoveHandlers() | 172 | protected virtual void RemoveHandlers() |
166 | { | 173 | { |
174 | StopThread(); | ||
175 | |||
176 | m_scene.EventManager.OnRegionUp -= OnRegionUp; | ||
167 | m_scene.EventManager.OnMakeRootAgent -= MakeRootAgent; | 177 | m_scene.EventManager.OnMakeRootAgent -= MakeRootAgent; |
168 | m_scene.EventManager.OnMakeChildAgent -= MakeChildAgent; | 178 | m_scene.EventManager.OnMakeChildAgent -= MakeChildAgent; |
169 | m_scene.EventManager.OnClientClosed -= ClientLoggedOut; | 179 | m_scene.EventManager.OnClientClosed -= ClientLoggedOut; |
@@ -279,7 +289,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
279 | /// <returns></returns> | 289 | /// <returns></returns> |
280 | public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq) | 290 | public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq) |
281 | { | 291 | { |
282 | m_log.Debug("[WORLD MAP]: MapLayer Request in region: " + m_scene.RegionInfo.RegionName); | 292 | m_log.DebugFormat("[WORLD MAP]: MapLayer Request in region: {0}", m_scene.RegionInfo.RegionName); |
283 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); | 293 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); |
284 | mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse()); | 294 | mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse()); |
285 | return mapResponse; | 295 | return mapResponse; |
@@ -321,8 +331,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
321 | lock (m_rootAgents) | 331 | lock (m_rootAgents) |
322 | { | 332 | { |
323 | m_rootAgents.Remove(AgentId); | 333 | m_rootAgents.Remove(AgentId); |
324 | if (m_rootAgents.Count == 0) | ||
325 | StopThread(); | ||
326 | } | 334 | } |
327 | } | 335 | } |
328 | #endregion | 336 | #endregion |
@@ -362,6 +370,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
362 | public virtual void HandleMapItemRequest(IClientAPI remoteClient, uint flags, | 370 | public virtual void HandleMapItemRequest(IClientAPI remoteClient, uint flags, |
363 | uint EstateID, bool godlike, uint itemtype, ulong regionhandle) | 371 | uint EstateID, bool godlike, uint itemtype, ulong regionhandle) |
364 | { | 372 | { |
373 | // m_log.DebugFormat("[WORLD MAP]: Handle MapItem request {0} {1}", regionhandle, itemtype); | ||
374 | |||
365 | lock (m_rootAgents) | 375 | lock (m_rootAgents) |
366 | { | 376 | { |
367 | if (!m_rootAgents.Contains(remoteClient.AgentId)) | 377 | if (!m_rootAgents.Contains(remoteClient.AgentId)) |
@@ -370,7 +380,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
370 | uint xstart = 0; | 380 | uint xstart = 0; |
371 | uint ystart = 0; | 381 | uint ystart = 0; |
372 | Utils.LongToUInts(m_scene.RegionInfo.RegionHandle, out xstart, out ystart); | 382 | Utils.LongToUInts(m_scene.RegionInfo.RegionHandle, out xstart, out ystart); |
373 | if (itemtype == 6) // we only sevice 6 right now (avatar green dots) | 383 | if (itemtype == 6) // Service 6 right now (MAP_ITEM_AGENTS_LOCATION; green dots) |
374 | { | 384 | { |
375 | if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle) | 385 | if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle) |
376 | { | 386 | { |
@@ -414,14 +424,58 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
414 | // Remote Map Item Request | 424 | // Remote Map Item Request |
415 | 425 | ||
416 | // ensures that the blockingqueue doesn't get borked if the GetAgents() timing changes. | 426 | // ensures that the blockingqueue doesn't get borked if the GetAgents() timing changes. |
417 | // Note that we only start up a remote mapItem Request thread if there's users who could | 427 | RequestMapItems("",remoteClient.AgentId,flags,EstateID,godlike,itemtype,regionhandle); |
418 | // be making requests | 428 | } |
419 | if (!threadrunning) | 429 | } else if (itemtype == 7) // Service 7 (MAP_ITEM_LAND_FOR_SALE) |
430 | { | ||
431 | if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle) | ||
432 | { | ||
433 | // Parcels | ||
434 | ILandChannel landChannel = m_scene.LandChannel; | ||
435 | List<ILandObject> parcels = landChannel.AllParcels(); | ||
436 | |||
437 | // Local Map Item Request | ||
438 | int tc = Environment.TickCount; | ||
439 | List<mapItemReply> mapitems = new List<mapItemReply>(); | ||
440 | mapItemReply mapitem = new mapItemReply(); | ||
441 | if ((parcels != null) && (parcels.Count >= 1)) | ||
420 | { | 442 | { |
421 | m_log.Warn("[WORLD MAP]: Starting new remote request thread manually. This means that AvatarEnteringParcel never fired! This needs to be fixed! Don't Mantis this, as the developers can see it in this message"); | 443 | foreach (ILandObject parcel_interface in parcels) |
422 | StartThread(new object()); | 444 | { |
445 | // Play it safe | ||
446 | if (!(parcel_interface is LandObject)) | ||
447 | continue; | ||
448 | |||
449 | LandObject land = (LandObject)parcel_interface; | ||
450 | LandData parcel = land.LandData; | ||
451 | |||
452 | // Show land for sale | ||
453 | if ((parcel.Flags & (uint)ParcelFlags.ForSale) == (uint)ParcelFlags.ForSale) | ||
454 | { | ||
455 | Vector3 min = parcel.AABBMin; | ||
456 | Vector3 max = parcel.AABBMax; | ||
457 | float x = (min.X+max.X)/2; | ||
458 | float y = (min.Y+max.Y)/2; | ||
459 | |||
460 | mapitem = new mapItemReply(); | ||
461 | mapitem.x = (uint)(xstart + x); | ||
462 | mapitem.y = (uint)(ystart + y); | ||
463 | // mapitem.z = (uint)m_scene.GetGroundHeight(x,y); | ||
464 | mapitem.id = UUID.Zero; | ||
465 | mapitem.name = parcel.Name; | ||
466 | mapitem.Extra = parcel.Area; | ||
467 | mapitem.Extra2 = parcel.SalePrice; | ||
468 | mapitems.Add(mapitem); | ||
469 | } | ||
470 | } | ||
423 | } | 471 | } |
472 | remoteClient.SendMapItemReply(mapitems.ToArray(), itemtype, flags); | ||
473 | } | ||
474 | else | ||
475 | { | ||
476 | // Remote Map Item Request | ||
424 | 477 | ||
478 | // ensures that the blockingqueue doesn't get borked if the GetAgents() timing changes. | ||
425 | RequestMapItems("",remoteClient.AgentId,flags,EstateID,godlike,itemtype,regionhandle); | 479 | RequestMapItems("",remoteClient.AgentId,flags,EstateID,godlike,itemtype,regionhandle); |
426 | } | 480 | } |
427 | } | 481 | } |
@@ -542,6 +596,28 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
542 | } | 596 | } |
543 | av.ControllingClient.SendMapItemReply(returnitems.ToArray(), mrs.itemtype, mrs.flags); | 597 | av.ControllingClient.SendMapItemReply(returnitems.ToArray(), mrs.itemtype, mrs.flags); |
544 | } | 598 | } |
599 | |||
600 | // Service 7 (MAP_ITEM_LAND_FOR_SALE) | ||
601 | uint itemtype = 7; | ||
602 | |||
603 | if (response.ContainsKey(itemtype.ToString())) | ||
604 | { | ||
605 | List<mapItemReply> returnitems = new List<mapItemReply>(); | ||
606 | OSDArray itemarray = (OSDArray)response[itemtype.ToString()]; | ||
607 | for (int i = 0; i < itemarray.Count; i++) | ||
608 | { | ||
609 | OSDMap mapitem = (OSDMap)itemarray[i]; | ||
610 | mapItemReply mi = new mapItemReply(); | ||
611 | mi.x = (uint)mapitem["X"].AsInteger(); | ||
612 | mi.y = (uint)mapitem["Y"].AsInteger(); | ||
613 | mi.id = mapitem["ID"].AsUUID(); | ||
614 | mi.Extra = mapitem["Extra"].AsInteger(); | ||
615 | mi.Extra2 = mapitem["Extra2"].AsInteger(); | ||
616 | mi.name = mapitem["Name"].AsString(); | ||
617 | returnitems.Add(mi); | ||
618 | } | ||
619 | av.ControllingClient.SendMapItemReply(returnitems.ToArray(), itemtype, mrs.flags); | ||
620 | } | ||
545 | } | 621 | } |
546 | } | 622 | } |
547 | } | 623 | } |
@@ -589,12 +665,23 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
589 | private OSDMap RequestMapItemsAsync(UUID id, uint flags, | 665 | private OSDMap RequestMapItemsAsync(UUID id, uint flags, |
590 | uint EstateID, bool godlike, uint itemtype, ulong regionhandle) | 666 | uint EstateID, bool godlike, uint itemtype, ulong regionhandle) |
591 | { | 667 | { |
668 | // m_log.DebugFormat("[WORLDMAP]: RequestMapItemsAsync; region handle: {0} {1}", regionhandle, itemtype); | ||
669 | |||
592 | string httpserver = ""; | 670 | string httpserver = ""; |
593 | bool blacklisted = false; | 671 | bool blacklisted = false; |
594 | lock (m_blacklistedregions) | 672 | lock (m_blacklistedregions) |
595 | { | 673 | { |
596 | if (m_blacklistedregions.ContainsKey(regionhandle)) | 674 | if (m_blacklistedregions.ContainsKey(regionhandle)) |
597 | blacklisted = true; | 675 | { |
676 | if (Environment.TickCount > (m_blacklistedregions[regionhandle] + blacklistTimeout)) | ||
677 | { | ||
678 | m_log.DebugFormat("[WORLDMAP]: Unblock blacklisted region {0}", regionhandle); | ||
679 | |||
680 | m_blacklistedregions.Remove(regionhandle); | ||
681 | } | ||
682 | else | ||
683 | blacklisted = true; | ||
684 | } | ||
598 | } | 685 | } |
599 | 686 | ||
600 | if (blacklisted) | 687 | if (blacklisted) |
@@ -636,7 +723,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
636 | lock (m_blacklistedurls) | 723 | lock (m_blacklistedurls) |
637 | { | 724 | { |
638 | if (m_blacklistedurls.ContainsKey(httpserver)) | 725 | if (m_blacklistedurls.ContainsKey(httpserver)) |
639 | blacklisted = true; | 726 | { |
727 | if (Environment.TickCount > (m_blacklistedurls[httpserver] + blacklistTimeout)) | ||
728 | { | ||
729 | m_log.DebugFormat("[WORLDMAP]: Unblock blacklisted URL {0}", httpserver); | ||
730 | |||
731 | m_blacklistedurls.Remove(httpserver); | ||
732 | } | ||
733 | else | ||
734 | blacklisted = true; | ||
735 | } | ||
640 | } | 736 | } |
641 | 737 | ||
642 | // Can't find the http server | 738 | // Can't find the http server |
@@ -682,7 +778,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
682 | mapitemsrequest.ContentLength = buffer.Length; //Count bytes to send | 778 | mapitemsrequest.ContentLength = buffer.Length; //Count bytes to send |
683 | os = mapitemsrequest.GetRequestStream(); | 779 | os = mapitemsrequest.GetRequestStream(); |
684 | os.Write(buffer, 0, buffer.Length); //Send it | 780 | os.Write(buffer, 0, buffer.Length); //Send it |
685 | os.Close(); | ||
686 | //m_log.DebugFormat("[WORLD MAP]: Getting MapItems from {0}", httpserver); | 781 | //m_log.DebugFormat("[WORLD MAP]: Getting MapItems from {0}", httpserver); |
687 | } | 782 | } |
688 | catch (WebException ex) | 783 | catch (WebException ex) |
@@ -705,6 +800,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
705 | responseMap["connect"] = OSD.FromBoolean(false); | 800 | responseMap["connect"] = OSD.FromBoolean(false); |
706 | return responseMap; | 801 | return responseMap; |
707 | } | 802 | } |
803 | finally | ||
804 | { | ||
805 | if (os != null) | ||
806 | os.Close(); | ||
807 | } | ||
708 | 808 | ||
709 | string response_mapItems_reply = null; | 809 | string response_mapItems_reply = null; |
710 | { // get the response | 810 | { // get the response |
@@ -1060,6 +1160,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1060 | 1160 | ||
1061 | Utils.LongToUInts(m_scene.RegionInfo.RegionHandle,out xstart,out ystart); | 1161 | Utils.LongToUInts(m_scene.RegionInfo.RegionHandle,out xstart,out ystart); |
1062 | 1162 | ||
1163 | // Service 6 (MAP_ITEM_AGENTS_LOCATION; green dots) | ||
1164 | |||
1063 | OSDMap responsemap = new OSDMap(); | 1165 | OSDMap responsemap = new OSDMap(); |
1064 | int tc = Environment.TickCount; | 1166 | int tc = Environment.TickCount; |
1065 | if (m_scene.GetRootAgentCount() == 0) | 1167 | if (m_scene.GetRootAgentCount() == 0) |
@@ -1092,6 +1194,60 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1092 | }); | 1194 | }); |
1093 | responsemap["6"] = responsearr; | 1195 | responsemap["6"] = responsearr; |
1094 | } | 1196 | } |
1197 | |||
1198 | // Service 7 (MAP_ITEM_LAND_FOR_SALE) | ||
1199 | |||
1200 | ILandChannel landChannel = m_scene.LandChannel; | ||
1201 | List<ILandObject> parcels = landChannel.AllParcels(); | ||
1202 | |||
1203 | if ((parcels == null) || (parcels.Count == 0)) | ||
1204 | { | ||
1205 | OSDMap responsemapdata = new OSDMap(); | ||
1206 | responsemapdata["X"] = OSD.FromInteger((int)(xstart + 1)); | ||
1207 | responsemapdata["Y"] = OSD.FromInteger((int)(ystart + 1)); | ||
1208 | responsemapdata["ID"] = OSD.FromUUID(UUID.Zero); | ||
1209 | responsemapdata["Name"] = OSD.FromString(""); | ||
1210 | responsemapdata["Extra"] = OSD.FromInteger(0); | ||
1211 | responsemapdata["Extra2"] = OSD.FromInteger(0); | ||
1212 | OSDArray responsearr = new OSDArray(); | ||
1213 | responsearr.Add(responsemapdata); | ||
1214 | |||
1215 | responsemap["7"] = responsearr; | ||
1216 | } | ||
1217 | else | ||
1218 | { | ||
1219 | OSDArray responsearr = new OSDArray(m_scene.GetRootAgentCount()); | ||
1220 | foreach (ILandObject parcel_interface in parcels) | ||
1221 | { | ||
1222 | // Play it safe | ||
1223 | if (!(parcel_interface is LandObject)) | ||
1224 | continue; | ||
1225 | |||
1226 | LandObject land = (LandObject)parcel_interface; | ||
1227 | LandData parcel = land.LandData; | ||
1228 | |||
1229 | // Show land for sale | ||
1230 | if ((parcel.Flags & (uint)ParcelFlags.ForSale) == (uint)ParcelFlags.ForSale) | ||
1231 | { | ||
1232 | Vector3 min = parcel.AABBMin; | ||
1233 | Vector3 max = parcel.AABBMax; | ||
1234 | float x = (min.X+max.X)/2; | ||
1235 | float y = (min.Y+max.Y)/2; | ||
1236 | |||
1237 | OSDMap responsemapdata = new OSDMap(); | ||
1238 | responsemapdata["X"] = OSD.FromInteger((int)(xstart + x)); | ||
1239 | responsemapdata["Y"] = OSD.FromInteger((int)(ystart + y)); | ||
1240 | // responsemapdata["Z"] = OSD.FromInteger((int)m_scene.GetGroundHeight(x,y)); | ||
1241 | responsemapdata["ID"] = OSD.FromUUID(UUID.Zero); | ||
1242 | responsemapdata["Name"] = OSD.FromString(parcel.Name); | ||
1243 | responsemapdata["Extra"] = OSD.FromInteger(parcel.Area); | ||
1244 | responsemapdata["Extra2"] = OSD.FromInteger(parcel.SalePrice); | ||
1245 | responsearr.Add(responsemapdata); | ||
1246 | } | ||
1247 | } | ||
1248 | responsemap["7"] = responsearr; | ||
1249 | } | ||
1250 | |||
1095 | return responsemap; | 1251 | return responsemap; |
1096 | } | 1252 | } |
1097 | 1253 | ||
@@ -1140,12 +1296,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1140 | 1296 | ||
1141 | private void MakeRootAgent(ScenePresence avatar) | 1297 | private void MakeRootAgent(ScenePresence avatar) |
1142 | { | 1298 | { |
1143 | // You may ask, why this is in a threadpool to start with.. | ||
1144 | // The reason is so we don't cause the thread to freeze waiting | ||
1145 | // for the 1 second it costs to start a thread manually. | ||
1146 | if (!threadrunning) | ||
1147 | Util.FireAndForget(this.StartThread); | ||
1148 | |||
1149 | lock (m_rootAgents) | 1299 | lock (m_rootAgents) |
1150 | { | 1300 | { |
1151 | if (!m_rootAgents.Contains(avatar.UUID)) | 1301 | if (!m_rootAgents.Contains(avatar.UUID)) |
@@ -1160,8 +1310,30 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1160 | lock (m_rootAgents) | 1310 | lock (m_rootAgents) |
1161 | { | 1311 | { |
1162 | m_rootAgents.Remove(avatar.UUID); | 1312 | m_rootAgents.Remove(avatar.UUID); |
1163 | if (m_rootAgents.Count == 0) | 1313 | } |
1164 | StopThread(); | 1314 | } |
1315 | |||
1316 | public void OnRegionUp(GridRegion otherRegion) | ||
1317 | { | ||
1318 | ulong regionhandle = otherRegion.RegionHandle; | ||
1319 | string httpserver = otherRegion.ServerURI + "MAP/MapItems/" + regionhandle.ToString(); | ||
1320 | |||
1321 | lock (m_blacklistedregions) | ||
1322 | { | ||
1323 | if (!m_blacklistedregions.ContainsKey(regionhandle)) | ||
1324 | m_blacklistedregions.Remove(regionhandle); | ||
1325 | } | ||
1326 | |||
1327 | lock (m_blacklistedurls) | ||
1328 | { | ||
1329 | if (m_blacklistedurls.ContainsKey(httpserver)) | ||
1330 | m_blacklistedurls.Remove(httpserver); | ||
1331 | } | ||
1332 | |||
1333 | lock (m_cachedRegionMapItemsAddress) | ||
1334 | { | ||
1335 | if (!m_cachedRegionMapItemsAddress.ContainsKey(regionhandle)) | ||
1336 | m_cachedRegionMapItemsAddress.Remove(regionhandle); | ||
1165 | } | 1337 | } |
1166 | } | 1338 | } |
1167 | 1339 | ||