From c8a6d4c696134b3d5d37e7847d6e321b0ea44ae5 Mon Sep 17 00:00:00 2001
From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com>
Date: Sun, 21 Nov 2021 18:06:39 -0800
Subject: [PATCH] fix: Fixes .net 6 compilation (#860)
---
Directory.Build.props | 4 ++--
.../SerializationGenerator.csproj | 14 ++++++++------
.../SerializationSchemaGenerator.csproj | 8 +++++---
Projects/Server/Server.csproj | 2 +-
Projects/Server/Utilities/Utility.cs | 15 +++++++++++++++
Projects/UOContent/Items/Construction/Ankhs.cs | 8 ++++----
Projects/UOContent/UOContent.csproj | 2 +-
7 files changed, 36 insertions(+), 17 deletions(-)
diff --git a/Directory.Build.props b/Directory.Build.props
index 27ca9d8996..c48855eab4 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -4,7 +4,7 @@
Kamron Batman
ModernUO
2019-2020
- net5.0;net6.0
+ net6.0
x64
x64
preview
@@ -56,7 +56,7 @@
-
+
3.4.244
all
diff --git a/Projects/SerializationGenerator/SerializationGenerator.csproj b/Projects/SerializationGenerator/SerializationGenerator.csproj
index 03b5a5bdba..f74e5e965a 100755
--- a/Projects/SerializationGenerator/SerializationGenerator.csproj
+++ b/Projects/SerializationGenerator/SerializationGenerator.csproj
@@ -1,16 +1,17 @@
- netstandard2.0
+ netstandard2.0
preview
analyzers
-
-
-
-
-
+
+
+
+
+
+
@@ -22,6 +23,7 @@
+
diff --git a/Projects/SerializationSchemaGenerator/SerializationSchemaGenerator.csproj b/Projects/SerializationSchemaGenerator/SerializationSchemaGenerator.csproj
index 31e89d5612..d3d1a168e3 100755
--- a/Projects/SerializationSchemaGenerator/SerializationSchemaGenerator.csproj
+++ b/Projects/SerializationSchemaGenerator/SerializationSchemaGenerator.csproj
@@ -1,7 +1,6 @@
Exe
- net5.0
Output
@@ -14,7 +13,10 @@
-
-
+
+
+
+
+
diff --git a/Projects/Server/Server.csproj b/Projects/Server/Server.csproj
index cf357a582f..f2cc0ec7a5 100755
--- a/Projects/Server/Server.csproj
+++ b/Projects/Server/Server.csproj
@@ -34,7 +34,7 @@
-
+
diff --git a/Projects/Server/Utilities/Utility.cs b/Projects/Server/Utilities/Utility.cs
index a184d4b233..d3a780a4f2 100644
--- a/Projects/Server/Utilities/Utility.cs
+++ b/Projects/Server/Utilities/Utility.cs
@@ -1049,6 +1049,21 @@ public static int RandomMinMax(int min, int max)
return min + (int)RandomSources.Source.Next((uint)(max - min + 1));
}
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static long RandomMinMax(long min, long max)
+ {
+ if (min > max)
+ {
+ (min, max) = (max, min);
+ }
+ else if (min == max)
+ {
+ return min;
+ }
+
+ return min + RandomSources.Source.Next(max - min + 1);
+ }
+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int Random(int from, int count) => RandomSources.Source.Next(from, count);
diff --git a/Projects/UOContent/Items/Construction/Ankhs.cs b/Projects/UOContent/Items/Construction/Ankhs.cs
index a9993b5dfd..d75e968f55 100644
--- a/Projects/UOContent/Items/Construction/Ankhs.cs
+++ b/Projects/UOContent/Items/Construction/Ankhs.cs
@@ -114,7 +114,7 @@ public override void OnClick()
[Serializable(0, false)]
public partial class AnkhWest : Item
{
- [SerializableField(0)]
+ [SerializableField(0, getter: "private", setter: "private")]
private InternalItem _item;
[Constructible]
@@ -184,7 +184,7 @@ public override void OnAfterDelete()
}
[Serializable(0, false)]
- private class InternalItem : Item
+ private partial class InternalItem : Item
{
[SerializableField(0)]
private AnkhWest _item;
@@ -260,7 +260,7 @@ public override void OnDoubleClickDead(Mobile m)
[Serializable(0, false)]
public partial class AnkhNorth : Item
{
- [SerializableField(0)]
+ [SerializableField(0, getter: "private", setter: "private")]
private InternalItem _item;
[Constructible]
@@ -332,7 +332,7 @@ public override void OnAfterDelete()
[TypeAlias("Server.Items.AnkhEast+InternalItem")]
[Serializable(0, false)]
- private class InternalItem : Item
+ private partial class InternalItem : Item
{
[SerializableField(0)]
private AnkhNorth _item;
diff --git a/Projects/UOContent/UOContent.csproj b/Projects/UOContent/UOContent.csproj
index 5f322c8298..2ef0f6dfcf 100755
--- a/Projects/UOContent/UOContent.csproj
+++ b/Projects/UOContent/UOContent.csproj
@@ -40,7 +40,7 @@
-
+