From 7b446aba9174aac68c62ec40c2115a1e1f012191 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 4 May 2008 22:55:52 +0000 Subject: * Implemented DIE_AT_EDGE and Temporary objects don't save to the database. --- OpenSim/Data/MSSQL/MSSQLDataStore.cs | 4 +++- OpenSim/Data/MySQL/MySQLDataStore.cs | 4 +++- OpenSim/Data/SQLite/SQLiteRegionData.cs | 4 +++- OpenSim/Region/Environment/Scenes/Scene.cs | 19 +++++++++++++++++++ OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 20 ++++++++++++++++++++ .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 13 ++++++++++--- 6 files changed, 58 insertions(+), 6 deletions(-) diff --git a/OpenSim/Data/MSSQL/MSSQLDataStore.cs b/OpenSim/Data/MSSQL/MSSQLDataStore.cs index 44bc660..125501b 100644 --- a/OpenSim/Data/MSSQL/MSSQLDataStore.cs +++ b/OpenSim/Data/MSSQL/MSSQLDataStore.cs @@ -152,7 +152,9 @@ namespace OpenSim.Data.MSSQL { foreach (SceneObjectPart prim in obj.Children.Values) { - if ((prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == 0) + if ((prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == 0 + && (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Temporary) == 0 + && (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.TemporaryOnRez) == 0) { m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); addPrim(prim, obj.UUID, regionUUID); diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs index c3fe332..ac0d382 100644 --- a/OpenSim/Data/MySQL/MySQLDataStore.cs +++ b/OpenSim/Data/MySQL/MySQLDataStore.cs @@ -254,7 +254,9 @@ namespace OpenSim.Data.MySQL { foreach (SceneObjectPart prim in obj.Children.Values) { - if ((prim.GetEffectiveObjectFlags() & (uint) LLObject.ObjectFlags.Physics) == 0) + if ((prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == 0 + && (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Temporary) == 0 + && (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.TemporaryOnRez) == 0) { m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); addPrim(prim, obj.UUID, regionUUID); diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index b648ee8..f1694ca 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -183,7 +183,9 @@ namespace OpenSim.Data.SQLite { foreach (SceneObjectPart prim in obj.Children.Values) { - if ((prim.GetEffectiveObjectFlags() & (uint) LLObject.ObjectFlags.Physics) == 0) + if ((prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == 0 + && (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Temporary) == 0 + && (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.TemporaryOnRez) == 0) { m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID)); diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 3cc2cbc..33a9102 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1352,6 +1352,25 @@ namespace OpenSim.Region.Environment.Scenes public void CrossPrimGroupIntoNewRegion(LLVector3 position, SceneObjectGroup grp) { + if (grp == null) + return; + if (grp.RootPart == null) + return; + + if (grp.RootPart.DIE_AT_EDGE) + { + // We remove the object here + try + { + DeleteSceneObjectGroup(grp); + } + catch (Exception) + { + m_log.Warn("[DATABASE]: exception when trying to remove the prim that crossed the border."); + } + return; + } + m_log.Warn("Prim crossing: " + grp.UUID.ToString()); int thisx = (int)RegionInfo.RegionLocX; int thisy = (int)RegionInfo.RegionLocY; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 9b4f9af..9311904 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -101,6 +101,7 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] private Dictionary m_scriptEvents = new Dictionary(); [XmlIgnore] public scriptEvents m_aggregateScriptEvents=0; [XmlIgnore] private LLObject.ObjectFlags LocalFlags = LLObject.ObjectFlags.None; + [XmlIgnore] public bool DIE_AT_EDGE = false; [XmlIgnore] public bool m_IsAttachment = false; @@ -2733,6 +2734,25 @@ namespace OpenSim.Region.Environment.Scenes //} } + + public void SetDieAtEdge(bool p) + { + if (m_parentGroup == null) + return; + if (m_parentGroup.RootPart == null) + return; + + m_parentGroup.RootPart.DIE_AT_EDGE = p; + } + public bool GetDieAtEdge() + { + if (m_parentGroup == null) + return false; + if (m_parentGroup.RootPart == null) + return false; + + return m_parentGroup.RootPart.DIE_AT_EDGE; + } } } diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 7649ff3..f0108f8 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -844,7 +844,10 @@ namespace OpenSim.Region.ScriptEngine.Common } if ((status & BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE) == BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE) { - NotImplemented("llSetStatus - STATUS_DIE_AT_EDGE"); + if (value == 1) + m_host.SetDieAtEdge(true); + else + m_host.SetDieAtEdge(false); } if ((status & BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE) == BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE) { @@ -890,8 +893,12 @@ namespace OpenSim.Region.ScriptEngine.Common NotImplemented("llGetStatus - STATUS_BLOCK_GRAB"); return 0; case BuiltIn_Commands_BaseClass.STATUS_DIE_AT_EDGE: - NotImplemented("llGetStatus - STATUS_DIE_AT_EDGE"); - return 0; + + if (m_host.GetDieAtEdge()) + return 1; + else + return 0; + case BuiltIn_Commands_BaseClass.STATUS_RETURN_AT_EDGE: NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE"); return 0; -- cgit v1.1