From 6e35ddb0e9642e6719d5043da99d45f8885d13f0 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 19 Aug 2009 16:15:04 -0700 Subject: Fixes GetItem and GetFolder for SQLite. Turns out some methods were no-op in SQlite. Fixes most grief in http://opensimulator.org/mantis/view.php?id=4035 http://opensimulator.org/mantis/view.php?id=4027 --- .../Inventory/LocalInventoryServiceConnector.cs | 6 +++--- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 562c5dd..e6edcf2 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs @@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public override Dictionary GetSystemFolders(UUID userID) { - InventoryFolderBase root = GetRootFolder(userID); + InventoryFolderBase root = m_InventoryService.GetRootFolder(userID); if (root != null) { InventoryCollection content = GetFolderContent(userID, root.ID); @@ -202,13 +202,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory { if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) { - m_log.InfoFormat("[INVENTORY CONNECTOR]: folder type {0} ", folder.Type); + //m_log.InfoFormat("[INVENTORY CONNECTOR]: folder type {0} ", folder.Type); folders[(AssetType)folder.Type] = folder; } } // Put the root folder there, as type Folder folders[AssetType.Folder] = root; - m_log.InfoFormat("[INVENTORY CONNECTOR]: root folder is type {0} ", root.Type); + //m_log.InfoFormat("[INVENTORY CONNECTOR]: root folder is type {0} ", root.Type); return folders; } diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index a119efc..a9d361b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -179,8 +179,8 @@ namespace OpenSim.Region.Framework.Scenes else { m_log.ErrorFormat( - "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update", - remoteClient.AgentId); + "[AGENT INVENTORY]: Could not find item {0} for caps inventory update", + itemID); } return UUID.Zero; -- cgit v1.1 From 948c7ea20b1e33ee3f3aceb87fff731ddbb3bf0e Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 19 Aug 2009 18:08:20 -0700 Subject: Commented T021_TestCrossToNewRegion because (1) it can fail on panda, and (2) it is not a meaningful representation of region crossing. --- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index ce6f3d6..3ee6007 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -225,7 +225,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(presence.AbsolutePosition, Is.EqualTo(pos), "Position is not the same one entered"); } - [Test] + // I'm commenting this test because it does not represent + // crossings. The Thread.Sleep's in here are not meaningful mocks, + // and they sometimes fail in panda. + // We need to talk in order to develop a test + // that really tests region crossings. There are 3 async components, + // but things are synchronous among them. So there should be + // 3 threads in here. + //[Test] public void T021_TestCrossToNewRegion() { TestHelper.InMethod(); -- cgit v1.1 From 1604c9d19e12602608dbb402382cde8302185efd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 20 Aug 2009 10:14:53 -0700 Subject: One more place fixed for setting the inventory folder owner. Thanks jhurliman. --- OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 77b980c..d722e23 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -519,7 +519,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat( // "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); - InventoryFolderBase folder = new InventoryFolderBase(folderID); + InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId); folder = InventoryService.GetFolder(folder); if (folder != null) { -- cgit v1.1 From 4c8bcd2ff63cfbc38f6c1df4f22c0c019da5af1d Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 20 Aug 2009 20:19:08 +0100 Subject: Add some output (at DEBUG level) to the message transfer module to aid in tracking down an initialization failure. --- .../Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 5e7cf4b..4495303 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs @@ -56,7 +56,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage if (cnf != null && cnf.GetString( "MessageTransferModule", "MessageTransferModule") != "MessageTransferModule") + { + m_log.Debug("[MESSAGE TRANSFER]: Disabled by configuration"); return; + } cnf = config.Configs["Startup"]; if (cnf != null) @@ -72,6 +75,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage "grid_instant_message", processXMLRPCGridInstantMessage); } + m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active"); scene.RegisterModuleInterface(this); m_Scenes.Add(scene); } -- cgit v1.1 From 297393f349d6529549f78142f426d95f2fdf0b90 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 20 Aug 2009 21:05:00 +0100 Subject: Remove a load-order dependency in inventory transfer that was biting Windows users --- .../Avatar/Inventory/Transfer/InventoryTransferModule.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 5afbf68..75976e2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -67,13 +67,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer if (!m_Scenelist.Contains(scene)) { - if (m_Scenelist.Count == 0) - { - m_TransferModule = scene.RequestModuleInterface(); - if (m_TransferModule == null) - m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); - } - m_Scenelist.Add(scene); scene.RegisterModuleInterface(this); @@ -86,6 +79,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer public void PostInitialise() { + if (m_Scenelist.Count > 0) + { + m_TransferModule = m_Scenelist[0].RequestModuleInterface(); + if (m_TransferModule == null) + m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); + } } public void Close() -- cgit v1.1 From e83b00a3dfc5410f5ca6bd2eed3d8565ebbffecf Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 21 Aug 2009 08:51:43 +1000 Subject: * Implements a bunch of stuff in NPCModule --- .../Region/OptionalModules/World/NPC/NPCModule.cs | 64 +++++++++++++++++++--- .../Shared/Api/Implementation/LSL_Api.cs | 48 ++++++++-------- 2 files changed, 80 insertions(+), 32 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 8c9717c..a3cefc9 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -25,26 +25,74 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System.Collections.Generic; using OpenMetaverse; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Framework; namespace OpenSim.Region.OptionalModules.World.NPC { - public class NPCModule : IRegionModule + public interface INPCModule + { + UUID CreateNPC(string firstname, string lastname,Vector3 position, Scene scene, UUID cloneAppearanceFrom); + void Autopilot(UUID agentID, Scene scene, Vector3 pos); + void Say(UUID agentID, Scene scene, string text); + void DeleteNPC(UUID agentID, Scene scene); + } + + public class NPCModule : IRegionModule, INPCModule { // private const bool m_enabled = false; + private Dictionary m_avatars = new Dictionary(); + + public UUID CreateNPC(string firstname, string lastname,Vector3 position, Scene scene, UUID cloneAppearanceFrom) + { + NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, scene); + scene.AddNewClient(npcAvatar); + + ScenePresence sp; + if(scene.TryGetAvatar(npcAvatar.AgentId, out sp)) + { + AvatarAppearance x = scene.CommsManager.AvatarService.GetUserAppearance(cloneAppearanceFrom); + + List wearbyte = new List(); + for (int i = 0; i < x.VisualParams.Length; i++) + { + wearbyte.Add(x.VisualParams[i]); + } + + sp.SetAppearance(x.Texture.GetBytes(), wearbyte); + } + + m_avatars.Add(npcAvatar.AgentId, npcAvatar); + + return npcAvatar.AgentId; + } + + public void Autopilot(UUID agentID, Scene scene, Vector3 pos) + { + ScenePresence sp; + scene.TryGetAvatar(agentID, out sp); + sp.DoAutoPilot(0,pos,m_avatars[agentID]); + } + + public void Say(UUID agentID, Scene scene, string text) + { + m_avatars[agentID].Say(text); + } + + public void DeleteNPC(UUID agentID, Scene scene) + { + scene.RemoveClient(agentID); + } + + public void Initialise(Scene scene, IConfigSource source) { - // if (m_enabled) - // { - // NPCAvatar testAvatar = new NPCAvatar("Jack", "NPC", new Vector3(128, 128, 40), scene); - // NPCAvatar testAvatar2 = new NPCAvatar("Jill", "NPC", new Vector3(136, 128, 40), scene); - // scene.AddNewClient(testAvatar); - // scene.AddNewClient(testAvatar2); - // } + scene.RegisterModuleInterface(this); } public void PostInitialise() diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 4e665e9..972e71c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1978,30 +1978,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return new LSL_Rotation(q.X, q.Y, q.Z, q.W); } - private LSL_Rotation GetPartRot( SceneObjectPart part ) - { - Quaternion q; - if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim - { - if (part.ParentGroup.RootPart.AttachmentPoint != 0) - { - ScenePresence avatar = World.GetScenePresence(part.AttachedAvatar); - if (avatar != null) - if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0) - q = avatar.CameraRotation; // Mouselook - else - q = avatar.Rotation; // Currently infrequently updated so may be inaccurate - else - q = part.ParentGroup.GroupRotation; // Likely never get here but just in case - } - else - q = part.ParentGroup.GroupRotation; // just the group rotation - return new LSL_Rotation(q.X, q.Y, q.Z, q.W); - } - q = part.GetWorldRotation(); - return new LSL_Rotation(q.X, q.Y, q.Z, q.W); - } - + private LSL_Rotation GetPartRot( SceneObjectPart part ) + { + Quaternion q; + if (part.LinkNum == 0 || part.LinkNum == 1) // unlinked or root prim + { + if (part.ParentGroup.RootPart.AttachmentPoint != 0) + { + ScenePresence avatar = World.GetScenePresence(part.AttachedAvatar); + if (avatar != null) + if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0) + q = avatar.CameraRotation; // Mouselook + else + q = avatar.Rotation; // Currently infrequently updated so may be inaccurate + else + q = part.ParentGroup.GroupRotation; // Likely never get here but just in case + } + else + q = part.ParentGroup.GroupRotation; // just the group rotation + return new LSL_Rotation(q.X, q.Y, q.Z, q.W); + } + q = part.GetWorldRotation(); + return new LSL_Rotation(q.X, q.Y, q.Z, q.W); + } + public LSL_Rotation llGetLocalRot() { m_host.AddScriptLPS(1); -- cgit v1.1 From 118f710a79c68da04861941a3304b1dba2c847bb Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 20 Aug 2009 16:18:32 -0700 Subject: Fixed a missing field in SendBulkInventoryFolderUpdate. --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 6969a3d..a7a5aa3 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -2177,7 +2177,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP bulkUpdate.AgentData.AgentID = AgentId; bulkUpdate.AgentData.TransactionID = transactionId; bulkUpdate.FolderData = folderDataBlocks.ToArray(); - + List foo = new List(); + bulkUpdate.ItemData = foo.ToArray(); + //m_log.Debug("SendBulkUpdateInventory :" + bulkUpdate); OutPacket(bulkUpdate, ThrottleOutPacketType.Asset); } -- cgit v1.1