Skip to content

Commit

Permalink
Put back the crappy dll copying for now. There are other changes that…
Browse files Browse the repository at this point in the history
… require c# 12 which is a part of dotnet 8 and the use of System.Drawing.Common in dotnet 8 is entirely unsupported now. I may just have to live with this and get the System.Drawing porting work out of the way.
  • Loading branch information
mdickson committed Apr 25, 2024
1 parent 39da087 commit 0281196
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 44 deletions.
43 changes: 21 additions & 22 deletions OpenSim/Region/Application/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,28 +103,27 @@ public static void Main(string[] args)
m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config");
}

// NOPE
// // temporay set the platform dependent System.Drawing.Common.dll
// string targetdll = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
// "System.Drawing.Common.dll");
// string src = targetdll + (Util.IsWindows() ? ".win" : ".linux");
// try
// {
// if (!File.Exists(targetdll))
// File.Copy(src, targetdll);
// else
// {
// FileInfo targetInfo = new(targetdll);
// FileInfo srcInfo = new(src);
// if(targetInfo.Length != srcInfo.Length)
// File.Copy(src, targetdll, true);
// }
// }
// catch (Exception e)
// {
// m_log.Error("Failed to copy System.Drawing.Common.dll for current platform" + e.Message);
// throw;
// }
// temporay set the platform dependent System.Drawing.Common.dll
string targetdll = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
"System.Drawing.Common.dll");
string src = targetdll + (Util.IsWindows() ? ".win" : ".linux");
try
{
if (!File.Exists(targetdll))
File.Copy(src, targetdll);
else
{
FileInfo targetInfo = new(targetdll);
FileInfo srcInfo = new(src);
if(targetInfo.Length != srcInfo.Length)
File.Copy(src, targetdll, true);
}
}
catch (Exception e)
{
m_log.Error("Failed to copy System.Drawing.Common.dll for current platform" + e.Message);
throw;
}

m_log.InfoFormat(
"[OPENSIM MAIN]: System Locale is {0}", System.Threading.Thread.CurrentThread.CurrentCulture);
Expand Down
43 changes: 21 additions & 22 deletions OpenSim/Server/ServerMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,28 +142,27 @@ public static int Main(string[] args)
connList = string.Join(",", servicesList.ToArray());
}

// NOPE
// // temporay set the platform dependent System.Drawing.Common.dll
// string targetdll = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
// "System.Drawing.Common.dll");
// string src = targetdll + (Util.IsWindows() ? ".win" : ".linux");
// try
// {
// if (!File.Exists(targetdll))
// File.Copy(src, targetdll);
// else
// {
// FileInfo targetInfo = new(targetdll);
// FileInfo srcInfo = new(src);
// if (targetInfo.Length != srcInfo.Length)
// File.Copy(src, targetdll, true);
// }
// }
// catch (Exception e)
// {
// m_log.Error("Failed to copy System.Drawing.Common.dll for current platform" + e.Message);
// throw;
// }
// temporay set the platform dependent System.Drawing.Common.dll
string targetdll = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
"System.Drawing.Common.dll");
string src = targetdll + (Util.IsWindows() ? ".win" : ".linux");
try
{
if (!File.Exists(targetdll))
File.Copy(src, targetdll);
else
{
FileInfo targetInfo = new(targetdll);
FileInfo srcInfo = new(src);
if (targetInfo.Length != srcInfo.Length)
File.Copy(src, targetdll, true);
}
}
catch (Exception e)
{
m_log.Error("Failed to copy System.Drawing.Common.dll for current platform" + e.Message);
throw;
}


string[] conns = connList.Split(new char[] {',', ' ', '\n', '\r', '\t'});
Expand Down
Binary file added bin/System.Drawing.Common.dll.linux
Binary file not shown.
Binary file added bin/System.Drawing.Common.dll.win
Binary file not shown.

0 comments on commit 0281196

Please sign in to comment.