From 7c566dca5a41cd3a9cb0336b00bdf7d63e24d2e9 Mon Sep 17 00:00:00 2001 From: Mandarinka Tasty Date: Sun, 4 Dec 2016 07:10:13 +0100 Subject: The new Constant: integer OBJECT_REZZER_KEY = 32; Signed-off-by: Mandarinka Tasty Signed-off-by: UbitUmarov --- OpenSim/Data/MySQL/MySQLSimulationData.cs | 9 +++++++-- OpenSim/Data/MySQL/Resources/RegionStore.migrations | 8 ++++++++ OpenSim/Data/SQLite/Resources/RegionStore.migrations | 8 ++++++++ OpenSim/Data/SQLite/SQLiteSimulationData.cs | 3 +++ OpenSim/Framework/TaskInventoryItem.cs | 11 +++++++++++ .../Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 2 ++ .../Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs | 1 + .../Framework/InventoryAccess/InventoryAccessModule.cs | 2 ++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 ++ OpenSim/Region/Framework/Scenes/SceneGraph.cs | 1 + OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 ++++++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 10 +++++++++- .../Framework/Scenes/Serialization/SceneObjectSerializer.cs | 9 +++++++++ .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 ++++++ .../Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | 1 + 15 files changed, 76 insertions(+), 3 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index ab24b76..2aaa2ff 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -167,7 +167,7 @@ namespace OpenSim.Data.MySQL "SitTargetOrientY, SitTargetOrientZ, " + "RegionUUID, CreatorID, " + "OwnerID, GroupID, " + - "LastOwnerID, SceneGroupID, " + + "LastOwnerID, RezzerID, SceneGroupID, " + "PayPrice, PayButton1, " + "PayButton2, PayButton3, " + "PayButton4, LoopedSound, " + @@ -207,7 +207,7 @@ namespace OpenSim.Data.MySQL "?SitTargetOrientW, ?SitTargetOrientX, " + "?SitTargetOrientY, ?SitTargetOrientZ, " + "?RegionUUID, ?CreatorID, ?OwnerID, " + - "?GroupID, ?LastOwnerID, ?SceneGroupID, " + + "?GroupID, ?LastOwnerID, ?RezzerID, ?SceneGroupID, " + "?PayPrice, ?PayButton1, ?PayButton2, " + "?PayButton3, ?PayButton4, ?LoopedSound, " + "?LoopedSoundGain, ?TextureAnimation, " + @@ -1279,6 +1279,10 @@ namespace OpenSim.Data.MySQL prim.OwnerID = DBGuid.FromDB(row["OwnerID"]); prim.GroupID = DBGuid.FromDB(row["GroupID"]); prim.LastOwnerID = DBGuid.FromDB(row["LastOwnerID"]); + if (row["RezzerID"] != DBNull.Value) + prim.RezzerID = DBGuid.FromDB(row["RezzerID"]); + else + prim.RezzerID = UUID.Zero; // explicit conversion of integers is required, which sort // of sucks. No idea if there is a shortcut here or not. @@ -1682,6 +1686,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("OwnerID", prim.OwnerID.ToString()); cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString()); cmd.Parameters.AddWithValue("LastOwnerID", prim.LastOwnerID.ToString()); + cmd.Parameters.AddWithValue("RezzerID", prim.RezzerID.ToString()); cmd.Parameters.AddWithValue("OwnerMask", prim.OwnerMask); cmd.Parameters.AddWithValue("NextOwnerMask", prim.NextOwnerMask); cmd.Parameters.AddWithValue("GroupMask", prim.GroupMask); diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index edc04b9..2108c76 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations @@ -453,3 +453,11 @@ MODIFY `cloud_scroll_x` float(9,7) NOT NULL DEFAULT '0.20', MODIFY `cloud_scroll_y` float(9,7) NOT NULL DEFAULT '0.01'; COMMIT; + +:VERSION 56 #----- Add RezzerID field in table prims + +BEGIN; + +ALTER TABLE `prims` ADD COLUMN `RezzerID` char(36) DEFAULT NULL; + +COMMIT; diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index 64624db..eef14d6 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations @@ -363,3 +363,11 @@ CREATE TABLE IF NOT EXISTS bakedterrain( Heightfield blob); COMMIT; + +:VERSION 35 #----- Add RezzerID field in table prims + +BEGIN; + +ALTER TABLE `prims` ADD COLUMN `RezzerID` char(36) DEFAULT NULL; + +COMMIT; diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index c1c7b7e..5cfc202 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -1216,6 +1216,7 @@ namespace OpenSim.Data.SQLite createCol(prims, "OwnerID", typeof(String)); createCol(prims, "GroupID", typeof(String)); createCol(prims, "LastOwnerID", typeof(String)); + createCol(prims, "RezzerID", typeof(String)); createCol(prims, "OwnerMask", typeof(Int32)); createCol(prims, "NextOwnerMask", typeof(Int32)); createCol(prims, "GroupMask", typeof(Int32)); @@ -1679,6 +1680,7 @@ namespace OpenSim.Data.SQLite prim.OwnerID = new UUID((String)row["OwnerID"]); prim.GroupID = new UUID((String)row["GroupID"]); prim.LastOwnerID = new UUID((String)row["LastOwnerID"]); + prim.RezzerID = row["RezzerID"] == DBNull.Value ? UUID.Zero : new UUID((String)row["RezzerID"]); prim.OwnerMask = Convert.ToUInt32(row["OwnerMask"]); prim.NextOwnerMask = Convert.ToUInt32(row["NextOwnerMask"]); prim.GroupMask = Convert.ToUInt32(row["GroupMask"]); @@ -2125,6 +2127,7 @@ namespace OpenSim.Data.SQLite row["OwnerID"] = prim.OwnerID.ToString(); row["GroupID"] = prim.GroupID.ToString(); row["LastOwnerID"] = prim.LastOwnerID.ToString(); + row["RezzerID"] = prim.RezzerID.ToString(); row["OwnerMask"] = prim.OwnerMask; row["NextOwnerMask"] = prim.NextOwnerMask; row["GroupMask"] = prim.GroupMask; diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index 2ec4bd1..b195bbe 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs @@ -59,6 +59,7 @@ namespace OpenSim.Framework private int _invType = 0; private UUID _itemID = UUID.Zero; private UUID _lastOwnerID = UUID.Zero; + private UUID _rezzerID = UUID.Zero; private string _name = String.Empty; private uint _nextOwnerMask = FULL_MASK_PERMISSIONS_GENERAL; private UUID _ownerID = UUID.Zero; @@ -254,6 +255,16 @@ namespace OpenSim.Framework } } + public UUID RezzerID + { + get { + return _rezzerID; + } + set { + _rezzerID = value; + } + } + public string Name { get { return _name; diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 2481d11..032104d 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -1046,6 +1046,7 @@ namespace OpenSim.Region.ClientStack.Linden prim.OwnerID = owner_id; prim.GroupID = UUID.Zero; prim.LastOwnerID = creatorID; + prim.RezzerID = creatorID; prim.CreationDate = Util.UnixTimeSinceEpoch(); if (grp == null) @@ -1093,6 +1094,7 @@ namespace OpenSim.Region.ClientStack.Linden { grp = new SceneObjectGroup(prim); grp.LastOwnerID = creatorID; + grp.RezzerID = creatorID; } else grp.AddPart(prim); diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs index 769fe28..713125c 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs @@ -284,6 +284,7 @@ namespace OpenSim.Region.ClientStack.Linden prim.OwnerID = AgentId; prim.GroupID = obj.GroupID; prim.LastOwnerID = prim.OwnerID; + prim.RezzerID = AgentId; prim.CreationDate = Util.UnixTimeSinceEpoch(); prim.Name = obj.Name; prim.Description = ""; diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index fa7803f..771e5fe 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -981,6 +981,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset. part.LastOwnerID = part.OwnerID; part.OwnerID = remoteClient.AgentId; + part.RezzerID = remoteClient.AgentId; } } @@ -1150,6 +1151,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess part.LastOwnerID = part.OwnerID; part.OwnerID = item.Owner; + part.RezzerID = item.Owner; part.Inventory.ChangeInventoryOwner(item.Owner); } diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 339fc15..daf7741 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2625,6 +2625,8 @@ namespace OpenSim.Region.Framework.Scenes } group.FromPartID = sourcePart.UUID; + group.RezzerID = group.FromPartID; + if( i == 0) AddNewSceneObject(group, true, curpos, rot, vel); else diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index f5f83ca..579874a 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1942,6 +1942,7 @@ namespace OpenSim.Region.Framework.Scenes else { part.LastOwnerID = part.ParentGroup.RootPart.LastOwnerID; + part.RezzerID = part.ParentGroup.RootPart.RezzerID; childParts.Add(part); } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6cdbac5..fcbcc3f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -886,6 +886,12 @@ namespace OpenSim.Region.Framework.Scenes set { m_rootPart.LastOwnerID = value; } } + public UUID RezzerID + { + get { return m_rootPart.RezzerID; } + set { m_rootPart.RezzerID = value; } + } + public UUID OwnerID { get { return m_rootPart.OwnerID; } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 3a06e7d..b95b5be 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -460,7 +460,7 @@ namespace OpenSim.Region.Framework.Scenes m_name = "Object"; CreationDate = (int)Utils.DateTimeToUnixTime(Rezzed); - LastOwnerID = CreatorID = OwnerID = ownerID; + RezzerID = LastOwnerID = CreatorID = OwnerID = ownerID; UUID = UUID.Random(); Shape = shape; OwnershipCost = 0; @@ -484,6 +484,7 @@ namespace OpenSim.Region.Framework.Scenes #region XML Schema + private UUID _rezzerID; private UUID _lastOwnerID; private UUID _ownerID; private UUID _groupID; @@ -1385,6 +1386,12 @@ namespace OpenSim.Region.Framework.Scenes set { _lastOwnerID = value; } } + public UUID RezzerID + { + get { return _rezzerID; } + set { _rezzerID = value; } + } + public uint BaseMask { get { return _baseMask; } @@ -2222,6 +2229,7 @@ namespace OpenSim.Region.Framework.Scenes // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. dupe.LastOwnerID = OwnerID; + dupe.RezzerID = RezzerID; byte[] extraP = new byte[Shape.ExtraParams.Length]; Array.Copy(Shape.ExtraParams, extraP, extraP.Length); diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 7d3a168..0b7379b 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -428,6 +428,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization m_SOPXmlProcessors.Add("GroupID", ProcessGroupID); m_SOPXmlProcessors.Add("OwnerID", ProcessOwnerID); m_SOPXmlProcessors.Add("LastOwnerID", ProcessLastOwnerID); + m_SOPXmlProcessors.Add("RezzerID", ProcessRezzerID); m_SOPXmlProcessors.Add("BaseMask", ProcessBaseMask); m_SOPXmlProcessors.Add("OwnerMask", ProcessOwnerMask); m_SOPXmlProcessors.Add("GroupMask", ProcessGroupMask); @@ -864,6 +865,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization obj.LastOwnerID = Util.ReadUUID(reader, "LastOwnerID"); } + private static void ProcessRezzerID(SceneObjectPart obj, XmlReader reader) + { + obj.RezzerID = Util.ReadUUID(reader, "RezzerID"); + } + private static void ProcessBaseMask(SceneObjectPart obj, XmlReader reader) { obj.BaseMask = (uint)reader.ReadElementContentAsInt("BaseMask", String.Empty); @@ -1452,6 +1458,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization UUID lastOwnerID = options.ContainsKey("wipe-owners") ? UUID.Zero : sop.LastOwnerID; WriteUUID(writer, "LastOwnerID", lastOwnerID, options); + UUID rezzerID = options.ContainsKey("wipe-owners") ? UUID.Zero : sop.RezzerID; + WriteUUID(writer, "RezzerID", rezzerID, options); + writer.WriteElementString("BaseMask", sop.BaseMask.ToString()); writer.WriteElementString("OwnerMask", sop.OwnerMask.ToString()); writer.WriteElementString("GroupMask", sop.GroupMask.ToString()); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 763106f..71e8ca9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -13793,6 +13793,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } catch { }; ret.Add(new LSL_Integer(invcount)); break; + case ScriptBaseClass.OBJECT_REZZER_KEY: + ret.Add(new LSL_Key(id)); + break; case ScriptBaseClass.OBJECT_GROUP_TAG: ret.Add(new LSL_String(av.Grouptitle)); break; @@ -13988,6 +13991,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api count += parts[i].Inventory.Count; ret.Add(new LSL_Integer(count)); break; + case ScriptBaseClass.OBJECT_REZZER_KEY: + ret.Add(new LSL_Key(obj.ParentGroup.RezzerID.ToString())); + break; case ScriptBaseClass.OBJECT_GROUP_TAG: ret.Add(new LSL_String(String.Empty)); break; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 48afcc0..734d878 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -640,6 +640,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int OBJECT_OMEGA = 29; public const int OBJECT_PRIM_COUNT = 30; public const int OBJECT_TOTAL_INVENTORY_COUNT = 31; + public const int OBJECT_REZZER_KEY = 32; public const int OBJECT_GROUP_TAG = 33; public const int OBJECT_TEMP_ATTACHED = 34; -- cgit v1.1