Merge branch 'master' into careminster

Conflicts:
	OpenSim/Framework/Servers/BaseOpenSimServer.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
This commit is contained in:
Melanie
2013-03-15 23:45:32 +00:00
25 changed files with 474 additions and 339 deletions

View File

@@ -39,7 +39,7 @@ using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.Framework.DynamicAttributes.DAExampleModule
namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DAExampleModule")]
public class DAExampleModule : INonSharedRegionModule
@@ -48,6 +48,8 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DAExampleModule
private static readonly bool ENABLED = false; // enable for testing
public const string DANamespace = "DAExample Module";
protected Scene m_scene;
protected IDialogModule m_dialogMod;
@@ -89,7 +91,7 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DAExampleModule
if (sop == null)
return true;
if (!sop.DynAttrs.TryGetValue(Name, out attrs))
if (!sop.DynAttrs.TryGetValue(DANamespace, out attrs))
attrs = new OSDMap();
OSDInteger newValue;
@@ -104,8 +106,10 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DAExampleModule
attrs["moves"] = newValue;
sop.DynAttrs[Name] = attrs;
sop.DynAttrs[DANamespace] = attrs;
}
sop.ParentGroup.HasGroupChanged = true;
m_dialogMod.SendGeneralAlert(string.Format("{0} {1} moved {2} times", sop.Name, sop.UUID, newValue));

View File

@@ -36,6 +36,7 @@ using OpenMetaverse.Packets;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Region.Framework;
using OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
@@ -50,9 +51,14 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule
public class MyObject
{
public int Moves { get; set; }
public MyObject(int moves)
{
Moves = moves;
}
}
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly bool ENABLED = false; // enable for testing
@@ -92,7 +98,23 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule
private void OnObjectAddedToScene(SceneObjectGroup so)
{
so.RootPart.DynObjs.Add(Name, new MyObject());
SceneObjectPart rootPart = so.RootPart;
OSDMap attrs;
int movesSoFar = 0;
// Console.WriteLine("Here for {0}", so.Name);
if (rootPart.DynAttrs.TryGetValue(DAExampleModule.DANamespace, out attrs))
{
movesSoFar = attrs["moves"].AsInteger();
m_log.DebugFormat(
"[DO EXAMPLE MODULE]: Found saved moves {0} for {1} in {2}", movesSoFar, so.Name, m_scene.Name);
}
rootPart.DynObjs.Add(Name, new MyObject(movesSoFar));
}
private bool OnSceneGroupMove(UUID groupId, Vector3 delta)

View File

@@ -95,6 +95,11 @@ namespace OpenSim.Region.CoreModules.World.Land
return null;
}
public ILandObject GetLandObject(Vector3 position)
{
return GetLandObject(position.X, position.Y);
}
public ILandObject GetLandObject(int x, int y)
{
if (m_landManagementModule != null)