From ebe5e1731d24e68ec7a8aa61a397f5febc1c2662 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 15 Feb 2012 01:45:25 +0000
Subject: In ObjectTortureTests, run garbage collector on Teardown and run
scene loop update when scene objects have been deleted.
At least on mono 2.6.4, running GC.Collect() is not guaranteed to force gc of all objects when run in the same method where those objects had references.
Therefore, GC.Collect() is now being done in the per-script teardown of ObjectTortureTests.
In addition, scene loop update is being run after garbage collection in order to clean out the viewer update list of scene objects in the SceneGraph.
These measures mean that scene objects/parts are now garbage collected after a test run if deleted from the scene, resulting in a much better memory usage report (though probably still not very accurate).
However, deletion takes a very long time - what's really needed is to find out now why the entire scene isn't being GC'd by this measure.
This change hasn't yet been applied to the other stress tests.
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 10 +++---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 3 ++
.../Scenes/Tests/SceneObjectBasicTests.cs | 41 ++++++++++++++++++++--
OpenSim/Tests/Common/Mock/TestScene.cs | 3 +-
OpenSim/Tests/Torture/ObjectTortureTests.cs | 21 +++++++++--
5 files changed, 68 insertions(+), 10 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 693a79e..e66678a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -359,7 +359,7 @@ namespace OpenSim.Region.Framework.Scenes
m_log.ErrorFormat(
"[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}",
sceneObject.Name, m_parentScene.RegionInfo.RegionName, UUID.Zero);
-
+
return false;
}
@@ -368,12 +368,12 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "[SCENEGRAPH]: Scene graph for {0} already contains object {1} in AddSceneObject()",
// m_parentScene.RegionInfo.RegionName, sceneObject.UUID);
-
+
return false;
}
-
+
// m_log.DebugFormat(
-// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
+// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName);
SceneObjectPart[] parts = sceneObject.Parts;
@@ -409,7 +409,7 @@ namespace OpenSim.Region.Framework.Scenes
lock (SceneObjectGroupsByFullID)
SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
-
+
lock (SceneObjectGroupsByFullPartID)
{
foreach (SceneObjectPart part in parts)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 4c339d9..b130bf7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -303,6 +303,9 @@ namespace OpenSim.Region.Framework.Scenes
// ~SceneObjectPart()
// {
+// Console.WriteLine(
+// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
+// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index 80f198d..7737d8e 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -27,6 +27,7 @@
using System;
using System.Reflection;
+using System.Threading;
using NUnit.Framework;
using OpenMetaverse;
using OpenSim.Framework;
@@ -43,6 +44,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests
[TestFixture]
public class SceneObjectBasicTests
{
+// [TearDown]
+// public void TearDown()
+// {
+// Console.WriteLine("TearDown");
+// GC.Collect();
+// Thread.Sleep(3000);
+// }
+
+// public class GcNotify
+// {
+// public static AutoResetEvent gcEvent = new AutoResetEvent(false);
+// private static bool _initialized = false;
+//
+// public static void Initialize()
+// {
+// if (!_initialized)
+// {
+// _initialized = true;
+// new GcNotify();
+// }
+// }
+//
+// private GcNotify(){}
+//
+// ~GcNotify()
+// {
+// if (!Environment.HasShutdownStarted &&
+// !AppDomain.CurrentDomain.IsFinalizingForUnload())
+// {
+// Console.WriteLine("GcNotify called");
+// gcEvent.Set();
+// new GcNotify();
+// }
+// }
+// }
+
///
/// Test adding an object to a scene.
///
@@ -147,11 +184,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
public void TestDeleteSceneObject()
{
TestHelpers.InMethod();
-
+
TestScene scene = SceneHelpers.SetupScene();
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
scene.DeleteSceneObject(part.ParentGroup, false);
-
+
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
Assert.That(retrievedPart, Is.Null);
}
diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs
index 328cd2b..eea68c3 100644
--- a/OpenSim/Tests/Common/Mock/TestScene.cs
+++ b/OpenSim/Tests/Common/Mock/TestScene.cs
@@ -50,7 +50,8 @@ namespace OpenSim.Tests.Common.Mock
~TestScene()
{
- Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName);
+ //Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName);
+ Console.WriteLine("TestScene destructor called");
}
///
diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs
index 74b336e..e83186a 100644
--- a/OpenSim/Tests/Torture/ObjectTortureTests.cs
+++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs
@@ -49,6 +49,13 @@ namespace OpenSim.Tests.Torture
[TestFixture]
public class ObjectTortureTests
{
+ [TearDown]
+ public void TearDown()
+ {
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ }
+
// [Test]
// public void Test0000Clean()
// {
@@ -141,8 +148,18 @@ namespace OpenSim.Tests.Torture
string.Format("Object {0} could not be retrieved", i));
}
- // This does not work to fire the SceneObjectGroup destructors - something else is hanging on to them.
-// scene.DeleteAllSceneObjects();
+ // When a scene object is added to a scene, it is placed in the update list for sending to viewers
+ // (though in this case we have none). When it is deleted, it is not removed from the update which is
+ // fine since it will later be ignored.
+ //
+ // However, that means that we need to manually run an update here to clear out that list so that deleted
+ // objects will be clean up by the garbage collector before the next stress test is run.
+ scene.Update();
+
+ // Currently, we need to do this in order to garbage collect the scene objects ready for the next test run.
+ // However, what we really need to do is find out why the entire scene is not garbage collected in
+ // teardown.
+ scene.DeleteAllSceneObjects();
Console.WriteLine(
"Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)",
--
cgit v1.1
From c906128191a6801df46d5542c441ef37c5c456a9 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 16 Feb 2012 00:15:39 +0000
Subject: Fix some logic mistakes where firstly osNpcCreate() without options
was creating npcs sensed as agents and secondly the OS_NPC_SENSE_AS_AGENT
option was having the opposite effect.
Hopefully makes progress on addressing http://opensimulator.org/mantis/view.php?id=5872
---
OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 4 ++--
.../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 4 ++--
.../Shared/Api/Implementation/Plugins/SensorRepeat.cs | 17 ++++++++++++++++-
3 files changed, 20 insertions(+), 5 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 5359354..2052cdb 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -121,8 +121,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue);
m_log.DebugFormat(
- "[NPC MODULE]: Creating NPC {0} {1} {2} at {3} in {4}",
- firstname, lastname, npcAvatar.AgentId, position, scene.RegionInfo.RegionName);
+ "[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}",
+ firstname, lastname, npcAvatar.AgentId, owner, senseAsAgent, position, scene.RegionInfo.RegionName);
AgentCircuitData acd = new AgentCircuitData();
acd.AgentID = npcAvatar.AgentId;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index b1583eb..646a97b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2233,7 +2233,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
m_host.AddScriptLPS(1);
- return NpcCreate(firstname, lastname, position, notecard, false, true);
+ return NpcCreate(firstname, lastname, position, notecard, false, false);
}
public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options)
@@ -2244,7 +2244,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return NpcCreate(
firstname, lastname, position, notecard,
(options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0,
- (options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) == 0);
+ (options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) != 0);
}
private LSL_Key NpcCreate(
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index 850f50b..5c1bdff 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -31,7 +31,6 @@ using System.Collections.Generic;
using OpenMetaverse;
using OpenSim.Framework;
using log4net;
-
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.ScriptEngine.Shared;
@@ -41,6 +40,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
{
public class SensorRepeat
{
+// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
public AsyncCommandManager m_CmdManager;
public SensorRepeat(AsyncCommandManager CmdManager)
@@ -447,11 +448,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
Action senseEntity = new Action(presence =>
{
+// m_log.DebugFormat(
+// "[SENSOR REPEAT]: Inspecting scene presence {0}, type {1} on sensor sweep for {2}, type {3}",
+// presence.Name, presence.PresenceType, ts.name, ts.type);
+
if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc)
{
INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
if (npcData == null || !npcData.SenseAsAgent)
+ {
+// m_log.DebugFormat(
+// "[SENSOR REPEAT]: Discarding NPC {0} from agent sense sweep for script item id {1}",
+// presence.Name, ts.itemID);
return;
+ }
}
if ((ts.type & AGENT) == 0)
@@ -464,7 +474,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
{
INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
if (npcData != null && npcData.SenseAsAgent)
+ {
+// m_log.DebugFormat(
+// "[SENSOR REPEAT]: Discarding NPC {0} from non-agent sense sweep for script item id {1}",
+// presence.Name, ts.itemID);
return;
+ }
}
}
--
cgit v1.1
From c0760f9f91de2525269ef704f7460079e6a3e3ef Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 16 Feb 2012 00:28:57 +0000
Subject: Comment out "experimental" log message printed out whenever a physics
mesh was generated for a mesh
Also adds prim name to the "no asset data" error log message
---
OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index f15e81b..6f6ed7f 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -313,7 +313,7 @@ namespace OpenSim.Region.Physics.Meshing
private bool GenerateCoordsAndFacesFromPrimMeshData(
string primName, PrimitiveBaseShape primShape, Vector3 size, out List coords, out List faces)
{
- m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName);
+// m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName);
coords = new List();
faces = new List();
@@ -321,7 +321,7 @@ namespace OpenSim.Region.Physics.Meshing
if (primShape.SculptData.Length <= 0)
{
- m_log.Error("[MESH]: asset data is zero length");
+ m_log.ErrorFormat("[MESH]: asset data for {0} is zero length", primName);
return false;
}
--
cgit v1.1
From df960d57671db906edeca472d651c3c26cc27e53 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 16 Feb 2012 01:25:54 +0000
Subject: Add known identity informatio nto log message if an exception is
thrown during LLUDPServer.HandleUseCircuitCode()
---
.../Region/ClientStack/Linden/UDP/LLUDPServer.cs | 89 +++++++++++++---------
1 file changed, 53 insertions(+), 36 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 7b1aa2c..3b0fd8e 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -903,47 +903,64 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void HandleUseCircuitCode(object o)
{
-// DateTime startTime = DateTime.Now;
- object[] array = (object[])o;
- UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
- UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
-
- m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
-
- IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
+ IPEndPoint remoteEndPoint;
+ IClientAPI client;
- AuthenticateResponse sessionInfo;
- if (IsClientAuthorized(uccp, out sessionInfo))
+ try
{
- // Begin the process of adding the client to the simulator
- IClientAPI client
- = AddClient(
- uccp.CircuitCode.Code,
- uccp.CircuitCode.ID,
- uccp.CircuitCode.SessionID,
- remoteEndPoint,
- sessionInfo);
-
- // Send ack straight away to let the viewer know that the connection is active.
- // The client will be null if it already exists (e.g. if on a region crossing the client sends a use
- // circuit code to the existing child agent. This is not particularly obvious.
- SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
-
- // We only want to send initial data to new clients, not ones which are being converted from child to root.
- if (client != null)
- client.SceneAgent.SendInitialDataToMe();
+ // DateTime startTime = DateTime.Now;
+ object[] array = (object[])o;
+ UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
+ UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
+
+ m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
+
+ remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
+
+ AuthenticateResponse sessionInfo;
+ if (IsClientAuthorized(uccp, out sessionInfo))
+ {
+ // Begin the process of adding the client to the simulator
+ client
+ = AddClient(
+ uccp.CircuitCode.Code,
+ uccp.CircuitCode.ID,
+ uccp.CircuitCode.SessionID,
+ remoteEndPoint,
+ sessionInfo);
+
+ // Send ack straight away to let the viewer know that the connection is active.
+ // The client will be null if it already exists (e.g. if on a region crossing the client sends a use
+ // circuit code to the existing child agent. This is not particularly obvious.
+ SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
+
+ // We only want to send initial data to new clients, not ones which are being converted from child to root.
+ if (client != null)
+ client.SceneAgent.SendInitialDataToMe();
+ }
+ else
+ {
+ // Don't create clients for unauthorized requesters.
+ m_log.WarnFormat(
+ "[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
+ uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
+ }
+
+ // m_log.DebugFormat(
+ // "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
+ // buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
+
}
- else
+ catch (Exception e)
{
- // Don't create clients for unauthorized requesters.
- m_log.WarnFormat(
- "[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
- uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
+ m_log.ErrorFormat(
+ "[LLUDPSERVER]: UseCircuitCode handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}",
+ remoteEndPoint != null ? remoteEndPoint.ToString() : "n/a",
+ client != null ? client.Name : "unknown",
+ client != null ? client.AgentId : "unknown",
+ e.Message,
+ e.StackTrace);
}
-
- // m_log.DebugFormat(
-// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
-// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
}
///
--
cgit v1.1
From 80ec2ac167713a4561938697a259e2a9681dadd4 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 16 Feb 2012 01:39:12 +0000
Subject: Correct a bug introduced in 1f402fdf (Feb 7 2012) where the delete
friends grid call would try and contact the wrong uri. Also fixes the build
from df960d5
---
OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 6 +++---
OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 3b0fd8e..1e22fcc 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -903,8 +903,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void HandleUseCircuitCode(object o)
{
- IPEndPoint remoteEndPoint;
- IClientAPI client;
+ IPEndPoint remoteEndPoint = null;
+ IClientAPI client = null;
try
{
@@ -957,7 +957,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
"[LLUDPSERVER]: UseCircuitCode handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}",
remoteEndPoint != null ? remoteEndPoint.ToString() : "n/a",
client != null ? client.Name : "unknown",
- client != null ? client.AgentId : "unknown",
+ client != null ? client.AgentId.ToString() : "unknown",
e.Message,
e.StackTrace);
}
diff --git a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
index 44138c9..b1dd84e 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
@@ -220,7 +220,7 @@ namespace OpenSim.Services.Connectors.Friends
public bool Delete(Dictionary sendData, string PrincipalID, string Friend)
{
string reply = string.Empty;
- string uri = m_ServerURI = "/friends";
+ string uri = m_ServerURI + "/friends";
try
{
reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData));
--
cgit v1.1
From 2b842958cc172fbf9ee79b495a268f012fb47cdc Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 16 Feb 2012 02:58:00 +0000
Subject: If shape properties fail SOP parsing (e.g. due to commas instead of
decimal points) print out one short message listing the failing node names
rather than lots of exceptions.
Adds skeleton bad float values deserialization test
---
.../World/Serialiser/Tests/SerialiserTests.cs | 133 +++++++++++++++++++++
.../Scenes/Serialization/SceneObjectSerializer.cs | 34 ++++--
2 files changed, 155 insertions(+), 12 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
index d5b585a..9c8c4d5 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
@@ -148,6 +148,113 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
";
+ private string badFloatsXml = @"
+
+
+
+ false
+ a6dacf01-4636-4bb9-8a97-30609438af9d
+ e6a5a05e-e8cc-4816-8701-04165e335790
+ 1
+
+ 0
+ e6a5a05e-e8cc-4816-8701-04165e335790
+ 2698615125
+ NaughtyPrim
+ 0
+ false
+ 1099511628032000
+ 0
+ 147.2392.69822.78084
+ 000
+ -4.371139E-08-1-4.371139E-080
+ 000
+ 000
+ 000
+ 000
+
+
+
+
+
+ 0
+ 0
+
+ 1
+ AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA==
+ AA==
+ 0
+ 16
+ 0
+ 0
+ 0
+ 100
+ 100
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 9
+ 0
+ 0
+ 0
+ 10100.5
+ 0
+ Square
+ Same
+ 00000000-0000-0000-0000-000000000000
+ 0
+ 0
+ 0,5
+ yo mamma
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 1
+ false
+ false
+ false
+
+ 10100.5
+ 0
+ 0001
+ 000
+ 000
+ 0001
+ 0
+ 1211330445
+ 0
+ 0
+ 0
+ 0
+ 00000000-0000-0000-0000-000000000000
+ a6dacf01-4636-4bb9-8a97-30609438af9d
+ a6dacf01-4636-4bb9-8a97-30609438af9d
+ 2147483647
+ 2147483647
+ 0
+ 0
+ 2147483647
+ None
+ 00000000-0000-0000-0000-000000000000
+ 0
+
+
+
+ ";
+
private string xml2 = @"
@@ -257,6 +364,32 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
}
[Test]
+ public void TestDeserializeBadFloatsXml()
+ {
+ TestHelpers.InMethod();
+ log4net.Config.XmlConfigurator.Configure();
+
+ SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(badFloatsXml);
+ SceneObjectPart rootPart = so.RootPart;
+
+ Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790")));
+ Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d")));
+ Assert.That(rootPart.Name, Is.EqualTo("NaughtyPrim"));
+
+ // This terminates the deserialization earlier if couldn't be parsed.
+ // TODO: Need to address this
+ Assert.That(rootPart.GroupPosition.X, Is.EqualTo(147.23f));
+
+ Assert.That(rootPart.Shape.PathCurve, Is.EqualTo(16));
+
+ // Defaults for bad parses
+ Assert.That(rootPart.Shape.FlexiTension, Is.EqualTo(0));
+ Assert.That(rootPart.Shape.FlexiDrag, Is.EqualTo(0));
+
+ // TODO: Check other properties
+ }
+
+ [Test]
public void TestSerializeXml()
{
TestHelpers.InMethod();
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 0a32214..e6b88a3 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -29,6 +29,7 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
+using System.Linq;
using System.Reflection;
using System.Xml;
using log4net;
@@ -570,13 +571,15 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
{
- bool errors = false;
- obj.Shape = ReadShape(reader, "Shape", out errors);
+ List errorNodeNames;
+ obj.Shape = ReadShape(reader, "Shape", out errorNodeNames);
- if (errors)
+ if (errorNodeNames != null)
+ {
m_log.DebugFormat(
- "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors. Please see earlier log entries.",
- obj.Name, obj.UUID);
+ "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors in properties {2}.",
+ obj.Name, obj.UUID, string.Join(", ", errorNodeNames.ToArray()));
+ }
}
private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
@@ -1519,37 +1522,44 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
///
///
/// The name of the xml element containing the shape
- /// true if any errors were encountered during parsing, false otherwise
+ /// a list containing the failing node names. If no failures then null.
/// The shape parsed
- public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors)
+ public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out List errorNodeNames)
{
- errors = false;
+ List internalErrorNodeNames = null;
PrimitiveBaseShape shape = new PrimitiveBaseShape();
if (reader.IsEmptyElement)
{
reader.Read();
+ errorNodeNames = null;
return shape;
}
reader.ReadStartElement(name, String.Empty); // Shape
- errors = ExternalRepresentationUtils.ExecuteReadProcessors(
+ ExternalRepresentationUtils.ExecuteReadProcessors(
shape,
m_ShapeXmlProcessors,
reader,
(o, nodeName, e)
=>
{
- m_log.DebugFormat(
- "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
- nodeName, e.Message, e.StackTrace);
+// m_log.DebugFormat(
+// "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
+// nodeName, e.Message, e.StackTrace);
+ if (internalErrorNodeNames == null)
+ internalErrorNodeNames = new List();
+
+ internalErrorNodeNames.Add(nodeName);
}
);
reader.ReadEndElement(); // Shape
+ errorNodeNames = internalErrorNodeNames;
+
return shape;
}
--
cgit v1.1
From 1267094a5123f5874351d82a3fdf6e257e93d283 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 16 Feb 2012 03:02:11 +0000
Subject: Turn off logging on test in last commit (2b84295).
---
OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
index 9c8c4d5..d1d2020 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
@@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
public void TestDeserializeBadFloatsXml()
{
TestHelpers.InMethod();
- log4net.Config.XmlConfigurator.Configure();
+// log4net.Config.XmlConfigurator.Configure();
SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(badFloatsXml);
SceneObjectPart rootPart = so.RootPart;
--
cgit v1.1
From 4486b7d8e8aaa7f98e0003ce06fc0e145903f6b9 Mon Sep 17 00:00:00 2001
From: PixelTomsen
Date: Thu, 16 Feb 2012 00:07:12 +0100
Subject: Fix: Object owned by the group does not return to the last owner
http://opensimulator.org/mantis/view.php?id=5404
---
.../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 6 ++++++
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 +-
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 63ba3d3..5da15ff 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -552,6 +552,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// action, remoteClient.Name, userID);
}
else
+ if (so.RootPart.OwnerID == so.RootPart.GroupID)
+ {
+ // Group owned objects go to the last owner
+ userID = so.RootPart.LastOwnerID;
+ }
+ else
{
// All returns / deletes go to the object owner
//
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 5a5307c..9d9729e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1926,7 +1926,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectGroup g in deleteGroups)
{
- AddReturn(g.OwnerID, g.Name, g.AbsolutePosition, "parcel owner return");
+ AddReturn(g.OwnerID == g.GroupID ? g.LastOwnerID : g.OwnerID, g.Name, g.AbsolutePosition, "parcel owner return");
}
}
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 5b838f8..878476e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1330,7 +1330,7 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat(
"[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
RootPart.UUID);
- m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel autoreturn");
+ m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn");
m_scene.DeRezObjects(null, new List() { RootPart.LocalId }, UUID.Zero,
DeRezAction.Return, UUID.Zero);
--
cgit v1.1
From 912aac34476a3d66c2dfa8d31352d614bd477286 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 16 Feb 2012 03:37:40 +0000
Subject: minor formatting changes from last commit (4486n7d)
---
.../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 5da15ff..d320af4 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -551,15 +551,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}",
// action, remoteClient.Name, userID);
}
- else
- if (so.RootPart.OwnerID == so.RootPart.GroupID)
+ else if (so.RootPart.OwnerID == so.RootPart.GroupID)
{
- // Group owned objects go to the last owner
+ // Group owned objects go to the last owner before the object was transferred.
userID = so.RootPart.LastOwnerID;
}
else
{
- // All returns / deletes go to the object owner
+ // Other returns / deletes go to the object owner
//
userID = so.RootPart.OwnerID;
--
cgit v1.1
From 6b867773a83e90407203d0f0f6f7fa36121265d9 Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Thu, 16 Feb 2012 08:59:34 -0500
Subject: Remove some debugging output form the logger
---
.../Scripting/RegionReadyModule/RegionReadyModule.cs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
index d2810be..d0142a4 100644
--- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
@@ -230,8 +230,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
- m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}",
- m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
+ // m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}",
+ // m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
+
+ m_log.InfoFormat("[RegionReady]: Logins enabled for {0}", m_scene.RegionInfo.RegionName);
if ( m_uri != string.Empty )
{
--
cgit v1.1
From 972f73ed2bf44d2d1d27dc0e63673dc5690a518a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 17 Feb 2012 02:53:12 +0000
Subject: Make osNpcStopAnimation() call AvatarStopAnimation() rather than
AvatarPlayAnimation()
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 646a97b..c55e2ae 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2595,7 +2595,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID npcID = new UUID(npc.m_string);
if (module.CheckPermissions(npcID, m_host.OwnerID))
- AvatarPlayAnimation(npcID.ToString(), animation);
+ AvatarStopAnimation(npcID.ToString(), animation);
}
}
--
cgit v1.1
From ba98d6fffe03389d6538a11d5eec45c863964403 Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Fri, 17 Feb 2012 08:03:53 -0500
Subject: Fix missing telehub handling on login
---
OpenSim/Region/Framework/Scenes/Scene.cs | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 4c8e2d2..ecc553d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3427,6 +3427,27 @@ namespace OpenSim.Region.Framework.Scenes
agent.startpos.Z = 720;
}
}
+
+ // Honor Estate teleport routing via Telehubs
+ if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && RegionInfo.EstateSettings.AllowDirectTeleport == false)
+ {
+ SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
+ // Can have multiple SpawnPoints
+ List spawnpoints = RegionInfo.RegionSettings.SpawnPoints();
+ if ( spawnpoints.Count > 1)
+ {
+ // We have multiple SpawnPoints, Route the agent to a random one
+ agent.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count)].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
+ }
+ else
+ {
+ // We have a single SpawnPoint and will route the agent to it
+ agent.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
+ }
+
+ return true;
+ }
+
// Honor parcel landing type and position.
if (land != null)
{
--
cgit v1.1
From 6baa13ab7aeb7d0ee08f2460f52961dbd79bada1 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Fri, 17 Feb 2012 09:12:41 -0800
Subject: Add new and updated script events
---
OpenSim/Region/Framework/Scenes/EventManager.cs | 58 ++++++++++++++++++++--
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 12 +++++
2 files changed, 67 insertions(+), 3 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index d31d380..34d3da7 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -184,10 +184,62 @@ namespace OpenSim.Region.Framework.Scenes
public event ClientClosed OnClientClosed;
+ // Fired when a script is created
+ // The indication that a new script exists in this region.
+ public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID);
+ public event NewScript OnNewScript;
+ public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID)
+ {
+ NewScript handlerNewScript = OnNewScript;
+ if (handlerNewScript != null)
+ {
+ foreach (NewScript d in handlerNewScript.GetInvocationList())
+ {
+ try
+ {
+ d(clientID, part, itemID);
+ }
+ catch (Exception e)
+ {
+ m_log.ErrorFormat(
+ "[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}",
+ e.Message, e.StackTrace);
+ }
+ }
+ }
+ }
+
+ //TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset
+ // An indication that the script has changed.
+ public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID);
+ public event UpdateScript OnUpdateScript;
+ public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID)
+ {
+ UpdateScript handlerUpdateScript = OnUpdateScript;
+ if (handlerUpdateScript != null)
+ {
+ foreach (UpdateScript d in handlerUpdateScript.GetInvocationList())
+ {
+ try
+ {
+ d(clientId, itemId, primId, isScriptRunning, newAssetID);
+ }
+ catch (Exception e)
+ {
+ m_log.ErrorFormat(
+ "[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}",
+ e.Message, e.StackTrace);
+ }
+ }
+ }
+ }
+
///
- /// This is fired when a scene object property that a script might be interested in (such as color, scale or
- /// inventory) changes. Only enough information is sent for the LSL changed event
- /// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed)
+ /// ScriptChangedEvent is fired when a scene object property that a script might be interested
+ /// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event.
+ /// This is not an indication that the script has changed (see OnUpdateScript for that).
+ /// This event is sent to a script to tell it that some property changed on
+ /// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed .
///
public event ScriptChangedEvent OnScriptChangedEvent;
public delegate void ScriptChangedEvent(uint localID, uint change);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 9d9729e..6cc78b8 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -283,6 +283,10 @@ namespace OpenSim.Region.Framework.Scenes
{
remoteClient.SendAgentAlertMessage("Script saved", false);
}
+
+ // Tell anyone managing scripts that a script has been reloaded/changed
+ EventManager.TriggerUpdateScript(remoteClient.AgentId, itemId, primId, isScriptRunning, item.AssetID);
+
part.ParentGroup.ResumeScripts();
return errors;
}
@@ -1624,9 +1628,13 @@ namespace OpenSim.Region.Framework.Scenes
// have state in inventory
part.Inventory.CreateScriptInstance(copyID, 0, false, DefaultScriptEngine, 0);
+ // tell anyone watching that there is a new script in town
+ EventManager.TriggerNewScript(agentID, part, copyID);
+
// m_log.InfoFormat("[PRIMINVENTORY]: " +
// "Rezzed script {0} into prim local ID {1} for user {2}",
// item.inventoryName, localID, remoteClient.Name);
+
part.ParentGroup.ResumeScripts();
return part;
@@ -1707,6 +1715,10 @@ namespace OpenSim.Region.Framework.Scenes
part.Inventory.AddInventoryItem(taskItem, false);
part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
+
+ // tell anyone managing scripts that a new script exists
+ EventManager.TriggerNewScript(agentID, part, taskItem.ItemID);
+
part.ParentGroup.ResumeScripts();
return part;
--
cgit v1.1
From 784263f5e334aeda15effee599efc8bf546aa010 Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Fri, 17 Feb 2012 13:43:14 -0800
Subject: Added the TriggerAvatarAppearanceChanged to EventManager. It's
triggered by AvatarFactoryModule after an avatar's appearance has been
succesfully changed and persisted (if the persist option is set).
---
.../Avatar/AvatarFactory/AvatarFactoryModule.cs | 4 ++++
OpenSim/Region/Framework/Scenes/EventManager.cs | 24 ++++++++++++++++++++++
2 files changed, 28 insertions(+)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index c7f4c20..b0cee03 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -496,6 +496,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
SetAppearanceAssets(sp.UUID, sp.Appearance);
m_scene.AvatarService.SetAppearance(agentid, sp.Appearance);
+
+ // Trigger this here because it's the final step in the set/queue/save process for appearance setting.
+ // Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes).
+ m_scene.EventManager.TriggerAvatarAppearanceChanged(sp);
}
private void SetAppearanceAssets(UUID userID, AvatarAppearance appearance)
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index d31d380..6586437 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -173,6 +173,9 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
+ public delegate void AvatarAppearanceChange(ScenePresence avatar);
+ public event AvatarAppearanceChange OnAvatarAppearanceChange;
+
public event Action OnSignificantClientMovement;
public delegate void IncomingInstantMessage(GridInstantMessage message);
@@ -1238,6 +1241,27 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ public void TriggerAvatarAppearanceChanged(ScenePresence avatar)
+ {
+ AvatarAppearanceChange handler = OnAvatarAppearanceChange;
+ if (handler != null)
+ {
+ foreach (AvatarAppearanceChange d in handler.GetInvocationList())
+ {
+ try
+ {
+ d(avatar);
+ }
+ catch (Exception e)
+ {
+ m_log.ErrorFormat(
+ "[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}",
+ e.Message, e.StackTrace);
+ }
+ }
+ }
+ }
+
public void TriggerIncomingInstantMessage(GridInstantMessage message)
{
IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage;
--
cgit v1.1
From d03e878d530a551ae7fb5757f8bcd61aac46d919 Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Fri, 17 Feb 2012 17:31:20 -0500
Subject: Fillin missing SQLite support for Telehubs
---
.../Data/SQLite/Resources/RegionStore.migrations | 16 ++++
OpenSim/Data/SQLite/SQLiteSimulationData.cs | 102 +++++++++++++++++++++
2 files changed, 118 insertions(+)
(limited to 'OpenSim')
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
index 0f40cdc..a00a8fb 100644
--- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations
+++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
@@ -541,4 +541,20 @@ CREATE TABLE regionwindlight (
cloud_scroll_y_lock INTEGER NOT NULL DEFAULT '0',
draw_classic_clouds INTEGER NOT NULL DEFAULT '1');
+COMMIT;
+
+
+:VERSION 24
+
+BEGIN;
+
+CREATE TABLE IF NOT EXISTS `spawn_points` (
+ `RegionID` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000',
+ `Yaw` float NOT NULL,
+ `Pitch` float NOT NULL,
+ `Distance` float NOT NULL
+);
+
+ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
+
COMMIT;
\ No newline at end of file
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index ce1b7b4..83f803b 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -61,6 +61,7 @@ namespace OpenSim.Data.SQLite
private const string regionbanListSelect = "select * from regionban";
private const string regionSettingsSelect = "select * from regionsettings";
private const string regionWindlightSelect = "select * from regionwindlight";
+ private const string regionSpawnPointsSelect = "select * from spawn_points";
private DataSet ds;
private SqliteDataAdapter primDa;
@@ -71,6 +72,7 @@ namespace OpenSim.Data.SQLite
private SqliteDataAdapter landAccessListDa;
private SqliteDataAdapter regionSettingsDa;
private SqliteDataAdapter regionWindlightDa;
+ private SqliteDataAdapter regionSpawnPointsDa;
private SqliteConnection m_conn;
private String m_connectionString;
@@ -140,6 +142,10 @@ namespace OpenSim.Data.SQLite
SqliteCommand regionWindlightSelectCmd = new SqliteCommand(regionWindlightSelect, m_conn);
regionWindlightDa = new SqliteDataAdapter(regionWindlightSelectCmd);
+
+ SqliteCommand regionSpawnPointsSelectCmd = new SqliteCommand(regionSpawnPointsSelect, m_conn);
+ regionSpawnPointsDa = new SqliteDataAdapter(regionSpawnPointsSelectCmd);
+
// This actually does the roll forward assembly stuff
Migration m = new Migration(m_conn, Assembly, "RegionStore");
m.Update();
@@ -170,6 +176,9 @@ namespace OpenSim.Data.SQLite
ds.Tables.Add(createRegionWindlightTable());
setupRegionWindlightCommands(regionWindlightDa, m_conn);
+ ds.Tables.Add(createRegionSpawnPointsTable());
+ setupRegionSpawnPointsCommands(regionSpawnPointsDa, m_conn);
+
// WORKAROUND: This is a work around for sqlite on
// windows, which gets really unhappy with blob columns
// that have no sample data in them. At some point we
@@ -246,6 +255,15 @@ namespace OpenSim.Data.SQLite
m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on regionwindlight table :{0}", e.Message);
}
+ try
+ {
+ regionSpawnPointsDa.Fill(ds.Tables["spawn_points"]);
+ }
+ catch (Exception e)
+ {
+ m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on spawn_points table :{0}", e.Message);
+ }
+
// We have to create a data set mapping for every table, otherwise the IDataAdaptor.Update() will not populate rows with values!
// Not sure exactly why this is - this kind of thing was not necessary before - justincc 20100409
// Possibly because we manually set up our own DataTables before connecting to the database
@@ -257,6 +275,7 @@ namespace OpenSim.Data.SQLite
CreateDataSetMapping(landAccessListDa, "landaccesslist");
CreateDataSetMapping(regionSettingsDa, "regionsettings");
CreateDataSetMapping(regionWindlightDa, "regionwindlight");
+ CreateDataSetMapping(regionSpawnPointsDa, "spawn_points");
}
}
catch (Exception e)
@@ -319,6 +338,11 @@ namespace OpenSim.Data.SQLite
regionWindlightDa.Dispose();
regionWindlightDa = null;
}
+ if (regionSpawnPointsDa != null)
+ {
+ regionSpawnPointsDa.Dispose();
+ regionWindlightDa = null;
+ }
}
public void StoreRegionSettings(RegionSettings rs)
@@ -339,8 +363,43 @@ namespace OpenSim.Data.SQLite
fillRegionSettingsRow(settingsRow, rs);
}
+ StoreSpawnPoints(rs);
+
Commit();
}
+
+ }
+
+ public void StoreSpawnPoints(RegionSettings rs)
+ {
+ lock (ds)
+ {
+ // DataTable spawnpoints = ds.Tables["spawn_points"];
+
+ // remove region's spawnpoints
+ using (
+ SqliteCommand cmd =
+ new SqliteCommand("delete from spawn_points where RegionID=:RegionID",
+ m_conn))
+ {
+
+ cmd.Parameters.Add(new SqliteParameter(":RegionID", rs.RegionUUID.ToString()));
+ cmd.ExecuteNonQuery();
+ }
+ }
+
+ foreach (SpawnPoint sp in rs.SpawnPoints())
+ {
+ using (SqliteCommand cmd = new SqliteCommand("insert into spawn_points(RegionID, Yaw, Pitch, Distance)" +
+ "values ( :RegionID, :Yaw, :Pitch, :Distance)", m_conn))
+ {
+ cmd.Parameters.Add(new SqliteParameter(":RegionID", rs.RegionUUID.ToString()));
+ cmd.Parameters.Add(new SqliteParameter(":Yaw", sp.Yaw));
+ cmd.Parameters.Add(new SqliteParameter(":Pitch", sp.Pitch));
+ cmd.Parameters.Add(new SqliteParameter(":Distance", sp.Distance));
+ cmd.ExecuteNonQuery();
+ }
+ }
}
///
@@ -435,10 +494,31 @@ namespace OpenSim.Data.SQLite
RegionSettings newSettings = buildRegionSettings(row);
newSettings.OnSave += StoreRegionSettings;
+ LoadSpawnPoints(newSettings);
+
return newSettings;
}
}
+ private void LoadSpawnPoints(RegionSettings rs)
+ {
+ rs.ClearSpawnPoints();
+
+ DataTable spawnpoints = ds.Tables["spawn_points"];
+ string byRegion = "RegionID = '" + rs.RegionUUID + "'";
+ DataRow[] spForRegion = spawnpoints.Select(byRegion);
+
+ foreach (DataRow spRow in spForRegion)
+ {
+ SpawnPoint sp = new SpawnPoint();
+ sp.Pitch = (float)spRow["Pitch"];
+ sp.Yaw = (float)spRow["Yaw"];
+ sp.Distance = (float)spRow["Distance"];
+
+ rs.AddSpawnPoint(sp);
+ }
+ }
+
///
/// Adds an object into region storage
///
@@ -1265,6 +1345,7 @@ namespace OpenSim.Data.SQLite
createCol(regionsettings, "covenant", typeof(String));
createCol(regionsettings, "covenant_datetime", typeof(Int32));
createCol(regionsettings, "map_tile_ID", typeof(String));
+ createCol(regionsettings, "TelehubObject", typeof(String));
regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] };
return regionsettings;
}
@@ -1345,6 +1426,17 @@ namespace OpenSim.Data.SQLite
return regionwindlight;
}
+ private static DataTable createRegionSpawnPointsTable()
+ {
+ DataTable spawn_points = new DataTable("spawn_points");
+ createCol(spawn_points, "regionID", typeof(String));
+ createCol(spawn_points, "Yaw", typeof(float));
+ createCol(spawn_points, "Pitch", typeof(float));
+ createCol(spawn_points, "Distance", typeof(float));
+
+ return spawn_points;
+ }
+
/***********************************************************************
*
* Convert between ADO.NET <=> OpenSim Objects
@@ -1666,6 +1758,7 @@ namespace OpenSim.Data.SQLite
newSettings.Covenant = new UUID((String)row["covenant"]);
newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]);
newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]);
+ newSettings.TelehubObject = new UUID((String)row["TelehubObject"]);
return newSettings;
}
@@ -2068,6 +2161,7 @@ namespace OpenSim.Data.SQLite
row["covenant"] = settings.Covenant.ToString();
row["covenant_datetime"] = settings.CovenantChangedDateTime;
row["map_tile_ID"] = settings.TerrainImageID.ToString();
+ row["TelehubObject"] = settings.TelehubObject.ToString();
}
///
@@ -2591,6 +2685,14 @@ namespace OpenSim.Data.SQLite
da.UpdateCommand.Connection = conn;
}
+ private void setupRegionSpawnPointsCommands(SqliteDataAdapter da, SqliteConnection conn)
+ {
+ da.InsertCommand = createInsertCommand("spawn_points", ds.Tables["spawn_points"]);
+ da.InsertCommand.Connection = conn;
+ da.UpdateCommand = createUpdateCommand("spawn_points", "RegionID=:RegionID", ds.Tables["spawn_points"]);
+ da.UpdateCommand.Connection = conn;
+ }
+
///
///
///
--
cgit v1.1
From b817c337dc2c5d8efda710f445114aa9a9344611 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 18 Feb 2012 00:33:52 +0000
Subject: On Windows automatically load the correct native ODE library
depending on whether the process is 32-bit or 64-bit
In theory, this means that a 64-bit Windows OS user can now run OpenSim.exe with ODE and use more than 2 (or 3) GB of memory.
However, this is completely untested since I don't currently own a 64-bit Windows box. Feedback appreciated.
Using OpenSim.32BitLaunch.exe should continue to work. Other platforms are unaffected.
This will currently not work with sqlite - I will add that too if this works.
---
OpenSim/Framework/Servers/BaseOpenSimServer.cs | 4 ++-
OpenSim/Framework/Util.cs | 38 +++++++++++++++++++++-
.../Region/Physics/Manager/PhysicsPluginManager.cs | 3 +-
OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 24 ++++++++++++--
4 files changed, 64 insertions(+), 5 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 545e76c..0dd01af 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -308,7 +308,9 @@ namespace OpenSim.Framework.Servers
// clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and
// the clr version number doesn't match the project version number under Mono.
//m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine);
- m_log.Info("[STARTUP]: Operating system version: " + Environment.OSVersion + Environment.NewLine);
+ m_log.InfoFormat(
+ "[STARTUP]: Operating system version: {0}, .NET platform {1}, {2}-bit\n",
+ Environment.OSVersion, Environment.OSVersion.Platform, Util.Is64BitProcess() ? "64" : "32");
StartupSpecific();
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 4b0b13c..b3ec5c2 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -35,7 +35,8 @@ using System.IO;
using System.IO.Compression;
using System.Net;
using System.Net.Sockets;
-using System.Reflection;
+using System.Reflection;
+using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Security.Cryptography;
@@ -375,6 +376,20 @@ namespace OpenSim.Framework
}
return sb.ToString();
+ }
+
+ ///
+ /// Is the platform Windows?
+ ///
+ /// true if so, false otherwise
+ public static bool IsWindows()
+ {
+ PlatformID platformId = Environment.OSVersion.Platform;
+
+ return (platformId == PlatformID.Win32NT
+ || platformId == PlatformID.Win32S
+ || platformId == PlatformID.Win32Windows
+ || platformId == PlatformID.WinCE);
}
public static bool IsEnvironmentSupported(ref string reason)
@@ -1457,6 +1472,27 @@ namespace OpenSim.Framework
}
return data;
+ }
+
+ ///
+ /// Used to trigger an early library load on Windows systems.
+ ///
+ ///
+ /// Required to get 32-bit and 64-bit processes to automatically use the
+ /// appropriate native library.
+ ///
+ ///
+ ///
+ [DllImport("kernel32.dll")]
+ public static extern IntPtr LoadLibrary(string dllToLoad);
+
+ ///
+ /// Determine whether the current process is 64 bit
+ ///
+ /// true if so, false if not
+ public static bool Is64BitProcess()
+ {
+ return IntPtr.Size == 8;
}
#region FireAndForget Threading Pattern
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
index 3763696..8587a2b 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
@@ -30,7 +30,8 @@ using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Nini.Config;
-using log4net;
+using log4net;
+using OpenSim.Framework;
namespace OpenSim.Region.Physics.Manager
{
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 716161a..6ee2714 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Physics.OdePlugin
///
public class OdePlugin : IPhysicsPlugin
{
- //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private OdeScene m_scene;
@@ -59,13 +59,33 @@ namespace OpenSim.Region.Physics.OdePlugin
{
if (m_scene == null)
{
+ // We do this so that OpenSimulator on Windows loads the correct native ODE library depending on whether
+ // it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
+ // will find it already loaded later on.
+ //
+ // This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
+ // controlled in Ode.NET.dll.config
+ if (Util.IsWindows())
+ {
+ string nativeLibraryPath;
+
+ if (Util.Is64BitProcess())
+ nativeLibraryPath = "lib64/ode.dll";
+ else
+ nativeLibraryPath = "lib32/ode.dll";
+
+ m_log.DebugFormat("[ODE PLUGIN]: Loading native Windows ODE library at {0}", nativeLibraryPath);
+ Util.LoadLibrary(nativeLibraryPath);
+ }
+
// Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
// http://opensimulator.org/mantis/view.php?id=2750).
d.InitODE();
m_scene = new OdeScene(sceneIdentifier);
}
- return (m_scene);
+
+ return m_scene;
}
public string GetName()
--
cgit v1.1
From 8f8b478d366199eea49181f8d7ed0578f9e26bf7 Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Fri, 17 Feb 2012 20:04:38 -0500
Subject: Parcel sales support to SQLite
---
OpenSim/Data/SQLite/Resources/RegionStore.migrations | 8 +++++++-
OpenSim/Data/SQLite/SQLiteSimulationData.cs | 3 +++
2 files changed, 10 insertions(+), 1 deletion(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
index a00a8fb..1ceddf9 100644
--- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations
+++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
@@ -557,4 +557,10 @@ CREATE TABLE IF NOT EXISTS `spawn_points` (
ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
-COMMIT;
\ No newline at end of file
+COMMIT;
+
+:VERSION 25
+
+BEGIN;
+ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
+COMMIT;
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 83f803b..6295113 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -1346,6 +1346,7 @@ namespace OpenSim.Data.SQLite
createCol(regionsettings, "covenant_datetime", typeof(Int32));
createCol(regionsettings, "map_tile_ID", typeof(String));
createCol(regionsettings, "TelehubObject", typeof(String));
+ createCol(regionsettings, "parcel_tile_ID", typeof(String));
regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] };
return regionsettings;
}
@@ -1759,6 +1760,7 @@ namespace OpenSim.Data.SQLite
newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]);
newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]);
newSettings.TelehubObject = new UUID((String)row["TelehubObject"]);
+ newSettings.ParcelImageID = new UUID((String)row["parcel_tile_ID"]);
return newSettings;
}
@@ -2162,6 +2164,7 @@ namespace OpenSim.Data.SQLite
row["covenant_datetime"] = settings.CovenantChangedDateTime;
row["map_tile_ID"] = settings.TerrainImageID.ToString();
row["TelehubObject"] = settings.TelehubObject.ToString();
+ row["parcel_tile_ID"] = settings.ParcelImageID.ToString();
}
///
--
cgit v1.1
From 84184708de7f5663cabb3cf652c4f9922a14bf40 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 18 Feb 2012 01:15:43 +0000
Subject: Fix a bug where changing shape parameters of a child prim in a
linkset would not persist.
Resolves http://opensimulator.org/mantis/view.php?id=5819
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index e66678a..66fb493 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1592,7 +1592,7 @@ namespace OpenSim.Region.Framework.Scenes
if (group != null)
{
- if (m_parentScene.Permissions.CanEditObject(group.UUID,agentID))
+ if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID))
{
group.UpdateExtraParam(primLocalID, type, inUse, data);
}
@@ -1609,7 +1609,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroup group = GetGroupByPrim(primLocalID);
if (group != null)
{
- if (m_parentScene.Permissions.CanEditObject(group.GetPartsFullID(primLocalID), agentID))
+ if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID))
{
ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock();
shapeData.ObjectLocalID = shapeBlock.ObjectLocalID;
--
cgit v1.1
From 9846a1e56e28a5668d4a0a4076f02a9e359eef1a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 18 Feb 2012 02:52:29 +0000
Subject: Report an error if the required native Windows ODE library can't be
found.
---
OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 6ee2714..e8bb476 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -75,7 +75,10 @@ namespace OpenSim.Region.Physics.OdePlugin
nativeLibraryPath = "lib32/ode.dll";
m_log.DebugFormat("[ODE PLUGIN]: Loading native Windows ODE library at {0}", nativeLibraryPath);
- Util.LoadLibrary(nativeLibraryPath);
+
+ if (Util.LoadLibrary(nativeLibraryPath) == IntPtr.Zero)
+ m_log.ErrorFormat(
+ "[ODE PLUGIN]: Couldn't find native Windows ODE library at {0}", nativeLibraryPath);
}
// Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
--
cgit v1.1
From 7bdcf9eb26842af57e31f3cecd4f403a39a27bc0 Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Sat, 18 Feb 2012 00:32:09 -0500
Subject: Propagate our teleport flags on logins
---
OpenSim/Region/Framework/Scenes/Scene.cs | 5 ++++-
OpenSim/Services/HypergridService/GatekeeperService.cs | 8 ++++++--
OpenSim/Services/LLLoginService/LLLoginService.cs | 2 ++
3 files changed, 12 insertions(+), 3 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index ecc553d..841be96 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3261,6 +3261,9 @@ namespace OpenSim.Region.Framework.Scenes
{
bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 ||
(teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0);
+ bool viahome = ((teleportFlags & (uint)Constants.TeleportFlags.ViaHome) != 0);
+ bool godlike = ((teleportFlags & (uint)Constants.TeleportFlags.Godlike) != 0);
+
reason = String.Empty;
//Teleport flags:
@@ -3429,7 +3432,7 @@ namespace OpenSim.Region.Framework.Scenes
}
// Honor Estate teleport routing via Telehubs
- if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && RegionInfo.EstateSettings.AllowDirectTeleport == false)
+ if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && RegionInfo.EstateSettings.AllowDirectTeleport == false && !viahome && !godlike)
{
SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
// Can have multiple SpawnPoints
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 5d99c79..0a59f86 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -188,9 +188,9 @@ namespace OpenSim.Services.HypergridService
string authURL = string.Empty;
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
authURL = aCircuit.ServiceURLs["HomeURI"].ToString();
- m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9}",
+ m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9} Teleport Flags {10}",
aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName,
- aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0);
+ aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.ToString());
//
// Check client
@@ -315,6 +315,10 @@ namespace OpenSim.Services.HypergridService
// Finally launch the agent at the destination
//
Constants.TeleportFlags loginFlag = isFirstLogin ? Constants.TeleportFlags.ViaLogin : Constants.TeleportFlags.ViaHGLogin;
+
+ // Preserve our TeleportFlags we have gathered so-far
+ loginFlag |= (Constants.TeleportFlags) aCircuit.teleportFlags;
+
m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag);
return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
}
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 02b5cc1..5dff512 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -465,6 +465,7 @@ namespace OpenSim.Services.LLLoginService
position = pinfo.HomePosition;
lookAt = pinfo.HomeLookAt;
+ flags |= TeleportFlags.ViaHome;
}
if (tryDefaults)
@@ -753,6 +754,7 @@ namespace OpenSim.Services.LLLoginService
{
circuitCode = (uint)Util.RandomClass.Next(); ;
aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0);
+ aCircuit.teleportFlags |= (uint)flags;
success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason);
if (!success && m_GridService != null)
{
--
cgit v1.1
From f4cd35322f59b7aae548595541abaa80deefc74d Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Sat, 18 Feb 2012 00:45:43 -0500
Subject: Route logins according to Estate, Telehub and TeleportFlags
---
OpenSim/Region/Framework/Scenes/Scene.cs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 841be96..13c866d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3431,8 +3431,10 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- // Honor Estate teleport routing via Telehubs
- if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && RegionInfo.EstateSettings.AllowDirectTeleport == false && !viahome && !godlike)
+ // Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags
+ if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero &&
+ RegionInfo.EstateSettings.AllowDirectTeleport == false &&
+ !viahome && !godlike)
{
SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
// Can have multiple SpawnPoints
--
cgit v1.1
From 2ffc055f7ead4e6b07b82bcc47748295595d350d Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sat, 18 Feb 2012 21:59:42 -0800
Subject: This should smooth movement in heteregeneous networks by a lot: cache
the region by position instead of looking it up all the time -- this was
being done during the main update loop!
---
.../ServiceConnectorsOut/Grid/RegionInfoCache.cs | 34 +++++++++++++++++++++-
.../Grid/RemoteGridServiceConnector.cs | 8 ++++-
2 files changed, 40 insertions(+), 2 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs
index 786e0b5..be8a9a2 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs
@@ -65,13 +65,26 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
}
}
+ internal struct ScopedRegionPosition
+ {
+ public UUID m_scopeID;
+ public ulong m_regionHandle;
+ public ScopedRegionPosition(UUID scopeID, ulong handle)
+ {
+ m_scopeID = scopeID;
+ m_regionHandle = handle;
+ }
+ }
+
private ExpiringCache m_UUIDCache;
private ExpiringCache m_NameCache;
+ private ExpiringCache m_PositionCache;
public RegionInfoCache()
{
m_UUIDCache = new ExpiringCache();
- m_NameCache = new ExpiringCache();
+ m_NameCache = new ExpiringCache();
+ m_PositionCache = new ExpiringCache();
}
public void Cache(GridRegion rinfo)
@@ -96,6 +109,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
{
ScopedRegionName name = new ScopedRegionName(scopeID,rinfo.RegionName);
m_NameCache.AddOrUpdate(name, id, CACHE_EXPIRATION_SECONDS);
+
+ ScopedRegionPosition pos = new ScopedRegionPosition(scopeID, rinfo.RegionHandle);
+ m_PositionCache.AddOrUpdate(pos, rinfo, CACHE_EXPIRATION_SECONDS);
}
}
@@ -114,6 +130,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return null;
}
+ public GridRegion Get(UUID scopeID, ulong handle, out bool inCache)
+ {
+ inCache = false;
+
+ GridRegion rinfo = null;
+ ScopedRegionPosition pos = new ScopedRegionPosition(scopeID, handle);
+ if (m_PositionCache.TryGetValue(pos, out rinfo))
+ {
+ inCache = true;
+ return rinfo;
+ }
+
+ return null;
+ }
+
+
public GridRegion Get(UUID scopeID, string name, out bool inCache)
{
inCache = false;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
index 6f364ae..e6c89d7 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
@@ -186,10 +186,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
{
- GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
+ bool inCache = false;
+ GridRegion rinfo = m_RegionInfoCache.Get(scopeID, Util.UIntsToLong((uint)x, (uint)y), out inCache);
+ if (inCache)
+ return rinfo;
+
+ rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
if (rinfo == null)
rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y);
+ m_RegionInfoCache.Cache(rinfo);
return rinfo;
}
--
cgit v1.1
From a114367b9b24496bdaaeeeb037e99885ec6f511b Mon Sep 17 00:00:00 2001
From: PixelTomsen
Date: Sun, 19 Feb 2012 08:51:40 +0100
Subject: Fix:OmegaX, OmegaY and OmegaZ not saved for child prims
http://opensimulator.org/mantis/view.php?id=5893
Signed-off-by: nebadon
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index b130bf7..65905a0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1556,9 +1556,9 @@ namespace OpenSim.Region.Framework.Scenes
dupe.GroupPosition = GroupPosition;
dupe.OffsetPosition = OffsetPosition;
dupe.RotationOffset = RotationOffset;
- dupe.Velocity = new Vector3(0, 0, 0);
- dupe.Acceleration = new Vector3(0, 0, 0);
- dupe.AngularVelocity = new Vector3(0, 0, 0);
+ dupe.Velocity = Velocity;
+ dupe.Acceleration = Acceleration;
+ dupe.AngularVelocity = AngularVelocity;
dupe.Flags = Flags;
dupe.OwnershipCost = OwnershipCost;
--
cgit v1.1
From d22715126c05307ce5f91816ea5754b7884ff11d Mon Sep 17 00:00:00 2001
From: PixelTomsen
Date: Sun, 19 Feb 2012 09:53:50 +0100
Subject: Fix:Fly setting for Parcel dosen't work
http://opensimulator.org/mantis/view.php?id=5887
Signed-off-by: nebadon
---
OpenSim/Region/CoreModules/World/Land/LandObject.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index d146901..cc42f7f 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -272,7 +272,8 @@ namespace OpenSim.Region.CoreModules.World.Land
ParcelFlags.AllowGroupScripts |
ParcelFlags.CreateGroupObjects |
ParcelFlags.AllowAPrimitiveEntry |
- ParcelFlags.AllowGroupObjectEntry);
+ ParcelFlags.AllowGroupObjectEntry |
+ ParcelFlags.AllowFly);
}
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale))
--
cgit v1.1