Skip to content

Commit

Permalink
Merge changes from 8738 release into dotnet6 branch. Includes fixes a…
Browse files Browse the repository at this point in the history
…nd the Linksetdata changes. a few small changes due to later version of C# standard.
  • Loading branch information
mdickson committed Dec 6, 2023
2 parents 754ee54 + 26af79f commit cc3dcdc
Show file tree
Hide file tree
Showing 19 changed files with 1,195 additions and 17 deletions.
20 changes: 18 additions & 2 deletions OpenSim/Data/MySQL/MySQLSimulationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ public virtual void StoreObject(SceneObjectGroup obj, UUID regionUUID)
"AttachedPosY, AttachedPosZ, " +
"PhysicsShapeType, Density, GravityModifier, " +
"Friction, Restitution, Vehicle, PhysInertia, DynAttrs, " +
"RotationAxisLocks, sopanims, sitactrange, pseudocrc" +
"RotationAxisLocks, sopanims, sitactrange, pseudocrc, " +
"linksetdata" +
") values (" + "?UUID, " +
"?CreationDate, ?Name, ?Text, " +
"?Description, ?SitName, ?TouchName, " +
Expand Down Expand Up @@ -212,7 +213,8 @@ public virtual void StoreObject(SceneObjectGroup obj, UUID regionUUID)
"?AttachedPosY, ?AttachedPosZ, " +
"?PhysicsShapeType, ?Density, ?GravityModifier, " +
"?Friction, ?Restitution, ?Vehicle, ?PhysInertia, ?DynAttrs," +
"?RotationAxisLocks, ?sopanims, ?sitactrange, ?pseudocrc)";
"?RotationAxisLocks, ?sopanims, ?sitactrange, ?pseudocrc, " +
"?linksetdata)";

FillPrimCommand(cmd, prim, obj.UUID, regionUUID);

Expand Down Expand Up @@ -1196,6 +1198,11 @@ private SceneObjectPart BuildPrim(IDataReader row)
if(pseudocrc != 0)
prim.PseudoCRC = pseudocrc;

if (!(row["linksetdata"] is DBNull))
{
prim.DeserializeLinksetData((string)row["linksetdata"]);
}

return prim;
}

Expand Down Expand Up @@ -1616,6 +1623,15 @@ private void FillPrimCommand(MySqlCommand cmd, SceneObjectPart prim, UUID sceneG

cmd.Parameters.AddWithValue("sitactrange", prim.SitActiveRange);
cmd.Parameters.AddWithValue("pseudocrc", prim.PseudoCRC);

if (prim.LinksetData != null)
{
cmd.Parameters.AddWithValue("linksetdata", prim.SerializeLinksetData());
}
else
{
cmd.Parameters.AddWithValue("linksetdata", null);
}
}

/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions OpenSim/Data/MySQL/Resources/RegionStore.migrations
Original file line number Diff line number Diff line change
Expand Up @@ -553,3 +553,8 @@ COMMIT;
:VERSION 64 #----- material overrides
ALTER TABLE `primshapes` ADD COLUMN `MatOvrd` blob default NULL;
COMMIT;

:VERSION 65 #----- add linkset data storage column
BEGIN;
ALTER TABLE `prims` ADD COLUMN `linksetdata` MEDIUMTEXT default NULL;
COMMIT;
15 changes: 11 additions & 4 deletions OpenSim/Data/PGSQL/PGSQLSimulationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ UPDATE prims SET
""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches,
""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs, ""Vehicle"" = :Vehicle,
""PhysInertia"" = :PhysInertia, ""standtargetx"" =:standtargetx, ""standtargety"" =:standtargety, ""standtargetz"" =:standtargetz,
""sitactrange"" =:sitactrange, ""pseudocrc"" = :pseudocrc, ""sopanims"" = :sopanims
""sitactrange"" =:sitactrange, ""pseudocrc"" = :pseudocrc, ""sopanims"" = :sopanims,
""linksetdata"" =:linksetdata
WHERE ""UUID"" = :UUID ;
INSERT INTO
Expand All @@ -371,7 +371,7 @@ INSERT INTO
""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"",
""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"",
""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution"", ""PassCollisions"", ""RotationAxisLocks"", ""RezzerID"" , ""Vehicle"", ""PhysInertia"",
""standtargetx"", ""standtargety"", ""standtargetz"", ""sitactrange"", ""pseudocrc"",""sopanims""
""standtargetx"", ""standtargety"", ""standtargetz"", ""sitactrange"", ""pseudocrc"", ""sopanims"", ""linksetdata""
) Select
:UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask,
:EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX,
Expand All @@ -383,7 +383,7 @@ INSERT INTO
:ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA,
:ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs,
:PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution, :PassCollisions, :RotationAxisLocks, :RezzerID, :Vehicle, :PhysInertia,
:standtargetx, :standtargety, :standtargetz,:sitactrange, :pseudocrc, :sopanims
:standtargetx, :standtargety, :standtargetz,:sitactrange, :pseudocrc, :sopanims, :LinksetData
where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID);
";

