aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2012-04-27 09:26:14 -0700
committerDiva Canto2012-04-27 09:26:14 -0700
commit2970a18e54bc4811af67a2f0c307fb79c00c9a18 (patch)
treee4faab8dd2b55edff0632faf241c960ad553ccbc /OpenSim
parentMinor change in error message (HG teleport failures) (diff)
parentAdd regression test for teleporting an agent between separated regions on the... (diff)
downloadopensim-SC_OLD-2970a18e54bc4811af67a2f0c307fb79c00c9a18.zip
opensim-SC_OLD-2970a18e54bc4811af67a2f0c307fb79c00c9a18.tar.gz
opensim-SC_OLD-2970a18e54bc4811af67a2f0c307fb79c00c9a18.tar.bz2
opensim-SC_OLD-2970a18e54bc4811af67a2f0c307fb79c00c9a18.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs2
-rw-r--r--OpenSim/Framework/SLUtil.cs382
-rw-r--r--OpenSim/Framework/Tests/UtilTest.cs23
-rw-r--r--OpenSim/Framework/WebUtil.cs55
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs5
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs8
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs14
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs54
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs10
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs9
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/INPCModule.cs30
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs82
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs42
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs177
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs39
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs21
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs43
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs12
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs66
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs16
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs2
-rw-r--r--OpenSim/Tests/Common/Helpers/SceneHelpers.cs218
-rw-r--r--OpenSim/Tests/Common/Mock/TestLandChannel.cs17
-rw-r--r--OpenSim/Tests/Torture/NPCTortureTests.cs2
-rw-r--r--OpenSim/Tests/Torture/ObjectTortureTests.cs2
-rw-r--r--OpenSim/Tests/Torture/ScriptTortureTests.cs2
68 files changed, 814 insertions, 666 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
index fd152c3..85e5cc6 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/Tests/GetTextureHandlerTests.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Capabilities.Handlers.GetTexture.Tests
50 TestHelpers.InMethod(); 50 TestHelpers.InMethod();
51 51
52 // Overkill - we only really need the asset service, not a whole scene. 52 // Overkill - we only really need the asset service, not a whole scene.
53 Scene scene = SceneHelpers.SetupScene(); 53 Scene scene = new SceneHelpers().SetupScene();
54 54
55 GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService); 55 GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService);
56 TestOSHttpRequest req = new TestOSHttpRequest(); 56 TestOSHttpRequest req = new TestOSHttpRequest();
diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs
index db4541e..537de7a 100644
--- a/OpenSim/Framework/SLUtil.cs
+++ b/OpenSim/Framework/SLUtil.cs
@@ -38,239 +38,189 @@ namespace OpenSim.Framework
38 public static class SLUtil 38 public static class SLUtil
39 { 39 {
40// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 40// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
41 41
42 #region SL / file extension / content-type conversions 42 #region SL / file extension / content-type conversions
43 43
44 public static string SLAssetTypeToContentType(int assetType) 44 private class TypeMapping
45 { 45 {
46 switch ((AssetType)assetType) 46 private sbyte assetType;
47 private InventoryType inventoryType;
48 private string contentType;
49 private string contentType2;
50 private string extension;
51
52 public sbyte AssetTypeCode
53 {
54 get { return assetType; }
55 }
56
57 public object AssetType
58 {
59 get {
60 if (Enum.IsDefined(typeof(OpenMetaverse.AssetType), assetType))
61 return (OpenMetaverse.AssetType)assetType;
62 else
63 return OpenMetaverse.AssetType.Unknown;
64 }
65 }
66
67 public InventoryType InventoryType
68 {
69 get { return inventoryType; }
70 }
71
72 public string ContentType
73 {
74 get { return contentType; }
75 }
76
77 public string ContentType2
78 {
79 get { return contentType2; }
80 }
81
82 public string Extension
83 {
84 get { return extension; }
85 }
86
87 private TypeMapping(sbyte assetType, InventoryType inventoryType, string contentType, string contentType2, string extension)
88 {
89 this.assetType = assetType;
90 this.inventoryType = inventoryType;
91 this.contentType = contentType;
92 this.contentType2 = contentType2;
93 this.extension = extension;
94 }
95
96 public TypeMapping(AssetType assetType, InventoryType inventoryType, string contentType, string contentType2, string extension)
97 : this((sbyte)assetType, inventoryType, contentType, contentType2, extension)
98 {
99 }
100
101 public TypeMapping(AssetType assetType, InventoryType inventoryType, string contentType, string extension)
102 : this((sbyte)assetType, inventoryType, contentType, null, extension)
47 { 103 {
48 case AssetType.Texture:
49 return "image/x-j2c";
50 case AssetType.Sound:
51 return "audio/ogg";
52 case AssetType.CallingCard:
53 return "application/vnd.ll.callingcard";
54 case AssetType.Landmark:
55 return "application/vnd.ll.landmark";
56 case AssetType.Clothing:
57 return "application/vnd.ll.clothing";
58 case AssetType.Object:
59 return "application/vnd.ll.primitive";
60 case AssetType.Notecard:
61 return "application/vnd.ll.notecard";
62 case AssetType.Folder:
63 return "application/vnd.ll.folder";
64 case AssetType.RootFolder:
65 return "application/vnd.ll.rootfolder";
66 case AssetType.LSLText:
67 return "application/vnd.ll.lsltext";
68 case AssetType.LSLBytecode:
69 return "application/vnd.ll.lslbyte";
70 case AssetType.TextureTGA:
71 case AssetType.ImageTGA:
72 return "image/tga";
73 case AssetType.Bodypart:
74 return "application/vnd.ll.bodypart";
75 case AssetType.TrashFolder:
76 return "application/vnd.ll.trashfolder";
77 case AssetType.SnapshotFolder:
78 return "application/vnd.ll.snapshotfolder";
79 case AssetType.LostAndFoundFolder:
80 return "application/vnd.ll.lostandfoundfolder";
81 case AssetType.SoundWAV:
82 return "audio/x-wav";
83 case AssetType.ImageJPEG:
84 return "image/jpeg";
85 case AssetType.Animation:
86 return "application/vnd.ll.animation";
87 case AssetType.Gesture:
88 return "application/vnd.ll.gesture";
89 case AssetType.Simstate:
90 return "application/x-metaverse-simstate";
91 case AssetType.FavoriteFolder:
92 return "application/vnd.ll.favoritefolder";
93 case AssetType.Link:
94 return "application/vnd.ll.link";
95 case AssetType.LinkFolder:
96 return "application/vnd.ll.linkfolder";
97 case AssetType.CurrentOutfitFolder:
98 return "application/vnd.ll.currentoutfitfolder";
99 case AssetType.OutfitFolder:
100 return "application/vnd.ll.outfitfolder";
101 case AssetType.MyOutfitsFolder:
102 return "application/vnd.ll.myoutfitsfolder";
103 case AssetType.Unknown:
104 default:
105 return "application/octet-stream";
106 } 104 }
107 } 105 }
108 106
109 public static string SLInvTypeToContentType(int invType) 107 /// <summary>
108 /// Maps between AssetType, InventoryType and Content-Type.
109 /// Where more than one possibility exists, the first one takes precedence. E.g.:
110 /// AssetType "AssetType.Texture" -> Content-Type "image-xj2c"
111 /// Content-Type "image/x-j2c" -> InventoryType "InventoryType.Texture"
112 /// </summary>
113 private static TypeMapping[] MAPPINGS = new TypeMapping[] {
114 new TypeMapping(AssetType.Unknown, InventoryType.Unknown, "application/octet-stream", "bin"),
115 new TypeMapping(AssetType.Texture, InventoryType.Texture, "image/x-j2c", "image/jp2", "j2c"),
116 new TypeMapping(AssetType.Texture, InventoryType.Snapshot, "image/x-j2c", "image/jp2", "j2c"),
117 new TypeMapping(AssetType.TextureTGA, InventoryType.Texture, "image/tga", "tga"),
118 new TypeMapping(AssetType.ImageTGA, InventoryType.Texture, "image/tga", "tga"),
119 new TypeMapping(AssetType.ImageJPEG, InventoryType.Texture, "image/jpeg", "jpg"),
120 new TypeMapping(AssetType.Sound, InventoryType.Sound, "audio/ogg", "application/ogg", "ogg"),
121 new TypeMapping(AssetType.SoundWAV, InventoryType.Sound, "audio/x-wav", "wav"),
122 new TypeMapping(AssetType.CallingCard, InventoryType.CallingCard, "application/vnd.ll.callingcard", "application/x-metaverse-callingcard", "callingcard"),
123 new TypeMapping(AssetType.Landmark, InventoryType.Landmark, "application/vnd.ll.landmark", "application/x-metaverse-landmark", "landmark"),
124 new TypeMapping(AssetType.Clothing, InventoryType.Wearable, "application/vnd.ll.clothing", "application/x-metaverse-clothing", "clothing"),
125 new TypeMapping(AssetType.Object, InventoryType.Object, "application/vnd.ll.primitive", "application/x-metaverse-primitive", "primitive"),
126 new TypeMapping(AssetType.Object, InventoryType.Attachment, "application/vnd.ll.primitive", "application/x-metaverse-primitive", "primitive"),
127 new TypeMapping(AssetType.Notecard, InventoryType.Notecard, "application/vnd.ll.notecard", "application/x-metaverse-notecard", "notecard"),
128 new TypeMapping(AssetType.Folder, InventoryType.Folder, "application/vnd.ll.folder", "folder"),
129 new TypeMapping(AssetType.RootFolder, InventoryType.RootCategory, "application/vnd.ll.rootfolder", "rootfolder"),
130 new TypeMapping(AssetType.LSLText, InventoryType.LSL, "application/vnd.ll.lsltext", "application/x-metaverse-lsl", "lsl"),
131 new TypeMapping(AssetType.LSLBytecode, InventoryType.LSL, "application/vnd.ll.lslbyte", "application/x-metaverse-lso", "lso"),
132 new TypeMapping(AssetType.Bodypart, InventoryType.Wearable, "application/vnd.ll.bodypart", "application/x-metaverse-bodypart", "bodypart"),
133 new TypeMapping(AssetType.TrashFolder, InventoryType.Folder, "application/vnd.ll.trashfolder", "trashfolder"),
134 new TypeMapping(AssetType.SnapshotFolder, InventoryType.Folder, "application/vnd.ll.snapshotfolder", "snapshotfolder"),
135 new TypeMapping(AssetType.LostAndFoundFolder, InventoryType.Folder, "application/vnd.ll.lostandfoundfolder", "lostandfoundfolder"),
136 new TypeMapping(AssetType.Animation, InventoryType.Animation, "application/vnd.ll.animation", "application/x-metaverse-animation", "animation"),
137 new TypeMapping(AssetType.Gesture, InventoryType.Gesture, "application/vnd.ll.gesture", "application/x-metaverse-gesture", "gesture"),
138 new TypeMapping(AssetType.Simstate, InventoryType.Snapshot, "application/x-metaverse-simstate", "simstate"),
139 new TypeMapping(AssetType.FavoriteFolder, InventoryType.Unknown, "application/vnd.ll.favoritefolder", "favoritefolder"),
140 new TypeMapping(AssetType.Link, InventoryType.Unknown, "application/vnd.ll.link", "link"),
141 new TypeMapping(AssetType.LinkFolder, InventoryType.Unknown, "application/vnd.ll.linkfolder", "linkfolder"),
142 new TypeMapping(AssetType.CurrentOutfitFolder, InventoryType.Unknown, "application/vnd.ll.currentoutfitfolder", "currentoutfitfolder"),
143 new TypeMapping(AssetType.OutfitFolder, InventoryType.Unknown, "application/vnd.ll.outfitfolder", "outfitfolder"),
144 new TypeMapping(AssetType.MyOutfitsFolder, InventoryType.Unknown, "application/vnd.ll.myoutfitsfolder", "myoutfitsfolder"),
145 new TypeMapping(AssetType.Mesh, InventoryType.Mesh, "application/vnd.ll.mesh", "llm")
146 };
147
148 private static Dictionary<sbyte, string> asset2Content;
149 private static Dictionary<sbyte, string> asset2Extension;
150 private static Dictionary<InventoryType, string> inventory2Content;
151 private static Dictionary<string, sbyte> content2Asset;
152 private static Dictionary<string, InventoryType> content2Inventory;
153
154 static SLUtil()
110 { 155 {
111 switch ((InventoryType)invType) 156 asset2Content = new Dictionary<sbyte, string>();
157 asset2Extension = new Dictionary<sbyte, string>();
158 inventory2Content = new Dictionary<InventoryType, string>();
159 content2Asset = new Dictionary<string, sbyte>();
160 content2Inventory = new Dictionary<string, InventoryType>();
161
162 foreach (TypeMapping mapping in MAPPINGS)
112 { 163 {
113 case InventoryType.Animation: 164 sbyte assetType = mapping.AssetTypeCode;
114 return "application/vnd.ll.animation"; 165 if (!asset2Content.ContainsKey(assetType))
115 case InventoryType.CallingCard: 166 asset2Content.Add(assetType, mapping.ContentType);
116 return "application/vnd.ll.callingcard"; 167 if (!asset2Extension.ContainsKey(assetType))
117 case InventoryType.Folder: 168 asset2Extension.Add(assetType, mapping.Extension);
118 return "application/vnd.ll.folder"; 169 if (!inventory2Content.ContainsKey(mapping.InventoryType))
119 case InventoryType.Gesture: 170 inventory2Content.Add(mapping.InventoryType, mapping.ContentType);
120 return "application/vnd.ll.gesture"; 171 if (!content2Asset.ContainsKey(mapping.ContentType))
121 case InventoryType.Landmark: 172 content2Asset.Add(mapping.ContentType, assetType);
122 return "application/vnd.ll.landmark"; 173 if (!content2Inventory.ContainsKey(mapping.ContentType))
123 case InventoryType.LSL: 174 content2Inventory.Add(mapping.ContentType, mapping.InventoryType);
124 return "application/vnd.ll.lsltext"; 175
125 case InventoryType.Notecard: 176 if (mapping.ContentType2 != null)
126 return "application/vnd.ll.notecard"; 177 {
127 case InventoryType.Attachment: 178 if (!content2Asset.ContainsKey(mapping.ContentType2))
128 case InventoryType.Object: 179 content2Asset.Add(mapping.ContentType2, assetType);
129 return "application/vnd.ll.primitive"; 180 if (!content2Inventory.ContainsKey(mapping.ContentType2))
130 case InventoryType.Sound: 181 content2Inventory.Add(mapping.ContentType2, mapping.InventoryType);
131 return "audio/ogg"; 182 }
132 case InventoryType.Snapshot:
133 case InventoryType.Texture:
134 return "image/x-j2c";
135 case InventoryType.Wearable:
136 return "application/vnd.ll.clothing";
137 default:
138 return "application/octet-stream";
139 } 183 }
140 } 184 }
185
186 public static string SLAssetTypeToContentType(int assetType)
187 {
188 string contentType;
189 if (!asset2Content.TryGetValue((sbyte)assetType, out contentType))
190 contentType = asset2Content[(sbyte)AssetType.Unknown];
191 return contentType;
192 }
193
194 public static string SLInvTypeToContentType(int invType)
195 {
196 string contentType;
197 if (!inventory2Content.TryGetValue((InventoryType)invType, out contentType))
198 contentType = inventory2Content[InventoryType.Unknown];
199 return contentType;
200 }
141 201
142 public static sbyte ContentTypeToSLAssetType(string contentType) 202 public static sbyte ContentTypeToSLAssetType(string contentType)
143 { 203 {
144 switch (contentType) 204 sbyte assetType;
145 { 205 if (!content2Asset.TryGetValue(contentType, out assetType))
146 case "image/x-j2c": 206 assetType = (sbyte)AssetType.Unknown;
147 case "image/jp2": 207 return (sbyte)assetType;
148 return (sbyte)AssetType.Texture;
149 case "application/ogg":
150 case "audio/ogg":
151 return (sbyte)AssetType.Sound;
152 case "application/vnd.ll.callingcard":
153 case "application/x-metaverse-callingcard":
154 return (sbyte)AssetType.CallingCard;
155 case "application/vnd.ll.landmark":
156 case "application/x-metaverse-landmark":
157 return (sbyte)AssetType.Landmark;
158 case "application/vnd.ll.clothing":
159 case "application/x-metaverse-clothing":
160 return (sbyte)AssetType.Clothing;
161 case "application/vnd.ll.primitive":
162 case "application/x-metaverse-primitive":
163 return (sbyte)AssetType.Object;
164 case "application/vnd.ll.notecard":
165 case "application/x-metaverse-notecard":
166 return (sbyte)AssetType.Notecard;
167 case "application/vnd.ll.folder":
168 return (sbyte)AssetType.Folder;
169 case "application/vnd.ll.rootfolder":
170 return (sbyte)AssetType.RootFolder;
171 case "application/vnd.ll.lsltext":
172 case "application/x-metaverse-lsl":
173 return (sbyte)AssetType.LSLText;
174 case "application/vnd.ll.lslbyte":
175 case "application/x-metaverse-lso":
176 return (sbyte)AssetType.LSLBytecode;
177 case "image/tga":
178 // Note that AssetType.TextureTGA will be converted to AssetType.ImageTGA
179 return (sbyte)AssetType.ImageTGA;
180 case "application/vnd.ll.bodypart":
181 case "application/x-metaverse-bodypart":
182 return (sbyte)AssetType.Bodypart;
183 case "application/vnd.ll.trashfolder":
184 return (sbyte)AssetType.TrashFolder;
185 case "application/vnd.ll.snapshotfolder":
186 return (sbyte)AssetType.SnapshotFolder;
187 case "application/vnd.ll.lostandfoundfolder":
188 return (sbyte)AssetType.LostAndFoundFolder;
189 case "audio/x-wav":
190 return (sbyte)AssetType.SoundWAV;
191 case "image/jpeg":
192 return (sbyte)AssetType.ImageJPEG;
193 case "application/vnd.ll.animation":
194 case "application/x-metaverse-animation":
195 return (sbyte)AssetType.Animation;
196 case "application/vnd.ll.gesture":
197 case "application/x-metaverse-gesture":
198 return (sbyte)AssetType.Gesture;
199 case "application/x-metaverse-simstate":
200 return (sbyte)AssetType.Simstate;
201 case "application/vnd.ll.favoritefolder":
202 return (sbyte)AssetType.FavoriteFolder;
203 case "application/vnd.ll.link":
204 return (sbyte)AssetType.Link;
205 case "application/vnd.ll.linkfolder":
206 return (sbyte)AssetType.LinkFolder;
207 case "application/vnd.ll.currentoutfitfolder":
208 return (sbyte)AssetType.CurrentOutfitFolder;
209 case "application/vnd.ll.outfitfolder":
210 return (sbyte)AssetType.OutfitFolder;
211 case "application/vnd.ll.myoutfitsfolder":
212 return (sbyte)AssetType.MyOutfitsFolder;
213 case "application/octet-stream":
214 default:
215 return (sbyte)AssetType.Unknown;
216 }
217 } 208 }
218 209
219 public static sbyte ContentTypeToSLInvType(string contentType) 210 public static sbyte ContentTypeToSLInvType(string contentType)
220 { 211 {
221 switch (contentType) 212 InventoryType invType;
222 { 213 if (!content2Inventory.TryGetValue(contentType, out invType))
223 case "image/x-j2c": 214 invType = InventoryType.Unknown;
224 case "image/jp2": 215 return (sbyte)invType;
225 case "image/tga": 216 }
226 case "image/jpeg": 217
227 return (sbyte)InventoryType.Texture; 218 public static string SLAssetTypeToExtension(int assetType)
228 case "application/ogg": 219 {
229 case "audio/ogg": 220 string extension;
230 case "audio/x-wav": 221 if (!asset2Extension.TryGetValue((sbyte)assetType, out extension))
231 return (sbyte)InventoryType.Sound; 222 extension = asset2Extension[(sbyte)AssetType.Unknown];
232 case "application/vnd.ll.callingcard": 223 return extension;
233 case "application/x-metaverse-callingcard":
234 return (sbyte)InventoryType.CallingCard;
235 case "application/vnd.ll.landmark":
236 case "application/x-metaverse-landmark":
237 return (sbyte)InventoryType.Landmark;
238 case "application/vnd.ll.clothing":
239 case "application/x-metaverse-clothing":
240 case "application/vnd.ll.bodypart":
241 case "application/x-metaverse-bodypart":
242 return (sbyte)InventoryType.Wearable;
243 case "application/vnd.ll.primitive":
244 case "application/x-metaverse-primitive":
245 return (sbyte)InventoryType.Object;
246 case "application/vnd.ll.notecard":
247 case "application/x-metaverse-notecard":
248 return (sbyte)InventoryType.Notecard;
249 case "application/vnd.ll.folder":
250 return (sbyte)InventoryType.Folder;
251 case "application/vnd.ll.rootfolder":
252 return (sbyte)InventoryType.RootCategory;
253 case "application/vnd.ll.lsltext":
254 case "application/x-metaverse-lsl":
255 case "application/vnd.ll.lslbyte":
256 case "application/x-metaverse-lso":
257 return (sbyte)InventoryType.LSL;
258 case "application/vnd.ll.trashfolder":
259 case "application/vnd.ll.snapshotfolder":
260 case "application/vnd.ll.lostandfoundfolder":
261 return (sbyte)InventoryType.Folder;
262 case "application/vnd.ll.animation":
263 case "application/x-metaverse-animation":
264 return (sbyte)InventoryType.Animation;
265 case "application/vnd.ll.gesture":
266 case "application/x-metaverse-gesture":
267 return (sbyte)InventoryType.Gesture;
268 case "application/x-metaverse-simstate":
269 return (sbyte)InventoryType.Snapshot;
270 case "application/octet-stream":
271 default:
272 return (sbyte)InventoryType.Unknown;
273 }
274 } 224 }
275 225
276 #endregion SL / file extension / content-type conversions 226 #endregion SL / file extension / content-type conversions
@@ -377,4 +327,4 @@ namespace OpenSim.Framework
377 return output; 327 return output;
378 } 328 }
379 } 329 }
380} \ No newline at end of file 330}
diff --git a/OpenSim/Framework/Tests/UtilTest.cs b/OpenSim/Framework/Tests/UtilTest.cs
index 1ca35df..f0d2a3f 100644
--- a/OpenSim/Framework/Tests/UtilTest.cs
+++ b/OpenSim/Framework/Tests/UtilTest.cs
@@ -214,16 +214,13 @@ namespace OpenSim.Framework.Tests
214 214
215 for (int i = 0; i < contenttypes.Length; i++) 215 for (int i = 0; i < contenttypes.Length; i++)
216 { 216 {
217 if (SLUtil.ContentTypeToSLAssetType(contenttypes[i]) == 18) 217 int expected;
218 { 218 if (contenttypes[i] == "image/tga")
219 Assert.That(contenttypes[i] == "image/tga"); 219 expected = 12; // if we know only the content-type "image/tga", then we assume the asset type is TextureTGA; not ImageTGA
220 }
221 else 220 else
222 { 221 expected = assettypes[i];
223 Assert.That(SLUtil.ContentTypeToSLAssetType(contenttypes[i]) == assettypes[i], 222 Assert.AreEqual(expected, SLUtil.ContentTypeToSLAssetType(contenttypes[i]),
224 "Expecting {0} but got {1}", assettypes[i], 223 String.Format("Incorrect AssetType mapped from Content-Type {0}", contenttypes[i]));
225 SLUtil.ContentTypeToSLAssetType(contenttypes[i]));
226 }
227 } 224 }
228 225
229 int[] inventorytypes = new int[] {-1,0,1,2,3,6,7,8,9,10,15,17,18,20}; 226 int[] inventorytypes = new int[] {-1,0,1,2,3,6,7,8,9,10,15,17,18,20};
@@ -237,7 +234,7 @@ namespace OpenSim.Framework.Tests
237 "application/vnd.ll.primitive", 234 "application/vnd.ll.primitive",
238 "application/vnd.ll.notecard", 235 "application/vnd.ll.notecard",
239 "application/vnd.ll.folder", 236 "application/vnd.ll.folder",
240 "application/octet-stream", 237 "application/vnd.ll.rootfolder",
241 "application/vnd.ll.lsltext", 238 "application/vnd.ll.lsltext",
242 "image/x-j2c", 239 "image/x-j2c",
243 "application/vnd.ll.primitive", 240 "application/vnd.ll.primitive",
@@ -247,7 +244,8 @@ namespace OpenSim.Framework.Tests
247 244
248 for (int i=0;i<inventorytypes.Length;i++) 245 for (int i=0;i<inventorytypes.Length;i++)
249 { 246 {
250 Assert.That(SLUtil.SLInvTypeToContentType(inventorytypes[i]) == invcontenttypes[i], "Expected {0}, Got {1}", invcontenttypes[i], SLUtil.SLInvTypeToContentType(inventorytypes[i])); 247 Assert.AreEqual(invcontenttypes[i], SLUtil.SLInvTypeToContentType(inventorytypes[i]),
248 String.Format("Incorrect Content-Type mapped from InventoryType {0}", inventorytypes[i]));
251 } 249 }
252 250
253 invcontenttypes = new string[] 251 invcontenttypes = new string[]
@@ -280,7 +278,8 @@ namespace OpenSim.Framework.Tests
280 278
281 for (int i = 0; i < invtypes.Length; i++) 279 for (int i = 0; i < invtypes.Length; i++)
282 { 280 {
283 Assert.That(SLUtil.ContentTypeToSLInvType(invcontenttypes[i]) == invtypes[i], "Expected {0}, Got {1}", invtypes[i], SLUtil.ContentTypeToSLInvType(invcontenttypes[i])); 281 Assert.AreEqual(invtypes[i], SLUtil.ContentTypeToSLInvType(invcontenttypes[i]),
282 String.Format("Incorrect InventoryType mapped from Content-Type {0}", invcontenttypes[i]));
284 } 283 }
285 } 284 }
286 } 285 }
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index ead8f46..d2aa538 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -86,8 +86,7 @@ namespace OpenSim.Framework
86 return eplock; 86 return eplock;
87 } 87 }
88 } 88 }
89 89
90
91 #region JSONRequest 90 #region JSONRequest
92 91
93 /// <summary> 92 /// <summary>
@@ -216,7 +215,9 @@ namespace OpenSim.Framework
216 reqnum,url,method,tickdiff,tickdata); 215 reqnum,url,method,tickdiff,tickdata);
217 } 216 }
218 217
219 m_log.DebugFormat("[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage); 218 m_log.DebugFormat(
219 "[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
220
220 return ErrorResponseMap(errorMessage); 221 return ErrorResponseMap(errorMessage);
221 } 222 }
222 223
@@ -357,7 +358,8 @@ namespace OpenSim.Framework
357 reqnum,url,method,tickdiff,tickdata); 358 reqnum,url,method,tickdiff,tickdata);
358 } 359 }
359 360
360 m_log.WarnFormat("[WEB UTIL]: <{0}> form request failed: {1}",reqnum,errorMessage); 361 m_log.WarnFormat("[WEB UTIL]: <{0}> form request to {1} failed: {2}", reqnum, url, errorMessage);
362
361 return ErrorResponseMap(errorMessage); 363 return ErrorResponseMap(errorMessage);
362 } 364 }
363 365
@@ -771,12 +773,16 @@ namespace OpenSim.Framework
771 } 773 }
772 else 774 else
773 { 775 {
774 m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with status {2} and message {3}", verb, requestUrl, e.Status, e.Message); 776 m_log.ErrorFormat(
777 "[ASYNC REQUEST]: Request {0} {1} failed with status {2} and message {3}",
778 verb, requestUrl, e.Status, e.Message);
775 } 779 }
776 } 780 }
777 catch (Exception e) 781 catch (Exception e)
778 { 782 {
779 m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with exception {2}", verb, requestUrl, e); 783 m_log.ErrorFormat(
784 "[ASYNC REQUEST]: Request {0} {1} failed with exception {2}{3}",
785 verb, requestUrl, e.Message, e.StackTrace);
780 } 786 }
781 787
782 // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString()); 788 // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
@@ -788,7 +794,8 @@ namespace OpenSim.Framework
788 catch (Exception e) 794 catch (Exception e)
789 { 795 {
790 m_log.ErrorFormat( 796 m_log.ErrorFormat(
791 "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}", verb, requestUrl, e); 797 "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}{3}",
798 verb, requestUrl, e.Message, e.StackTrace);
792 } 799 }
793 800
794 }, null); 801 }, null);
@@ -841,7 +848,8 @@ namespace OpenSim.Framework
841 } 848 }
842 catch (Exception e) 849 catch (Exception e)
843 { 850 {
844 m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: " + e.ToString(), requestUrl); 851 m_log.DebugFormat(
852 "[FORMS]: exception occured {0} {1}: {2}{3}", verb, requestUrl, e.Message, e.StackTrace);
845 } 853 }
846 finally 854 finally
847 { 855 {
@@ -867,7 +875,9 @@ namespace OpenSim.Framework
867 } 875 }
868 catch (Exception e) 876 catch (Exception e)
869 { 877 {
870 m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString()); 878 m_log.DebugFormat(
879 "[FORMS]: Exception occured on receiving {0} {1}: {2}{3}",
880 verb, requestUrl, e.Message, e.StackTrace);
871 } 881 }
872 finally 882 finally
873 { 883 {
@@ -880,7 +890,7 @@ namespace OpenSim.Framework
880 catch (System.InvalidOperationException) 890 catch (System.InvalidOperationException)
881 { 891 {
882 // This is what happens when there is invalid XML 892 // This is what happens when there is invalid XML
883 m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request"); 893 m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving {0} {1}", verb, requestUrl);
884 } 894 }
885 } 895 }
886 return respstring; 896 return respstring;
@@ -938,7 +948,10 @@ namespace OpenSim.Framework
938 } 948 }
939 catch (Exception e) 949 catch (Exception e)
940 { 950 {
941 m_log.DebugFormat("[SynchronousRestObjectRequester]: exception in sending data to {0}: {1}", requestUrl, e); 951 m_log.DebugFormat(
952 "[SynchronousRestObjectRequester]: Exception in making request {0} {1}: {2}{3}",
953 verb, requestUrl, e.Message, e.StackTrace);
954
942 return deserial; 955 return deserial;
943 } 956 }
944 finally 957 finally
@@ -960,7 +973,11 @@ namespace OpenSim.Framework
960 respStream.Close(); 973 respStream.Close();
961 } 974 }
962 else 975 else
963 m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb); 976 {
977 m_log.DebugFormat(
978 "[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}",
979 verb, requestUrl);
980 }
964 } 981 }
965 } 982 }
966 catch (WebException e) 983 catch (WebException e)
@@ -971,20 +988,24 @@ namespace OpenSim.Framework
971 return deserial; 988 return deserial;
972 else 989 else
973 m_log.ErrorFormat( 990 m_log.ErrorFormat(
974 "[SynchronousRestObjectRequester]: WebException {0} {1} {2} {3}", 991 "[SynchronousRestObjectRequester]: WebException for {0} {1} {2}: {3} {4}",
975 requestUrl, typeof(TResponse).ToString(), e.Message, e.StackTrace); 992 verb, requestUrl, typeof(TResponse).ToString(), e.Message, e.StackTrace);
976 } 993 }
977 catch (System.InvalidOperationException) 994 catch (System.InvalidOperationException)
978 { 995 {
979 // This is what happens when there is invalid XML 996 // This is what happens when there is invalid XML
980 m_log.DebugFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString()); 997 m_log.DebugFormat(
998 "[SynchronousRestObjectRequester]: Invalid XML from {0} {1} {2}",
999 verb, requestUrl, typeof(TResponse).ToString());
981 } 1000 }
982 catch (Exception e) 1001 catch (Exception e)
983 { 1002 {
984 m_log.DebugFormat("[SynchronousRestObjectRequester]: Exception on response from {0} {1}", requestUrl, e); 1003 m_log.DebugFormat(
1004 "[SynchronousRestObjectRequester]: Exception on response from {0} {1}: {2}{3}",
1005 verb, requestUrl, e.Message, e.StackTrace);
985 } 1006 }
986 1007
987 return deserial; 1008 return deserial;
988 } 1009 }
989 } 1010 }
990} 1011} \ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 8ec2f20..e20c24f 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -235,7 +235,10 @@ namespace OpenSim.Region.ClientStack.Linden
235 235
236 if (!m_Scene.CheckClient(m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint)) 236 if (!m_Scene.CheckClient(m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint))
237 { 237 {
238 m_log.DebugFormat("[CAPS]: Unauthorized CAPS client"); 238 m_log.DebugFormat(
239 "[CAPS]: Unauthorized CAPS client {0} from {1}",
240 m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint);
241
239 return string.Empty; 242 return string.Empty;
240 } 243 }
241 244
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
index a5209b7..c25b58c 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests
60 CapabilitiesModule capsModule = new CapabilitiesModule(); 60 CapabilitiesModule capsModule = new CapabilitiesModule();
61 EventQueueGetModule eqgModule = new EventQueueGetModule(); 61 EventQueueGetModule eqgModule = new EventQueueGetModule();
62 62
63 m_scene = SceneHelpers.SetupScene(); 63 m_scene = new SceneHelpers().SetupScene();
64 SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule); 64 SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule);
65 } 65 }
66 66
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index fb6b11e..edf91cb 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -916,7 +916,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
916 UDPPacketBuffer buffer = (UDPPacketBuffer)array[0]; 916 UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
917 UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1]; 917 UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
918 918
919 m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint); 919 m_log.DebugFormat(
920 "[LLUDPSERVER]: Handling UseCircuitCode request for circuit {0} from {1}",
921 uccp.CircuitCode.Code, buffer.RemoteEndPoint);
920 922
921 remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint; 923 remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
922 924
@@ -1350,7 +1352,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1350 } 1352 }
1351 else 1353 else
1352 { 1354 {
1353 m_log.DebugFormat("[LLUDPSERVER]: Dropping incoming {0} packet for dead client {1}", packet.Type, udpClient.AgentID); 1355 m_log.DebugFormat(
1356 "[LLUDPSERVER]: Dropped incoming {0} for dead client {1} in {2}",
1357 packet.Type, udpClient.AgentID, m_scene.RegionInfo.RegionName);
1354 } 1358 }
1355 } 1359 }
1356 1360
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs
index a575e36..1321470 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
158 TestHelpers.InMethod(); 158 TestHelpers.InMethod();
159// XmlConfigurator.Configure(); 159// XmlConfigurator.Configure();
160 160
161 TestScene scene = SceneHelpers.SetupScene(); 161 TestScene scene = new SceneHelpers().SetupScene();
162 uint myCircuitCode = 123456; 162 uint myCircuitCode = 123456;
163 UUID myAgentUuid = TestHelpers.ParseTail(0x1); 163 UUID myAgentUuid = TestHelpers.ParseTail(0x1);
164 UUID mySessionUuid = TestHelpers.ParseTail(0x2); 164 UUID mySessionUuid = TestHelpers.ParseTail(0x2);
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
index 1b68d68..221f02b 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
79 79
80 J2KDecoderModule j2kdm = new J2KDecoderModule(); 80 J2KDecoderModule j2kdm = new J2KDecoderModule();
81 81
82 scene = SceneHelpers.SetupScene(); 82 scene = new SceneHelpers().SetupScene();
83 SceneHelpers.SetupSceneModules(scene, j2kdm); 83 SceneHelpers.SetupSceneModules(scene, j2kdm);
84 84
85 tc = new TestClient(SceneHelpers.GenerateAgentData(userId), scene); 85 tc = new TestClient(SceneHelpers.GenerateAgentData(userId), scene);
diff --git a/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs b/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs
index 5adb845..c91b25f 100644
--- a/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs
+++ b/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs
@@ -65,7 +65,7 @@ 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 = SceneHelpers.SetupScene(); 68 m_scene = new SceneHelpers().SetupScene();
69 SceneHelpers.SetupSceneModules(m_scene, config, m_cache); 69 SceneHelpers.SetupSceneModules(m_scene, config, m_cache);
70 } 70 }
71 71
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
index bfe5e4a..42d07fd 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
72 config.AddConfig("Modules"); 72 config.AddConfig("Modules");
73 config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); 73 config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
74 74
75 scene = SceneHelpers.SetupScene(); 75 scene = new SceneHelpers().SetupScene();
76 m_attMod = new AttachmentsModule(); 76 m_attMod = new AttachmentsModule();
77 SceneHelpers.SetupSceneModules(scene, config, m_attMod, new BasicInventoryAccessModule()); 77 SceneHelpers.SetupSceneModules(scene, config, m_attMod, new BasicInventoryAccessModule());
78 } 78 }
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
index 11a0a86..848b3bf 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
53 UUID userId = TestHelpers.ParseTail(0x1); 53 UUID userId = TestHelpers.ParseTail(0x1);
54 54
55 AvatarFactoryModule afm = new AvatarFactoryModule(); 55 AvatarFactoryModule afm = new AvatarFactoryModule();
56 TestScene scene = SceneHelpers.SetupScene(); 56 TestScene scene = new SceneHelpers().SetupScene();
57 SceneHelpers.SetupSceneModules(scene, afm); 57 SceneHelpers.SetupSceneModules(scene, afm);
58 ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId); 58 ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId);
59 59
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
81 CoreAssetCache assetCache = new CoreAssetCache(); 81 CoreAssetCache assetCache = new CoreAssetCache();
82 82
83 AvatarFactoryModule afm = new AvatarFactoryModule(); 83 AvatarFactoryModule afm = new AvatarFactoryModule();
84 TestScene scene = SceneHelpers.SetupScene(assetCache); 84 TestScene scene = new SceneHelpers(assetCache).SetupScene();
85 SceneHelpers.SetupSceneModules(scene, afm); 85 SceneHelpers.SetupSceneModules(scene, afm);
86 ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId); 86 ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId);
87 87
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
index 45b4264..7a197f7 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
@@ -78,7 +78,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends.Tests
78 config.AddConfig("FriendsService"); 78 config.AddConfig("FriendsService");
79 config.Configs["FriendsService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); 79 config.Configs["FriendsService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
80 80
81 m_scene = SceneHelpers.SetupScene(); 81 m_scene = new SceneHelpers().SetupScene();
82 m_fm = new FriendsModule(); 82 m_fm = new FriendsModule();
83 SceneHelpers.SetupSceneModules(m_scene, config, m_fm); 83 SceneHelpers.SetupSceneModules(m_scene, config, m_fm);
84 } 84 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
index 19ef571..90ae69d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
@@ -100,7 +100,7 @@ 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 = SceneHelpers.SetupScene(); 103 Scene scene = new SceneHelpers().SetupScene();
104 SceneHelpers.SetupSceneModules(scene, archiverModule); 104 SceneHelpers.SetupSceneModules(scene, archiverModule);
105 105
106 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); 106 UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index e409c8e..b112b6d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -61,7 +61,7 @@ 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 = SceneHelpers.SetupScene(); 64 m_scene = new SceneHelpers().SetupScene();
65 SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); 65 SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
66 } 66 }
67 67
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
index 417c20c..6eb3605 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
62 62
63 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 63 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
64 64
65 Scene scene = SceneHelpers.SetupScene(); 65 Scene scene = new SceneHelpers().SetupScene();
66 SceneHelpers.SetupSceneModules(scene, archiverModule); 66 SceneHelpers.SetupSceneModules(scene, archiverModule);
67 67
68 // Create user 68 // Create user
@@ -179,7 +179,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
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 = SceneHelpers.SetupScene(); 182 Scene scene = new SceneHelpers().SetupScene();
183 183
184 SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 184 SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
185 185
@@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
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 = SceneHelpers.SetupScene(); 225 Scene scene = new SceneHelpers().SetupScene();
226 SceneHelpers.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");
@@ -247,7 +247,7 @@ 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 = SceneHelpers.SetupScene(); 250 Scene scene = new SceneHelpers().SetupScene();
251 SceneHelpers.SetupSceneModules(scene, archiverModule); 251 SceneHelpers.SetupSceneModules(scene, archiverModule);
252 252
253 // Create user 253 // Create user
@@ -326,7 +326,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
326 TestHelpers.InMethod(); 326 TestHelpers.InMethod();
327// log4net.Config.XmlConfigurator.Configure(); 327// log4net.Config.XmlConfigurator.Configure();
328 328
329 Scene scene = SceneHelpers.SetupScene(); 329 Scene scene = new 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>();
@@ -393,7 +393,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
393 TestHelpers.InMethod(); 393 TestHelpers.InMethod();
394 //log4net.Config.XmlConfigurator.Configure(); 394 //log4net.Config.XmlConfigurator.Configure();
395 395
396 Scene scene = SceneHelpers.SetupScene(); 396 Scene scene = new SceneHelpers().SetupScene();
397 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); 397 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
398 398
399 string folder1ExistingName = "a"; 399 string folder1ExistingName = "a";
@@ -444,7 +444,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
444 TestHelpers.InMethod(); 444 TestHelpers.InMethod();
445// log4net.Config.XmlConfigurator.Configure(); 445// log4net.Config.XmlConfigurator.Configure();
446 446
447 Scene scene = SceneHelpers.SetupScene(); 447 Scene scene = new 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 a36d0fe..a318a3c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -178,7 +178,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
178 destinationRegionName = sp.Scene.RegionInfo.RegionName; 178 destinationRegionName = sp.Scene.RegionInfo.RegionName;
179 179
180 m_log.DebugFormat( 180 m_log.DebugFormat(
181 "[ENTITY TRANSFER MODULE]: RequestTeleportToLocation for {0} to {1} within existing region {2}", 181 "[ENTITY TRANSFER MODULE]: Teleport for {0} to {1} within {2}",
182 sp.Name, position, destinationRegionName); 182 sp.Name, position, destinationRegionName);
183 183
184 // Teleport within the same region 184 // Teleport within the same region
@@ -231,7 +231,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
231 GridRegion finalDestination = GetFinalDestination(reg); 231 GridRegion finalDestination = GetFinalDestination(reg);
232 if (finalDestination == null) 232 if (finalDestination == null)
233 { 233 {
234 m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Final destination is having problems. Unable to teleport agent."); 234 m_log.WarnFormat(
235 "[ENTITY TRANSFER MODULE]: Final destination is having problems. Unable to teleport {0} {1}",
236 sp.Name, sp.UUID);
237
235 sp.ControllingClient.SendTeleportFailed("Problem at destination"); 238 sp.ControllingClient.SendTeleportFailed("Problem at destination");
236 return; 239 return;
237 } 240 }
@@ -320,10 +323,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
320 } 323 }
321 324
322 if (IsInTransit(sp.UUID)) // Avie is already on the way. Caller shouldn't do this. 325 if (IsInTransit(sp.UUID)) // Avie is already on the way. Caller shouldn't do this.
326 {
327 m_log.DebugFormat(
328 "[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2} ({3}) {4}/{5} - agent is already in transit.",
329 sp.Name, sp.UUID, reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
330
323 return; 331 return;
332 }
324 333
325 m_log.DebugFormat( 334 m_log.DebugFormat(
326 "[ENTITY TRANSFER MODULE]: Request Teleport to {0} ({1}) {2}/{3}", 335 "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}",
336 sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName,
327 reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position); 337 reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
328 338
329 uint newRegionX = (uint)(reg.RegionHandle >> 40); 339 uint newRegionX = (uint)(reg.RegionHandle >> 40);
@@ -444,7 +454,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
444 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); 454 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
445 } 455 }
446 456
447
448 SetInTransit(sp.UUID); 457 SetInTransit(sp.UUID);
449 458
450 // Let's send a full update of the agent. This is a synchronous call. 459 // Let's send a full update of the agent. This is a synchronous call.
@@ -588,7 +597,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
588 597
589 protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout) 598 protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout)
590 { 599 {
591 sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, true); 600 if (sp.Scene.AttachmentsModule != null)
601 sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, true);
592 } 602 }
593 603
594 protected void KillEntity(Scene scene, uint localID) 604 protected void KillEntity(Scene scene, uint localID)
@@ -656,7 +666,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
656 666
657 public virtual void TeleportHome(UUID id, IClientAPI client) 667 public virtual void TeleportHome(UUID id, IClientAPI client)
658 { 668 {
659 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); 669 m_log.DebugFormat(
670 "[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId);
660 671
661 //OpenSim.Services.Interfaces.PresenceInfo pinfo = m_aScene.PresenceService.GetAgent(client.SessionId); 672 //OpenSim.Services.Interfaces.PresenceInfo pinfo = m_aScene.PresenceService.GetAgent(client.SessionId);
662 GridUserInfo uinfo = m_aScene.GridUserService.GetGridUserInfo(client.AgentId.ToString()); 673 GridUserInfo uinfo = m_aScene.GridUserService.GetGridUserInfo(client.AgentId.ToString());
@@ -671,14 +682,20 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
671 return; 682 return;
672 } 683 }
673 684
674 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", 685 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Home region of {0} is {1} ({2}-{3})",
675 regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize); 686 client.Name, regionInfo.RegionName, regionInfo.RegionCoordX, regionInfo.RegionCoordY);
676 687
677 // a little eekie that this goes back to Scene and with a forced cast, will fix that at some point... 688 // a little eekie that this goes back to Scene and with a forced cast, will fix that at some point...
678 ((Scene)(client.Scene)).RequestTeleportLocation( 689 ((Scene)(client.Scene)).RequestTeleportLocation(
679 client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt, 690 client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt,
680 (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); 691 (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome));
681 } 692 }
693 else
694 {
695 m_log.ErrorFormat(
696 "[ENTITY TRANSFER MODULE]: No grid user information found for {0} {1}. Cannot send home.",
697 client.Name, client.AgentId);
698 }
682 } 699 }
683 700
684 #endregion 701 #endregion
@@ -1362,19 +1379,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1362 // after a cross here 1379 // after a cross here
1363 Thread.Sleep(500); 1380 Thread.Sleep(500);
1364 1381
1365 Scene m_scene = sp.Scene; 1382 Scene scene = sp.Scene;
1366 1383
1367 uint x, y; 1384 m_log.DebugFormat(
1368 Utils.LongToUInts(reg.RegionHandle, out x, out y); 1385 "[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})",
1369 x = x / Constants.RegionSize; 1386 sp.Name, sp.UUID, reg.RegionName, endPoint, reg.RegionCoordX, reg.RegionCoordY);
1370 y = y / Constants.RegionSize;
1371 m_log.Debug("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint + ")");
1372 1387
1373 string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); 1388 string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath);
1374 1389
1375 string reason = String.Empty; 1390 string reason = String.Empty;
1376 1391
1377 bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason); 1392 bool regionAccepted = scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason);
1378 1393
1379 if (regionAccepted && newAgent) 1394 if (regionAccepted && newAgent)
1380 { 1395 {
@@ -1391,7 +1406,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1391 1406
1392 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: {0} is sending {1} EnableSimulator for neighbour region {2} @ {3} " + 1407 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: {0} is sending {1} EnableSimulator for neighbour region {2} @ {3} " +
1393 "and EstablishAgentCommunication with seed cap {4}", 1408 "and EstablishAgentCommunication with seed cap {4}",
1394 m_scene.RegionInfo.RegionName, sp.Name, reg.RegionName, reg.RegionHandle, capsPath); 1409 scene.RegionInfo.RegionName, sp.Name, reg.RegionName, reg.RegionHandle, capsPath);
1395 1410
1396 eq.EnableSimulator(reg.RegionHandle, endPoint, sp.UUID); 1411 eq.EnableSimulator(reg.RegionHandle, endPoint, sp.UUID);
1397 eq.EstablishAgentCommunication(sp.UUID, endPoint, capsPath); 1412 eq.EstablishAgentCommunication(sp.UUID, endPoint, capsPath);
@@ -1402,10 +1417,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1402 // TODO: make Event Queue disablable! 1417 // TODO: make Event Queue disablable!
1403 } 1418 }
1404 1419
1405 m_log.Debug("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString()); 1420 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Completed inform {0} {1} about neighbour {2}", sp.Name, sp.UUID, endPoint);
1406 } 1421 }
1422
1407 if (!regionAccepted) 1423 if (!regionAccepted)
1408 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Region {0} did not accept agent: {1}", reg.RegionName, reason); 1424 m_log.WarnFormat(
1425 "[ENTITY TRANSFER MODULE]: Region {0} did not accept {1} {2}: {3}",
1426 reg.RegionName, sp.Name, sp.UUID, reason);
1409 } 1427 }
1410 1428
1411 /// <summary> 1429 /// <summary>
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 1854b4a..488bbcb 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -201,7 +201,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
201 201
202 public override void TeleportHome(UUID id, IClientAPI client) 202 public override void TeleportHome(UUID id, IClientAPI client)
203 { 203 {
204 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); 204 m_log.DebugFormat(
205 "[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId);
205 206
206 // Let's find out if this is a foreign user or a local user 207 // Let's find out if this is a foreign user or a local user
207 IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>(); 208 IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>();
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
index e74310c..d6afaa9 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
@@ -65,7 +65,7 @@ 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 = SceneHelpers.SetupScene(); 68 m_scene = new SceneHelpers().SetupScene();
69 SceneHelpers.SetupSceneModules(m_scene, config, m_iam); 69 SceneHelpers.SetupSceneModules(m_scene, config, m_iam);
70 70
71 // Create user 71 // Create user
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index 85e7e94..90f27c4 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
191 { 191 {
192 if (s.RegionInfo.RegionHandle == destination.RegionHandle) 192 if (s.RegionInfo.RegionHandle == destination.RegionHandle)
193 { 193 {
194 m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName); 194// m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName);
195 return s.NewUserConnection(aCircuit, teleportFlags, out reason); 195 return s.NewUserConnection(aCircuit, teleportFlags, out reason);
196 } 196 }
197 } 197 }
@@ -209,9 +209,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
209 { 209 {
210 if (s.RegionInfo.RegionHandle == destination.RegionHandle) 210 if (s.RegionInfo.RegionHandle == destination.RegionHandle)
211 { 211 {
212 m_log.DebugFormat( 212// m_log.DebugFormat(
213 "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", 213// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
214 s.RegionInfo.RegionName, destination.RegionHandle); 214// s.RegionInfo.RegionName, destination.RegionHandle);
215 215
216 s.IncomingChildAgentDataUpdate(cAgentData); 216 s.IncomingChildAgentDataUpdate(cAgentData);
217 return true; 217 return true;
@@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
281 { 281 {
282 if (s.RegionInfo.RegionID == origin) 282 if (s.RegionInfo.RegionID == origin)
283 { 283 {
284 m_log.Debug("[LOCAL COMMS]: Found region to SendReleaseAgent"); 284// m_log.Debug("[LOCAL COMMS]: Found region to SendReleaseAgent");
285 AgentTransferModule.AgentArrivedAtDestination(id); 285 AgentTransferModule.AgentArrivedAtDestination(id);
286 return true; 286 return true;
287// return s.IncomingReleaseAgent(id); 287// return s.IncomingReleaseAgent(id);
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 4d459bf..ab3cc41 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -297,10 +297,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver
297 if (checkPermissions.Contains("T") && !canTransfer) 297 if (checkPermissions.Contains("T") && !canTransfer)
298 partPermitted = false; 298 partPermitted = false;
299 299
300 // If the user is the Creator of the object then it can always be included in the OAR
301 bool creator = (obj.CreatorID.Guid == user.Guid);
302 if (creator)
303 partPermitted = true;
304
300 //string name = (objGroup.PrimCount == 1) ? objGroup.Name : string.Format("{0} ({1}/{2})", obj.Name, primNumber, objGroup.PrimCount); 305 //string name = (objGroup.PrimCount == 1) ? objGroup.Name : string.Format("{0} ({1}/{2})", obj.Name, primNumber, objGroup.PrimCount);
301 //m_log.DebugFormat("[ARCHIVER]: Object permissions: {0}: Base={1:X4}, Owner={2:X4}, Everyone={3:X4}, permissionClass={4}, checkPermissions={5}, canCopy={6}, canTransfer={7}, permitted={8}", 306 //m_log.DebugFormat("[ARCHIVER]: Object permissions: {0}: Base={1:X4}, Owner={2:X4}, Everyone={3:X4}, permissionClass={4}, checkPermissions={5}, canCopy={6}, canTransfer={7}, creator={8}, permitted={9}",
302 // name, obj.BaseMask, obj.OwnerMask, obj.EveryoneMask, 307 // name, obj.BaseMask, obj.OwnerMask, obj.EveryoneMask,
303 // permissionClass, checkPermissions, canCopy, canTransfer, permitted); 308 // permissionClass, checkPermissions, canCopy, canTransfer, creator, partPermitted);
304 309
305 if (!partPermitted) 310 if (!partPermitted)
306 { 311 {
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index e05e8f6..053c6f5 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -68,7 +68,7 @@ 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 = SceneHelpers.SetupScene(); 71 m_scene = new SceneHelpers().SetupScene();
72 SceneHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); 72 SceneHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule);
73 } 73 }
74 74
@@ -463,7 +463,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
463 SerialiserModule serialiserModule = new SerialiserModule(); 463 SerialiserModule serialiserModule = new SerialiserModule();
464 TerrainModule terrainModule = new TerrainModule(); 464 TerrainModule terrainModule = new TerrainModule();
465 465
466 TestScene scene2 = SceneHelpers.SetupScene(); 466 TestScene scene2 = new SceneHelpers().SetupScene();
467 SceneHelpers.SetupSceneModules(scene2, archiverModule, serialiserModule, terrainModule); 467 SceneHelpers.SetupSceneModules(scene2, archiverModule, serialiserModule, terrainModule);
468 468
469 // Make sure there's a valid owner for the owner we saved (this should have been wiped if the code is 469 // Make sure there's a valid owner for the owner we saved (this should have been wiped if the code is
@@ -607,7 +607,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
607 SerialiserModule serialiserModule = new SerialiserModule(); 607 SerialiserModule serialiserModule = new SerialiserModule();
608 TerrainModule terrainModule = new TerrainModule(); 608 TerrainModule terrainModule = new TerrainModule();
609 609
610 Scene scene = SceneHelpers.SetupScene(); 610 Scene scene = new SceneHelpers().SetupScene();
611 SceneHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); 611 SceneHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
612 612
613 m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); 613 m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false);
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
index e553ffa..b5ee4d2 100644
--- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
+++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
@@ -64,7 +64,7 @@ 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 = SceneHelpers.SetupScene(); 67 m_scene = new SceneHelpers().SetupScene();
68 SceneHelpers.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;
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
index 4326606..0545250 100644
--- a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
+++ b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
@@ -53,7 +53,7 @@ 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 = SceneHelpers.SetupScene(); 56 m_scene = new SceneHelpers().SetupScene();
57 SceneHelpers.SetupSceneModules(m_scene, m_module); 57 SceneHelpers.SetupSceneModules(m_scene, m_module);
58 } 58 }
59 59
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
index d1d2020..7825e3e 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
@@ -343,7 +343,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
343 public void Init() 343 public void Init()
344 { 344 {
345 m_serialiserModule = new SerialiserModule(); 345 m_serialiserModule = new SerialiserModule();
346 m_scene = SceneHelpers.SetupScene(); 346 m_scene = new SceneHelpers().SetupScene();
347 SceneHelpers.SetupSceneModules(m_scene, m_serialiserModule); 347 SceneHelpers.SetupSceneModules(m_scene, m_serialiserModule);
348 } 348 }
349 349
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
index dc3ff89..b4dc3c3 100644
--- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
@@ -135,6 +135,36 @@ namespace OpenSim.Region.Framework.Interfaces
135 bool Say(UUID agentID, Scene scene, string text); 135 bool Say(UUID agentID, Scene scene, string text);
136 136
137 /// <summary> 137 /// <summary>
138 /// Get the NPC to say something.
139 /// </summary>
140 /// <param name="agentID">The UUID of the NPC</param>
141 /// <param name="scene"></param>
142 /// <param name="text"></param>
143 /// <param name="channel"></param>
144 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
145 bool Say(UUID agentID, Scene scene, string text, int channel);
146
147 /// <summary>
148 /// Get the NPC to shout something.
149 /// </summary>
150 /// <param name="agentID">The UUID of the NPC</param>
151 /// <param name="scene"></param>
152 /// <param name="text"></param>
153 /// <param name="channel"></param>
154 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
155 bool Shout(UUID agentID, Scene scene, string text, int channel);
156
157 /// <summary>
158 /// Get the NPC to whisper something.
159 /// </summary>
160 /// <param name="agentID">The UUID of the NPC</param>
161 /// <param name="scene"></param>
162 /// <param name="text"></param>
163 /// <param name="channel"></param>
164 /// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
165 bool Whisper(UUID agentID, Scene scene, string text, int channel);
166
167 /// <summary>
138 /// Sit the NPC. 168 /// Sit the NPC.
139 /// </summary> 169 /// </summary>
140 /// <param name="agentID"></param> 170 /// <param name="agentID"></param>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 10b25ed..816d3b6 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1988,7 +1988,7 @@ namespace OpenSim.Region.Framework.Scenes
1988 } 1988 }
1989 } 1989 }
1990 1990
1991 if (permissionToTake) 1991 if (permissionToTake && (action != DeRezAction.Delete || this.m_useTrashOnDelete))
1992 { 1992 {
1993 m_asyncSceneObjectDeleter.DeleteToInventory( 1993 m_asyncSceneObjectDeleter.DeleteToInventory(
1994 action, destinationID, deleteGroups, remoteClient, 1994 action, destinationID, deleteGroups, remoteClient,
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a87dfb7..4d0aa6f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -103,6 +103,7 @@ namespace OpenSim.Region.Framework.Scenes
103 public bool m_trustBinaries; 103 public bool m_trustBinaries;
104 public bool m_allowScriptCrossings; 104 public bool m_allowScriptCrossings;
105 public bool m_useFlySlow; 105 public bool m_useFlySlow;
106 public bool m_useTrashOnDelete = true;
106 107
107 /// <summary> 108 /// <summary>
108 /// Temporarily setting to trigger appearance resends at 60 second intervals. 109 /// Temporarily setting to trigger appearance resends at 60 second intervals.
@@ -436,6 +437,7 @@ namespace OpenSim.Region.Framework.Scenes
436 { 437 {
437 if (m_simulationService == null) 438 if (m_simulationService == null)
438 m_simulationService = RequestModuleInterface<ISimulationService>(); 439 m_simulationService = RequestModuleInterface<ISimulationService>();
440
439 return m_simulationService; 441 return m_simulationService;
440 } 442 }
441 } 443 }
@@ -709,6 +711,7 @@ namespace OpenSim.Region.Framework.Scenes
709 m_clampPrimSize = true; 711 m_clampPrimSize = true;
710 } 712 }
711 713
714 m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete",m_useTrashOnDelete);
712 m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries); 715 m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries);
713 m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings); 716 m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings);
714 m_dontPersistBefore = 717 m_dontPersistBefore =
@@ -3215,8 +3218,8 @@ namespace OpenSim.Region.Framework.Scenes
3215 try 3218 try
3216 { 3219 {
3217 m_log.DebugFormat( 3220 m_log.DebugFormat(
3218 "[SCENE]: Removing {0} agent {1} from region {2}", 3221 "[SCENE]: Removing {0} agent {1} {2} from region {3}",
3219 (isChildAgent ? "child" : "root"), agentID, RegionInfo.RegionName); 3222 (isChildAgent ? "child" : "root"), avatar.Name, agentID, RegionInfo.RegionName);
3220 3223
3221 m_sceneGraph.removeUserCount(!isChildAgent); 3224 m_sceneGraph.removeUserCount(!isChildAgent);
3222 3225
@@ -3794,41 +3797,41 @@ namespace OpenSim.Region.Framework.Scenes
3794 return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc); 3797 return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc);
3795 } 3798 }
3796 3799
3797 /// <summary> 3800// /// <summary>
3798 /// The Grid has requested that we log-off a user. Log them off. 3801// /// The Grid has requested that we log-off a user. Log them off.
3799 /// </summary> 3802// /// </summary>
3800 /// <param name="AvatarID">Unique ID of the avatar to log-off</param> 3803// /// <param name="AvatarID">Unique ID of the avatar to log-off</param>
3801 /// <param name="RegionSecret">SecureSessionID of the user, or the RegionSecret text when logging on to the grid</param> 3804// /// <param name="RegionSecret">SecureSessionID of the user, or the RegionSecret text when logging on to the grid</param>
3802 /// <param name="message">message to display to the user. Reason for being logged off</param> 3805// /// <param name="message">message to display to the user. Reason for being logged off</param>
3803 public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message) 3806// public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message)
3804 { 3807// {
3805 ScenePresence loggingOffUser = GetScenePresence(AvatarID); 3808// ScenePresence loggingOffUser = GetScenePresence(AvatarID);
3806 if (loggingOffUser != null) 3809// if (loggingOffUser != null)
3807 { 3810// {
3808 UUID localRegionSecret = UUID.Zero; 3811// UUID localRegionSecret = UUID.Zero;
3809 bool parsedsecret = UUID.TryParse(m_regInfo.regionSecret, out localRegionSecret); 3812// bool parsedsecret = UUID.TryParse(m_regInfo.regionSecret, out localRegionSecret);
3810 3813//
3811 // Region Secret is used here in case a new sessionid overwrites an old one on the user server. 3814// // Region Secret is used here in case a new sessionid overwrites an old one on the user server.
3812 // Will update the user server in a few revisions to use it. 3815// // Will update the user server in a few revisions to use it.
3813 3816//
3814 if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId || (parsedsecret && RegionSecret == localRegionSecret)) 3817// if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId || (parsedsecret && RegionSecret == localRegionSecret))
3815 { 3818// {
3816 m_sceneGridService.SendCloseChildAgentConnections(loggingOffUser.UUID, loggingOffUser.KnownRegionHandles); 3819// m_sceneGridService.SendCloseChildAgentConnections(loggingOffUser.UUID, loggingOffUser.KnownRegionHandles);
3817 loggingOffUser.ControllingClient.Kick(message); 3820// loggingOffUser.ControllingClient.Kick(message);
3818 // Give them a second to receive the message! 3821// // Give them a second to receive the message!
3819 Thread.Sleep(1000); 3822// Thread.Sleep(1000);
3820 loggingOffUser.ControllingClient.Close(); 3823// loggingOffUser.ControllingClient.Close();
3821 } 3824// }
3822 else 3825// else
3823 { 3826// {
3824 m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate"); 3827// m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
3825 } 3828// }
3826 } 3829// }
3827 else 3830// else
3828 { 3831// {
3829 m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString()); 3832// m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
3830 } 3833// }
3831 } 3834// }
3832 3835
3833 /// <summary> 3836 /// <summary>
3834 /// Triggered when an agent crosses into this sim. Also happens on initial login. 3837 /// Triggered when an agent crosses into this sim. Also happens on initial login.
@@ -3877,7 +3880,10 @@ namespace OpenSim.Region.Framework.Scenes
3877 ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, Constants.RegionSize / 2, Constants.RegionSize / 2); 3880 ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, Constants.RegionSize / 2, Constants.RegionSize / 2);
3878 if (nearestParcel == null) 3881 if (nearestParcel == null)
3879 { 3882 {
3880 m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: no allowed parcel", cAgentData.AgentID); 3883 m_log.DebugFormat(
3884 "[SCENE]: Denying root agent entry to {0} in {1}: no allowed parcel",
3885 cAgentData.AgentID, RegionInfo.RegionName);
3886
3881 return false; 3887 return false;
3882 } 3888 }
3883 3889
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 49a3485..2686004 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1969,6 +1969,11 @@ namespace OpenSim.Region.Framework.Scenes
1969 /// <param name="objectGroup">The group of prims which should be linked to this group</param> 1969 /// <param name="objectGroup">The group of prims which should be linked to this group</param>
1970 public void LinkToGroup(SceneObjectGroup objectGroup) 1970 public void LinkToGroup(SceneObjectGroup objectGroup)
1971 { 1971 {
1972 LinkToGroup(objectGroup, false);
1973 }
1974
1975 public void LinkToGroup(SceneObjectGroup objectGroup, bool insert)
1976 {
1972// m_log.DebugFormat( 1977// m_log.DebugFormat(
1973// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}", 1978// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
1974// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); 1979// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
@@ -1979,6 +1984,10 @@ namespace OpenSim.Region.Framework.Scenes
1979 1984
1980 SceneObjectPart linkPart = objectGroup.m_rootPart; 1985 SceneObjectPart linkPart = objectGroup.m_rootPart;
1981 1986
1987 // physics flags from group to be applied to linked parts
1988 bool grpusephys = UsesPhysics;
1989 bool grptemporary = IsTemporary;
1990
1982 Vector3 oldGroupPosition = linkPart.GroupPosition; 1991 Vector3 oldGroupPosition = linkPart.GroupPosition;
1983 Quaternion oldRootRotation = linkPart.RotationOffset; 1992 Quaternion oldRootRotation = linkPart.RotationOffset;
1984 1993
@@ -2002,15 +2011,35 @@ namespace OpenSim.Region.Framework.Scenes
2002 2011
2003 lock (m_parts.SyncRoot) 2012 lock (m_parts.SyncRoot)
2004 { 2013 {
2005 int linkNum = PrimCount + 1; 2014 int linkNum;
2015 if (insert)
2016 {
2017 linkNum = 2;
2018 foreach (SceneObjectPart part in Parts)
2019 {
2020 if (part.LinkNum > 1)
2021 part.LinkNum++;
2022 }
2023 }
2024 else
2025 {
2026 linkNum = PrimCount + 1;
2027 }
2006 2028
2007 m_parts.Add(linkPart.UUID, linkPart); 2029 m_parts.Add(linkPart.UUID, linkPart);
2008 2030
2009 linkPart.SetParent(this); 2031 linkPart.SetParent(this);
2010 linkPart.CreateSelected = true; 2032 linkPart.CreateSelected = true;
2011 2033
2034 // let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now
2035 linkPart.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (linkPart.Flags & PrimFlags.Phantom) != 0), linkPart.VolumeDetectActive);
2036 if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
2037 {
2038 linkPart.PhysActor.link(m_rootPart.PhysActor);
2039 this.Scene.PhysicsScene.AddPhysicsActorTaint(linkPart.PhysActor);
2040 }
2041
2012 linkPart.LinkNum = linkNum++; 2042 linkPart.LinkNum = linkNum++;
2013 linkPart.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect);
2014 2043
2015 SceneObjectPart[] ogParts = objectGroup.Parts; 2044 SceneObjectPart[] ogParts = objectGroup.Parts;
2016 Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b) 2045 Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b)
@@ -2022,7 +2051,16 @@ namespace OpenSim.Region.Framework.Scenes
2022 { 2051 {
2023 SceneObjectPart part = ogParts[i]; 2052 SceneObjectPart part = ogParts[i];
2024 if (part.UUID != objectGroup.m_rootPart.UUID) 2053 if (part.UUID != objectGroup.m_rootPart.UUID)
2054 {
2025 LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++); 2055 LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++);
2056 // let physics know
2057 part.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (part.Flags & PrimFlags.Phantom) != 0), part.VolumeDetectActive);
2058 if (part.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
2059 {
2060 part.PhysActor.link(m_rootPart.PhysActor);
2061 this.Scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
2062 }
2063 }
2026 part.ClearUndoState(); 2064 part.ClearUndoState();
2027 } 2065 }
2028 } 2066 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index e8178ce..6b38027 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1142,7 +1142,10 @@ namespace OpenSim.Region.Framework.Scenes
1142 1142
1143 if ((m_callbackURI != null) && !m_callbackURI.Equals("")) 1143 if ((m_callbackURI != null) && !m_callbackURI.Equals(""))
1144 { 1144 {
1145 m_log.DebugFormat("[SCENE PRESENCE]: Releasing agent in URI {0}", m_callbackURI); 1145 m_log.DebugFormat(
1146 "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}",
1147 client.Name, client.AgentId, m_callbackURI);
1148
1146 Scene.SimulationService.ReleaseAgent(m_originRegionID, UUID, m_callbackURI); 1149 Scene.SimulationService.ReleaseAgent(m_originRegionID, UUID, m_callbackURI);
1147 m_callbackURI = null; 1150 m_callbackURI = null;
1148 } 1151 }
@@ -1690,9 +1693,9 @@ namespace OpenSim.Region.Framework.Scenes
1690 if (pos.Z - terrainHeight < 0.2) 1693 if (pos.Z - terrainHeight < 0.2)
1691 pos.Z = terrainHeight; 1694 pos.Z = terrainHeight;
1692 1695
1693 m_log.DebugFormat( 1696// m_log.DebugFormat(
1694 "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}", 1697// "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}",
1695 Name, pos, terrainHeight, m_scene.RegionInfo.RegionName); 1698// Name, pos, terrainHeight, m_scene.RegionInfo.RegionName);
1696 1699
1697 if (noFly) 1700 if (noFly)
1698 Flying = false; 1701 Flying = false;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
index a5d2b23..ea9fc93 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
45 { 45 {
46 static public Random random; 46 static public Random random;
47 SceneObjectGroup found; 47 SceneObjectGroup found;
48 Scene scene = SceneHelpers.SetupScene(); 48 Scene scene = new SceneHelpers().SetupScene();
49 49
50 [Test] 50 [Test]
51 public void T010_AddObjects() 51 public void T010_AddObjects()
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
index 9a60e50..1c33a5f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
44 public void TestDuplicateObject() 44 public void TestDuplicateObject()
45 { 45 {
46 TestHelpers.InMethod(); 46 TestHelpers.InMethod();
47 Scene scene = SceneHelpers.SetupScene(); 47 Scene scene = new SceneHelpers().SetupScene();
48 48
49 UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010"); 49 UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010");
50 string part1Name = "part1"; 50 string part1Name = "part1";
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index 7737d8e..453e077 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -88,7 +88,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
88 { 88 {
89 TestHelpers.InMethod(); 89 TestHelpers.InMethod();
90 90
91 Scene scene = SceneHelpers.SetupScene(); 91 Scene scene = new SceneHelpers().SetupScene();
92 int partsToTestCount = 3; 92 int partsToTestCount = 3;
93 93
94 SceneObjectGroup so 94 SceneObjectGroup so
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
118 { 118 {
119 TestHelpers.InMethod(); 119 TestHelpers.InMethod();
120 120
121 Scene scene = SceneHelpers.SetupScene(); 121 Scene scene = new SceneHelpers().SetupScene();
122 122
123 string obj1Name = "Alfred"; 123 string obj1Name = "Alfred";
124 string obj2Name = "Betty"; 124 string obj2Name = "Betty";
@@ -152,7 +152,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
152 { 152 {
153 TestHelpers.InMethod(); 153 TestHelpers.InMethod();
154 154
155 Scene scene = SceneHelpers.SetupScene(); 155 Scene scene = new SceneHelpers().SetupScene();
156 int partsToTestCount = 3; 156 int partsToTestCount = 3;
157 157
158 SceneObjectGroup so 158 SceneObjectGroup so
@@ -185,7 +185,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
185 { 185 {
186 TestHelpers.InMethod(); 186 TestHelpers.InMethod();
187 187
188 TestScene scene = SceneHelpers.SetupScene(); 188 TestScene scene = new SceneHelpers().SetupScene();
189 SceneObjectPart part = SceneHelpers.AddSceneObject(scene); 189 SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
190 scene.DeleteSceneObject(part.ParentGroup, false); 190 scene.DeleteSceneObject(part.ParentGroup, false);
191 191
@@ -204,7 +204,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
204 204
205 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); 205 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
206 206
207 TestScene scene = SceneHelpers.SetupScene(); 207 TestScene scene = new SceneHelpers().SetupScene();
208 208
209 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. 209 // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
210 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; 210 AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
index 654b1a2..0076f41 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
61 61
62 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); 62 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
63 63
64 TestScene scene = SceneHelpers.SetupScene(); 64 TestScene scene = new SceneHelpers().SetupScene();
65 IConfigSource configSource = new IniConfigSource(); 65 IConfigSource configSource = new IniConfigSource();
66 IConfig config = configSource.AddConfig("Startup"); 66 IConfig config = configSource.AddConfig("Startup");
67 config.Set("serverside_object_permissions", true); 67 config.Set("serverside_object_permissions", true);
@@ -100,7 +100,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
100 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); 100 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
101 UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001"); 101 UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001");
102 102
103 TestScene scene = SceneHelpers.SetupScene(); 103 TestScene scene = new SceneHelpers().SetupScene();
104 IConfigSource configSource = new IniConfigSource(); 104 IConfigSource configSource = new IniConfigSource();
105 IConfig config = configSource.AddConfig("Startup"); 105 IConfig config = configSource.AddConfig("Startup");
106 config.Set("serverside_object_permissions", true); 106 config.Set("serverside_object_permissions", true);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index be5b4a8..1add3dd 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
55 UUID ownerId = TestHelpers.ParseTail(0x1); 55 UUID ownerId = TestHelpers.ParseTail(0x1);
56 int nParts = 3; 56 int nParts = 3;
57 57
58 TestScene scene = SceneHelpers.SetupScene(); 58 TestScene scene = new SceneHelpers().SetupScene();
59 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(nParts, ownerId, "TestLinkToSelf_", 0x10); 59 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(nParts, ownerId, "TestLinkToSelf_", 0x10);
60 scene.AddSceneObject(sog1); 60 scene.AddSceneObject(sog1);
61 scene.LinkObjects(ownerId, sog1.LocalId, new List<uint>() { sog1.Parts[1].LocalId }); 61 scene.LinkObjects(ownerId, sog1.LocalId, new List<uint>() { sog1.Parts[1].LocalId });
@@ -71,7 +71,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
71 71
72 bool debugtest = false; 72 bool debugtest = false;
73 73
74 Scene scene = SceneHelpers.SetupScene(); 74 Scene scene = new SceneHelpers().SetupScene();
75 SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene); 75 SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene);
76 SceneObjectGroup grp1 = part1.ParentGroup; 76 SceneObjectGroup grp1 = part1.ParentGroup;
77 SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene); 77 SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene);
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
153 153
154 bool debugtest = false; 154 bool debugtest = false;
155 155
156 Scene scene = SceneHelpers.SetupScene(); 156 Scene scene = new SceneHelpers().SetupScene();
157 SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene); 157 SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene);
158 SceneObjectGroup grp1 = part1.ParentGroup; 158 SceneObjectGroup grp1 = part1.ParentGroup;
159 SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene); 159 SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene);
@@ -286,7 +286,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
286 TestHelpers.InMethod(); 286 TestHelpers.InMethod();
287 //log4net.Config.XmlConfigurator.Configure(); 287 //log4net.Config.XmlConfigurator.Configure();
288 288
289 TestScene scene = SceneHelpers.SetupScene(); 289 TestScene scene = new SceneHelpers().SetupScene();
290 290
291 string rootPartName = "rootpart"; 291 string rootPartName = "rootpart";
292 UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); 292 UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
@@ -325,7 +325,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
325 TestHelpers.InMethod(); 325 TestHelpers.InMethod();
326 //log4net.Config.XmlConfigurator.Configure(); 326 //log4net.Config.XmlConfigurator.Configure();
327 327
328 TestScene scene = SceneHelpers.SetupScene(); 328 TestScene scene = new SceneHelpers().SetupScene();
329 329
330 string rootPartName = "rootpart"; 330 string rootPartName = "rootpart";
331 UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); 331 UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
index b49c6e7..0a94c19 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
52 TestHelpers.InMethod(); 52 TestHelpers.InMethod();
53// log4net.Config.XmlConfigurator.Configure(); 53// log4net.Config.XmlConfigurator.Configure();
54 54
55 Scene scene = SceneHelpers.SetupScene(); 55 Scene scene = new SceneHelpers().SetupScene();
56 SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene).ParentGroup; 56 SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene).ParentGroup;
57 57
58 g1.GroupResize(new Vector3(2, 3, 4)); 58 g1.GroupResize(new Vector3(2, 3, 4));
@@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
75 TestHelpers.InMethod(); 75 TestHelpers.InMethod();
76 //log4net.Config.XmlConfigurator.Configure(); 76 //log4net.Config.XmlConfigurator.Configure();
77 77
78 Scene scene = SceneHelpers.SetupScene(); 78 Scene scene = new SceneHelpers().SetupScene();
79 79
80 SceneObjectGroup g1 = SceneHelpers.CreateSceneObject(2, UUID.Zero); 80 SceneObjectGroup g1 = SceneHelpers.CreateSceneObject(2, UUID.Zero);
81 g1.RootPart.Scale = new Vector3(2, 3, 4); 81 g1.RootPart.Scale = new Vector3(2, 3, 4);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs
index c582cf6..d2361f8 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
52// UUID itemId = TestHelpers.ParseTail(0x2); 52// UUID itemId = TestHelpers.ParseTail(0x2);
53 string itemName = "Test Script Item"; 53 string itemName = "Test Script Item";
54 54
55 Scene scene = SceneHelpers.SetupScene(); 55 Scene scene = new SceneHelpers().SetupScene();
56 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId); 56 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId);
57 scene.AddNewSceneObject(so, true); 57 scene.AddNewSceneObject(so, true);
58 58
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
index 9fea3c6..6d255aa 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
50 [SetUp] 50 [SetUp]
51 public void SetUp() 51 public void SetUp()
52 { 52 {
53 m_scene = SceneHelpers.SetupScene(); 53 m_scene = new SceneHelpers().SetupScene();
54 } 54 }
55 55
56 [Test] 56 [Test]
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
index 360566d..742c769 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
52 [SetUp] 52 [SetUp]
53 public void Init() 53 public void Init()
54 { 54 {
55 m_scene = SceneHelpers.SetupScene(); 55 m_scene = new SceneHelpers().SetupScene();
56 m_so1 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so1", 0x10); 56 m_so1 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so1", 0x10);
57 m_so2 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so2", 0x20); 57 m_so2 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so2", 0x20);
58 } 58 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
index c13d82e..c7eaff9 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
58 58
59 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); 59 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
60 60
61 TestScene scene = SceneHelpers.SetupScene(); 61 TestScene scene = new SceneHelpers().SetupScene();
62 IConfigSource configSource = new IniConfigSource(); 62 IConfigSource configSource = new IniConfigSource();
63 63
64 IConfig startupConfig = configSource.AddConfig("Startup"); 64 IConfig startupConfig = configSource.AddConfig("Startup");
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
index ed9b179..2e46377 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
@@ -67,10 +67,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests
67 public void Init() 67 public void Init()
68 { 68 {
69 TestHelpers.InMethod(); 69 TestHelpers.InMethod();
70 70
71 scene = SceneHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000); 71 SceneHelpers sh = new SceneHelpers();
72 scene2 = SceneHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000); 72
73 scene3 = SceneHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000); 73 scene = sh.SetupScene("Neighbour x", UUID.Random(), 1000, 1000);
74 scene2 = sh.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000);
75 scene3 = sh.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000);
74 76
75 ISharedRegionModule interregionComms = new LocalSimulationConnectorModule(); 77 ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
76 interregionComms.Initialise(new IniConfigSource()); 78 interregionComms.Initialise(new IniConfigSource());
@@ -101,7 +103,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
101 TestHelpers.InMethod(); 103 TestHelpers.InMethod();
102// log4net.Config.XmlConfigurator.Configure(); 104// log4net.Config.XmlConfigurator.Configure();
103 105
104 TestScene scene = SceneHelpers.SetupScene(); 106 TestScene scene = new SceneHelpers().SetupScene();
105 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); 107 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
106 108
107 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null); 109 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null);
@@ -126,7 +128,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
126 IConfig config = configSource.AddConfig("Modules"); 128 IConfig config = configSource.AddConfig("Modules");
127 config.Set("SimulationServices", "LocalSimulationConnectorModule"); 129 config.Set("SimulationServices", "LocalSimulationConnectorModule");
128 130
129 TestScene scene = SceneHelpers.SetupScene(); 131 TestScene scene = new SceneHelpers().SetupScene();
130 SceneHelpers.SetupSceneModules(scene, configSource, lsc); 132 SceneHelpers.SetupSceneModules(scene, configSource, lsc);
131 133
132 UUID agentId = TestHelpers.ParseTail(0x01); 134 UUID agentId = TestHelpers.ParseTail(0x01);
@@ -176,8 +178,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
176 178
177// UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); 179// UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
178 180
179 TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); 181 TestScene myScene1 = new SceneHelpers().SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
180 TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); 182 TestScene myScene2 = new SceneHelpers().SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
181 183
182 IConfigSource configSource = new IniConfigSource(); 184 IConfigSource configSource = new IniConfigSource();
183 IConfig config = configSource.AddConfig("Startup"); 185 IConfig config = configSource.AddConfig("Startup");
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs
index 89f8007..646e5fa 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
59 TestHelpers.InMethod(); 59 TestHelpers.InMethod();
60// log4net.Config.XmlConfigurator.Configure(); 60// log4net.Config.XmlConfigurator.Configure();
61 61
62 TestScene scene = SceneHelpers.SetupScene(); 62 TestScene scene = new SceneHelpers().SetupScene();
63 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); 63 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
64 sp.Flying = true; 64 sp.Flying = true;
65 sp.PhysicsCollisionUpdate(new CollisionEventUpdate()); 65 sp.PhysicsCollisionUpdate(new CollisionEventUpdate());
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
index cfea10d..1d1ff88 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
64 [SetUp] 64 [SetUp]
65 public void Init() 65 public void Init()
66 { 66 {
67 m_scene = SceneHelpers.SetupScene(); 67 m_scene = new SceneHelpers().SetupScene();
68 } 68 }
69 69
70 [Test] 70 [Test]
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
index b7b8db4..313e350 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
50 [SetUp] 50 [SetUp]
51 public void Init() 51 public void Init()
52 { 52 {
53 m_scene = SceneHelpers.SetupScene(); 53 m_scene = new SceneHelpers().SetupScene();
54 m_sp = SceneHelpers.AddScenePresence(m_scene, TestHelpers.ParseTail(0x1)); 54 m_sp = SceneHelpers.AddScenePresence(m_scene, TestHelpers.ParseTail(0x1));
55 } 55 }
56 56
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
index eb7bfbd..19542ff 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
61 // Not strictly necessary since FriendsModule assumes it is the default (!) 61 // Not strictly necessary since FriendsModule assumes it is the default (!)
62 config.Configs["Modules"].Set("EntityTransferModule", etm.Name); 62 config.Configs["Modules"].Set("EntityTransferModule", etm.Name);
63 63
64 TestScene scene = SceneHelpers.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000); 64 TestScene scene = new SceneHelpers().SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
65 SceneHelpers.SetupSceneModules(scene, config, etm); 65 SceneHelpers.SetupSceneModules(scene, config, etm);
66 66
67 Vector3 teleportPosition = new Vector3(10, 11, 12); 67 Vector3 teleportPosition = new Vector3(10, 11, 12);
@@ -83,145 +83,58 @@ namespace OpenSim.Region.Framework.Scenes.Tests
83// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt)); 83// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
84 } 84 }
85 85
86 /// <summary> 86 [Test]
87 /// Test a teleport between two regions that are not neighbours and do not share any neighbours in common. 87 public void TestSameSimulatorSeparatedRegionsTeleport()
88 /// </summary>
89 /// Does not yet do what is says on the tin.
90 /// Commenting for now
91 //[Test, LongRunning]
92 public void TestSimpleNotNeighboursTeleport()
93 { 88 {
94 TestHelpers.InMethod(); 89 TestHelpers.InMethod();
95 ThreadRunResults results = new ThreadRunResults(); 90// log4net.Config.XmlConfigurator.Configure();
96 results.Result = false;
97 results.Message = "Test did not run";
98 TestRunning testClass = new TestRunning(results);
99 91
100 Thread testThread = new Thread(testClass.run); 92 UUID userId = TestHelpers.ParseTail(0x1);
101 93
102 // Seems kind of redundant to start a thread and then join it, however.. We need to protect against 94 EntityTransferModule etm = new EntityTransferModule();
103 // A thread abort exception in the simulator code. 95 LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
104 testThread.Start();
105 testThread.Join();
106 96
107 Assert.That(testClass.results.Result, Is.EqualTo(true), testClass.results.Message); 97 IConfigSource config = new IniConfigSource();
108 // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); 98 config.AddConfig("Modules");
109 } 99 // Not strictly necessary since FriendsModule assumes it is the default (!)
100 config.Configs["Modules"].Set("EntityTransferModule", etm.Name);
101 config.Configs["Modules"].Set("SimulationServices", lscm.Name);
110 102
111 [TearDown] 103 SceneHelpers sh = new SceneHelpers();
112 public void TearDown() 104 TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
113 { 105 TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1002, 1000);
114 try
115 {
116 if (MainServer.Instance != null) MainServer.Instance.Stop();
117 }
118 catch (NullReferenceException)
119 { }
120 }
121 106
122 } 107 SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, etm, lscm);
123 108
124 public class ThreadRunResults 109 Vector3 teleportPosition = new Vector3(10, 11, 12);
125 { 110 Vector3 teleportLookAt = new Vector3(20, 21, 22);
126 public bool Result = false;
127 public string Message = string.Empty;
128 }
129 111
130 public class TestRunning 112 ScenePresence sp = SceneHelpers.AddScenePresence(sceneA, userId);
131 { 113 sp.AbsolutePosition = new Vector3(30, 31, 32);
132 public ThreadRunResults results; 114
133 public TestRunning(ThreadRunResults t) 115 // XXX: A very nasty hack to tell the client about the destination scene without having to crank the whole
134 { 116 // UDP stack (?)
135 results = t; 117 ((TestClient)sp.ControllingClient).TeleportTargetScene = sceneB;
136 } 118
137 public void run(object o) 119 sceneA.RequestTeleportLocation(
138 { 120 sp.ControllingClient,
139 121 sceneB.RegionInfo.RegionHandle,
140 //results.Result = true; 122 teleportPosition,
141 log4net.Config.XmlConfigurator.Configure(); 123 teleportLookAt,
142 124 (uint)TeleportFlags.ViaLocation);
143 UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100"); 125
144 UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200"); 126 Assert.That(sceneA.GetScenePresence(userId), Is.Null);
145 127
146 // shared module 128 ScenePresence sceneBSp = sceneB.GetScenePresence(userId);
147 ISharedRegionModule interregionComms = new LocalSimulationConnectorModule(); 129 Assert.That(sceneBSp, Is.Not.Null);
148 130 Assert.That(sceneBSp.Scene.RegionInfo.RegionName, Is.EqualTo(sceneB.RegionInfo.RegionName));
149 131 Assert.That(sceneBSp.AbsolutePosition, Is.EqualTo(teleportPosition));
150 Scene sceneB = SceneHelpers.SetupScene("sceneB", sceneBId, 1010, 1010); 132
151 SceneHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); 133 // TODO: Add assertions to check correct circuit details in both scenes.
152 sceneB.RegisterRegionWithGrid(); 134
153 135 // Lookat is sent to the client only - sp.Lookat does not yield the same thing (calculation from camera
154 Scene sceneA = SceneHelpers.SetupScene("sceneA", sceneAId, 1000, 1000); 136 // position instead).
155 SceneHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms); 137// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
156 sceneA.RegisterRegionWithGrid();
157
158 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
159 TestClient client = (TestClient)SceneHelpers.AddScenePresence(sceneA, agentId).ControllingClient;
160
161 ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>();
162
163 results.Result = (sceneACapsModule.GetCapsPath(agentId) == client.CapsSeedUrl);
164
165 if (!results.Result)
166 {
167 results.Message = "Incorrect caps object path set up in sceneA";
168 return;
169 }
170
171 /*
172 Assert.That(
173 sceneACapsModule.GetCapsPath(agentId),
174 Is.EqualTo(client.CapsSeedUrl),
175 "Incorrect caps object path set up in sceneA");
176 */
177 // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used.
178
179
180 client.TeleportTargetScene = sceneB;
181 client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40));
182
183 results.Result = (sceneB.GetScenePresence(agentId) != null);
184 if (!results.Result)
185 {
186 results.Message = "Client does not have an agent in sceneB";
187 return;
188 }
189
190 //Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB");
191
192 //Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA");
193
194 results.Result = (sceneA.GetScenePresence(agentId) == null);
195 if (!results.Result)
196 {
197 results.Message = "Client still had an agent in sceneA";
198 return;
199 }
200
201 ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface<ICapabilitiesModule>();
202
203
204 results.Result = ("http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort +
205 "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/" == client.CapsSeedUrl);
206 if (!results.Result)
207 {
208 results.Message = "Incorrect caps object path set up in sceneB";
209 return;
210 }
211
212 // Temporary assertion - caps url construction should at least be doable through a method.
213 /*
214 Assert.That(
215 "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/",
216 Is.EqualTo(client.CapsSeedUrl),
217 "Incorrect caps object path set up in sceneB");
218 */
219 // This assertion will currently fail since we don't remove the caps paths when no longer needed
220 //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path");
221
222 // TODO: Check that more of everything is as it should be
223
224 // TODO: test what happens if we try to teleport to a region that doesn't exist
225 } 138 }
226 } 139 }
227} 140} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
index 5c9a77d..d722a09 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
60 { 60 {
61 TestHelpers.InMethod(); 61 TestHelpers.InMethod();
62 62
63 Scene scene = SceneHelpers.SetupScene(); 63 Scene scene = new SceneHelpers().SetupScene();
64 scene.Update(1); 64 scene.Update(1);
65 65
66 Assert.That(scene.Frame, Is.EqualTo(1)); 66 Assert.That(scene.Frame, Is.EqualTo(1));
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 55c80f5..d15141b 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Tests
58 TestHelpers.InMethod(); 58 TestHelpers.InMethod();
59// log4net.Config.XmlConfigurator.Configure(); 59// log4net.Config.XmlConfigurator.Configure();
60 60
61 Scene scene = SceneHelpers.SetupScene(); 61 Scene scene = new SceneHelpers().SetupScene();
62 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); 62 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
63 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); 63 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
64 SceneObjectPart sop1 = sog1.RootPart; 64 SceneObjectPart sop1 = sog1.RootPart;
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Framework.Tests
81 TestHelpers.InMethod(); 81 TestHelpers.InMethod();
82// log4net.Config.XmlConfigurator.Configure(); 82// log4net.Config.XmlConfigurator.Configure();
83 83
84 Scene scene = SceneHelpers.SetupScene(); 84 Scene scene = new SceneHelpers().SetupScene();
85 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); 85 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
86 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); 86 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
87 SceneObjectPart sop1 = sog1.RootPart; 87 SceneObjectPart sop1 = sog1.RootPart;
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Framework.Tests
124 TestHelpers.InMethod(); 124 TestHelpers.InMethod();
125// log4net.Config.XmlConfigurator.Configure(); 125// log4net.Config.XmlConfigurator.Configure();
126 126
127 Scene scene = SceneHelpers.SetupScene(); 127 Scene scene = new SceneHelpers().SetupScene();
128 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); 128 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
129 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); 129 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
130 SceneObjectPart sop1 = sog1.RootPart; 130 SceneObjectPart sop1 = sog1.RootPart;
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Tests
153 TestHelpers.InMethod(); 153 TestHelpers.InMethod();
154// log4net.Config.XmlConfigurator.Configure(); 154// log4net.Config.XmlConfigurator.Configure();
155 155
156 Scene scene = SceneHelpers.SetupScene(); 156 Scene scene = new SceneHelpers().SetupScene();
157 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); 157 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
158 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID); 158 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
159 SceneObjectPart sop1 = sog1.RootPart; 159 SceneObjectPart sop1 = sog1.RootPart;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
index 55fc1e7..44d2d45 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Tests
58 TestHelpers.InMethod(); 58 TestHelpers.InMethod();
59// log4net.Config.XmlConfigurator.Configure(); 59// log4net.Config.XmlConfigurator.Configure();
60 60
61 Scene scene = SceneHelpers.SetupScene(); 61 Scene scene = new SceneHelpers().SetupScene();
62 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001)); 62 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001));
63 UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002)); 63 UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002));
64 InventoryItemBase item1 = UserInventoryHelpers.CreateInventoryItem(scene, "item1", user1.PrincipalID); 64 InventoryItemBase item1 = UserInventoryHelpers.CreateInventoryItem(scene, "item1", user1.PrincipalID);
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Framework.Tests
85 TestHelpers.InMethod(); 85 TestHelpers.InMethod();
86// log4net.Config.XmlConfigurator.Configure(); 86// log4net.Config.XmlConfigurator.Configure();
87 87
88 Scene scene = SceneHelpers.SetupScene(); 88 Scene scene = new SceneHelpers().SetupScene();
89 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001)); 89 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001));
90 UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002)); 90 UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002));
91 InventoryFolderBase folder1 91 InventoryFolderBase folder1
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
index d9fe87c..198e487 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
47 public void Init() 47 public void Init()
48 { 48 {
49 // FIXME: We don't need a full scene here - it would be enough to set up the asset service. 49 // FIXME: We don't need a full scene here - it would be enough to set up the asset service.
50 Scene scene = SceneHelpers.SetupScene(); 50 Scene scene = new SceneHelpers().SetupScene();
51 m_assetService = scene.AssetService; 51 m_assetService = scene.AssetService;
52 m_uuidGatherer = new UuidGatherer(m_assetService); 52 m_uuidGatherer = new UuidGatherer(m_assetService);
53 } 53 }
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
index d2f6327..ac638f1 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
50 TestHelpers.InMethod(); 50 TestHelpers.InMethod();
51// log4net.Config.XmlConfigurator.Configure(); 51// log4net.Config.XmlConfigurator.Configure();
52 52
53 TestScene scene = SceneHelpers.SetupScene(); 53 TestScene scene = new SceneHelpers().SetupScene();
54 IConfigSource configSource = new IniConfigSource(); 54 IConfigSource configSource = new IniConfigSource();
55 IConfig config = configSource.AddConfig("Groups"); 55 IConfig config = configSource.AddConfig("Groups");
56 config.Set("Enabled", true); 56 config.Set("Enabled", true);
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
index eda2aef..4949097 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
@@ -163,28 +163,37 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
163 return; 163 return;
164 } 164 }
165 165
166 m_comms.RegisterScriptInvocation(this,"JsonCreateStore"); 166 try
167 m_comms.RegisterScriptInvocation(this,"JsonDestroyStore"); 167 {
168 m_comms.RegisterScriptInvocation(this,"JsonCreateStore");
169 m_comms.RegisterScriptInvocation(this,"JsonDestroyStore");
168 170
169 m_comms.RegisterScriptInvocation(this,"JsonReadNotecard"); 171 m_comms.RegisterScriptInvocation(this,"JsonReadNotecard");
170 m_comms.RegisterScriptInvocation(this,"JsonWriteNotecard"); 172 m_comms.RegisterScriptInvocation(this,"JsonWriteNotecard");
171 173
172 m_comms.RegisterScriptInvocation(this,"JsonTestPath"); 174 m_comms.RegisterScriptInvocation(this,"JsonTestPath");
173 m_comms.RegisterScriptInvocation(this,"JsonTestPathJson"); 175 m_comms.RegisterScriptInvocation(this,"JsonTestPathJson");
174 176
175 m_comms.RegisterScriptInvocation(this,"JsonGetValue"); 177 m_comms.RegisterScriptInvocation(this,"JsonGetValue");
176 m_comms.RegisterScriptInvocation(this,"JsonGetValueJson"); 178 m_comms.RegisterScriptInvocation(this,"JsonGetValueJson");
177 179
178 m_comms.RegisterScriptInvocation(this,"JsonTakeValue"); 180 m_comms.RegisterScriptInvocation(this,"JsonTakeValue");
179 m_comms.RegisterScriptInvocation(this,"JsonTakeValueJson"); 181 m_comms.RegisterScriptInvocation(this,"JsonTakeValueJson");
180 182
181 m_comms.RegisterScriptInvocation(this,"JsonReadValue"); 183 m_comms.RegisterScriptInvocation(this,"JsonReadValue");
182 m_comms.RegisterScriptInvocation(this,"JsonReadValueJson"); 184 m_comms.RegisterScriptInvocation(this,"JsonReadValueJson");
183 185
184 m_comms.RegisterScriptInvocation(this,"JsonSetValue"); 186 m_comms.RegisterScriptInvocation(this,"JsonSetValue");
185 m_comms.RegisterScriptInvocation(this,"JsonSetValueJson"); 187 m_comms.RegisterScriptInvocation(this,"JsonSetValueJson");
186 188
187 m_comms.RegisterScriptInvocation(this,"JsonRemoveValue"); 189 m_comms.RegisterScriptInvocation(this,"JsonRemoveValue");
190 }
191 catch (Exception e)
192 {
193 // See http://opensimulator.org/mantis/view.php?id=5971 for more information
194 m_log.WarnFormat("[JsonStroreScripts] script method registration failed; {0}",e.Message);
195 m_enabled = false;
196 }
188 } 197 }
189 } 198 }
190 199
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 5ea5af7..e57e5e6 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -76,22 +76,27 @@ namespace OpenSim.Region.OptionalModules.World.NPC
76 76
77 public void Say(string message) 77 public void Say(string message)
78 { 78 {
79 SendOnChatFromClient(message, ChatTypeEnum.Say); 79 SendOnChatFromClient(0, message, ChatTypeEnum.Say);
80 } 80 }
81 81
82 public void Shout(string message) 82 public void Say(int channel, string message)
83 { 83 {
84 SendOnChatFromClient(message, ChatTypeEnum.Shout); 84 SendOnChatFromClient(channel, message, ChatTypeEnum.Say);
85 } 85 }
86 86
87 public void Whisper(string message) 87 public void Shout(int channel, string message)
88 { 88 {
89 SendOnChatFromClient(message, ChatTypeEnum.Whisper); 89 SendOnChatFromClient(channel, message, ChatTypeEnum.Shout);
90 }
91
92 public void Whisper(int channel, string message)
93 {
94 SendOnChatFromClient(channel, message, ChatTypeEnum.Whisper);
90 } 95 }
91 96
92 public void Broadcast(string message) 97 public void Broadcast(string message)
93 { 98 {
94 SendOnChatFromClient(message, ChatTypeEnum.Broadcast); 99 SendOnChatFromClient(0, message, ChatTypeEnum.Broadcast);
95 } 100 }
96 101
97 public void GiveMoney(UUID target, int amount) 102 public void GiveMoney(UUID target, int amount)
@@ -146,10 +151,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
146 151
147 #region Internal Functions 152 #region Internal Functions
148 153
149 private void SendOnChatFromClient(string message, ChatTypeEnum chatType) 154 private void SendOnChatFromClient(int channel, string message, ChatTypeEnum chatType)
150 { 155 {
151 OSChatMessage chatFromClient = new OSChatMessage(); 156 OSChatMessage chatFromClient = new OSChatMessage();
152 chatFromClient.Channel = 0; 157 chatFromClient.Channel = channel;
153 chatFromClient.From = Name; 158 chatFromClient.From = Name;
154 chatFromClient.Message = message; 159 chatFromClient.Message = message;
155 chatFromClient.Position = StartPos; 160 chatFromClient.Position = StartPos;
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 435a683..3ac1eb1 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -212,6 +212,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
212 212
213 public bool Say(UUID agentID, Scene scene, string text) 213 public bool Say(UUID agentID, Scene scene, string text)
214 { 214 {
215 return Say(agentID, scene, text, 0);
216 }
217
218 public bool Say(UUID agentID, Scene scene, string text, int channel)
219 {
215 lock (m_avatars) 220 lock (m_avatars)
216 { 221 {
217 if (m_avatars.ContainsKey(agentID)) 222 if (m_avatars.ContainsKey(agentID))
@@ -219,7 +224,25 @@ namespace OpenSim.Region.OptionalModules.World.NPC
219 ScenePresence sp; 224 ScenePresence sp;
220 scene.TryGetScenePresence(agentID, out sp); 225 scene.TryGetScenePresence(agentID, out sp);
221 226
222 m_avatars[agentID].Say(text); 227 m_avatars[agentID].Say(channel, text);
228
229 return true;
230 }
231 }
232
233 return false;
234 }
235
236 public bool Shout(UUID agentID, Scene scene, string text, int channel)
237 {
238 lock (m_avatars)
239 {
240 if (m_avatars.ContainsKey(agentID))
241 {
242 ScenePresence sp;
243 scene.TryGetScenePresence(agentID, out sp);
244
245 m_avatars[agentID].Shout(channel, text);
223 246
224 return true; 247 return true;
225 } 248 }
@@ -246,6 +269,24 @@ namespace OpenSim.Region.OptionalModules.World.NPC
246 return false; 269 return false;
247 } 270 }
248 271
272 public bool Whisper(UUID agentID, Scene scene, string text, int channel)
273 {
274 lock (m_avatars)
275 {
276 if (m_avatars.ContainsKey(agentID))
277 {
278 ScenePresence sp;
279 scene.TryGetScenePresence(agentID, out sp);
280
281 m_avatars[agentID].Whisper(channel, text);
282
283 return true;
284 }
285 }
286
287 return false;
288 }
289
249 public bool Stand(UUID agentID, Scene scene) 290 public bool Stand(UUID agentID, Scene scene)
250 { 291 {
251 lock (m_avatars) 292 lock (m_avatars)
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
index eea0b2e..a39257e 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
85 m_attMod = new AttachmentsModule(); 85 m_attMod = new AttachmentsModule();
86 m_npcMod = new NPCModule(); 86 m_npcMod = new NPCModule();
87 87
88 m_scene = SceneHelpers.SetupScene(); 88 m_scene = new SceneHelpers().SetupScene();
89 SceneHelpers.SetupSceneModules(m_scene, config, m_afMod, m_umMod, m_attMod, m_npcMod, new BasicInventoryAccessModule()); 89 SceneHelpers.SetupSceneModules(m_scene, config, m_afMod, m_umMod, m_attMod, m_npcMod, new BasicInventoryAccessModule());
90 } 90 }
91 91
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index d4c872c..d641958 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -832,8 +832,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
832 832
833 public void llRegionSayTo(string target, int channel, string msg) 833 public void llRegionSayTo(string target, int channel, string msg)
834 { 834 {
835 string error = String.Empty;
836
837 if (msg.Length > 1023) 835 if (msg.Length > 1023)
838 msg = msg.Substring(0, 1023); 836 msg = msg.Substring(0, 1023);
839 837
@@ -3548,7 +3546,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3548 public void llCreateLink(string target, int parent) 3546 public void llCreateLink(string target, int parent)
3549 { 3547 {
3550 m_host.AddScriptLPS(1); 3548 m_host.AddScriptLPS(1);
3551
3552 UUID targetID; 3549 UUID targetID;
3553 3550
3554 if (!UUID.TryParse(target, out targetID)) 3551 if (!UUID.TryParse(target, out targetID))
@@ -3572,11 +3569,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3572 3569
3573 if (targetPart.ParentGroup.AttachmentPoint != 0) 3570 if (targetPart.ParentGroup.AttachmentPoint != 0)
3574 return; // Fail silently if attached 3571 return; // Fail silently if attached
3572
3573 if (targetPart.ParentGroup.RootPart.OwnerID != m_host.ParentGroup.RootPart.OwnerID)
3574 return;
3575
3575 SceneObjectGroup parentPrim = null, childPrim = null; 3576 SceneObjectGroup parentPrim = null, childPrim = null;
3576 3577
3577 if (targetPart != null) 3578 if (targetPart != null)
3578 { 3579 {
3579 if (parent != 0) { 3580 if (parent != 0)
3581 {
3580 parentPrim = m_host.ParentGroup; 3582 parentPrim = m_host.ParentGroup;
3581 childPrim = targetPart.ParentGroup; 3583 childPrim = targetPart.ParentGroup;
3582 } 3584 }
@@ -3588,7 +3590,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3588 3590
3589 // Required for linking 3591 // Required for linking
3590 childPrim.RootPart.ClearUpdateSchedule(); 3592 childPrim.RootPart.ClearUpdateSchedule();
3591 parentPrim.LinkToGroup(childPrim); 3593 parentPrim.LinkToGroup(childPrim, true);
3592 } 3594 }
3593 3595
3594 parentPrim.TriggerScriptChangedEvent(Changed.LINK); 3596 parentPrim.TriggerScriptChangedEvent(Changed.LINK);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 7fc7337..0d4ea19 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -351,7 +351,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
351 351
352 UUID ownerID = ti.OwnerID; 352 UUID ownerID = ti.OwnerID;
353 353
354 //OSSL only may be used if objet is in the same group as the parcel 354 //OSSL only may be used if object is in the same group as the parcel
355 if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER")) 355 if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER"))
356 { 356 {
357 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); 357 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
@@ -729,11 +729,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
729 729
730 m_host.AddScriptLPS(1); 730 m_host.AddScriptLPS(1);
731 731
732 // For safety, we add another permission check here, and don't rely only on the standard OSSL permissions
732 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) 733 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
733 { 734 {
734 MainConsole.Instance.RunCommand(command); 735 MainConsole.Instance.RunCommand(command);
735 return true; 736 return true;
736 } 737 }
738
737 return false; 739 return false;
738 } 740 }
739 741
@@ -2539,6 +2541,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2539 2541
2540 public void osNpcSay(LSL_Key npc, string message) 2542 public void osNpcSay(LSL_Key npc, string message)
2541 { 2543 {
2544 osNpcSay(npc, 0, message);
2545 }
2546
2547 public void osNpcSay(LSL_Key npc, int channel, string message)
2548 {
2542 CheckThreatLevel(ThreatLevel.High, "osNpcSay"); 2549 CheckThreatLevel(ThreatLevel.High, "osNpcSay");
2543 m_host.AddScriptLPS(1); 2550 m_host.AddScriptLPS(1);
2544 2551
@@ -2550,7 +2557,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2550 if (!module.CheckPermissions(npcId, m_host.OwnerID)) 2557 if (!module.CheckPermissions(npcId, m_host.OwnerID))
2551 return; 2558 return;
2552 2559
2553 module.Say(npcId, World, message); 2560 module.Say(npcId, World, message, channel);
2561 }
2562 }
2563
2564 public void osNpcShout(LSL_Key npc, int channel, string message)
2565 {
2566 CheckThreatLevel(ThreatLevel.High, "osNpcShout");
2567 m_host.AddScriptLPS(1);
2568
2569 INPCModule module = World.RequestModuleInterface<INPCModule>();
2570 if (module != null)
2571 {
2572 UUID npcId = new UUID(npc.m_string);
2573
2574 if (!module.CheckPermissions(npcId, m_host.OwnerID))
2575 return;
2576
2577 module.Shout(npcId, World, message, channel);
2554 } 2578 }
2555 } 2579 }
2556 2580
@@ -2635,6 +2659,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2635 } 2659 }
2636 } 2660 }
2637 2661
2662 public void osNpcWhisper(LSL_Key npc, int channel, string message)
2663 {
2664 CheckThreatLevel(ThreatLevel.High, "osNpcWhisper");
2665 m_host.AddScriptLPS(1);
2666
2667 INPCModule module = World.RequestModuleInterface<INPCModule>();
2668 if (module != null)
2669 {
2670 UUID npcId = new UUID(npc.m_string);
2671
2672 if (!module.CheckPermissions(npcId, m_host.OwnerID))
2673 return;
2674
2675 module.Whisper(npcId, World, message, channel);
2676 }
2677 }
2678
2638 /// <summary> 2679 /// <summary>
2639 /// Save the current appearance of the script owner permanently to the named notecard. 2680 /// Save the current appearance of the script owner permanently to the named notecard.
2640 /// </summary> 2681 /// </summary>
@@ -2786,21 +2827,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2786 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); 2827 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
2787 m_host.AddScriptLPS(1); 2828 m_host.AddScriptLPS(1);
2788 2829
2789 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) 2830 World.ForEachRootScenePresence(delegate(ScenePresence sp)
2790 { 2831 {
2791 World.ForEachRootScenePresence(delegate(ScenePresence sp) 2832 if (sp.Firstname == FirstName && sp.Lastname == SurName)
2792 { 2833 {
2793 if (sp.Firstname == FirstName && sp.Lastname == SurName) 2834 // kick client...
2794 { 2835 if (alert != null)
2795 // kick client... 2836 sp.ControllingClient.Kick(alert);
2796 if (alert != null)
2797 sp.ControllingClient.Kick(alert);
2798 2837
2799 // ...and close on our side 2838 // ...and close on our side
2800 sp.Scene.IncomingCloseAgent(sp.UUID); 2839 sp.Scene.IncomingCloseAgent(sp.UUID);
2801 } 2840 }
2802 }); 2841 });
2803 }
2804 } 2842 }
2805 2843
2806 public void osCauseDamage(string avatar, double damage) 2844 public void osCauseDamage(string avatar, double damage)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index d0c852b..e92518d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -217,11 +217,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
217 void osNpcSetRot(LSL_Key npc, rotation rot); 217 void osNpcSetRot(LSL_Key npc, rotation rot);
218 void osNpcStopMoveToTarget(LSL_Key npc); 218 void osNpcStopMoveToTarget(LSL_Key npc);
219 void osNpcSay(key npc, string message); 219 void osNpcSay(key npc, string message);
220 void osNpcSay(key npc, int channel, string message);
221 void osNpcShout(key npc, int channel, string message);
220 void osNpcSit(key npc, key target, int options); 222 void osNpcSit(key npc, key target, int options);
221 void osNpcStand(LSL_Key npc); 223 void osNpcStand(LSL_Key npc);
222 void osNpcRemove(key npc); 224 void osNpcRemove(key npc);
223 void osNpcPlayAnimation(LSL_Key npc, string animation); 225 void osNpcPlayAnimation(LSL_Key npc, string animation);
224 void osNpcStopAnimation(LSL_Key npc, string animation); 226 void osNpcStopAnimation(LSL_Key npc, string animation);
227 void osNpcWhisper(key npc, int channel, string message);
225 228
226 LSL_Key osOwnerSaveAppearance(string notecard); 229 LSL_Key osOwnerSaveAppearance(string notecard);
227 LSL_Key osAgentSaveAppearance(key agentId, string notecard); 230 LSL_Key osAgentSaveAppearance(key agentId, string notecard);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 36ac0e3..d230662 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -580,6 +580,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
580 m_OSSL_Functions.osNpcSay(npc, message); 580 m_OSSL_Functions.osNpcSay(npc, message);
581 } 581 }
582 582
583 public void osNpcSay(key npc, int channel, string message)
584 {
585 m_OSSL_Functions.osNpcSay(npc, channel, message);
586 }
587
588
589 public void osNpcShout(key npc, int channel, string message)
590 {
591 m_OSSL_Functions.osNpcShout(npc, channel, message);
592 }
593
583 public void osNpcSit(LSL_Key npc, LSL_Key target, int options) 594 public void osNpcSit(LSL_Key npc, LSL_Key target, int options)
584 { 595 {
585 m_OSSL_Functions.osNpcSit(npc, target, options); 596 m_OSSL_Functions.osNpcSit(npc, target, options);
@@ -605,6 +616,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
605 m_OSSL_Functions.osNpcStopAnimation(npc, animation); 616 m_OSSL_Functions.osNpcStopAnimation(npc, animation);
606 } 617 }
607 618
619 public void osNpcWhisper(key npc, int channel, string message)
620 {
621 m_OSSL_Functions.osNpcWhisper(npc, channel, message);
622 }
623
608 public LSL_Key osOwnerSaveAppearance(string notecard) 624 public LSL_Key osOwnerSaveAppearance(string notecard)
609 { 625 {
610 return m_OSSL_Functions.osOwnerSaveAppearance(notecard); 626 return m_OSSL_Functions.osOwnerSaveAppearance(notecard);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
index e2d0db2..49266e9 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
63 IConfig config = initConfigSource.AddConfig("XEngine"); 63 IConfig config = initConfigSource.AddConfig("XEngine");
64 config.Set("Enabled", "true"); 64 config.Set("Enabled", "true");
65 65
66 m_scene = SceneHelpers.SetupScene(); 66 m_scene = new SceneHelpers().SetupScene();
67 SceneHelpers.SetupSceneModules(m_scene, initConfigSource); 67 SceneHelpers.SetupSceneModules(m_scene, initConfigSource);
68 68
69 m_engine = new XEngine.XEngine(); 69 m_engine = new XEngine.XEngine();
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
index 9cf9258..92a63bf 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
58 IConfig config = initConfigSource.AddConfig("XEngine"); 58 IConfig config = initConfigSource.AddConfig("XEngine");
59 config.Set("Enabled", "true"); 59 config.Set("Enabled", "true");
60 60
61 Scene scene = SceneHelpers.SetupScene(); 61 Scene scene = new SceneHelpers().SetupScene();
62 SceneObjectPart part = SceneHelpers.AddSceneObject(scene); 62 SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
63 63
64 XEngine.XEngine engine = new XEngine.XEngine(); 64 XEngine.XEngine engine = new XEngine.XEngine();
@@ -261,7 +261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
261 TestHelpers.InMethod(); 261 TestHelpers.InMethod();
262 262
263 // Create Prim1. 263 // Create Prim1.
264 Scene scene = SceneHelpers.SetupScene(); 264 Scene scene = new SceneHelpers().SetupScene();
265 string obj1Name = "Prim1"; 265 string obj1Name = "Prim1";
266 UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001"); 266 UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
267 SceneObjectPart part1 = 267 SceneObjectPart part1 =
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
index 7573dff..c51227b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
67 config = initConfigSource.AddConfig("NPC"); 67 config = initConfigSource.AddConfig("NPC");
68 config.Set("Enabled", "true"); 68 config.Set("Enabled", "true");
69 69
70 m_scene = SceneHelpers.SetupScene(); 70 m_scene = new SceneHelpers().SetupScene();
71 SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule()); 71 SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule());
72 72
73 m_engine = new XEngine.XEngine(); 73 m_engine = new XEngine.XEngine();
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
index 9d9fc51..9c36108 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
68 config = initConfigSource.AddConfig("NPC"); 68 config = initConfigSource.AddConfig("NPC");
69 config.Set("Enabled", "true"); 69 config.Set("Enabled", "true");
70 70
71 m_scene = SceneHelpers.SetupScene(); 71 m_scene = new SceneHelpers().SetupScene();
72 SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule()); 72 SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule());
73 73
74 m_engine = new XEngine.XEngine(); 74 m_engine = new XEngine.XEngine();
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
index 7d7bd82..a3f848c 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests
73 // to AssemblyResolver.OnAssemblyResolve fails. 73 // to AssemblyResolver.OnAssemblyResolve fails.
74 xEngineConfig.Set("AppDomainLoading", "false"); 74 xEngineConfig.Set("AppDomainLoading", "false");
75 75
76 m_scene = SceneHelpers.SetupScene("My Test", UUID.Random(), 1000, 1000, null, configSource); 76 m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource);
77 SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule); 77 SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule);
78 m_scene.StartScripts(); 78 m_scene.StartScripts();
79 } 79 }
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
index 7a6b1cf..8e54707 100644
--- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
@@ -58,57 +58,67 @@ namespace OpenSim.Tests.Common
58 /// </summary> 58 /// </summary>
59 public class SceneHelpers 59 public class SceneHelpers
60 { 60 {
61 public static TestScene SetupScene() 61 private AgentCircuitManager m_acm = new AgentCircuitManager();
62 private ISimulationDataService m_simDataService
63 = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null);
64 private IEstateDataService m_estateDataService;
65
66 private LocalAssetServicesConnector m_assetService;
67 private LocalAuthenticationServicesConnector m_authenticationService;
68 private LocalInventoryServicesConnector m_inventoryService;
69 private LocalGridServicesConnector m_gridService;
70 private LocalUserAccountServicesConnector m_userAccountService;
71 private LocalPresenceServicesConnector m_presenceService;
72
73 private CoreAssetCache m_cache;
74
75 public SceneHelpers() : this(null) {}
76
77 public SceneHelpers(CoreAssetCache cache)
62 { 78 {
63 return SetupScene(null); 79 m_assetService = StartAssetService(cache);
80 m_authenticationService = StartAuthenticationService();
81 m_inventoryService = StartInventoryService();
82 m_gridService = StartGridService();
83 m_userAccountService = StartUserAccountService();
84 m_presenceService = StartPresenceService();
85
86 m_inventoryService.PostInitialise();
87 m_assetService.PostInitialise();
88 m_userAccountService.PostInitialise();
89 m_presenceService.PostInitialise();
90
91 m_cache = cache;
64 } 92 }
65 93
66 /// <summary> 94 /// <summary>
67 /// Set up a test scene 95 /// Set up a test scene
68 /// </summary> 96 /// </summary>
69 /// <remarks> 97 /// <remarks>
70 /// Automatically starts service threads, as would the normal runtime. 98 /// Automatically starts services, as would the normal runtime.
71 /// </remarks> 99 /// </remarks>
72 /// <returns></returns> 100 /// <returns></returns>
73 public static TestScene SetupScene(CoreAssetCache cache) 101 public TestScene SetupScene()
74 { 102 {
75 return SetupScene("Unit test region", UUID.Random(), 1000, 1000, cache); 103 return SetupScene("Unit test region", UUID.Random(), 1000, 1000);
76 } 104 }
77 105
78 public static TestScene SetupScene(string name, UUID id, uint x, uint y) 106 public TestScene SetupScene(string name, UUID id, uint x, uint y)
79 {
80 return SetupScene(name, id, x, y, null);
81 }
82
83 /// <summary>
84 /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions
85 /// or a different, to get a brand new scene with new shared region modules.
86 /// </summary>
87 /// <param name="name">Name of the region</param>
88 /// <param name="id">ID of the region</param>
89 /// <param name="x">X co-ordinate of the region</param>
90 /// <param name="y">Y co-ordinate of the region</param>
91 /// <param name="cache"></param>
92 /// <returns></returns>
93 public static TestScene SetupScene(
94 string name, UUID id, uint x, uint y, CoreAssetCache cache)
95 { 107 {
96 return SetupScene(name, id, x, y, cache, new IniConfigSource()); 108 return SetupScene(name, id, x, y, new IniConfigSource());
97 } 109 }
98 110
99 /// <summary> 111 /// <summary>
100 /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions 112 /// Set up a scene.
101 /// or a different, to get a brand new scene with new shared region modules.
102 /// </summary> 113 /// </summary>
103 /// <param name="name">Name of the region</param> 114 /// <param name="name">Name of the region</param>
104 /// <param name="id">ID of the region</param> 115 /// <param name="id">ID of the region</param>
105 /// <param name="x">X co-ordinate of the region</param> 116 /// <param name="x">X co-ordinate of the region</param>
106 /// <param name="y">Y co-ordinate of the region</param> 117 /// <param name="y">Y co-ordinate of the region</param>
107 /// <param name="cache"></param>
108 /// <param name="configSource"></param> 118 /// <param name="configSource"></param>
109 /// <returns></returns> 119 /// <returns></returns>
110 public static TestScene SetupScene( 120 public TestScene SetupScene(
111 string name, UUID id, uint x, uint y, CoreAssetCache cache, IConfigSource configSource) 121 string name, UUID id, uint x, uint y, IConfigSource configSource)
112 { 122 {
113 Console.WriteLine("Setting up test scene {0}", name); 123 Console.WriteLine("Setting up test scene {0}", name);
114 124
@@ -119,30 +129,47 @@ namespace OpenSim.Tests.Common
119 regInfo.RegionName = name; 129 regInfo.RegionName = name;
120 regInfo.RegionID = id; 130 regInfo.RegionID = id;
121 131
122 AgentCircuitManager acm = new AgentCircuitManager();
123 SceneCommunicationService scs = new SceneCommunicationService(); 132 SceneCommunicationService scs = new SceneCommunicationService();
124 133
125 ISimulationDataService simDataService = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null);
126 IEstateDataService estateDataService = null;
127
128 TestScene testScene = new TestScene( 134 TestScene testScene = new TestScene(
129 regInfo, acm, scs, simDataService, estateDataService, null, false, configSource, null); 135 regInfo, m_acm, scs, m_simDataService, m_estateDataService, null, false, configSource, null);
130 136
131 IRegionModule godsModule = new GodsModule(); 137 IRegionModule godsModule = new GodsModule();
132 godsModule.Initialise(testScene, new IniConfigSource()); 138 godsModule.Initialise(testScene, new IniConfigSource());
133 testScene.AddModule(godsModule.Name, godsModule); 139 testScene.AddModule(godsModule.Name, godsModule);
134 140
135 LocalAssetServicesConnector assetService = StartAssetService(testScene, cache); 141 // Add scene to services
136 StartAuthenticationService(testScene); 142 m_assetService.AddRegion(testScene);
137 LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene); 143
138 StartGridService(testScene); 144 if (m_cache != null)
139 LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene); 145 {
140 LocalPresenceServicesConnector presenceService = StartPresenceService(testScene); 146 m_cache.AddRegion(testScene);
141 147 m_cache.RegionLoaded(testScene);
142 inventoryService.PostInitialise(); 148 testScene.AddRegionModule(m_cache.Name, m_cache);
143 assetService.PostInitialise(); 149 }
144 userAccountService.PostInitialise(); 150
145 presenceService.PostInitialise(); 151 m_assetService.RegionLoaded(testScene);
152 testScene.AddRegionModule(m_assetService.Name, m_assetService);
153
154 m_authenticationService.AddRegion(testScene);
155 m_authenticationService.RegionLoaded(testScene);
156 testScene.AddRegionModule(m_authenticationService.Name, m_authenticationService);
157
158 m_inventoryService.AddRegion(testScene);
159 m_inventoryService.RegionLoaded(testScene);
160 testScene.AddRegionModule(m_inventoryService.Name, m_inventoryService);
161
162 m_gridService.AddRegion(testScene);
163 m_gridService.RegionLoaded(testScene);
164 testScene.AddRegionModule(m_gridService.Name, m_gridService);
165
166 m_userAccountService.AddRegion(testScene);
167 m_userAccountService.RegionLoaded(testScene);
168 testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService);
169
170 m_presenceService.AddRegion(testScene);
171 m_presenceService.RegionLoaded(testScene);
172 testScene.AddRegionModule(m_presenceService.Name, m_presenceService);
146 173
147 testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); 174 testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random();
148 testScene.SetModuleInterfaces(); 175 testScene.SetModuleInterfaces();
@@ -162,19 +189,17 @@ namespace OpenSim.Tests.Common
162 return testScene; 189 return testScene;
163 } 190 }
164 191
165 private static LocalAssetServicesConnector StartAssetService(Scene testScene, CoreAssetCache cache) 192 private static LocalAssetServicesConnector StartAssetService(CoreAssetCache cache)
166 { 193 {
167 LocalAssetServicesConnector assetService = new LocalAssetServicesConnector();
168 IConfigSource config = new IniConfigSource(); 194 IConfigSource config = new IniConfigSource();
169
170 config.AddConfig("Modules"); 195 config.AddConfig("Modules");
171 config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); 196 config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector");
172 config.AddConfig("AssetService"); 197 config.AddConfig("AssetService");
173 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); 198 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService");
174 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); 199 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
175 200
201 LocalAssetServicesConnector assetService = new LocalAssetServicesConnector();
176 assetService.Initialise(config); 202 assetService.Initialise(config);
177 assetService.AddRegion(testScene);
178 203
179 if (cache != null) 204 if (cache != null)
180 { 205 {
@@ -184,56 +209,43 @@ namespace OpenSim.Tests.Common
184 cacheConfig.AddConfig("AssetCache"); 209 cacheConfig.AddConfig("AssetCache");
185 210
186 cache.Initialise(cacheConfig); 211 cache.Initialise(cacheConfig);
187 cache.AddRegion(testScene);
188 cache.RegionLoaded(testScene);
189 testScene.AddRegionModule(cache.Name, cache);
190 } 212 }
191
192 assetService.RegionLoaded(testScene);
193 testScene.AddRegionModule(assetService.Name, assetService);
194 213
195 return assetService; 214 return assetService;
196 } 215 }
197 216
198 private static void StartAuthenticationService(Scene testScene) 217 private static LocalAuthenticationServicesConnector StartAuthenticationService()
199 { 218 {
200 ISharedRegionModule service = new LocalAuthenticationServicesConnector();
201 IConfigSource config = new IniConfigSource(); 219 IConfigSource config = new IniConfigSource();
202
203 config.AddConfig("Modules"); 220 config.AddConfig("Modules");
204 config.AddConfig("AuthenticationService"); 221 config.AddConfig("AuthenticationService");
205 config.Configs["Modules"].Set("AuthenticationServices", "LocalAuthenticationServicesConnector"); 222 config.Configs["Modules"].Set("AuthenticationServices", "LocalAuthenticationServicesConnector");
206 config.Configs["AuthenticationService"].Set( 223 config.Configs["AuthenticationService"].Set(
207 "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"); 224 "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService");
208 config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); 225 config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
209 226
227 LocalAuthenticationServicesConnector service = new LocalAuthenticationServicesConnector();
210 service.Initialise(config); 228 service.Initialise(config);
211 service.AddRegion(testScene); 229
212 service.RegionLoaded(testScene); 230 return service;
213 testScene.AddRegionModule(service.Name, service);
214 //m_authenticationService = service;
215 } 231 }
216 232
217 private static LocalInventoryServicesConnector StartInventoryService(Scene testScene) 233 private static LocalInventoryServicesConnector StartInventoryService()
218 { 234 {
219 LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector();
220
221 IConfigSource config = new IniConfigSource(); 235 IConfigSource config = new IniConfigSource();
222 config.AddConfig("Modules"); 236 config.AddConfig("Modules");
223 config.AddConfig("InventoryService"); 237 config.AddConfig("InventoryService");
224 config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); 238 config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector");
225 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService"); 239 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService");
226 config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); 240 config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
227 241
242 LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector();
228 inventoryService.Initialise(config); 243 inventoryService.Initialise(config);
229 inventoryService.AddRegion(testScene);
230 inventoryService.RegionLoaded(testScene);
231 testScene.AddRegionModule(inventoryService.Name, inventoryService);
232 244
233 return inventoryService; 245 return inventoryService;
234 } 246 }
235 247
236 private static LocalGridServicesConnector StartGridService(Scene testScene) 248 private static LocalGridServicesConnector StartGridService()
237 { 249 {
238 IConfigSource config = new IniConfigSource(); 250 IConfigSource config = new IniConfigSource();
239 config.AddConfig("Modules"); 251 config.AddConfig("Modules");
@@ -245,8 +257,6 @@ namespace OpenSim.Tests.Common
245 257
246 LocalGridServicesConnector gridService = new LocalGridServicesConnector(); 258 LocalGridServicesConnector gridService = new LocalGridServicesConnector();
247 gridService.Initialise(config); 259 gridService.Initialise(config);
248 gridService.AddRegion(testScene);
249 gridService.RegionLoaded(testScene);
250 260
251 return gridService; 261 return gridService;
252 } 262 }
@@ -256,7 +266,7 @@ namespace OpenSim.Tests.Common
256 /// </summary> 266 /// </summary>
257 /// <param name="testScene"></param> 267 /// <param name="testScene"></param>
258 /// <returns></returns> 268 /// <returns></returns>
259 private static LocalUserAccountServicesConnector StartUserAccountService(Scene testScene) 269 private static LocalUserAccountServicesConnector StartUserAccountService()
260 { 270 {
261 IConfigSource config = new IniConfigSource(); 271 IConfigSource config = new IniConfigSource();
262 config.AddConfig("Modules"); 272 config.AddConfig("Modules");
@@ -268,10 +278,6 @@ namespace OpenSim.Tests.Common
268 278
269 LocalUserAccountServicesConnector userAccountService = new LocalUserAccountServicesConnector(); 279 LocalUserAccountServicesConnector userAccountService = new LocalUserAccountServicesConnector();
270 userAccountService.Initialise(config); 280 userAccountService.Initialise(config);
271
272 userAccountService.AddRegion(testScene);
273 userAccountService.RegionLoaded(testScene);
274 testScene.AddRegionModule(userAccountService.Name, userAccountService);
275 281
276 return userAccountService; 282 return userAccountService;
277 } 283 }
@@ -280,7 +286,7 @@ namespace OpenSim.Tests.Common
280 /// Start a presence service 286 /// Start a presence service
281 /// </summary> 287 /// </summary>
282 /// <param name="testScene"></param> 288 /// <param name="testScene"></param>
283 private static LocalPresenceServicesConnector StartPresenceService(Scene testScene) 289 private static LocalPresenceServicesConnector StartPresenceService()
284 { 290 {
285 IConfigSource config = new IniConfigSource(); 291 IConfigSource config = new IniConfigSource();
286 config.AddConfig("Modules"); 292 config.AddConfig("Modules");
@@ -292,10 +298,6 @@ namespace OpenSim.Tests.Common
292 298
293 LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector(); 299 LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector();
294 presenceService.Initialise(config); 300 presenceService.Initialise(config);
295
296 presenceService.AddRegion(testScene);
297 presenceService.RegionLoaded(testScene);
298 testScene.AddRegionModule(presenceService.Name, presenceService);
299 301
300 return presenceService; 302 return presenceService;
301 } 303 }
@@ -313,19 +315,51 @@ namespace OpenSim.Tests.Common
313 /// <summary> 315 /// <summary>
314 /// Setup modules for a scene. 316 /// Setup modules for a scene.
315 /// </summary> 317 /// </summary>
316 /// <param name="scene"></param> 318 /// <remarks>
319 /// If called directly, then all the modules must be shared modules.
320 /// </remarks>
321 /// <param name="scenes"></param>
317 /// <param name="config"></param> 322 /// <param name="config"></param>
318 /// <param name="modules"></param> 323 /// <param name="modules"></param>
319 public static void SetupSceneModules(Scene scene, IConfigSource config, params object[] modules) 324 public static void SetupSceneModules(Scene scene, IConfigSource config, params object[] modules)
320 { 325 {
326 SetupSceneModules(new Scene[] { scene }, config, modules);
327 }
328
329 /// <summary>
330 /// Setup modules for a scene using their default settings.
331 /// </summary>
332 /// <param name="scenes"></param>
333 /// <param name="modules"></param>
334 public static void SetupSceneModules(Scene[] scenes, params object[] modules)
335 {
336 SetupSceneModules(scenes, new IniConfigSource(), modules);
337 }
338
339 /// <summary>
340 /// Setup modules for scenes.
341 /// </summary>
342 /// <remarks>
343 /// If called directly, then all the modules must be shared modules.
344 /// </remarks>
345 /// <param name="scenes"></param>
346 /// <param name="config"></param>
347 /// <param name="modules"></param>
348 public static void SetupSceneModules(Scene[] scenes, IConfigSource config, params object[] modules)
349 {
321 List<IRegionModuleBase> newModules = new List<IRegionModuleBase>(); 350 List<IRegionModuleBase> newModules = new List<IRegionModuleBase>();
322 foreach (object module in modules) 351 foreach (object module in modules)
323 { 352 {
324 if (module is IRegionModule) 353 if (module is IRegionModule)
325 { 354 {
326 IRegionModule m = (IRegionModule)module; 355 IRegionModule m = (IRegionModule)module;
327 m.Initialise(scene, config); 356
328 scene.AddModule(m.Name, m); 357 foreach (Scene scene in scenes)
358 {
359 m.Initialise(scene, config);
360 scene.AddModule(m.Name, m);
361 }
362
329 m.PostInitialise(); 363 m.PostInitialise();
330 } 364 }
331 else if (module is IRegionModuleBase) 365 else if (module is IRegionModuleBase)
@@ -345,15 +379,19 @@ namespace OpenSim.Tests.Common
345 379
346 foreach (IRegionModuleBase module in newModules) 380 foreach (IRegionModuleBase module in newModules)
347 { 381 {
348 module.AddRegion(scene); 382 foreach (Scene scene in scenes)
349 scene.AddRegionModule(module.Name, module); 383 {
384 module.AddRegion(scene);
385 scene.AddRegionModule(module.Name, module);
386 }
350 } 387 }
351 388
352 // RegionLoaded is fired after all modules have been appropriately added to all scenes 389 // RegionLoaded is fired after all modules have been appropriately added to all scenes
353 foreach (IRegionModuleBase module in newModules) 390 foreach (IRegionModuleBase module in newModules)
354 module.RegionLoaded(scene); 391 foreach (Scene scene in scenes)
392 module.RegionLoaded(scene);
355 393
356 scene.SetModuleInterfaces(); 394 foreach (Scene scene in scenes) { scene.SetModuleInterfaces(); }
357 } 395 }
358 396
359 /// <summary> 397 /// <summary>
diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs
index 0e4dfb9..4b4d52d 100644
--- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs
+++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs
@@ -46,6 +46,14 @@ namespace OpenSim.Tests.Common.Mock
46 { 46 {
47 m_scene = scene; 47 m_scene = scene;
48 m_parcels = new List<ILandObject>(); 48 m_parcels = new List<ILandObject>();
49 SetupDefaultParcel();
50 }
51
52 private void SetupDefaultParcel()
53 {
54 ILandObject obj = new LandObject(UUID.Zero, false, m_scene);
55 obj.LandData.Name = "Your Parcel";
56 m_parcels.Add(obj);
49 } 57 }
50 58
51 public List<ILandObject> ParcelsNearPoint(Vector3 position) 59 public List<ILandObject> ParcelsNearPoint(Vector3 position)
@@ -63,11 +71,7 @@ namespace OpenSim.Tests.Common.Mock
63 m_parcels.Clear(); 71 m_parcels.Clear();
64 72
65 if (setupDefaultParcel) 73 if (setupDefaultParcel)
66 { 74 SetupDefaultParcel();
67 ILandObject obj = new LandObject(UUID.Zero, false, m_scene);
68 obj.LandData.Name = "Your Parcel";
69 m_parcels.Add(obj);
70 }
71 } 75 }
72 76
73 protected ILandObject GetNoLand() 77 protected ILandObject GetNoLand()
@@ -102,6 +106,5 @@ namespace OpenSim.Tests.Common.Mock
102 106
103 public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} 107 public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {}
104 public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} 108 public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {}
105
106 } 109 }
107} 110} \ No newline at end of file
diff --git a/OpenSim/Tests/Torture/NPCTortureTests.cs b/OpenSim/Tests/Torture/NPCTortureTests.cs
index 0224505..731df68 100644
--- a/OpenSim/Tests/Torture/NPCTortureTests.cs
+++ b/OpenSim/Tests/Torture/NPCTortureTests.cs
@@ -98,7 +98,7 @@ namespace OpenSim.Tests.Torture
98 umm = new UserManagementModule(); 98 umm = new UserManagementModule();
99 am = new AttachmentsModule(); 99 am = new AttachmentsModule();
100 100
101 scene = SceneHelpers.SetupScene(); 101 scene = new SceneHelpers().SetupScene();
102 SceneHelpers.SetupSceneModules(scene, config, afm, umm, am, new BasicInventoryAccessModule(), new NPCModule()); 102 SceneHelpers.SetupSceneModules(scene, config, afm, umm, am, new BasicInventoryAccessModule(), new NPCModule());
103 } 103 }
104 104
diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs
index d0d2199..195d47b 100644
--- a/OpenSim/Tests/Torture/ObjectTortureTests.cs
+++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs
@@ -126,7 +126,7 @@ namespace OpenSim.Tests.Torture
126 // Using a local variable for scene, at least on mono 2.6.7, means that it's much more likely to be garbage 126 // Using a local variable for scene, at least on mono 2.6.7, means that it's much more likely to be garbage
127 // collected when we teardown this test. If it's done in a member variable, even if that is subsequently 127 // collected when we teardown this test. If it's done in a member variable, even if that is subsequently
128 // nulled out, the garbage collect can be delayed. 128 // nulled out, the garbage collect can be delayed.
129 TestScene scene = SceneHelpers.SetupScene(); 129 TestScene scene = new SceneHelpers().SetupScene();
130 130
131// Process process = Process.GetCurrentProcess(); 131// Process process = Process.GetCurrentProcess();
132// long startProcessMemory = process.PrivateMemorySize64; 132// long startProcessMemory = process.PrivateMemorySize64;
diff --git a/OpenSim/Tests/Torture/ScriptTortureTests.cs b/OpenSim/Tests/Torture/ScriptTortureTests.cs
index 2ef55b3..24f278f 100644
--- a/OpenSim/Tests/Torture/ScriptTortureTests.cs
+++ b/OpenSim/Tests/Torture/ScriptTortureTests.cs
@@ -84,7 +84,7 @@ namespace OpenSim.Tests.Torture
84 // to AssemblyResolver.OnAssemblyResolve fails. 84 // to AssemblyResolver.OnAssemblyResolve fails.
85 xEngineConfig.Set("AppDomainLoading", "false"); 85 xEngineConfig.Set("AppDomainLoading", "false");
86 86
87 m_scene = SceneHelpers.SetupScene("My Test", UUID.Random(), 1000, 1000, null, configSource); 87 m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource);
88 SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule); 88 SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule);
89 89
90 m_scene.EventManager.OnChatFromWorld += OnChatFromWorld; 90 m_scene.EventManager.OnChatFromWorld += OnChatFromWorld;