Skip to content

Commit

Permalink
Feature/lsd fix (#83)
Browse files Browse the repository at this point in the history
* Placeholders for AISv3.  EF Core Model code in OpenSim.Data.Models.  Both projects are in the Source directory and not yet included in the solution.  Tests are added back in Tests.  Still need to Add the LinkSet Data tests and activate them in the solution.

* Add PBR Terrain fields to ef core regionsettings table. Add OpenSIm.Data.Models to solution.

* Restructure the LinksetData Deserialize.  We'll also save the size value so it doesnt need to be calculated.  We make the size a required field so we can tell if its not present and fall back to handling the old format as well.  Make the serialized fields writable publically so they can be deserialized successfully. This is a change in dotnet 8.

* Address CodeQL comments. Ternary operator in LinksetData Deserialize and rename some generated code for the Search tables ef core support away from Object which is of course a reserved word.
  • Loading branch information
mdickson authored Aug 6, 2024
1 parent c96c260 commit d64ff14
Show file tree
Hide file tree
Showing 305 changed files with 44,364 additions and 11,630 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
OpenSimConsoleHistory.txt

.project
.settings
.gitignore
Expand All @@ -19,6 +21,9 @@ launchSettings.json

build/

*/bin/Debug/*
*/bin/Release/*

packages/

Prebuild/src/bin
Expand Down
17 changes: 10 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
<Project>
<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<ImplicitUsings>disable</ImplicitUsings>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDependencyFile>false</GenerateDependencyFile>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
<MSBuildProjectExtensionsPath>$(SolutionDir)\obj\$(Configuration)\$(MSBuildProjectName)\</MSBuildProjectExtensionsPath>
<IntermediateOutputPath>$(SolutionDir)\obj\$(Configuration)\$(MSBuildProjectName)\</IntermediateOutputPath>
<OutputPath>$(SolutionDir)\build\$(Configuration)\$(AssemblyName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<MSBuildProjectExtensionsPath>$(SolutionDir)/obj/$(Configuration)/$(MSBuildProjectName)/</MSBuildProjectExtensionsPath>
<IntermediateOutputPath>$(SolutionDir)/obj/$(Configuration)/$(MSBuildProjectName)/</IntermediateOutputPath>
<OutputPath>$(SolutionDir)/build/$(Configuration)/$(AssemblyName)/</OutputPath>
<OutDir>$(OutputPath)</OutDir>
</PropertyGroup>

<!-- <ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133">
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<Version>3.6.133</Version>
</PackageReference>
</ItemGroup> -->

Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion CONTRIBUTORS.txt → Docs/CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ This software uses components from the following developers:
* log4net (http://logging.apache.org/log4net/)
* GlynnTucker.Cache (http://gtcache.sourceforge.net/)
* NDesk.Options 0.2.1 (http://www.ndesk.org/Options)
* Json.NET 3.5 Release 6. The binary used is actually Newtonsoft.Json.Net20.dll for Mono 2.4 compatability (http://james.newtonking.com/projects/json-net.aspx)
* zlib.net for C# 1.0.4 (http://www.componentace.com/zlib_.NET.htm)

Some plugins are based on Cable Beach
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions OpenSim.sln
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenSim.Region.OptionalModu
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenSim.Server.MoneyServer", "addon-modules\OpenSim.Server.MoneyServer\OpenSim.Server.MoneyServer\OpenSim.Server.MoneyServer.csproj", "{C3AEE6AC-BE40-4003-A7A3-E8AA039E4451}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{7F5EC7C6-FD99-4084-8530-5D3F28D6D7C0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Tests.Common", "Tests\OpenSim.Tests.Common\OpenSim.Tests.Common.csproj", "{4B7616BC-6CCE-4B78-AE40-1F24C92442F5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{E886CEB5-B01D-411F-A7A0-72AA1B71761D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Data.Model", "Source\OpenSim.Data.Model\OpenSim.Data.Model.csproj", "{B120B128-D6C6-40B6-9D83-4F1F7D921109}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -441,10 +449,22 @@ Global
{C3AEE6AC-BE40-4003-A7A3-E8AA039E4451}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3AEE6AC-BE40-4003-A7A3-E8AA039E4451}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3AEE6AC-BE40-4003-A7A3-E8AA039E4451}.Release|Any CPU.Build.0 = Release|Any CPU
{4B7616BC-6CCE-4B78-AE40-1F24C92442F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B7616BC-6CCE-4B78-AE40-1F24C92442F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B7616BC-6CCE-4B78-AE40-1F24C92442F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B7616BC-6CCE-4B78-AE40-1F24C92442F5}.Release|Any CPU.Build.0 = Release|Any CPU
{B120B128-D6C6-40B6-9D83-4F1F7D921109}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B120B128-D6C6-40B6-9D83-4F1F7D921109}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B120B128-D6C6-40B6-9D83-4F1F7D921109}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B120B128-D6C6-40B6-9D83-4F1F7D921109}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4B7616BC-6CCE-4B78-AE40-1F24C92442F5} = {7F5EC7C6-FD99-4084-8530-5D3F28D6D7C0}
{B120B128-D6C6-40B6-9D83-4F1F7D921109} = {E886CEB5-B01D-411F-A7A0-72AA1B71761D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A40AD54B-8BC7-41E4-B241-19B59EA65D2A}
EndGlobalSection
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Addons/Groups/Service/GroupsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class GroupsService : GroupsServiceBase

#region Daily Cleanup

private Timer m_CleanupTimer;
private System.Timers.Timer m_CleanupTimer;

public GroupsService(IConfigSource config, string configName)
: base(config, configName)
Expand All @@ -114,7 +114,7 @@ public GroupsService(IConfigSource config)
: this(config, string.Empty)
{
// Once a day
m_CleanupTimer = new Timer(24 * 60 * 60 * 1000);
m_CleanupTimer = new System.Timers.Timer(24 * 60 * 60 * 1000);
m_CleanupTimer.AutoReset = true;
m_CleanupTimer.Elapsed += new ElapsedEventHandler(m_CleanupTimer_Elapsed);
m_CleanupTimer.Enabled = true;
Expand Down
9 changes: 5 additions & 4 deletions OpenSim/Data/MySQL/MySQLSimulationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,10 +1184,11 @@ private SceneObjectPart BuildPrim(IDataReader row)
int pseudocrc = (int)row["pseudocrc"];
if(pseudocrc != 0)
prim.PseudoCRC = pseudocrc;

if (!(row["linksetdata"] is DBNull))

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

return prim;
Expand Down Expand Up @@ -1616,7 +1617,7 @@ private void FillPrimCommand(MySqlCommand cmd, SceneObjectPart prim, UUID sceneG
cmd.Parameters.AddWithValue("sitactrange", prim.SitActiveRange);
cmd.Parameters.AddWithValue("pseudocrc", prim.PseudoCRC);

if (prim.IsRoot && prim.LinksetData is not null)
if (prim.LinksetData is not null)
{
cmd.Parameters.AddWithValue("linksetdata", prim.SerializeLinksetData());
}
Expand Down
10 changes: 7 additions & 3 deletions OpenSim/Data/PGSQL/PGSQLSimulationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1408,9 +1408,13 @@ private static SceneObjectPart BuildPrim(IDataRecord primRow)
prim.Animations = null;
}

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

return prim;
Expand Down Expand Up @@ -1886,7 +1890,7 @@ private NpgsqlParameter[] CreatePrimParameters(SceneObjectPart prim, UUID sceneG
else
parameters.Add(_Database.CreateParameterNullBytea("sopanims"));

if (prim.IsRoot && prim.LinksetData is not null)
if (prim.LinksetData is not null)
parameters.Add(_Database.CreateParameter("linksetdata", prim.SerializeLinksetData()));
else
parameters.Add(_Database.CreateParameter("linksetdata", null));
Expand Down
10 changes: 7 additions & 3 deletions OpenSim/Data/SQLite/SQLiteSimulationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1804,9 +1804,13 @@ private SceneObjectPart buildPrim(DataRow row)
prim.Animations = null;
}

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

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

if (prim.IsRoot && prim.LinksetData is not null)
if (prim.LinksetData is not null)
row["linksetdata"] = prim.SerializeLinksetData();
else
row["linksetdata"] = null;
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Framework/Monitoring/AssetStatsCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace OpenSim.Framework.Monitoring
/// </summary>
public class AssetStatsCollector : BaseStatsCollector
{
private Timer ageStatsTimer = new Timer(24 * 60 * 60 * 1000);
private System.Timers.Timer ageStatsTimer = new System.Timers.Timer(24 * 60 * 60 * 1000);
private DateTime startTime = DateTime.Now;

private long assetRequestsToday;
Expand Down
33 changes: 0 additions & 33 deletions OpenSim/Framework/Monitoring/Properties/AssemblyInfo.cs

This file was deleted.

2 changes: 1 addition & 1 deletion OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public override OSDMap OReport(string uptime, string version, string scene)
// running
foreach (ProcessThread currentThread in p.Threads)
{
if (currentThread != null && currentThread.ThreadState == ThreadState.Running)
if (currentThread != null && currentThread.ThreadState == System.Diagnostics.ThreadState.Running)
numberThreadsRunning++;
}
}
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Framework/Monitoring/StatsLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static class StatsLogger
{
private static readonly ILog m_statsLog = LogManager.GetLogger("special.StatsLogger");

private static Timer m_loggingTimer;
private static System.Timers.Timer m_loggingTimer;
private static int m_statsLogIntervalMs = 5000;

public static void RegisterConsoleCommands(ICommandConsole console)
Expand Down Expand Up @@ -114,7 +114,7 @@ public static void Start()
if (m_loggingTimer != null)
Stop();

m_loggingTimer = new Timer(m_statsLogIntervalMs);
m_loggingTimer = new System.Timers.Timer(m_statsLogIntervalMs);
m_loggingTimer.AutoReset = false;
m_loggingTimer.Elapsed += Log;
m_loggingTimer.Start();
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Framework/Monitoring/UserStatsCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace OpenSim.Framework.Monitoring
/// </summary>
public class UserStatsCollector : BaseStatsCollector
{
private Timer ageStatsTimer = new Timer(24 * 60 * 60 * 1000);
private System.Timers.Timer ageStatsTimer = new System.Timers.Timer(24 * 60 * 60 * 1000);

private int successfulLoginsToday;
public int SuccessfulLoginsToday { get { return successfulLoginsToday; } }
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 = "8940";
public const string Release = "8984";

public static string Version
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class BakedTextureUploader
private UUID m_agentID = UUID.Zero;
private IPAddress m_remoteAddress;
private IAssetCache m_assetCache;
private Timer m_timeout;
private System.Timers.Timer m_timeout;

public BakedTextureUploader(string path, IHttpServer httpServer, UUID agentID, IAssetCache cache, IPAddress remoteAddress)
{
Expand All @@ -169,7 +169,7 @@ public BakedTextureUploader(string path, IHttpServer httpServer, UUID agentID, I
m_agentID = agentID;
m_remoteAddress = remoteAddress;
m_assetCache = cache;
m_timeout = new Timer();
m_timeout = new System.Timers.Timer();
m_timeout.Elapsed += Timeout;
m_timeout.AutoReset = false;
m_timeout.Interval = 30000;
Expand Down
Loading

0 comments on commit d64ff14

Please sign in to comment.