aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDiva Canto2009-08-14 14:04:15 -0700
committerDiva Canto2009-08-14 14:04:15 -0700
commitcd444c1e82dcf7929cc34e00a66bc16998c3d90c (patch)
tree24a2495ea19c5a2e258582fc3db8407dfc1c86be /OpenSim/Region
parentReturning UUID.Zero is scene and user profile service are null in GetSession.... (diff)
parent* Re-enable TestLoadIarV0_1ExistingUsers() (diff)
downloadopensim-SC_OLD-cd444c1e82dcf7929cc34e00a66bc16998c3d90c.zip
opensim-SC_OLD-cd444c1e82dcf7929cc34e00a66bc16998c3d90c.tar.gz
opensim-SC_OLD-cd444c1e82dcf7929cc34e00a66bc16998c3d90c.tar.bz2
opensim-SC_OLD-cd444c1e82dcf7929cc34e00a66bc16998c3d90c.tar.xz
Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs55
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs25
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs15
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs9
6 files changed, 55 insertions, 61 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 28b4d64..470a386 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -74,7 +74,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
74 /// <summary> 74 /// <summary>
75 /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). 75 /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet).
76 /// </summary> 76 /// </summary>
77 //[Test] 77 [Test]
78 public void TestSaveIarV0_1() 78 public void TestSaveIarV0_1()
79 { 79 {
80 TestHelper.InMethod(); 80 TestHelper.InMethod();
@@ -82,7 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
82 82
83 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 83 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
84 84
85 Scene scene = SceneSetupHelpers.SetupScene(""); 85 Scene scene = SceneSetupHelpers.SetupScene("Inventory");
86 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 86 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
87 CommunicationsManager cm = scene.CommsManager; 87 CommunicationsManager cm = scene.CommsManager;
88 88
@@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
222 /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where 222 /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where
223 /// an account exists with the creator name. 223 /// an account exists with the creator name.
224 /// </summary> 224 /// </summary>
225 //[Test] 225 [Test]
226 public void TestLoadIarV0_1ExistingUsers() 226 public void TestLoadIarV0_1ExistingUsers()
227 { 227 {
228 TestHelper.InMethod(); 228 TestHelper.InMethod();
@@ -262,7 +262,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
262 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 262 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
263 263
264 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene 264 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
265 Scene scene = SceneSetupHelpers.SetupScene(); 265 Scene scene = SceneSetupHelpers.SetupScene("inventory");
266 IUserAdminService userAdminService = scene.CommsManager.UserAdminService; 266 IUserAdminService userAdminService = scene.CommsManager.UserAdminService;
267 267
268 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 268 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
@@ -276,16 +276,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
276 276
277 CachedUserInfo userInfo 277 CachedUserInfo userInfo
278 = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); 278 = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName);
279 //userInfo.FetchInventory(); 279
280 /*
281 for (int i = 0 ; i < 50 ; i++)
282 {
283 if (userInfo.HasReceivedInventory == true)
284 break;
285 Thread.Sleep(200);
286 }
287 Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)");
288 */
289 InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); 280 InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName);
290 Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); 281 Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item");
291 Assert.That( 282 Assert.That(
@@ -395,17 +386,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
395 userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager, InventoryReceived); 386 userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager, InventoryReceived);
396 Monitor.Wait(this, 60000); 387 Monitor.Wait(this, 60000);
397 } 388 }
398
399 //userInfo.FetchInventory();
400 /*
401 for (int i = 0 ; i < 50 ; i++)
402 {
403 if (userInfo.HasReceivedInventory == true)
404 break;
405 Thread.Sleep(200);
406 }
407 Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)");
408 */
409 389
410 Console.WriteLine("userInfo.RootFolder 1: {0}", userInfo.RootFolder); 390 Console.WriteLine("userInfo.RootFolder 1: {0}", userInfo.RootFolder);
411 391
@@ -429,22 +409,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
429 409
430 Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder); 410 Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder);
431 411
432 try 412 new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null)
433 { 413 .ReplicateArchivePathToUserInventory(
434 new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) 414 itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded);
435 .ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); 415
436 416 Console.WriteLine("userInfo.RootFolder 3: {0}", userInfo.RootFolder);
437 Console.WriteLine("userInfo.RootFolder 3: {0}", userInfo.RootFolder); 417 InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a");
438 InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); 418 Assert.That(folder1, Is.Not.Null, "Could not find folder a");
439 Assert.That(folder1, Is.Not.Null, "Could not find folder a"); 419 InventoryFolderImpl folder2 = folder1.FindFolderByPath("b");
440 InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); 420 Assert.That(folder2, Is.Not.Null, "Could not find folder b");
441 Assert.That(folder2, Is.Not.Null, "Could not find folder b");
442 }
443 catch (NullReferenceException e)
444 {
445 // Non fatal for now until we resolve the race condition
446 Console.WriteLine("Test failed with {0}", e);
447 }
448 } 421 }
449 } 422 }
450} 423}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
index 1836447..88452d2 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
@@ -113,6 +113,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
113 agent.InventoryFolder = UUID.Zero; 113 agent.InventoryFolder = UUID.Zero;
114 agent.startpos = Vector3.Zero; 114 agent.startpos = Vector3.Zero;
115 agent.CapsPath = GetRandomCapsObjectPath(); 115 agent.CapsPath = GetRandomCapsObjectPath();
116 agent.ChildrenCapSeeds = new Dictionary<ulong, string>();
116 117
117 string reason; 118 string reason;
118 scene.NewUserConnection(agent, out reason); 119 scene.NewUserConnection(agent, out reason);
@@ -147,7 +148,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
147 TestHelper.InMethod(); 148 TestHelper.InMethod();
148 149
149 string reason; 150 string reason;
151
152 if (acd1 == null)
153 fixNullPresence();
154
150 scene.NewUserConnection(acd1, out reason); 155 scene.NewUserConnection(acd1, out reason);
156 if (testclient == null)
157 testclient = new TestClient(acd1, scene);
151 scene.AddNewClient(testclient); 158 scene.AddNewClient(testclient);
152 159
153 ScenePresence presence = scene.GetScenePresence(agent1); 160 ScenePresence presence = scene.GetScenePresence(agent1);
@@ -162,6 +169,24 @@ namespace OpenSim.Region.Framework.Scenes.Tests
162 169
163 Assert.That(neighbours.Count, Is.EqualTo(2)); 170 Assert.That(neighbours.Count, Is.EqualTo(2));
164 } 171 }
172 public void fixNullPresence()
173 {
174 string firstName = "testfirstname";
175
176 AgentCircuitData agent = new AgentCircuitData();
177 agent.AgentID = agent1;
178 agent.firstname = firstName;
179 agent.lastname = "testlastname";
180 agent.SessionID = UUID.Zero;
181 agent.SecureSessionID = UUID.Zero;
182 agent.circuitcode = 123;
183 agent.BaseFolder = UUID.Zero;
184 agent.InventoryFolder = UUID.Zero;
185 agent.startpos = Vector3.Zero;
186 agent.CapsPath = GetRandomCapsObjectPath();
187
188 acd1 = agent;
189 }
165 190
166 [Test] 191 [Test]
167 public void T013_TestRemoveNeighbourRegion() 192 public void T013_TestRemoveNeighbourRegion()
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ff85b96..691732a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -125,9 +125,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
125 125
126 if (lease.CurrentState == LeaseState.Initial) 126 if (lease.CurrentState == LeaseState.Initial)
127 { 127 {
128 lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); 128 lease.InitialLeaseTime = TimeSpan.FromMinutes(0);
129 lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); 129// lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0);
130 lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); 130// lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0);
131 } 131 }
132 return lease; 132 return lease;
133 } 133 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 6539bda..6e3a3ab 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -166,9 +166,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
166 166
167 if (lease.CurrentState == LeaseState.Initial) 167 if (lease.CurrentState == LeaseState.Initial)
168 { 168 {
169 lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); 169 lease.InitialLeaseTime = TimeSpan.FromMinutes(0);
170 lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); 170// lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0);
171 lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); 171// lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0);
172 } 172 }
173 return lease; 173 return lease;
174 } 174 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
index d119a77..838cafb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
@@ -42,16 +42,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
42 public partial class ScriptBaseClass : MarshalByRefObject, IScript 42 public partial class ScriptBaseClass : MarshalByRefObject, IScript
43 { 43 {
44 private Dictionary<string, MethodInfo> inits = new Dictionary<string, MethodInfo>(); 44 private Dictionary<string, MethodInfo> inits = new Dictionary<string, MethodInfo>();
45 private ScriptSponsor m_sponser; 45// private ScriptSponsor m_sponser;
46 46
47 public override Object InitializeLifetimeService() 47 public override Object InitializeLifetimeService()
48 { 48 {
49 ILease lease = (ILease)base.InitializeLifetimeService(); 49 ILease lease = (ILease)base.InitializeLifetimeService();
50 if (lease.CurrentState == LeaseState.Initial) 50 if (lease.CurrentState == LeaseState.Initial)
51 { 51 {
52 lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); 52 // Infinite
53 lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); 53 lease.InitialLeaseTime = TimeSpan.FromMinutes(0);
54 lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); 54// lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0);
55// lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0);
55 } 56 }
56 return lease; 57 return lease;
57 } 58 }
@@ -79,7 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
79 } 80 }
80 } 81 }
81 82
82 m_sponser = new ScriptSponsor(); 83// m_sponser = new ScriptSponsor();
83 } 84 }
84 85
85 private Executor m_Executor = null; 86 private Executor m_Executor = null;
@@ -112,7 +113,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
112 return; 113 return;
113 114
114 ILease lease = (ILease)RemotingServices.GetLifetimeService(data as MarshalByRefObject); 115 ILease lease = (ILease)RemotingServices.GetLifetimeService(data as MarshalByRefObject);
115 lease.Register(m_sponser); 116// lease.Register(m_sponser);
116 117
117 MethodInfo mi = inits[api]; 118 MethodInfo mi = inits[api];
118 119
@@ -126,7 +127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
126 127
127 public void Close() 128 public void Close()
128 { 129 {
129 m_sponser.Close(); 130// m_sponser.Close();
130 } 131 }
131 132
132 public Dictionary<string, object> GetVars() 133 public Dictionary<string, object> GetVars()
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 4211ced..225126d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -53,7 +53,7 @@ using OpenSim.Region.ScriptEngine.Interfaces;
53 53
54namespace OpenSim.Region.ScriptEngine.Shared.Instance 54namespace OpenSim.Region.ScriptEngine.Shared.Instance
55{ 55{
56 public class ScriptInstance : MarshalByRefObject, IScriptInstance, ISponsor 56 public class ScriptInstance : MarshalByRefObject, IScriptInstance
57 { 57 {
58 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 58 // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
59 59
@@ -261,7 +261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
261 "SecondLife.Script"); 261 "SecondLife.Script");
262 262
263 ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); 263 ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass);
264 lease.Register(this); 264// lease.Register(this);
265 } 265 }
266 catch (Exception) 266 catch (Exception)
267 { 267 {
@@ -1006,10 +1006,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
1006 { 1006 {
1007 return true; 1007 return true;
1008 } 1008 }
1009
1010 public TimeSpan Renewal(ILease lease)
1011 {
1012 return lease.InitialLeaseTime;
1013 }
1014 } 1009 }
1015} 1010}