Skip to content

Commit

Permalink
Merge branch 'release/0.9.3.0.8915'
Browse files Browse the repository at this point in the history
  • Loading branch information
mdickson committed Jun 7, 2024
2 parents 5ad24f4 + 3891738 commit 10f37a5
Show file tree
Hide file tree
Showing 40 changed files with 448 additions and 6,067 deletions.
32 changes: 26 additions & 6 deletions .github/workflows/dotnetci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: .NET
name: dotnet package

on:
push:
Expand All @@ -8,16 +8,36 @@ on:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '8.0.x', '9.0.x' ]

steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
- uses: actions/checkout@v4

- name: Setup .NET ${{matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.*
dotnet-version: ${{ matrix.dotnet-version }}

- name: Display dotnet version
run: dotnet --version

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore
run: dotnet build --configuration Release

# - name: Run Tests
# run: dotnet test --logger "trx;LogFileName=<TestResults.trx>"
#
# - name: Create the package
# run: dotnet pack --configuration Release <my project>
# - name: Publish the package to GPR
# run: dotnet nuget push <my project>/bin/Release/*.nupkg
#
# - name: Publish the package to GPR
# run: dotnet nuget push <my project>/bin/Release/*.nupkg
8 changes: 8 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@
<OutputPath>$(SolutionDir)\build\$(Configuration)\$(AssemblyName)\</OutputPath>
<OutDir>$(OutputPath)</OutDir>
</PropertyGroup>

<!-- <ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup> -->

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<ItemGroup>
<PackageReference Include="log4net" Version="2.0.15" />
</ItemGroup>
<!-- <ItemGroup>
<EmbeddedResource Include="Resources\OpenSim.ApplicationPlugins.LoadRegions.addin.xml" />
</ItemGroup> -->
<ItemGroup>
<Reference Include="Nini">
<HintPath>..\..\..\bin\Nini.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
<PackageReference Include="Mono.Addins.Setup" Version="1.4.1" />
<PackageReference Include="Mono.Addins.CecilReflector" Version="1.4.1" />
</ItemGroup>
<!-- <ItemGroup>
<EmbeddedResource Include="Resources/OpenSim.ApplicationPlugins.RegionModulesController.addin.xml" />
</ItemGroup> -->
<ItemGroup>
<Reference Include="Nini">
<HintPath>..\..\..\bin\Nini.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<ItemGroup>
<PackageReference Include="log4net" Version="2.0.15" />
</ItemGroup>
<!-- <ItemGroup>
<EmbeddedResource Include="Resources/OpenSim.ApplicationPlugins.RemoteController.addin.xml" />
</ItemGroup> -->
<ItemGroup>
<Reference Include="Nini">
<HintPath>..\..\..\bin\Nini.dll</HintPath>
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Capabilities/OpenSim.Capabilities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
<Compile Remove="Handlers\FetchInventory\FetchInvDescServerConnector.cs" />
<Compile Remove="Handlers\FetchInventory\FetchInventory2Handler.cs" />
<Compile Remove="Handlers\FetchInventory\FetchInventory2ServerConnector.cs" />
<Compile Remove="Handlers\FetchInventory\FetchLib2Handler.cs" />
<Compile Remove="Handlers\FetchInventory\FetchLibDescHandler.cs" />
<Compile Remove="Handlers\FetchInventory\FetchLib2Handler.cs" />
<Compile Remove="Handlers\FetchInventory\FetchLibDescHandler.cs" />
<Compile Remove="Handlers\GetAssets\GetAssetsHandler.cs" />
<Compile Remove="Handlers\GetMesh\GetMeshHandler.cs" />
<Compile Remove="Handlers\GetMesh\GetMeshServerConnector.cs" />
Expand Down
7 changes: 4 additions & 3 deletions OpenSim/Data/MySQL/Resources/RegionStore.migrations
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,10 @@ BEGIN;
ALTER TABLE `land` ADD COLUMN `environment` MEDIUMTEXT default NULL;
COMMIT;

:VERSION 64 #----- material overrides
ALTER TABLE `primshapes` ADD COLUMN `MatOvrd` blob default NULL;
COMMIT;
:VERSION 64 #----- material overrides
BEGIN;
ALTER TABLE `primshapes` ADD COLUMN `MatOvrd` blob default NULL;
COMMIT;

:VERSION 65 #----- add linkset data storage column
BEGIN;
Expand Down
6 changes: 3 additions & 3 deletions OpenSim/Data/PGSQL/PGSQLEstateData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private void LoadBanList(EstateSettings es)
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
NpgsqlParameter idParameter = new NpgsqlParameter("EstateID", DbType.Int32);
idParameter.Value = es.EstateID;
idParameter.Value = (int)es.EstateID;
cmd.Parameters.Add(idParameter);
conn.Open();
using (NpgsqlDataReader reader = cmd.ExecuteReader())
Expand Down Expand Up @@ -324,7 +324,7 @@ private UUID[] LoadUUIDList(uint estateID, string table)
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("EstateID", estateID));
cmd.Parameters.Add(_Database.CreateParameter("EstateID", (int)estateID));
conn.Open();
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
Expand Down Expand Up @@ -397,7 +397,7 @@ public EstateSettings LoadEstateSettings(int estateID)
conn.Open();
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
cmd.Parameters.AddWithValue("EstateID", (int)estateID);
cmd.Parameters.AddWithValue("EstateID", estateID);
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
if (reader.Read())
Expand Down
4 changes: 1 addition & 3 deletions OpenSim/Data/PGSQL/PGSQLFramework.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ namespace OpenSim.Data.PGSQL
/// </summary>
public class PGSqlFramework
{
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);

protected string m_connectionString;
protected object m_dbLock = new object();
Expand Down
50 changes: 39 additions & 11 deletions OpenSim/Data/PGSQL/PGSQLManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ internal NpgsqlDbType DbtypeFromType(Type type)
{
return NpgsqlDbType.Double;
}
if (type == typeof(Single))
if (type == typeof(float))
{
return NpgsqlDbType.Double;
}
Expand Down Expand Up @@ -166,10 +166,6 @@ private static object CreateParameterValue(object value)
{
Type valueType = value.GetType();

if (valueType == typeof(UUID)) //TODO check if this works
{
return ((UUID) value).Guid;
}
if (valueType == typeof(UUID))
{
return ((UUID)value).Guid;
Expand All @@ -186,6 +182,14 @@ private static object CreateParameterValue(object value)
{
return value;
}
if (valueType == typeof(uint))
{
return (int)(uint)value;
}
if (valueType == typeof(ushort))
{
return (int)(ushort)value;
}
return value;
}

Expand All @@ -199,17 +203,26 @@ internal static object CreateParameterValue(object value, string PGFieldType)
{
if (PGFieldType == "uuid")
{
UUID uidout;
UUID.TryParse(value.ToString(), out uidout);
return uidout;
if(value is not UUID uid)
UUID.TryParse(value.ToString(), out uid);
return uid.Guid;
}
if (PGFieldType == "smallint" || PGFieldType == "smallserial")
{
short.TryParse(value.ToString(), out short sintout);
return sintout;
}
if (PGFieldType == "integer")
{
int intout;
int.TryParse(value.ToString(), out intout);
int.TryParse(value.ToString(), out int intout);
return intout;
}
if (PGFieldType == "boolean")
if (PGFieldType == "bigint")
{
long.TryParse(value.ToString(), out long lintout);
return lintout;
}
if (PGFieldType == "boolean" || PGFieldType == "bit")
{
return (value.ToString() == "true");
}
Expand All @@ -225,6 +238,9 @@ internal static object CreateParameterValue(object value, string PGFieldType)
{
return Convert.ToDouble(value);
}
if (PGFieldType == "character" || PGFieldType == "character varying" || PGFieldType == "text")
return value.ToString();

return CreateParameterValue(value);
}

Expand Down Expand Up @@ -269,6 +285,18 @@ internal NpgsqlParameter CreateParameter(string parameterName, object parameterO
return parameter;
}

internal NpgsqlParameter CreateParameterNullBytea(string parameterName)
{
//Tweak so we dont always have to add : sign
if (parameterName.StartsWith(":")) parameterName = parameterName.Replace(":", "");

//HACK if object is null, it is turned into a string, there are no nullable type till now
NpgsqlParameter parameter = new NpgsqlParameter(parameterName, NpgsqlDbType.Bytea);
parameter.Direction = ParameterDirection.Input;
parameter.Value = DBNull.Value;
return parameter;
}

/// <summary>
/// Create a parameter with PGSQL schema type
/// </summary>
Expand Down
18 changes: 15 additions & 3 deletions OpenSim/Data/PGSQL/PGSQLSimulationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
}
catch (NpgsqlException sqlEx)
{
_Log.ErrorFormat("[REGION DB]: Store SceneObjectPrim SQL error: {0} at line {1}", sqlEx.Message, sqlEx.Line);
_Log.Error($"[REGION DB]: Store SceneObjectPrim SQL error: {sqlEx.Message}");
throw;
}
}
Expand All @@ -288,7 +288,7 @@ public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
}
catch (NpgsqlException sqlEx)
{
_Log.ErrorFormat("[REGION DB]: Store SceneObjectPrimShapes SQL error: {0} at line {1}", sqlEx.Message, sqlEx.Line);
_Log.Error($"[REGION DB]: Store SceneObjectPrimShapes SQL error: {sqlEx.Message}");
throw;
}
}
Expand Down Expand Up @@ -1873,7 +1873,7 @@ private NpgsqlParameter[] CreatePrimParameters(SceneObjectPart prim, UUID sceneG
if (prim.Animations != null)
parameters.Add(_Database.CreateParameter("sopanims", prim.SerializeAnimations()));
else
parameters.Add(_Database.CreateParameter("sopanims", null));
parameters.Add(_Database.CreateParameterNullBytea("sopanims"));

if (prim.IsRoot && prim.LinksetData is not null)
parameters.Add(_Database.CreateParameter("linksetdata", prim.SerializeLinksetData()));
Expand Down Expand Up @@ -1923,8 +1923,17 @@ private NpgsqlParameter[] CreatePrimShapeParameters(SceneObjectPart prim, UUID s
parameters.Add(_Database.CreateParameter("ProfileEnd", s.ProfileEnd));
parameters.Add(_Database.CreateParameter("ProfileCurve", s.ProfileCurve));
parameters.Add(_Database.CreateParameter("ProfileHollow", s.ProfileHollow));

if (s.TextureEntry is null)
parameters.Add(_Database.CreateParameterNullBytea("Texture"));
else
parameters.Add(_Database.CreateParameter("Texture", s.TextureEntry));

if (s.ExtraParams is null)
parameters.Add(_Database.CreateParameterNullBytea("ExtraParams"));
else
parameters.Add(_Database.CreateParameter("ExtraParams", s.ExtraParams));

parameters.Add(_Database.CreateParameter("State", s.State));

if (null == s.Media)
Expand All @@ -1937,6 +1946,9 @@ private NpgsqlParameter[] CreatePrimShapeParameters(SceneObjectPart prim, UUID s
}

byte[] matovrdata = s.RenderMaterialsOvrToRawBin();
if(matovrdata is null)
parameters.Add(_Database.CreateParameterNullBytea("MatOvrd"));
else
parameters.Add(_Database.CreateParameter("MatOvrd", matovrdata));

return parameters.ToArray();
Expand Down
4 changes: 1 addition & 3 deletions OpenSim/Data/PGSQL/Resources/AssetStore.migrations
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ COMMIT;

BEGIN TRANSACTION;

--# "creatorID" goes up to VARCHAR(128)

alter table assets
alter column "creatorID" type varchar(128);
alter column "creatorid" type varchar(128);

Commit;
26 changes: 10 additions & 16 deletions OpenSim/Data/PGSQL/Resources/EstateStore.migrations
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ WITH (OIDS=FALSE);
-- ----------------------------
ALTER TABLE "public"."estate_map" ADD PRIMARY KEY ("RegionID") NOT DEFERRABLE INITIALLY IMMEDIATE;

-- ----------------------------
-- SEQUENCE estate_settings_id
-- ----------------------------
CREATE SEQUENCE IF NOT EXISTS "public"."estate_settings_id"
INCREMENT 100
MINVALUE 1
MAXVALUE 9223372036854775807
START 100
CACHE 1;

-- ----------------------------
-- Table structure for estate_settings
-- ----------------------------
Expand Down Expand Up @@ -110,22 +120,6 @@ CREATE INDEX IF NOT EXISTS "ix_estateban" ON "public"."estateban" USING btree("

COMMIT;

:VERSION 13

BEGIN TRASACTION;

-- ----------------------------
-- SEQUENCE estate_settings_id
-- ----------------------------
CREATE SEQUENCE IF NOT EXISTS "public"."estate_settings_id"
INCREMENT 100
MINVALUE 1
MAXVALUE 9223372036854775807
START 100
CACHE 1;

COMMIT;

:VERSION 14
BEGIN TRANSACTION;

Expand Down
13 changes: 0 additions & 13 deletions OpenSim/Data/PGSQL/Resources/InventoryStore.migrations
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,6 @@ alter table inventoryitems

COMMIT ;

:VERSION 7

BEGIN TRANSACTION;

-- # "creatorID" goes back to VARCHAR(36) (???)

alter table inventoryitems
alter column "creatorID" type varchar(36);

COMMIT ;

:VERSION 8

ALTER TABLE inventoryitems
Expand All @@ -203,8 +192,6 @@ ALTER TABLE inventoryitems

BEGIN TRANSACTION;

--# "creatorID" goes up to VARCHAR(255)

alter table inventoryitems
alter column "creatorID" type varchar(255);

Expand Down
Loading

0 comments on commit 10f37a5

Please sign in to comment.