diff --git a/OpenSim/Data/PGSQL/PGSQLEstateData.cs b/OpenSim/Data/PGSQL/PGSQLEstateData.cs index 141b8edaa1..5ad0eaabf1 100644 --- a/OpenSim/Data/PGSQL/PGSQLEstateData.cs +++ b/OpenSim/Data/PGSQL/PGSQLEstateData.cs @@ -452,7 +452,7 @@ namespace OpenSim.Data.PGSQL public List GetEstates(string search) { List result = new List(); - string sql = "select \"estateID\" from estate_settings where lower(\"EstateName\") = lower(:EstateName)"; + string sql = "select \"EstateID\" from estate_settings where lower(\"EstateName\") = lower(:EstateName)"; using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) { conn.Open(); diff --git a/OpenSim/Data/PGSQL/PGSQLFramework.cs b/OpenSim/Data/PGSQL/PGSQLFramework.cs index 494b0aad8f..1028e4ea86 100644 --- a/OpenSim/Data/PGSQL/PGSQLFramework.cs +++ b/OpenSim/Data/PGSQL/PGSQLFramework.cs @@ -29,6 +29,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Data; +using System.Reflection; using OpenMetaverse; using OpenSim.Framework; using Npgsql; @@ -50,8 +51,36 @@ namespace OpenSim.Data.PGSQL protected PGSqlFramework(string connectionString) { m_connectionString = connectionString; + InitializeMonoSecurity(); } + public void InitializeMonoSecurity() + { + if (!Util.IsPlatformMono) + { + + if (AppDomain.CurrentDomain.GetData("MonoSecurityPostgresAdded") == null) + { + AppDomain.CurrentDomain.SetData("MonoSecurityPostgresAdded", "true"); + + AppDomain currentDomain = AppDomain.CurrentDomain; + currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); + } + } + } + + private System.Reflection.Assembly ResolveEventHandlerMonoSec(object sender, ResolveEventArgs args) + { + Assembly MyAssembly = null; + + if (args.Name.Substring(0, args.Name.IndexOf(",")) == "Mono.Security") + { + MyAssembly = Assembly.LoadFrom("lib/NET/Mono.Security.dll"); + } + + //Return the loaded assembly. + return MyAssembly; + } ////////////////////////////////////////////////////////////// // // All non queries are funneled through one connection diff --git a/OpenSim/Data/PGSQL/PGSQLManager.cs b/OpenSim/Data/PGSQL/PGSQLManager.cs index 3ddaf38693..97f40b260b 100644 --- a/OpenSim/Data/PGSQL/PGSQLManager.cs +++ b/OpenSim/Data/PGSQL/PGSQLManager.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Data; using System.IO; using System.Reflection; +using OpenSim.Framework; using log4net; using OpenMetaverse; using Npgsql; @@ -56,6 +57,34 @@ namespace OpenSim.Data.PGSQL public PGSQLManager(string connection) { connectionString = connection; + InitializeMonoSecurity(); + } + + public void InitializeMonoSecurity() + { + if (!Util.IsPlatformMono) + { + if (AppDomain.CurrentDomain.GetData("MonoSecurityPostgresAdded") == null) + { + AppDomain.CurrentDomain.SetData("MonoSecurityPostgresAdded", "true"); + + AppDomain currentDomain = AppDomain.CurrentDomain; + currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); + } + } + } + + private System.Reflection.Assembly ResolveEventHandlerMonoSec(object sender, ResolveEventArgs args) + { + Assembly MyAssembly = null; + + if (args.Name.Substring(0, args.Name.IndexOf(",")) == "Mono.Security") + { + MyAssembly = Assembly.LoadFrom("lib/NET/Mono.Security.dll"); + } + + //Return the loaded assembly. + return MyAssembly; } /// diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 7984accb61..2b8a04f3e8 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -4515,6 +4515,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP SceneObjectPart root = sop.ParentGroup.RootPart; block.TouchName = Util.StringToBytes256(root.TouchName); + + // SL 3.3.4, at least, appears to read this information as a concatenated byte[] stream of UUIDs but + // it's not yet clear whether this is actually used. If this is done in the future then a pre-cached + // copy is really needed since it's less efficient to be constantly recreating this byte array. +// using (MemoryStream memStream = new MemoryStream()) +// { +// using (BinaryWriter binWriter = new BinaryWriter(memStream)) +// { +// for (int i = 0; i < sop.GetNumberOfSides(); i++) +// { +// Primitive.TextureEntryFace teFace = sop.Shape.Textures.FaceTextures[i]; +// +// UUID textureID; +// +// if (teFace != null) +// textureID = teFace.TextureID; +// else +// textureID = sop.Shape.Textures.DefaultTexture.TextureID; +// +// binWriter.Write(textureID.GetBytes()); +// } +// +// block.TextureID = memStream.ToArray(); +// } +// } + block.TextureID = new byte[0]; // TextureID ??? block.SitName = Util.StringToBytes256(root.SitName); block.OwnerMask = root.OwnerMask; diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 8d957dcf50..218c2b2444 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -862,44 +862,44 @@ namespace OpenSim.Region.ClientStack.LindenUDP return x == m_location; } - public void BroadcastPacket(Packet packet, ThrottleOutPacketType category, bool sendToPausedAgents, bool allowSplitting) - { - // CoarseLocationUpdate and AvatarGroupsReply packets cannot be split in an automated way - if ((packet.Type == PacketType.CoarseLocationUpdate || packet.Type == PacketType.AvatarGroupsReply) && allowSplitting) - allowSplitting = false; - - if (allowSplitting && packet.HasVariableBlocks) - { - byte[][] datas = packet.ToBytesMultiple(); - int packetCount = datas.Length; - - if (packetCount < 1) - m_log.Error("[LLUDPSERVER]: Failed to split " + packet.Type + " with estimated length " + packet.Length); - - for (int i = 0; i < packetCount; i++) - { - byte[] data = datas[i]; - m_scene.ForEachClient( - delegate(IClientAPI client) - { - if (client is LLClientView) - SendPacketData(((LLClientView)client).UDPClient, data, packet.Type, category, null); - } - ); - } - } - else - { - byte[] data = packet.ToBytes(); - m_scene.ForEachClient( - delegate(IClientAPI client) - { - if (client is LLClientView) - SendPacketData(((LLClientView)client).UDPClient, data, packet.Type, category, null); - } - ); - } - } +// public void BroadcastPacket(Packet packet, ThrottleOutPacketType category, bool sendToPausedAgents, bool allowSplitting) +// { +// // CoarseLocationUpdate and AvatarGroupsReply packets cannot be split in an automated way +// if ((packet.Type == PacketType.CoarseLocationUpdate || packet.Type == PacketType.AvatarGroupsReply) && allowSplitting) +// allowSplitting = false; +// +// if (allowSplitting && packet.HasVariableBlocks) +// { +// byte[][] datas = packet.ToBytesMultiple(); +// int packetCount = datas.Length; +// +// if (packetCount < 1) +// m_log.Error("[LLUDPSERVER]: Failed to split " + packet.Type + " with estimated length " + packet.Length); +// +// for (int i = 0; i < packetCount; i++) +// { +// byte[] data = datas[i]; +// m_scene.ForEachClient( +// delegate(IClientAPI client) +// { +// if (client is LLClientView) +// SendPacketData(((LLClientView)client).UDPClient, data, packet.Type, category, null); +// } +// ); +// } +// } +// else +// { +// byte[] data = packet.ToBytes(); +// m_scene.ForEachClient( +// delegate(IClientAPI client) +// { +// if (client is LLClientView) +// SendPacketData(((LLClientView)client).UDPClient, data, packet.Type, category, null); +// } +// ); +// } +// } /// /// Start the process of sending a packet to the client. @@ -919,6 +919,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (packet.Type == PacketType.CoarseLocationUpdate && allowSplitting) allowSplitting = false; + bool packetQueued = false; + if (allowSplitting && packet.HasVariableBlocks) { byte[][] datas = packet.ToBytesMultiple(); @@ -930,18 +932,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP for (int i = 0; i < packetCount; i++) { byte[] data = datas[i]; - SendPacketData(udpClient, data, packet.Type, category, method); + + if (!SendPacketData(udpClient, data, packet.Type, category, method)) + packetQueued = true; } } else { byte[] data = packet.ToBytes(); - SendPacketData(udpClient, data, packet.Type, category, method); + packetQueued = SendPacketData(udpClient, data, packet.Type, category, method); } PacketPool.Instance.ReturnPacket(packet); - m_dataPresentEvent.Set(); + if (packetQueued) + m_dataPresentEvent.Set(); } /// @@ -955,7 +960,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// The method to call if the packet is not acked by the client. If null, then a standard /// resend of the packet is done. /// - public void SendPacketData( + /// true if the data was sent immediately, false if it was queued for sending + public bool SendPacketData( LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category, UnackedPacketMethod method) { int dataLength = data.Length; @@ -1020,7 +1026,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP // packet so that it isn't sent before a queued update packet. bool requestQueue = type == PacketType.KillObject; if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue)) + { SendPacketFinal(outgoingPacket); + return true; + } + else + { + return false; + } #endregion Queue or Send } diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 0e79733cc0..e77f0aa792 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -631,7 +631,22 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands cdl.AddRow("SculptType", s.SculptType); cdl.AddRow("State", s.State); - // TODO, unpack and display texture entries + // TODO, need to display more information about textures but in a compact format + // to stop output becoming huge. + for (int i = 0; i < sop.GetNumberOfSides(); i++) + { + Primitive.TextureEntryFace teFace = s.Textures.FaceTextures[i]; + + UUID textureID; + + if (teFace != null) + textureID = teFace.TextureID; + else + textureID = s.Textures.DefaultTexture.TextureID; + + cdl.AddRow(string.Format("Face {0} texture ID", i), textureID); + } + //cdl.AddRow("Textures", string.Format("{0} entries", s.Textures. } diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 998c19ee90..cddf8189b1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -244,25 +244,20 @@ namespace OpenSim.Region.Framework.Scenes if (part.ParentGroup.RootPart.LocalId != part.LocalId) return; - bool isAttachment = false; - // This is wrong, wrong, wrong. Selection should not be // handled by group, but by prim. Legacy cruft. // TODO: Make selection flagging per prim! // part.ParentGroup.IsSelected = false; - if (part.ParentGroup.IsAttachment) - isAttachment = true; - else - part.ParentGroup.ScheduleGroupForFullUpdate(); + part.ParentGroup.ScheduleGroupForFullUpdate(); // If it's not an attachment, and we are allowed to move it, // then we might have done so. If we moved across a parcel // boundary, we will need to recount prims on the parcels. // For attachments, that makes no sense. // - if (!isAttachment) + if (!part.ParentGroup.IsAttachment) { if (Permissions.CanEditObject( part.UUID, remoteClient.AgentId) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b3e6b67b11..9e6c25de7e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2700,7 +2700,8 @@ namespace OpenSim.Region.Framework.Scenes return; // This was pulled from SceneViewer. Attachments always receive full updates. - // I could not verify if this is a requirement but this maintains existing behavior + // This is needed because otherwise if only the root prim changes position, then + // it looks as if the entire object has moved (including the other prims). if (ParentGroup.IsAttachment) { ScheduleFullUpdate(); diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs index f7dd158376..be6f1528d0 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs @@ -249,7 +249,7 @@ public enum CollisionFlags : uint BS_VEHICLE_COLLISIONS = 1 << 12, // return collisions for vehicle ground checking BS_RETURN_ROOT_COMPOUND_SHAPE = 1 << 13, // return the pos/rot of the root shape in a compound shape BS_NONE = 0, - BS_ALL = 0xFFFFFFFF + BS_ALL = 0x7FFF // collision flags are a signed short }; // Values f collisions groups and masks @@ -265,14 +265,14 @@ public enum CollisionFilterGroups : uint BDebrisGroup = 1 << 3, // 0008 BSensorTrigger = 1 << 4, // 0010 BCharacterGroup = 1 << 5, // 0020 - BAllGroup = 0x000FFFFF, + BAllGroup = 0x0007FFF, // collision flags are a signed short // Filter groups defined by BulletSim - BGroundPlaneGroup = 1 << 10, // 0400 - BTerrainGroup = 1 << 11, // 0800 - BRaycastGroup = 1 << 12, // 1000 - BSolidGroup = 1 << 13, // 2000 + BGroundPlaneGroup = 1 << 8, // 0400 + BTerrainGroup = 1 << 9, // 0800 + BRaycastGroup = 1 << 10, // 1000 + BSolidGroup = 1 << 11, // 2000 // BLinksetGroup = xx // a linkset proper is either static or dynamic - BLinksetChildGroup = 1 << 14, // 4000 + BLinksetChildGroup = 1 << 12, // 4000 }; // CFM controls the 'hardness' of the constraint. 0=fixed, 0..1=violatable. Default=0 diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index 43aa63e22d..834228e992 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs @@ -120,6 +120,7 @@ public static class BSParam public static float NumberOfSolverIterations { get; private set; } public static bool UseSingleSidedMeshes { get; private set; } public static float GlobalContactBreakingThreshold { get; private set; } + public static float PhysicsUnmanLoggingFrames { get; private set; } // Avatar parameters public static float AvatarFriction { get; private set; } @@ -671,6 +672,10 @@ public static class BSParam 0f, (s) => { return GlobalContactBreakingThreshold; }, (s,v) => { GlobalContactBreakingThreshold = v; s.UnmanagedParams[0].globalContactBreakingThreshold = v; } ), + new ParameterDefn("PhysicsUnmanLoggingFrames", "If non-zero, frames between output of detailed unmanaged physics statistics", + 0f, + (s) => { return PhysicsUnmanLoggingFrames; }, + (s,v) => { PhysicsUnmanLoggingFrames = v; s.UnmanagedParams[0].physicsLoggingFrames = v; } ), new ParameterDefn("CSHullMaxDepthSplit", "CS impl: max depth to split for hull. 1-10 but > 7 is iffy", 7 ), diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainHeightmap.cs b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainHeightmap.cs index c7deb4ec9d..8888d6d76d 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainHeightmap.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainHeightmap.cs @@ -112,15 +112,14 @@ public sealed class BSTerrainHeightmap : BSTerrainPhys m_physicsScene.PE.SetRestitution(m_mapInfo.terrainBody, BSParam.TerrainRestitution); m_physicsScene.PE.SetCollisionFlags(m_mapInfo.terrainBody, CollisionFlags.CF_STATIC_OBJECT); + m_mapInfo.terrainBody.collisionType = CollisionType.Terrain; + // Return the new terrain to the world of physical objects m_physicsScene.PE.AddObjectToWorld(m_physicsScene.World, m_mapInfo.terrainBody); // redo its bounding box now that it is in the world m_physicsScene.PE.UpdateSingleAabb(m_physicsScene.World, m_mapInfo.terrainBody); - m_mapInfo.terrainBody.collisionType = CollisionType.Terrain; - m_mapInfo.terrainBody.ApplyCollisionMask(m_physicsScene); - // Make it so the terrain will not move or be considered for movement. m_physicsScene.PE.ForceActivationState(m_mapInfo.terrainBody, ActivationState.DISABLE_SIMULATION); diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs index c016eed70b..441d2d3732 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs @@ -138,13 +138,14 @@ public sealed class BSTerrainManager : IDisposable m_groundPlane = m_physicsScene.PE.CreateBodyWithDefaultMotionState(groundPlaneShape, BSScene.GROUNDPLANE_ID, Vector3.Zero, Quaternion.Identity); - m_physicsScene.PE.AddObjectToWorld(m_physicsScene.World, m_groundPlane); - m_physicsScene.PE.UpdateSingleAabb(m_physicsScene.World, m_groundPlane); - // Ground plane does not move - m_physicsScene.PE.ForceActivationState(m_groundPlane, ActivationState.DISABLE_SIMULATION); // Everything collides with the ground plane. m_groundPlane.collisionType = CollisionType.Groundplane; - m_groundPlane.ApplyCollisionMask(m_physicsScene); + + m_physicsScene.PE.AddObjectToWorld(m_physicsScene.World, m_groundPlane); + m_physicsScene.PE.UpdateSingleAabb(m_physicsScene.World, m_groundPlane); + + // Ground plane does not move + m_physicsScene.PE.ForceActivationState(m_groundPlane, ActivationState.DISABLE_SIMULATION); BSTerrainPhys initialTerrain = new BSTerrainHeightmap(m_physicsScene, Vector3.Zero, BSScene.TERRAIN_ID, DefaultRegionSize); lock (m_terrains) diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs index d5060e3c6c..971ff9ffb9 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs @@ -235,7 +235,8 @@ public static Dictionary CollisionTypeM { CollisionType.Groundplane, new CollisionTypeFilterGroup(CollisionType.Groundplane, (uint)CollisionFilterGroups.BGroundPlaneGroup, - (uint)CollisionFilterGroups.BAllGroup) + // (uint)CollisionFilterGroups.BAllGroup) + (uint)(CollisionFilterGroups.BCharacterGroup | CollisionFilterGroups.BSolidGroup)) }, { CollisionType.Terrain, new CollisionTypeFilterGroup(CollisionType.Terrain, diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e03cf17637..61017b8f06 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3325,7 +3325,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } emailModule.SendEmail(m_host.UUID, address, subject, message); - llSleep(EMAIL_PAUSE_TIME); + ScriptSleep(EMAIL_PAUSE_TIME * 1000); } public void llGetNextEmail(string address, string subject) diff --git a/README.md b/README.md index 118fe71d3e..6309385df2 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ need to build OpenSim before running it. # Running OpenSim on Windows +You will need .NET Framework 3.5 installed to run OpenSimulator. + We recommend that you run OpenSim from a command prompt on Windows in order to capture any errors. diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example index 6a84574759..0660de4b33 100644 --- a/bin/Robust.ini.example +++ b/bin/Robust.ini.example @@ -425,7 +425,7 @@ MapGetServiceConnector = "8002/OpenSim.Server.Handlers.dll:MapGetServiceConnecto ; helper uri: optional: if it exists if will be used to tell the client to use ; this for all economy related things - ;economy = http://127.0.0.1:9000/ + ;economy = http://127.0.0.1:8002/ ; web page of grid: optional: page providing further information about your grid ;about = http://127.0.0.1/about/ diff --git a/bin/lib/NET/Mono.Security.dll b/bin/lib/NET/Mono.Security.dll new file mode 100644 index 0000000000..6accde7911 Binary files /dev/null and b/bin/lib/NET/Mono.Security.dll differ diff --git a/bin/lib32/BulletSim.dll b/bin/lib32/BulletSim.dll index 7c16cb52a9..ee7cce739c 100755 Binary files a/bin/lib32/BulletSim.dll and b/bin/lib32/BulletSim.dll differ diff --git a/bin/lib32/libBulletSim.dylib b/bin/lib32/libBulletSim.dylib index 02f8a7f9c4..6efec3a75b 100755 Binary files a/bin/lib32/libBulletSim.dylib and b/bin/lib32/libBulletSim.dylib differ diff --git a/bin/lib32/libBulletSim.so b/bin/lib32/libBulletSim.so index 3d2737b792..ee2bd806f1 100755 Binary files a/bin/lib32/libBulletSim.so and b/bin/lib32/libBulletSim.so differ diff --git a/bin/lib64/BulletSim.dll b/bin/lib64/BulletSim.dll index 3afdf631d6..b4c4becfbe 100755 Binary files a/bin/lib64/BulletSim.dll and b/bin/lib64/BulletSim.dll differ diff --git a/bin/lib64/libBulletSim.so b/bin/lib64/libBulletSim.so index 6a178485fe..9c4033b3ed 100755 Binary files a/bin/lib64/libBulletSim.so and b/bin/lib64/libBulletSim.so differ