Expand Down Expand Up @@ -1410,6 +1410,11 @@ private static SceneObjectPart BuildPrim(IDataRecord primRow)
prim.Animations = null;
}

if ((primRow["LinksetData"] is DBNull) == false)
{
prim.DeserializeLinksetData(((string)primRow["linksetdata"]));
}

return prim;
}

Expand Down Expand Up @@ -1879,6 +1884,8 @@ private NpgsqlParameter[] CreatePrimParameters(SceneObjectPart prim, UUID sceneG
else
parameters.Add(_Database.CreateParameter("sopanims", null));

parameters.Add(_Database.CreateParameter("linksetdata", prim.SerializeLinksetData()));

return parameters.ToArray();
}

Expand Down
5 changes: 5 additions & 0 deletions OpenSim/Data/PGSQL/Resources/RegionStore.migrations
Original file line number Diff line number Diff line change
Expand Up @@ -1261,3 +1261,8 @@ BEGIN;
ALTER TABLE `prims` ADD COLUMN `sopanims` bytea NULL;
ALTER TABLE `primshapes` ADD COLUMN `MatOvrd` bytea NULL;
COMMIT;

:VERSION 53 #----- add linkset data storage column
BEGIN;
ALTER TABLE `prims` ADD COLUMN `linksetdata` varchar default NULL;
COMMIT;
5 changes: 5 additions & 0 deletions OpenSim/Data/SQLite/Resources/RegionStore.migrations
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,8 @@ BEGIN;
ALTER TABLE `prims` ADD COLUMN `sopanims` blob default NULL;
ALTER TABLE `primshapes` ADD COLUMN `MatOvrd` blob default NULL;
COMMIT;

:VERSION 41 #----- add linkset data storage column
BEGIN;
ALTER TABLE `prims` ADD COLUMN `linksetdata` TEXT default NULL;
COMMIT;
8 changes: 8 additions & 0 deletions OpenSim/Data/SQLite/SQLiteSimulationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,8 @@ private static DataTable createPrimTable()
createCol(prims, "pseudocrc", typeof(int));
createCol(prims, "sopanims", typeof(byte[]));

createCol(prims, "linksetdata", typeof(string));

// Add in contraints
prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] };

Expand Down Expand Up @@ -1809,6 +1811,11 @@ private SceneObjectPart buildPrim(DataRow row)
prim.Animations = null;
}

if (!(row["linksetdata"] is DBNull))
{
prim.DeserializeLinksetData((string)row["LinksetData"]);
}

return prim;
}

Expand Down Expand Up @@ -2202,6 +2209,7 @@ private static void fillPrimRow(DataRow row, SceneObjectPart prim, UUID sceneGro
row["pseudocrc"] = prim.PseudoCRC;
row["sopanims"] = prim.SerializeAnimations();

row["linksetdata"] = prim.SerializeLinksetData();
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Framework/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class VersionInfo
{
public const string VersionNumber = "0.9.3.0";
public const string AssemblyVersionNumber = "0.9.3.0";
public const string Release = "8704";
public const string Release = "8740";

public const int VERSIONINFO_VERSION_LENGTH = 48;

Expand Down
1 change: 1 addition & 0 deletions OpenSim/Region/Framework/OpenSim.Region.Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@
<PackageReference Include="log4net" Version="2.0.15" />
<PackageReference Include="RawScape.Nini" Version="1.0.0" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="System.Text.Json" Version="6.0.9" />
</ItemGroup>
</Project>
Loading

0 comments on commit cc3dcdc

Please sign in to comment.