From 5bd41d5b6880504783127140163e1754b361f12d Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Sun, 6 Nov 2022 09:59:11 -0800 Subject: [PATCH] feat: Adds .NET 7 & Arm64 support (#1229) ## BREAKING CHANGE **Publishing for linux will no longer include runtimes** ## Major Changes * Adds .NET 7 support. * Adds ARM64 support (experimental). * Changes linux support to be open-ended against anything .NET 7 supports. * Fixes native library resolutions. (Make sure to install `dev` versions of the libraries) * Updates README * Adds Ubuntu 22, CentOS 8/9 Stream to CI/CD. ## TODOs: * Update modernuo.com docs Closes #1173 Closes #1159 --- .config/dotnet-tools.json | 2 +- .github/workflows/build-test.yml | 36 ++++++-- Directory.Build.props | 21 +++-- Projects/Server/Collections/PooledRefQueue.cs | 4 - Projects/Server/Gumps/GumpAlphaRegion.cs | 4 - Projects/Server/Gumps/GumpBackground.cs | 4 - Projects/Server/Gumps/GumpButton.cs | 4 - Projects/Server/Gumps/GumpCheck.cs | 4 - Projects/Server/Gumps/GumpECHandleInput.cs | 4 - Projects/Server/Gumps/GumpEntry.cs | 4 - Projects/Server/Gumps/GumpGroup.cs | 4 - Projects/Server/Gumps/GumpHtml.cs | 4 - Projects/Server/Gumps/GumpHtmlLocalized.cs | 4 - Projects/Server/Gumps/GumpImage.cs | 4 - Projects/Server/Gumps/GumpImageTileButton.cs | 4 - Projects/Server/Gumps/GumpImageTiled.cs | 4 - Projects/Server/Gumps/GumpItem.cs | 4 - Projects/Server/Gumps/GumpItemProperty.cs | 4 - Projects/Server/Gumps/GumpLabel.cs | 4 - Projects/Server/Gumps/GumpLabelCropped.cs | 4 - Projects/Server/Gumps/GumpMasterGump.cs | 4 - Projects/Server/Gumps/GumpPage.cs | 4 - Projects/Server/Gumps/GumpRadio.cs | 4 - Projects/Server/Gumps/GumpSpriteImage.cs | 4 - Projects/Server/Gumps/GumpTextEntry.cs | 4 - Projects/Server/Gumps/GumpTextEntryLimited.cs | 4 - Projects/Server/Gumps/GumpTooltip.cs | 4 - Projects/Server/Server.csproj | 10 +-- Projects/UOContent/UOContent.csproj | 17 +--- README.md | 83 +++++++++++-------- azure-pipelines.yml | 35 +------- docs/building-server.md | 20 +++-- docs/installation.md | 10 +-- docs/overrides/.icons/brands/debian.svg | 3 - docs/overrides/.icons/brands/linuxmint.svg | 1 - docs/overrides/partials/nav.html | 2 +- docs/starting-server.md | 22 +++++ global.json | 4 +- mkdocs.yml | 1 + publish.cmd | 30 ++++--- publish.sh | 1 + version.json | 2 +- 42 files changed, 164 insertions(+), 232 deletions(-) delete mode 100644 docs/overrides/.icons/brands/debian.svg delete mode 100644 docs/overrides/.icons/brands/linuxmint.svg create mode 100644 docs/starting-server.md diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index a0210c819..bbcb8ec4c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "modernuoschemagenerator": { - "version": "2.5.2", + "version": "2.5.3", "commands": [ "ModernUOSchemaGenerator" ] diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 4543d0f47..73974245d 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -21,10 +21,10 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - - name: Setup .NET 6 + - name: Setup .NET 7 uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.402 + dotnet-version: 7.0.100-rc.2.22477.23 - name: Build run: ./publish.cmd Release - name: Test @@ -38,22 +38,40 @@ jobs: fail-fast: false matrix: include: - - container: fedora:35 - name: Fedora 35 + - container: ubuntu:jammy + name: Ubuntu 22 + packageManager: apt + - container: debian:bullseye + name: Debian 11 + packageManager: apt - container: fedora:36 name: Fedora 36 + packageManager: dnf + - container: quay.io/centos/centos:stream8 + name: CentOS 8 Stream + packageManager: dnf + - container: quay.io/centos/centos:stream9 + name: CentOS 9 Stream + packageManager: dnf steps: - - name: Install Prerequisites - run: dnf makecache --refresh && dnf install -y findutils libicu + - name: Enable EPEL + run: dnf upgrade --refresh -y && dnf install -y epel-release epel-next-release + if: ${{ startsWith(matrix.name, 'CentOS') }} + - name: Install Prerequisites using dnf + run: dnf makecache --refresh && dnf install -y findutils libicu zlib-devel zstd libargon2-devel + if: ${{ matrix.packageManager == 'dnf' }} + - name: Install Prerequisites using apt + run: apt-get update -y && apt-get install -y curl libicu-dev libz-dev zstd libargon2-dev + if: ${{ matrix.packageManager == 'apt' }} - uses: actions/checkout@v3 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - - name: Setup .NET 6 + - name: Setup .NET 7 uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.402 + dotnet-version: 7.0.100-rc.2.22477.23 - name: Build - run: ./publish.cmd Release + run: ./publish.sh Release - name: Test run: dotnet test --no-restore diff --git a/Directory.Build.props b/Directory.Build.props index 3ed9b201a..e76bdec62 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,14 +4,13 @@ Kamron Batman ModernUO 2019-2022 - net6.0 - x64 - x64 + net7.0 + x64;arm64 preview true true NU1603 - win-x64;osx-x64;linux-x64;debian.10-x64;debian.11-x64;ubuntu.16.04-x64;ubuntu.18.04-x64;ubuntu.20.04-x64;centos.7-x64;centos.8-x64;fedora.32-x64;fedora.33-x64;fedora.34-x64;fedora.35-x64;fedora.36-x64;rhel.7-x64;rhel.8-x64;linuxmint.17-x64;linuxmint.18-x64;linuxmint.19-x64 + win-x64;win-arm64;osx-x64;osx-arm64;linux-x64;linux-arm64 Debug;Release;Analyze false true @@ -21,10 +20,14 @@ true true true + true + true WINDOWS OSX LINUX UNIX + CPU_X64 + CPU_ARM64 NO_LOCAL_INIT MUO $(SolutionDir) @@ -36,12 +39,18 @@ true true - + win-x64 - + + win-arm64 + + osx-x64 + + osx-arm64 + TRACE;DEBUG false diff --git a/Projects/Server/Collections/PooledRefQueue.cs b/Projects/Server/Collections/PooledRefQueue.cs index 2a73e4bde..7d9d54de4 100644 --- a/Projects/Server/Collections/PooledRefQueue.cs +++ b/Projects/Server/Collections/PooledRefQueue.cs @@ -316,11 +316,7 @@ public ref struct PooledRefQueue } // Increments the index wrapping it if necessary. -#if NET7_SDK private void MoveNext(scoped ref int index) -#else - private void MoveNext(ref int index) -#endif { // It is tempting to use the remainder operator here but it is actually much slower // than a simple comparison and a rarely taken branch. diff --git a/Projects/Server/Gumps/GumpAlphaRegion.cs b/Projects/Server/Gumps/GumpAlphaRegion.cs index 119d183e0..a58e97312 100644 --- a/Projects/Server/Gumps/GumpAlphaRegion.cs +++ b/Projects/Server/Gumps/GumpAlphaRegion.cs @@ -36,11 +36,7 @@ public class GumpAlphaRegion : GumpEntry public int Height { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { writer.WriteAscii($"{{ checkertrans {X} {Y} {Width} {Height} }}"); } diff --git a/Projects/Server/Gumps/GumpBackground.cs b/Projects/Server/Gumps/GumpBackground.cs index 99614d389..1bae1898a 100644 --- a/Projects/Server/Gumps/GumpBackground.cs +++ b/Projects/Server/Gumps/GumpBackground.cs @@ -39,11 +39,7 @@ public class GumpBackground : GumpEntry public int GumpID { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { writer.WriteAscii($"{{ resizepic {X} {Y} {GumpID} {Width} {Height} }}"); } diff --git a/Projects/Server/Gumps/GumpButton.cs b/Projects/Server/Gumps/GumpButton.cs index 6d44556e4..9156d2d5e 100644 --- a/Projects/Server/Gumps/GumpButton.cs +++ b/Projects/Server/Gumps/GumpButton.cs @@ -54,11 +54,7 @@ public class GumpButton : GumpEntry public int Param { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { writer.WriteAscii($"{{ button {X} {Y} {NormalID} {PressedID} {(int)Type} {Param} {ButtonID} }}"); } diff --git a/Projects/Server/Gumps/GumpCheck.cs b/Projects/Server/Gumps/GumpCheck.cs index 006997002..d1135599a 100644 --- a/Projects/Server/Gumps/GumpCheck.cs +++ b/Projects/Server/Gumps/GumpCheck.cs @@ -42,11 +42,7 @@ public class GumpCheck : GumpEntry public int SwitchID { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { var initialState = InitialState ? "1" : "0"; writer.WriteAscii($"{{ checkbox {X} {Y} {InactiveID} {ActiveID} {initialState} {SwitchID} }}"); diff --git a/Projects/Server/Gumps/GumpECHandleInput.cs b/Projects/Server/Gumps/GumpECHandleInput.cs index 504320154..ba14b3a55 100644 --- a/Projects/Server/Gumps/GumpECHandleInput.cs +++ b/Projects/Server/Gumps/GumpECHandleInput.cs @@ -22,11 +22,7 @@ public class GumpECHandleInput : GumpEntry { private static byte[] _layout = Gump.StringToBuffer("{ echandleinput }"); -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { writer.Write(_layout); } diff --git a/Projects/Server/Gumps/GumpEntry.cs b/Projects/Server/Gumps/GumpEntry.cs index 3113aad8e..304017fd3 100644 --- a/Projects/Server/Gumps/GumpEntry.cs +++ b/Projects/Server/Gumps/GumpEntry.cs @@ -25,9 +25,5 @@ public abstract class GumpEntry // TODO: Replace OrderedHashSet with InsertOnlyHashSet, a copy of HashSet that is ReadOnly compatible, but includes // a public AddIfNotPresent function that returns the index of the element -#if NET7_SDK public abstract void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches); -#else - public abstract void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches); -#endif } diff --git a/Projects/Server/Gumps/GumpGroup.cs b/Projects/Server/Gumps/GumpGroup.cs index aa9f46fd1..ac5bd73ad 100644 --- a/Projects/Server/Gumps/GumpGroup.cs +++ b/Projects/Server/Gumps/GumpGroup.cs @@ -26,11 +26,7 @@ public class GumpGroup : GumpEntry public int Group { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { if (Group == 1) { diff --git a/Projects/Server/Gumps/GumpHtml.cs b/Projects/Server/Gumps/GumpHtml.cs index e971362ae..ba7d06201 100644 --- a/Projects/Server/Gumps/GumpHtml.cs +++ b/Projects/Server/Gumps/GumpHtml.cs @@ -45,11 +45,7 @@ public class GumpHtml : GumpEntry public bool Scrollbar { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { var textIndex = strings.GetOrAdd(Text ?? ""); var background = Background ? "1" : "0"; diff --git a/Projects/Server/Gumps/GumpHtmlLocalized.cs b/Projects/Server/Gumps/GumpHtmlLocalized.cs index 21759b48f..0bb80b2ea 100644 --- a/Projects/Server/Gumps/GumpHtmlLocalized.cs +++ b/Projects/Server/Gumps/GumpHtmlLocalized.cs @@ -101,11 +101,7 @@ public class GumpHtmlLocalized : GumpEntry public GumpHtmlLocalizedType Type { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { var background = Background ? "1" : "0"; var scrollbar = Scrollbar ? "1" : "0"; diff --git a/Projects/Server/Gumps/GumpImage.cs b/Projects/Server/Gumps/GumpImage.cs index ef1ae1a3f..313f28e69 100644 --- a/Projects/Server/Gumps/GumpImage.cs +++ b/Projects/Server/Gumps/GumpImage.cs @@ -39,11 +39,7 @@ public class GumpImage : GumpEntry public string Class { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { var hasHue = Hue != 0; var hasClass = !string.IsNullOrEmpty(Class); diff --git a/Projects/Server/Gumps/GumpImageTileButton.cs b/Projects/Server/Gumps/GumpImageTileButton.cs index 28cfc3b26..3e468f4c0 100644 --- a/Projects/Server/Gumps/GumpImageTileButton.cs +++ b/Projects/Server/Gumps/GumpImageTileButton.cs @@ -61,11 +61,7 @@ public class GumpImageTileButton : GumpEntry public int Height { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { writer.WriteAscii( $"{{ buttontileart {X} {Y} {NormalID} {PressedID} {(int)Type} {Param} {ButtonID} {ItemID} {Hue} {Width} {Height} }}" diff --git a/Projects/Server/Gumps/GumpImageTiled.cs b/Projects/Server/Gumps/GumpImageTiled.cs index 4f5d14d71..e536126b7 100644 --- a/Projects/Server/Gumps/GumpImageTiled.cs +++ b/Projects/Server/Gumps/GumpImageTiled.cs @@ -39,11 +39,7 @@ public class GumpImageTiled : GumpEntry public int GumpID { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { writer.WriteAscii($"{{ gumppictiled {X} {Y} {Width} {Height} {GumpID} }}"); } diff --git a/Projects/Server/Gumps/GumpItem.cs b/Projects/Server/Gumps/GumpItem.cs index f8a4e2d63..5662e7927 100644 --- a/Projects/Server/Gumps/GumpItem.cs +++ b/Projects/Server/Gumps/GumpItem.cs @@ -36,11 +36,7 @@ public class GumpItem : GumpEntry public int Hue { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { writer.WriteAscii(Hue == 0 ? $"{{ tilepic {X} {Y} {ItemID} }}" : $"{{ tilepichue {X} {Y} {ItemID} {Hue} }}"); } diff --git a/Projects/Server/Gumps/GumpItemProperty.cs b/Projects/Server/Gumps/GumpItemProperty.cs index 3bf334b27..de84a01e8 100644 --- a/Projects/Server/Gumps/GumpItemProperty.cs +++ b/Projects/Server/Gumps/GumpItemProperty.cs @@ -24,11 +24,7 @@ public class GumpItemProperty : GumpEntry public Serial Serial { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { writer.WriteAscii($"{{ itemproperty {Serial.Value} }}"); } diff --git a/Projects/Server/Gumps/GumpLabel.cs b/Projects/Server/Gumps/GumpLabel.cs index 4dbef6161..169392c46 100644 --- a/Projects/Server/Gumps/GumpLabel.cs +++ b/Projects/Server/Gumps/GumpLabel.cs @@ -36,11 +36,7 @@ public class GumpLabel : GumpEntry public string Text { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { var textIndex = strings.GetOrAdd(Text ?? ""); writer.WriteAscii($"{{ text {X} {Y} {Hue} {textIndex} }}"); diff --git a/Projects/Server/Gumps/GumpLabelCropped.cs b/Projects/Server/Gumps/GumpLabelCropped.cs index 831d6fd86..c73dba17a 100644 --- a/Projects/Server/Gumps/GumpLabelCropped.cs +++ b/Projects/Server/Gumps/GumpLabelCropped.cs @@ -42,11 +42,7 @@ public class GumpLabelCropped : GumpEntry public string Text { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { var textIndex = strings.GetOrAdd(Text ?? ""); writer.WriteAscii($"{{ croppedtext {X} {Y} {Width} {Height} {Hue} {textIndex} }}"); diff --git a/Projects/Server/Gumps/GumpMasterGump.cs b/Projects/Server/Gumps/GumpMasterGump.cs index 3be5e1e36..03c6387a2 100644 --- a/Projects/Server/Gumps/GumpMasterGump.cs +++ b/Projects/Server/Gumps/GumpMasterGump.cs @@ -24,11 +24,7 @@ public class GumpMasterGump : GumpEntry public int GumpID { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { writer.WriteAscii($"{{ mastergump {GumpID} }}"); } diff --git a/Projects/Server/Gumps/GumpPage.cs b/Projects/Server/Gumps/GumpPage.cs index 7494336c7..991c22ea5 100644 --- a/Projects/Server/Gumps/GumpPage.cs +++ b/Projects/Server/Gumps/GumpPage.cs @@ -26,11 +26,7 @@ public class GumpPage : GumpEntry public int Page { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { if (Page == 0) { diff --git a/Projects/Server/Gumps/GumpRadio.cs b/Projects/Server/Gumps/GumpRadio.cs index 1a4cd7b2e..079685bd4 100644 --- a/Projects/Server/Gumps/GumpRadio.cs +++ b/Projects/Server/Gumps/GumpRadio.cs @@ -42,11 +42,7 @@ public class GumpRadio : GumpEntry public int SwitchID { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { var initialState = InitialState ? "1" : "0"; writer.WriteAscii($"{{ radio {X} {Y} {InactiveID} {ActiveID} {initialState} {SwitchID} }}"); diff --git a/Projects/Server/Gumps/GumpSpriteImage.cs b/Projects/Server/Gumps/GumpSpriteImage.cs index 90610080e..c0d49e308 100644 --- a/Projects/Server/Gumps/GumpSpriteImage.cs +++ b/Projects/Server/Gumps/GumpSpriteImage.cs @@ -45,11 +45,7 @@ public class GumpSpriteImage : GumpEntry public int SY { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { writer.WriteAscii($"{{ picinpic {X} {Y} {GumpID} {Width} {Height} {SX} {SY} }}"); } diff --git a/Projects/Server/Gumps/GumpTextEntry.cs b/Projects/Server/Gumps/GumpTextEntry.cs index 0bc1d020a..94fcd6104 100644 --- a/Projects/Server/Gumps/GumpTextEntry.cs +++ b/Projects/Server/Gumps/GumpTextEntry.cs @@ -45,11 +45,7 @@ public class GumpTextEntry : GumpEntry public string InitialText { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { var textIndex = strings.GetOrAdd(InitialText ?? ""); writer.WriteAscii($"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {textIndex} }}"); diff --git a/Projects/Server/Gumps/GumpTextEntryLimited.cs b/Projects/Server/Gumps/GumpTextEntryLimited.cs index 60b6a176d..af7b8173e 100644 --- a/Projects/Server/Gumps/GumpTextEntryLimited.cs +++ b/Projects/Server/Gumps/GumpTextEntryLimited.cs @@ -50,11 +50,7 @@ public class GumpTextEntryLimited : GumpEntry public int Size { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { var textIndex = strings.GetOrAdd(InitialText ?? ""); writer.WriteAscii($"{{ textentrylimited {X} {Y} {Width} {Height} {Hue} {EntryID} {textIndex} {Size} }}"); diff --git a/Projects/Server/Gumps/GumpTooltip.cs b/Projects/Server/Gumps/GumpTooltip.cs index 25a565bd4..04f6ba997 100644 --- a/Projects/Server/Gumps/GumpTooltip.cs +++ b/Projects/Server/Gumps/GumpTooltip.cs @@ -32,11 +32,7 @@ public class GumpTooltip : GumpEntry public string Args { get; set; } -#if NET7_SDK public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, scoped ref int entries, scoped ref int switches) -#else - public override void AppendTo(ref SpanWriter writer, OrderedHashSet strings, ref int entries, ref int switches) -#endif { writer.WriteAscii(string.IsNullOrEmpty(Args) ? $"{{ tooltip {Number} }}" : $"{{ tooltip {Number} @{Args}@ }}"); } diff --git a/Projects/Server/Server.csproj b/Projects/Server/Server.csproj index 6c5d4e0f0..953eb269a 100755 --- a/Projects/Server/Server.csproj +++ b/Projects/Server/Server.csproj @@ -10,7 +10,6 @@ ..\..\Distribution ..\..\Distribution 0.0.0 - NET7_SDK @@ -23,8 +22,6 @@ - - @@ -33,15 +30,14 @@ - - + - + - + diff --git a/Projects/UOContent/UOContent.csproj b/Projects/UOContent/UOContent.csproj index b8077df3e..1ef0dbf8a 100755 --- a/Projects/UOContent/UOContent.csproj +++ b/Projects/UOContent/UOContent.csproj @@ -6,7 +6,6 @@ ModernUO Content ..\..\Distribution\Assemblies ..\..\Distribution\Assemblies - NET7_SDK @@ -24,15 +23,7 @@ - - - - - - - - @@ -43,11 +34,11 @@ - - - + + + - + diff --git a/README.md b/README.md index ec97e20c9..1f15ea1b5 100644 --- a/README.md +++ b/README.md @@ -15,31 +15,38 @@ ModernUO [![Discord](https://img.shields.io/discord/751317910504603701?logo=disc ## Requirements #### Supported Operating Systems -[![Windows 10/11/2016/2019/2022](https://img.shields.io/badge/-server%202022-0078D6?logo=windows)](https://www.microsoft.com/en-US/evalcenter/evaluate-windows-server-2022) -![MacOS 10.15/11/12](https://img.shields.io/badge/-monterey-222222?logo=apple&logoColor=white) -[![Debian 10/11](https://img.shields.io/badge/-bullseye-A81D33?logo=debian)](https://www.debian.org/distrib/) -[![Ubuntu 16/18/20 LTS](https://img.shields.io/badge/-20LTS-E95420?logo=ubuntu&logoColor=white)](https://ubuntu.com/download/server) -[![Linux Mint 17/18/19/20](https://img.shields.io/badge/-20-87CF3E?logo=linux%20mint&logoColor=white)](https://linuxmint.com/download.php) -[![CentOS 7/8](https://img.shields.io/badge/-8.5-262577?logo=centos&logoColor=white)](https://www.centos.org/download/) -[![Fedora 32/33/34/35/36](https://img.shields.io/badge/-36-51a2da?logo=fedora&logoColor=white)](https://getfedora.org/en/server/download/) -[![RedHat 7/8](https://img.shields.io/badge/-8-BE0000?logo=red%20hat&logoColor=white)](https://access.redhat.com/downloads) +[![Windows 10/11/2016/2019/2022](https://img.shields.io/badge/-server%202022-0078D6?logo=windows&logoColor=0078D6&labelColor=222222)](https://www.microsoft.com/en-US/evalcenter/evaluate-windows-server-2022) +![MacOS 10.15/11/12/13](https://img.shields.io/badge/-ventura-222222?logo=apple&logoColor=white&labelColor=222222) +[![Debian 10/11](https://img.shields.io/badge/-bullseye-A81D33?logo=debian&logoColor=A81D33&labelColor=222222)](https://www.debian.org/distrib/) +[![Ubuntu 16/18/20/22 LTS](https://img.shields.io/badge/-22LTS-E95420?logo=ubuntu&logoColor=E95420&labelColor=222222)](https://ubuntu.com/download/server) +
+[![Alpine 3.15+](https://img.shields.io/badge/-3.16-0D597F?logo=alpinelinux&logoColor=0D597F&labelColor=222222)](https://alpinelinux.org/downloads/) +[![Fedora 33/34/35/36](https://img.shields.io/badge/-36-51a2da?logo=fedora&logoColor=51a2da&labelColor=222222)](https://getfedora.org/en/server/download/) +[![RedHat 7/8](https://img.shields.io/badge/-8-BE0000?logo=redhat&logoColor=BE0000&labelColor=222222)](https://access.redhat.com/downloads) +[![CentOS 7/8/9](https://img.shields.io/badge/-9-262577?logo=centos&logoColor=white&labelColor=222222)](https://www.centos.org/download/) +[![openSUSE 15+](https://img.shields.io/badge/-15-73BA25?logo=openSUSE&logoColor=73BA25&labelColor=222222)](https://get.opensuse.org/) +[![SUSE Enterprise 12 SP2+](https://img.shields.io/badge/-12%20SP2-0C322C?logo=suse&logoColor=30BA78&labelColor=222222)](https://www.suse.com/download/sles/) +[![Linux Mint 17/18/19/20](https://img.shields.io/badge/-20-87CF3E?logo=linux%20mint&logoColor=87CF3E&labelColor=222222)](https://linuxmint.com/download.php) +[![Arch](https://img.shields.io/badge/-Arch-1793D1?logo=archlinux&logoColor=1793D1&labelColor=222222)](https://archlinux.org/download/) #### Running the server -[![.NET](https://img.shields.io/badge/-6.0.8-5C2D91?logo=.NET)](https://dotnet.microsoft.com/download/dotnet/6.0) +[![.NET](https://img.shields.io/badge/-7.0.0-5C2D91?logo=.NET&logoColor=white&labelColor=222222)](https://dotnet.microsoft.com/download/dotnet/7.0) #### Development -[![git](https://img.shields.io/badge/-git-F05032?logo=git&logoColor=white)](https://git-scm.com/downloads) -[![.NET](https://img.shields.io/badge/-%206.0.400%20SDK-5C2D91?logo=.NET)](https://dotnet.microsoft.com/download/dotnet/6.0) +[![git](https://img.shields.io/badge/-git-F05032?logo=git&logoColor=F05032&labelColor=222222)](https://git-scm.com/downloads) +[![.NET](https://img.shields.io/badge/-%207.0.100%20SDK-5C2D91?logo=.NET&logoColor=white&labelColor=222222)](https://dotnet.microsoft.com/download/dotnet/7.0) #### Supported IDEs -    -[Jetbrains Rider 2022.2.2](https://www.jetbrains.com/rider/download) -                          -[Visual Studio 2022](https://visualstudio.microsoft.com/downloads) -
-Rider 2022.2.2+             Visual Studio 2022+ -###### Note: VS Code is not currently supported. + +

Jetbrains Rider 2022.2.3+spaceVSCodespaceVisual Studio 2022 v17.4+

## Getting Started - Install prerequisite [requirements](https://github.com/modernuo/ModernUO#requirements) @@ -48,26 +55,36 @@ Rider 2022.2.2+            - Open `ModernUO.sln` to start developing ## Building/Publishing -- Run `./publish.cmd [release|debug (default: release)] [os]` - - `os` - [Supported operating systems](https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md) +- Run `./publish.cmd [release|debug (default: release)] [os] [arch (default: x64)]` + - `os` - [Supported operating systems](https://github.com/dotnet/core/blob/main/release-notes/7.0/supported-os.md) - `win` - Windows 10/11/2016/2019/2022 - - `osx` - MacOS 10.15/11.0+/12.0+ (Catalina, Big Sur, Monterey) - - `ubuntu.16.04`, `ubuntu.18.04` `ubuntu.20.04` - Ubuntu LTS - - `linuxmint.17`, `linuxmint.18`, `linuxmint.19` - Linux Mint - - `debian.10`, `debian.11` - Debian - - `centos.7`, `centos.8` - CentOS - - `fedora.32`, `fedora.33`, `fedora.34`, `fedora.35`, `fedora.36` - Fedora - - `rhel.7`, `rhel.8` - Redhat - - `linux` - Other linux distros - - If blank, the operating system running the build is used. Linux Mint 20 is not supported directly yet, so build explicitly against `ubuntu.20.04` instead. + - `osx` - MacOS 10.15/11/12/13 (Catalina, Big Sur, Monterey, Ventura) + - `linux` - Linux + - `arch` + - `x64` - Intel 64-bit + - `arm64` - ARM 64-bit + +## Linux Prerequisites +### Fedora, CentOS, RHEL, etc +```shell +dnf upgrade --refresh -y +# CentOS does not come with EPEL enabled +dnf install -y epel-release epel-next-release +# Note: libargon2 is old. +# Download/symlink from here: https://github.com/modernuo/Argon2.Bindings/tree/main/runtimes +dnf install -y findutils libicu zlib-devel zstd libargon2-devel +``` + +### Ubuntu, Debian, etc +```shell +apt-get update -y +apt-get install -y libicu-dev libz-dev zstd libargon2-dev +``` ## Running the Server - Follow the [publish](https://github.com/modernuo/ModernUO#publishing-builds) instructions - Run `ModernUO.exe` or `dotnet ModernUO.dll` from the `Distribution` directory on the server -**Note:** If you are running a version of linux that isn't listed above, then you may have to install the following using a package manager: - * `libargon2-dev`, `libz-dev`, and `zstd` - ## Troubleshooting / FAQ - See [FAQ](./FAQ.md) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5d03c7a41..7ed6ea4d2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,41 +15,10 @@ jobs: steps: - task: UseDotNet@2 - displayName: 'Install .NET 6' + displayName: 'Install .NET 7' inputs: packageType: sdk - version: 6.0.402 - - task: NuGetAuthenticate@1 - - script: ./publish.cmd Release - displayName: 'Build' - - script: dotnet test --no-restore - displayName: 'Test' - -- job: BuildLinux - strategy: - matrix: - 'CentOS 8': - containerImage: centos:8 - 'CentOS 7': - containerImage: centos:7 - 'Debian 11': - containerImage: mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim - 'Ubuntu 20': - containerImage: mcr.microsoft.com/dotnet/sdk:6.0-focal - - displayName: Linux - - pool: - vmImage: 'ubuntu-latest' - - container: $[ variables['containerImage'] ] - - steps: - - task: UseDotNet@2 - displayName: 'Install .NET 6' - inputs: - packageType: sdk - version: 6.0.402 + version: 7.0.100-rc.2.22477.23 - task: NuGetAuthenticate@1 - script: ./publish.cmd Release displayName: 'Build' diff --git a/docs/building-server.md b/docs/building-server.md index 9e2e63b71..bd793c978 100644 --- a/docs/building-server.md +++ b/docs/building-server.md @@ -7,15 +7,15 @@ title: Creating a build The server software must be built before it can be run. === "Windows" - Using _command prompt_, _git bash_, or _powershell_, run: + Using _windows terminal_, _git bash_, or _powershell_, run: ```bash - ./publish.cmd + ./publish.cmd ``` === "OSX/Linux" Using _terminal_, run: ```bash - ./publish.sh + ./publish.sh ```

`os` (_Optional_)
@@ -23,9 +23,11 @@ The operating system to build the server against. If not specified then the serv :fontawesome-brands-windows:{: .windows } `win`
:fontawesome-brands-apple:{: .apple } `osx`
-:fontawesome-brands-ubuntu:{: .ubuntu } `ubuntu.14.04` `ubuntu.16.04`, `ubuntu.18.04` `ubuntu.20.04`
-:brands-linuxmint:{: .linuxmint } `linuxmint.17` `linuxmint.18`, `linuxmint.19`, `ubuntu.20.04` for v20
-:brands-debian:{: .debian } `debian.9`, `debian.10`
-:fontawesome-brands-fedora:{: .fedora } `fedora.32`, `fedora.33`, `fedora.34`
-:fontawesome-brands-centos:{: .centos } `centos.7`, `centos.8`
-:fontawesome-brands-redhat:{: .redhat } `redhat.7`, `redhat.8` +:fontawesome-brands-linux:{: .linux } `linux`
+ +

+`arch` (_Optional_)
+The architecture to build the server against. If not specified then the server will be built for x64. + +`x64`
+`arm64`
diff --git a/docs/installation.md b/docs/installation.md index edf4c673b..817f5207d 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -6,15 +6,15 @@ title: Installation === "Windows" ### Prerequisites - 1. Download and install the latest [.NET 6 SDK](https://dotnet.microsoft.com/download/dotnet/6.0) + 1. Download and install the latest [.NET 7 SDK](https://dotnet.microsoft.com/download/dotnet/7.0) 1. Download and install from [here](https://git-scm.com/download/win) !!! Tip - Use Git Bash as your command prompt. This can be found in the Windows Start Menu after installation. + Use [Windows Terminal](https://learn.microsoft.com/en-us/windows/terminal/install) as your command prompt. ### Install ModernUO 1. Navigate to the folder where you want to install ModernUO. - 1. Using _Git Bash_ run: + 1. Using _Windows Terminal_ run: ```bash git clone https://github.com/modernuo/modernuo cd modernuo @@ -22,7 +22,7 @@ title: Installation === "OSX" ### Prerequisites - 1. Download and install the latest [.NET 6 SDK](https://dotnet.microsoft.com/download/dotnet/6.0). + 1. Download and install the latest [.NET 7 SDK](https://dotnet.microsoft.com/download/dotnet/7.0). 1. Using _terminal_, install [homebrew](https://brew.sh) and git: ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" @@ -37,7 +37,7 @@ title: Installation === "Linux" ### Prerequisites - 1. Download and install the latest [.NET 6 SDK](https://docs.microsoft.com/en-us/dotnet/core/install/linux). + 1. Download and install the latest [.NET 7 SDK](https://docs.microsoft.com/en-us/dotnet/core/install/linux). 1. Using _bash_, install git: ```bash sudo apt update && sudo apt install git diff --git a/docs/overrides/.icons/brands/debian.svg b/docs/overrides/.icons/brands/debian.svg deleted file mode 100644 index c249a7a2d..000000000 --- a/docs/overrides/.icons/brands/debian.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/docs/overrides/.icons/brands/linuxmint.svg b/docs/overrides/.icons/brands/linuxmint.svg deleted file mode 100644 index a9dcf1131..000000000 --- a/docs/overrides/.icons/brands/linuxmint.svg +++ /dev/null @@ -1 +0,0 @@ -Linux Mint \ No newline at end of file diff --git a/docs/overrides/partials/nav.html b/docs/overrides/partials/nav.html index c3a8bc1ce..8924593d6 100644 --- a/docs/overrides/partials/nav.html +++ b/docs/overrides/partials/nav.html @@ -52,7 +52,7 @@ {% include "partials/nav-item.html" %} {% endfor %}
  • - + Discord diff --git a/docs/starting-server.md b/docs/starting-server.md new file mode 100644 index 000000000..f7f82d4de --- /dev/null +++ b/docs/starting-server.md @@ -0,0 +1,22 @@ +--- +title: Starting the server +--- + +# Starting the server + +Now that the software has been built, all you need to do is run it! +Everything is run from the _Distribution_ folder. + +=== "Windows" + Using _windows terminal_, _git bash_, or _powershell_, run: + ```bash + cd Distribution + ModernUO.exe + ``` + +=== "OSX/Linux" + Using _terminal_, run: + ```bash + cd Distribution + dotnet run ModernUO.dll + ``` diff --git a/global.json b/global.json index d019e8b02..7cd6a1f4f 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "6.0.400", + "version": "7.0.0", "rollForward": "latestMajor", - "allowPrerelease": false + "allowPrerelease": true } } \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 9ab434a9c..43d8041c6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -72,6 +72,7 @@ nav: - 'Get Started': - 'installation.md' - 'building-server.md' + - 'starting-server.md' - 'Scripting guide': - 'scripting-guide/timers.md' - 'scripting-guide/serialization.md' diff --git a/publish.cmd b/publish.cmd index 6ce7daf6e..e2acbdcdb 100755 --- a/publish.cmd +++ b/publish.cmd @@ -5,14 +5,14 @@ GOTO :CMDSCRIPT ::SHELLSCRIPT config=$1 os=$2 +arch=${3:-x64} -if [[ $os ]]; then - os="-r $os-x64" +if [[ -n $os ]]; then + os="-r $os" elif [[ $(uname) = "Darwin" ]]; then - os="-r osx-x64" -elif [[ -f /etc/os-release ]]; then - . /etc/os-release - os="-r $(tr '[:upper:]' '[:lower:]' <<< $ID).$VERSION_ID-x64" + os="-r osx" +else + os="-r linux" fi if [[ $config ]]; then @@ -34,8 +34,8 @@ dotnet clean --verbosity quiet echo dotnet restore --force-evaluate --source https://api.nuget.org/v3/index.json dotnet restore --force-evaluate --source https://api.nuget.org/v3/index.json -echo dotnet publish ${config} ${os} --no-restore --self-contained=false -o Distribution/Assemblies Projects/UOContent/UOContent.csproj -dotnet publish ${config} ${os} --no-restore --self-contained=false -o Distribution/Assemblies Projects/UOContent/UOContent.csproj +echo dotnet publish ${config} ${os}-${arch} --no-restore --self-contained=false -o Distribution/Assemblies Projects/UOContent/UOContent.csproj +dotnet publish ${config} ${os}-${arch} --no-restore --self-contained=false -o Distribution/Assemblies Projects/UOContent/UOContent.csproj echo Generating serialization migration schema... dotnet tool run ModernUOSchemaGenerator -- ModernUO.sln @@ -55,9 +55,15 @@ IF "%~1" == "" ( ) IF "%~2" == "" ( - SET os=-r win-x64 + SET os=-r win ) ELSE ( - SET os=-r %~2-x64 + SET os=-r %~2 +) + +IF "%~3" == "" ( + SET arch=x64 +) ELSE ( + SET arch=%~3 ) echo dotnet tool restore @@ -68,8 +74,8 @@ dotnet clean --verbosity quiet echo dotnet restore --force-evaluate --source https://api.nuget.org/v3/index.json dotnet restore --force-evaluate --source https://api.nuget.org/v3/index.json -echo dotnet publish %config% %os% --no-restore --self-contained=false -o Distribution\Assemblies Projects\UOContent\UOContent.csproj -dotnet publish %config% %os% --no-restore --self-contained=false -o Distribution\Assemblies Projects\UOContent\UOContent.csproj +echo dotnet publish %config% %os%-%arch% --no-restore --self-contained=false -o Distribution\Assemblies Projects\UOContent\UOContent.csproj +dotnet publish %config% %os%-%arch% --no-restore --self-contained=false -o Distribution\Assemblies Projects\UOContent\UOContent.csproj echo Generating serialization migration schema... dotnet tool run ModernUOSchemaGenerator -- ModernUO.sln diff --git a/publish.sh b/publish.sh index df1d7baeb..12e7ddb28 100755 --- a/publish.sh +++ b/publish.sh @@ -1 +1,2 @@ +#!/bin/bash ./publish.cmd "$@" diff --git a/version.json b/version.json index 08ab2e7a1..a47c242d4 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "0.9.5" + "version": "0.9.6" }