From 99954c14980817adae427ab8ac4cdf07cbad0d7d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 26 Jun 2012 22:53:08 +0100 Subject: refactor: Remove unnecessary AttachmentModuleTests.m_userId in favour of local variables --- OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs') diff --git a/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs index b73df2c..3d3e65c 100644 --- a/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs @@ -126,6 +126,11 @@ namespace OpenSim.Tests.Common return CreateUserWithInventory(scene, "Bill", "Bailey", userId, "troll"); } + public static UserAccount CreateUserWithInventory(Scene scene, int userId) + { + return CreateUserWithInventory(scene, "Bill", "Bailey", TestHelpers.ParseTail(userId), "troll"); + } + public static UserAccount CreateUserWithInventory( Scene scene, string firstName, string lastName, UUID userId, string pw) { -- cgit v1.1 From 2eaa6d5ace738cf1848f82ce7a0b435928b6846f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 9 Jul 2012 21:24:32 +0100 Subject: Do not allow a script to attach a prim if its being sat upon. This prevents a stack overflow where a get position on the avatar will refer to the attachment which will in turn refer back to the avatar. This required recording of all sitting avatars on a prim which is done separately from recording the sit target avatar. Recording HashSet is null if there are no sitting avatars in order to save memory. --- OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs') diff --git a/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs index 3d3e65c..2fbebc4 100644 --- a/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs @@ -138,6 +138,15 @@ namespace OpenSim.Tests.Common CreateUserWithInventory(scene, ua, pw); return ua; } + + public static UserAccount CreateUserWithInventory( + Scene scene, string firstName, string lastName, int userId, string pw) + { + UserAccount ua + = new UserAccount(TestHelpers.ParseTail(userId)) { FirstName = firstName, LastName = lastName }; + CreateUserWithInventory(scene, ua, pw); + return ua; + } public static void CreateUserWithInventory(Scene scene, UserAccount ua, string pw) { -- cgit v1.1