From a5ca15c42893681a777d091c737d5c7615af4f48 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 18 Dec 2013 23:35:38 +0000 Subject: [PATCH 1/2] Create regression test TestSendAgentGroupDataUpdate() for groups agent data sending --- .../Caps/EventQueue/EventQueueGetModule.cs | 6 +- .../XmlRpcGroups/Tests/GroupsModuleTests.cs | 65 ++++++++++++++++++- .../Common/Mock/TestEventQueueGetModule.cs | 3 +- prebuild.xml | 5 +- 4 files changed, 71 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index c28ba94930..0dbdbaf456 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -295,9 +295,9 @@ namespace OpenSim.Region.ClientStack.Linden { // Register an event queue for the client - //m_log.DebugFormat( - // "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}", - // agentID, caps, m_scene.RegionInfo.RegionName); + m_log.DebugFormat( + "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}", + agentID, caps, m_scene.RegionInfo.RegionName); // Let's instantiate a Queue for this agent right now TryGetQueue(agentID); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs index c1bdacb0e0..26d25975f3 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs @@ -26,13 +26,23 @@ */ using System; +using System.Collections; +using System.Net; using System.Reflection; using Nini.Config; using NUnit.Framework; using OpenMetaverse; +using OpenMetaverse.Messages.Linden; +using OpenMetaverse.Packets; +using OpenMetaverse.StructuredData; using OpenSim.Framework; using OpenSim.Framework.Communications; +using OpenSim.Framework.Servers; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Region.ClientStack.Linden; +using OpenSim.Region.CoreModules.Framework; using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups; using OpenSim.Tests.Common; using OpenSim.Tests.Common.Mock; @@ -44,11 +54,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests [TestFixture] public class GroupsModuleTests : OpenSimTestCase { + [SetUp] + public override void SetUp() + { + base.SetUp(); + + uint port = 9999; + uint sslPort = 9998; + + // This is an unfortunate bit of clean up we have to do because MainServer manages things through static + // variables and the VM is not restarted between tests. + MainServer.RemoveHttpServer(port); + + BaseHttpServer server = new BaseHttpServer(port, false, sslPort, ""); + MainServer.AddHttpServer(server); + MainServer.Instance = server; + } + [Test] - public void TestBasic() + public void TestSendAgentGroupDataUpdate() { TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); +// TestHelpers.EnableLogging(); TestScene scene = new SceneHelpers().SetupScene(); IConfigSource configSource = new IniConfigSource(); @@ -56,8 +83,40 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests config.Set("Enabled", true); config.Set("Module", "GroupsModule"); config.Set("DebugEnabled", true); + + GroupsModule gm = new GroupsModule(); + EventQueueGetModule eqgm = new EventQueueGetModule(); + + // We need a capabilities module active so that adding the scene presence creates an event queue in the + // EventQueueGetModule SceneHelpers.SetupSceneModules( - scene, configSource, new object[] { new MockGroupsServicesConnector() }); + scene, configSource, gm, new MockGroupsServicesConnector(), new CapabilitiesModule(), eqgm); + + ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseStem("1")); + + gm.SendAgentGroupDataUpdate(sp.ControllingClient); + + Hashtable eventsResponse = eqgm.GetEvents(UUID.Zero, sp.UUID); + + Assert.That((int)eventsResponse["int_response_code"], Is.EqualTo((int)HttpStatusCode.OK)); + +// Console.WriteLine("Response [{0}]", (string)eventsResponse["str_response_string"]); + + OSDMap rawOsd = (OSDMap)OSDParser.DeserializeLLSDXml((string)eventsResponse["str_response_string"]); + OSDArray eventsOsd = (OSDArray)rawOsd["events"]; + + bool foundUpdate = false; + foreach (OSD osd in eventsOsd) + { + OSDMap eventOsd = (OSDMap)osd; + + if (eventOsd["message"] == "AgentGroupDataUpdate") + foundUpdate = true; + } + + Assert.That(foundUpdate, Is.True, "Did not find AgentGroupDataUpdate in response"); + + // TODO: More checking of more actual event data. } } } \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 67070196ae..e666433c15 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -38,6 +38,7 @@ using OpenMetaverse; using OpenMetaverse.StructuredData; using OpenSim.Framework; using OpenSim.Framework.Servers; +using OpenSim.Region.ClientStack.Linden; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -164,7 +165,7 @@ namespace OpenSim.Tests.Common throw new System.NotImplementedException (); } - public OSD BuildEvent (string eventName, OSD eventBody) + public OSD BuildEvent(string eventName, OSD eventBody) { Console.WriteLine("TWO"); throw new System.NotImplementedException (); diff --git a/prebuild.xml b/prebuild.xml index f6e0f4b4e0..5b18195f60 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -2839,8 +2839,9 @@ - + + @@ -3200,6 +3201,7 @@ + @@ -3208,6 +3210,7 @@ + From e298bf41fff5045cb7fc9e87cc4114f9d8d6c9df Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 19 Dec 2013 01:24:36 +0000 Subject: [PATCH 2/2] Add missing viewer param elements for butt and breast physics. Patch from http://opensimulator.org/mantis/view.php?id=6864 except with tabs replaced by spaces Thanks cinderblocks! --- OpenSim/Framework/AvatarAppearance.cs | 76 ++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 157feb552f..024eeeb92b 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -1505,7 +1505,81 @@ namespace OpenSim.Framework SHAPE_EYELID_INNER_CORNER_UP = 214, SKIRT_SKIRT_RED = 215, SKIRT_SKIRT_GREEN = 216, - SKIRT_SKIRT_BLUE = 217 + SKIRT_SKIRT_BLUE = 217, + /// Breast_Physics_UpDown_Controller - -1-+1 + PHYSICS_BREAST_UPDOWN_CONTROLLER = 218, + /// Breast_Physics_InOut_Controller -1-+1 + PHYSICS_BREAST_PHYSICS_INOUT_CONTROLLER = 219, + /// Belly_Physics_UpDown_Controller - -1-+1 + PHYSICS_BELLY_PHYSICS_UPDOWN_CONTROLLER = 220, + /// Butt_Physics_UpDown_Controller - -1-+1 + PHYSICS_BUTT_PHYSICS_UPDOWN_CONTROLLER = 221, + /// Breast_Physics_LeftRight_Controller -1-+1 + PHYSICS_BREAST_PHYSICS_LEFTRIGHT_CONTROLLER = 222, + /// Breast_Physics_Mass - +0.1-+1 + PHYSICS_BREAST_PHYSICS_MASS = 223, + /// Breast_Physics_Gravity - 0-+30 + PHYSICS_BREAST_PHYSICS_GRAVITY = 224, + /// Breast_Physics_Drag - 0-+10 + PHYSICS_BREAST_PHYSICS_DRAG = 225, + /// Breast_Physics_UpDown_Max_Effect - 0-+3 + PHYSICS_BREAST_UPDOWN_MAX_EFFECT = 226, + /// Breast_Physics_UpDown_Spring - 0-+100 + PHYSICS_BREAST_UPDOWN_SPRING = 227, + /// Breast_Physics_UpDown_Gain - +1-+100 + PHYSICS_BREAST_UPDOWN_GAIN = 228, + /// Breast_Physics_UpDown_Damping - 0-+1 + PHYSICS_BREAST_UPDOWN_DAMPING = 229, + /// Breast_Physics_InOut_Max_Effect - 0-+3 + PHYSICS_BREAST_INOUT_MAX_EFFECT = 230, + /// Breast_Physics_InOut_Gain = +1-+100 + PHYSICS_BREAST_INOUT_GAIN = 231, + /// Breast_Physics_InOut_Damping - 0-+1 + PHYSICS_BREAST_INOUT_DAMPING = 232, + /// Belly_Physics_Mass - +0.1-+1 + PHYSICS_BELLY_PHYSICS_MASS = 233, + /// Belly_Physics_Gravity - 0-+30 + PHYSICS_BELLY_PHYSICS_GRAVITY = 234, + /// Belly_Physics_Drag - 0-+10 + PHYSICS_BELLY_PHYSICS_DRAG = 235, + /// Belly_Physics_UpDown_Max_Effect - 0-+3 + PHYSICS_BELLY_PHYSICS_UPDOWN_MAX_EFFECT = 236, + /// Belly_Physics_UpDown_Spring - 0-+100 + PHYSICS_BELLY_PHYSICS_UPDOWN_SPRING = 237, + /// Belly_Physics_UpDown_Gain - +1-+100 + PHYSICS_BELLY_PHYSICS_UPDOWN_GAIN = 238, + /// Belly_Physics_UpDown_Damping - 0-+1 + PHYSICS_BELLY_PHYSICS_UPDOWN_DAMPING = 239, + /// Butt_Physics_Mass - +0.1-+1 + PHYSICS_BUTT_PHYSICS_MASS = 240, + /// Butt_Physics_Gravity - 0-+30 + PHYSICS_BUTT_PHYSICS_GRAVITY = 241, + /// Butt_Physics_Drag - 0-+10 + PHYSICS_BUTT_PHYSICS_DRAG = 242, + /// Butt_Physics_UpDown_Max_Effect - 0-+30 + PHYSICS_BUTT_PHYSICS_UPDOWN_MAX_EFFECT = 243, + /// Butt_Physics_UpDown_Spring - 0-+100 + PHYSICS_BUTT_PHYSICS_UPDOWN_SPRING = 244, + /// Butt_Physics_UpDown_Gain - +1-+100 + PHYSICS_BUTT_PHYSICS_UPDOWN_GAIN = 245, + /// Butt_Physics_UpDown_Damping - 0-+1 + PHYSICS_BUTT_PHYSICS_UPDOWN_DAMPING = 246, + /// Butt_Physics_LeftRight_Max_Effect - 0-+3 + PHYSICS_BUTT_PHYSICS_LEFTRIGHT_MAX_EFFECT = 247, + /// Butt_Physics_LeftRight_Spring - 0-+100 + PHYSICS_BUTT_PHYSICS_LEFTRIGHT_SPRING = 248, + /// Butt_Physics_LeftRight_Gain - +1-+100 + PHYSICS_BUTT_PHYSICS_LEFTRIGHT_GAIN = 249, + /// Butt_Physics_LeftRight_Damping - 0-+1 + PHYSICS_BUTT_PHYSICS_LEFTRIGHT_DAMPING = 250, + /// Breast_Physics_LeftRight_Max_Effect = 0-+3 + PHYSICS_BREAST_PHYSICS_LEFTRIGHT_MAX_EFFECT = 251, + /// Breast_Physics_LeftRight_Spring - 0-+100 + PHYSICS_BREAST_PHYSICS_LEFTRIGHT_SPRING = 252, + /// Breast_Physics_LeftRight_Gain - +1-+100 + PHYSICS_BREAST_PHYSICS_LEFT_RIGHT_GAIN = 253, + /// Breast_Physics_LeftRight_Damping - 0-+1 + PHYSICS_BREAST_LEFTRIGHT_DAMPING = 254 } #endregion }