From af1ad30c01a1db4280f1837a2db0aa9a5126044b Mon Sep 17 00:00:00 2001 From: AsY!um- <377468+AsYlum-@users.noreply.github.com> Date: Tue, 11 Nov 2025 18:32:13 +0100 Subject: [PATCH 1/3] Use .net 10. --- .github/workflows/build-and-release.yml | 12 ++++++------ .github/workflows/build-pr.yml | 6 +++--- README.md | 6 ++++++ Ultima/Ultima.csproj | 2 +- UoFiddler.Controls/Forms/AnimDataImportForm.cs | 3 +++ UoFiddler.Controls/Forms/ItemDetailForm.cs | 2 ++ UoFiddler.Controls/UoFiddler.Controls.csproj | 4 +--- .../UserControls/AnimatedPictureBox.cs | 4 ++++ UoFiddler.Controls/UserControls/ItemsControl.cs | 1 + UoFiddler.Controls/UserControls/LandTilesControl.cs | 2 ++ UoFiddler.Controls/UserControls/TexturesControl.cs | 2 ++ .../UserControls/TileView/TileViewControl.cs | 11 +++++++++++ .../UoFiddler.Plugin.Compare.csproj | 2 +- .../UoFiddler.Plugin.ExamplePlugin.csproj | 2 +- .../UoFiddler.Plugin.MassImport.csproj | 2 +- .../UoFiddler.Plugin.MultiEditor.csproj | 3 +-- .../UserControls/MultiEditorControl.cs | 2 ++ .../UoFiddler.Plugin.SendItem.csproj | 2 +- .../UoFiddler.Plugin.UopPacker.csproj | 2 +- UoFiddler/UoFiddler.csproj | 3 +-- 20 files changed, 51 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 7d1952a8..40286675 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -30,14 +30,14 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.2.2 + uses: actions/checkout@v5.0.0 with: fetch-depth: 0 - name: Install .NET Core - uses: actions/setup-dotnet@v4.3.1 + uses: actions/setup-dotnet@v5.0.0 with: - dotnet-version: 8.0.x + dotnet-version: 10.0.x - name: Restore & build the application run: dotnet build $env:Solution_Name --configuration $env:Configuration @@ -45,7 +45,7 @@ jobs: Configuration: ${{ matrix.configuration }} - name: Upload build artifacts - uses: actions/upload-artifact@v4.6.2 + uses: actions/upload-artifact@v5.0.0 with: name: ${{ env.Asset_Name }}.zip path: ./UOFiddler/bin/Release/ @@ -65,7 +65,7 @@ jobs: steps: - name: Download artifacts - uses: actions/download-artifact@v4.3.0 + uses: actions/download-artifact@v6.0.0 with: name: ${{ env.Asset_Name }}.zip path: ./${{ env.Asset_Name }}/ @@ -74,7 +74,7 @@ jobs: run: 7z a -tzip ${{ env.Asset_Name }}.zip './${{ env.Asset_Name }}' - name: Create release - uses: softprops/action-gh-release@v2.2.2 + uses: softprops/action-gh-release@v2.4.2 with: name: UOFiddler ${{ github.ref_name }} generate_release_notes: true diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 49965e77..36209f67 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -27,14 +27,14 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.2.2 + uses: actions/checkout@v5.0.0 with: fetch-depth: 1 - name: Install .NET Core - uses: actions/setup-dotnet@v4.3.1 + uses: actions/setup-dotnet@v5.0.0 with: - dotnet-version: 8.0.x + dotnet-version: 10.0.x - name: Restore & build the application run: dotnet build $env:Solution_Name --configuration $env:Configuration diff --git a/README.md b/README.md index 486b11b9..dce433cf 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,12 @@ We have dedicated channel on POL Discord: https://discord.gg/4JbC8hA ## Requirements +Starting from version 4.18.0: + +- Requires .NET Desktop Runtime 10.0.x (or SDK) installed to run the application. +- You can download .NET 10.0 at: +- Minimum supported Windows version is Windows 10. + Starting from version 4.11.0: - Requires .NET Desktop Runtime 8.0.x (or SDK) installed to run the application. diff --git a/Ultima/Ultima.csproj b/Ultima/Ultima.csproj index 2805890f..43e70b79 100644 --- a/Ultima/Ultima.csproj +++ b/Ultima/Ultima.csproj @@ -1,6 +1,6 @@  - net8.0-windows + net10.0-windows true true false diff --git a/UoFiddler.Controls/Forms/AnimDataImportForm.cs b/UoFiddler.Controls/Forms/AnimDataImportForm.cs index 34faa018..3081a939 100644 --- a/UoFiddler.Controls/Forms/AnimDataImportForm.cs +++ b/UoFiddler.Controls/Forms/AnimDataImportForm.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Windows.Forms; using UoFiddler.Controls.Classes; using static Ultima.Animdata; @@ -8,7 +9,9 @@ namespace UoFiddler.Controls.Forms { public partial class AnimDataImportForm : Form { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Action OnAfterImport { get; set; } + public AnimDataImportForm() { InitializeComponent(); diff --git a/UoFiddler.Controls/Forms/ItemDetailForm.cs b/UoFiddler.Controls/Forms/ItemDetailForm.cs index 4c1276bb..87c805b5 100644 --- a/UoFiddler.Controls/Forms/ItemDetailForm.cs +++ b/UoFiddler.Controls/Forms/ItemDetailForm.cs @@ -10,6 +10,7 @@ ***************************************************************************/ using System; +using System.ComponentModel; using System.Drawing; using System.Drawing.Imaging; using System.IO; @@ -44,6 +45,7 @@ public ItemDetailForm(int i) /// /// Sets Hue /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int Hue { get => _hue; diff --git a/UoFiddler.Controls/UoFiddler.Controls.csproj b/UoFiddler.Controls/UoFiddler.Controls.csproj index 19f83a7d..60bc9cac 100644 --- a/UoFiddler.Controls/UoFiddler.Controls.csproj +++ b/UoFiddler.Controls/UoFiddler.Controls.csproj @@ -1,7 +1,7 @@  Controls - net8.0-windows + net10.0-windows true false Controls @@ -428,8 +428,6 @@ - - \ No newline at end of file diff --git a/UoFiddler.Controls/UserControls/AnimatedPictureBox.cs b/UoFiddler.Controls/UserControls/AnimatedPictureBox.cs index f668302f..5052408f 100644 --- a/UoFiddler.Controls/UserControls/AnimatedPictureBox.cs +++ b/UoFiddler.Controls/UserControls/AnimatedPictureBox.cs @@ -67,6 +67,7 @@ public AnimatedFrame CurrentFrame get => _frames?[_frameIndex]; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int FrameIndex { get => _frameIndex; @@ -84,6 +85,7 @@ public int FrameIndex } } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool ShowFrameBounds { get => _showFrameBounds; @@ -94,6 +96,7 @@ public bool ShowFrameBounds } } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int FrameDelay { get => _timer.Interval; @@ -118,6 +121,7 @@ public int FrameDelay } } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool Animate { get => _animate; diff --git a/UoFiddler.Controls/UserControls/ItemsControl.cs b/UoFiddler.Controls/UserControls/ItemsControl.cs index 7f190d5b..b2c9e1e6 100644 --- a/UoFiddler.Controls/UserControls/ItemsControl.cs +++ b/UoFiddler.Controls/UserControls/ItemsControl.cs @@ -42,6 +42,7 @@ public ItemsControl() private int _selectedGraphicId = -1; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int SelectedGraphicId { get => _selectedGraphicId; diff --git a/UoFiddler.Controls/UserControls/LandTilesControl.cs b/UoFiddler.Controls/UserControls/LandTilesControl.cs index 0587e37f..96fbf902 100644 --- a/UoFiddler.Controls/UserControls/LandTilesControl.cs +++ b/UoFiddler.Controls/UserControls/LandTilesControl.cs @@ -11,6 +11,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Drawing.Imaging; using System.IO; @@ -41,6 +42,7 @@ public LandTilesControl() private readonly List _tileList = new List(); private bool _showFreeSlots; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int SelectedGraphicId { get => _selectedGraphicId; diff --git a/UoFiddler.Controls/UserControls/TexturesControl.cs b/UoFiddler.Controls/UserControls/TexturesControl.cs index 1448c34b..dc70ab9d 100644 --- a/UoFiddler.Controls/UserControls/TexturesControl.cs +++ b/UoFiddler.Controls/UserControls/TexturesControl.cs @@ -11,6 +11,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Drawing.Imaging; using System.IO; @@ -35,6 +36,7 @@ public TexturesControl() private bool _loaded; private int _selectedTextureId = -1; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int SelectedTextureId { get => _selectedTextureId; diff --git a/UoFiddler.Controls/UserControls/TileView/TileViewControl.cs b/UoFiddler.Controls/UserControls/TileView/TileViewControl.cs index 3807b499..36d715b8 100644 --- a/UoFiddler.Controls/UserControls/TileView/TileViewControl.cs +++ b/UoFiddler.Controls/UserControls/TileView/TileViewControl.cs @@ -26,6 +26,7 @@ public class TileViewControl : ScrollableControl /// /// Get or Set SelectedIndex, setting this property to -1 will remove selection, -2 is reserved for "do nothing". /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int FocusIndex { get => _focusIndex; @@ -100,6 +101,7 @@ private void ScrollToItem(int value) private bool _multiSelect; [Browsable(true)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool MultiSelect { get => _multiSelect; @@ -115,6 +117,7 @@ public bool MultiSelect /// /// Get or Set amount of Items to be displayed. /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int VirtualListSize { get => _virtualListSize; @@ -182,6 +185,7 @@ private static int DivUp(int a, int b) private Size _tileSize = new Size(256, 256); + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Size TileSize { get => _tileSize; @@ -194,6 +198,7 @@ public Size TileSize private Padding _tileMargin = new Padding(2, 2, 2, 2); // external + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Padding TileMargin { get => _tileMargin; @@ -206,6 +211,7 @@ public Padding TileMargin private Padding _tilePadding = new Padding(2, 2, 2, 2); + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Padding TilePadding { get => _tilePadding; @@ -218,6 +224,7 @@ public Padding TilePadding private readonly Pen _tileBorder = new Pen(Brushes.Black, 1.0f); + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public float TileBorderWidth { get => _tileBorder.Width; @@ -229,6 +236,7 @@ public float TileBorderWidth } [Browsable(true)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Color TileBorderColor { get => _tileBorder.Color; @@ -269,6 +277,7 @@ public double TileHighLightOpacity /// Focused tile border and highlight color /// [Browsable(true)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Color TileFocusColor { get => _tileFocusColor; @@ -285,6 +294,7 @@ public Color TileFocusColor /// Selected tile highlight color /// [Browsable(true)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Color TileHighlightColor { get => _tileHighlightColor; @@ -304,6 +314,7 @@ public Color TileHighlightColor /// Color of tile background /// [Browsable(true)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Color TileBackgroundColor { get => _tileBackgroundColor; diff --git a/UoFiddler.Plugin.Compare/UoFiddler.Plugin.Compare.csproj b/UoFiddler.Plugin.Compare/UoFiddler.Plugin.Compare.csproj index 0b601f8b..8c4b59fd 100644 --- a/UoFiddler.Plugin.Compare/UoFiddler.Plugin.Compare.csproj +++ b/UoFiddler.Plugin.Compare/UoFiddler.Plugin.Compare.csproj @@ -1,7 +1,7 @@  ComparePlugin - net8.0-windows + net10.0-windows true false ComparePlugin diff --git a/UoFiddler.Plugin.ExamplePlugin/UoFiddler.Plugin.ExamplePlugin.csproj b/UoFiddler.Plugin.ExamplePlugin/UoFiddler.Plugin.ExamplePlugin.csproj index 5cfd82a0..64eb371c 100644 --- a/UoFiddler.Plugin.ExamplePlugin/UoFiddler.Plugin.ExamplePlugin.csproj +++ b/UoFiddler.Plugin.ExamplePlugin/UoFiddler.Plugin.ExamplePlugin.csproj @@ -1,7 +1,7 @@  TestPlugin - net8.0-windows + net10.0-windows true false FiddlerPlugin diff --git a/UoFiddler.Plugin.MassImport/UoFiddler.Plugin.MassImport.csproj b/UoFiddler.Plugin.MassImport/UoFiddler.Plugin.MassImport.csproj index 05f2f23f..61ae7134 100644 --- a/UoFiddler.Plugin.MassImport/UoFiddler.Plugin.MassImport.csproj +++ b/UoFiddler.Plugin.MassImport/UoFiddler.Plugin.MassImport.csproj @@ -1,7 +1,7 @@  MassImport - net8.0-windows + net10.0-windows true false MassImportPlugin diff --git a/UoFiddler.Plugin.MultiEditor/UoFiddler.Plugin.MultiEditor.csproj b/UoFiddler.Plugin.MultiEditor/UoFiddler.Plugin.MultiEditor.csproj index 97293276..6e1dba97 100644 --- a/UoFiddler.Plugin.MultiEditor/UoFiddler.Plugin.MultiEditor.csproj +++ b/UoFiddler.Plugin.MultiEditor/UoFiddler.Plugin.MultiEditor.csproj @@ -1,7 +1,7 @@  MultiEditor - net8.0-windows + net10.0-windows true false MultiEditor @@ -63,6 +63,5 @@ - \ No newline at end of file diff --git a/UoFiddler.Plugin.MultiEditor/UserControls/MultiEditorControl.cs b/UoFiddler.Plugin.MultiEditor/UserControls/MultiEditorControl.cs index 753022b0..676e13ae 100644 --- a/UoFiddler.Plugin.MultiEditor/UserControls/MultiEditorControl.cs +++ b/UoFiddler.Plugin.MultiEditor/UserControls/MultiEditorControl.cs @@ -11,6 +11,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.IO; using System.Windows.Forms; @@ -75,6 +76,7 @@ public MultiEditorControl() /// /// Current Hovered Tile (set inside MultiComponentList) /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public MultiTile HoverTile { get => _hoverTile; diff --git a/UoFiddler.Plugin.SendItem/UoFiddler.Plugin.SendItem.csproj b/UoFiddler.Plugin.SendItem/UoFiddler.Plugin.SendItem.csproj index ca63a1a4..c1f9b17d 100644 --- a/UoFiddler.Plugin.SendItem/UoFiddler.Plugin.SendItem.csproj +++ b/UoFiddler.Plugin.SendItem/UoFiddler.Plugin.SendItem.csproj @@ -1,7 +1,7 @@  SendItem - net8.0-windows + net10.0-windows true false SendItem diff --git a/UoFiddler.Plugin.UopPacker/UoFiddler.Plugin.UopPacker.csproj b/UoFiddler.Plugin.UopPacker/UoFiddler.Plugin.UopPacker.csproj index 53db5f62..00e7269e 100644 --- a/UoFiddler.Plugin.UopPacker/UoFiddler.Plugin.UopPacker.csproj +++ b/UoFiddler.Plugin.UopPacker/UoFiddler.Plugin.UopPacker.csproj @@ -1,7 +1,7 @@  UOPPacker - net8.0-windows + net10.0-windows true false UOP Packer diff --git a/UoFiddler/UoFiddler.csproj b/UoFiddler/UoFiddler.csproj index 4ab4fbe9..b5ecafe8 100644 --- a/UoFiddler/UoFiddler.csproj +++ b/UoFiddler/UoFiddler.csproj @@ -3,7 +3,7 @@ WinExe Resources\UOFiddlerIcon.ico UoFiddler.Program - net8.0-windows + net10.0-windows true false UoFiddler @@ -153,7 +153,6 @@ - From 6d132b7b1dad7d2911e0fdff013afe6464cbcc23 Mon Sep 17 00:00:00 2001 From: AsY!um- <377468+AsYlum-@users.noreply.github.com> Date: Tue, 11 Nov 2025 18:52:33 +0100 Subject: [PATCH 2/3] Fix some warnings. --- Ultima/ASCIIFont.cs | 2 +- Ultima/Art.cs | 10 +++++----- Ultima/Client.cs | 2 +- Ultima/Gumps.cs | 6 +++--- Ultima/Hues.cs | 2 +- Ultima/RadarCol.cs | 2 +- Ultima/Sound.cs | 10 +++++----- Ultima/Textures.cs | 2 +- Ultima/TileData.cs | 2 +- Ultima/TileMatrix.cs | 6 +++--- Ultima/TileMatrixPatch.cs | 4 ++-- UoFiddler.Plugin.Compare/Classes/SecondArt.cs | 6 +++--- UoFiddler.Plugin.Compare/Classes/SecondFileIndex.cs | 2 +- UoFiddler.Plugin.Compare/Classes/SecondGump.cs | 4 ++-- UoFiddler.Plugin.Compare/Classes/SecondTexture.cs | 2 +- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Ultima/ASCIIFont.cs b/Ultima/ASCIIFont.cs index 0b75244e..6b46a83a 100644 --- a/Ultima/ASCIIFont.cs +++ b/Ultima/ASCIIFont.cs @@ -87,7 +87,7 @@ public static unsafe void Initialize() using (var reader = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) { var buffer = new byte[(int)reader.Length]; - reader.Read(buffer, 0, (int)reader.Length); + reader.ReadExactly(buffer, 0, (int)reader.Length); fixed (byte* bin = buffer) { byte* read = bin; diff --git a/Ultima/Art.cs b/Ultima/Art.cs index 4f3b87e4..6d1bcf3a 100644 --- a/Ultima/Art.cs +++ b/Ultima/Art.cs @@ -181,7 +181,7 @@ public static bool IsValidStatic(int index) } stream.Seek(4, SeekOrigin.Current); - stream.Read(_validBuffer, 0, 4); + stream.ReadExactly(_validBuffer, 0, 4); short width = (short)(_validBuffer[0] | (_validBuffer[1] << 8)); short height = (short)(_validBuffer[2] | (_validBuffer[3] << 8)); @@ -272,7 +272,7 @@ public static byte[] GetRawLand(int index) } var buffer = new byte[length]; - stream.Read(buffer, 0, length); + stream.ReadExactly(buffer, 0, length); stream.Close(); return buffer; } @@ -344,7 +344,7 @@ public static byte[] GetRawStatic(int index) } var buffer = new byte[length]; - stream.Read(buffer, 0, length); + stream.ReadExactly(buffer, 0, length); stream.Close(); return buffer; } @@ -429,7 +429,7 @@ private static unsafe Bitmap LoadStatic(Stream stream, int length) _streamBuffer = new byte[length]; } - stream.Read(_streamBuffer, 0, length); + stream.ReadExactly(_streamBuffer, 0, length); stream.Close(); Bitmap bmp; @@ -504,7 +504,7 @@ private static unsafe Bitmap LoadLand(Stream stream, int length) _streamBuffer = new byte[length]; } - stream.Read(_streamBuffer, 0, length); + stream.ReadExactly(_streamBuffer, 0, length); stream.Close(); fixed (byte* binData = _streamBuffer) { diff --git a/Ultima/Client.cs b/Ultima/Client.cs index 6db63470..20678e6f 100644 --- a/Ultima/Client.cs +++ b/Ultima/Client.cs @@ -90,7 +90,7 @@ public static int Read(ProcessStream pc, int bytes) { var buffer = new byte[bytes]; - pc.Read(buffer, 0, bytes); + pc.ReadExactly(buffer, 0, bytes); switch (bytes) { diff --git a/Ultima/Gumps.cs b/Ultima/Gumps.cs index 0b338781..15f77bb3 100644 --- a/Ultima/Gumps.cs +++ b/Ultima/Gumps.cs @@ -157,7 +157,7 @@ public static byte[] GetRawGump(int index, out int width, out int height) _streamBuffer = new byte[entry.Length]; } - stream.Read(_streamBuffer, 0, entry.Length); + stream.ReadExactly(_streamBuffer, 0, entry.Length); var result = UopUtils.Decompress(_streamBuffer); if (result.success is false) @@ -272,7 +272,7 @@ public static unsafe Bitmap GetGump(int index, Hue hue, bool onlyHueGrayPixels, _colorTable = colorTable = new byte[128]; } - stream.Read(streamBuffer, 0, length); + stream.ReadExactly(streamBuffer, 0, length); fixed (ushort* psHueColors = hue.Colors) { @@ -445,7 +445,7 @@ public static unsafe Bitmap GetGump(int index, out bool patched) _streamBuffer = new byte[length]; } - stream.Read(_streamBuffer, 0, length); + stream.ReadExactly(_streamBuffer, 0, length); uint width = (uint)entry.Extra1; uint height = (uint)entry.Extra2; diff --git a/Ultima/Hues.cs b/Ultima/Hues.cs index 19183ba8..7c508503 100644 --- a/Ultima/Hues.cs +++ b/Ultima/Hues.cs @@ -47,7 +47,7 @@ public static void Initialize() GCHandle gc = GCHandle.Alloc(buffer, GCHandleType.Pinned); try { - fs.Read(buffer, 0, buffer.Length); + fs.ReadExactly(buffer, 0, buffer.Length); long currentPos = 0; for (int i = 0; i < blockCount; ++i) diff --git a/Ultima/RadarCol.cs b/Ultima/RadarCol.cs index 22d05235..42b3d827 100644 --- a/Ultima/RadarCol.cs +++ b/Ultima/RadarCol.cs @@ -44,7 +44,7 @@ public static void Initialize() Colors = new ushort[fs.Length / 2]; GCHandle gc = GCHandle.Alloc(Colors, GCHandleType.Pinned); var buffer = new byte[(int)fs.Length]; - fs.Read(buffer, 0, (int)fs.Length); + fs.ReadExactly(buffer, 0, (int)fs.Length); Marshal.Copy(buffer, 0, gc.AddrOfPinnedObject(), (int)fs.Length); gc.Free(); } diff --git a/Ultima/Sound.cs b/Ultima/Sound.cs index dde1ddbc..a5b51c3d 100644 --- a/Ultima/Sound.cs +++ b/Ultima/Sound.cs @@ -130,8 +130,8 @@ public static UoSound GetSound(int soundId, out bool translated) var stringBuffer = new byte[32]; var buffer = new byte[length]; - stream.Read(stringBuffer, 0, 32); - stream.Read(buffer, 0, length); + stream.ReadExactly(stringBuffer, 0, 32); + stream.ReadExactly(buffer, 0, length); stream.Close(); var resultBuffer = new byte[buffer.Length + (waveHeader.Length << 2)]; @@ -233,7 +233,7 @@ public static bool IsValidSound(int soundId, out string name, out bool translate } var stringBuffer = new byte[32]; - stream.Read(stringBuffer, 0, 32); + stream.ReadExactly(stringBuffer, 0, 32); stream.Close(); name = Encoding.ASCII.GetString(stringBuffer); // seems that the null terminator's not being properly recognized :/ if (name.IndexOf('\0') > 0) @@ -303,7 +303,7 @@ public static void Add(int id, string name, string file) { byte[] resultBuffer = new byte[wav.Length]; wav.Seek(0, SeekOrigin.Begin); - wav.Read(resultBuffer, 0, (int)wav.Length); + wav.ReadExactly(resultBuffer, 0, (int)wav.Length); resultBuffer = CheckAndFixWave(resultBuffer); @@ -376,7 +376,7 @@ public static void Save(string path) { m.Seek(headerLength, SeekOrigin.Begin); var resultBuffer = new byte[m.Length - headerLength]; - m.Read(resultBuffer, 0, (int)m.Length - headerLength); + m.ReadExactly(resultBuffer, 0, (int)m.Length - headerLength); binmul.Write(resultBuffer); } diff --git a/Ultima/Textures.cs b/Ultima/Textures.cs index 2bb5736d..5106dc3a 100644 --- a/Ultima/Textures.cs +++ b/Ultima/Textures.cs @@ -140,7 +140,7 @@ public static unsafe Bitmap GetTexture(int index, out bool patched) byte[] streamBuffer = new byte[max]; - stream.Read(streamBuffer, 0, max); + stream.ReadExactly(streamBuffer, 0, max); fixed (byte* data = streamBuffer) { diff --git a/Ultima/TileData.cs b/Ultima/TileData.cs index 39c3c1f4..5f882373 100644 --- a/Ultima/TileData.cs +++ b/Ultima/TileData.cs @@ -1321,7 +1321,7 @@ public static unsafe void Initialize() long currentPos = 0; try { - fs.Read(buffer, 0, buffer.Length); + fs.ReadExactly(buffer, 0, buffer.Length); for (int i = 0; i < 0x4000; i += 32) { var ptrHeader = new IntPtr(gc.AddrOfPinnedObject() + currentPos); diff --git a/Ultima/TileMatrix.cs b/Ultima/TileMatrix.cs index b609b9a9..67bc0fec 100644 --- a/Ultima/TileMatrix.cs +++ b/Ultima/TileMatrix.cs @@ -241,7 +241,7 @@ private void InitStatics() GCHandle gc = GCHandle.Alloc(_staticIndex, GCHandleType.Pinned); var buffer = new byte[index.Length]; - index.Read(buffer, 0, (int)index.Length); + index.ReadExactly(buffer, 0, (int)index.Length); Marshal.Copy(buffer, 0, gc.AddrOfPinnedObject(), (int)Math.Min(index.Length, BlockHeight * BlockWidth * 12)); gc.Free(); for (var i = (int)Math.Min(index.Length, BlockHeight * BlockWidth); i < BlockHeight * BlockWidth; ++i) @@ -297,7 +297,7 @@ private unsafe HuedTile[][][] ReadStaticBlock(int x, int y) GCHandle gc = GCHandle.Alloc(_buffer, GCHandleType.Pinned); try { - _statics.Read(_buffer, 0, length); + _statics.ReadExactly(_buffer, 0, length); if (_lists == null) { @@ -496,7 +496,7 @@ private Tile[] ReadLandBlock(int x, int y) _buffer = new byte[192]; } - _map.Read(_buffer, 0, 192); + _map.ReadExactly(_buffer, 0, 192); Marshal.Copy(_buffer, 0, gc.AddrOfPinnedObject(), 192); } diff --git a/Ultima/TileMatrixPatch.cs b/Ultima/TileMatrixPatch.cs index a53bbb01..f66b3dd6 100644 --- a/Ultima/TileMatrixPatch.cs +++ b/Ultima/TileMatrixPatch.cs @@ -193,7 +193,7 @@ private int PatchLand(TileMatrix matrix, string dataPath, string indexPath) _buffer = new byte[192]; } - fsData.Read(_buffer, 0, 192); + fsData.ReadExactly(_buffer, 0, 192); Marshal.Copy(_buffer, 0, gc.AddrOfPinnedObject(), 192); } @@ -277,7 +277,7 @@ private int PatchStatics(TileMatrix matrix, string dataPath, string indexPath, s _buffer = new byte[length]; } - fsData.Read(_buffer, 0, length); + fsData.ReadExactly(_buffer, 0, length); Marshal.Copy(_buffer, 0, gc.AddrOfPinnedObject(), length); diff --git a/UoFiddler.Plugin.Compare/Classes/SecondArt.cs b/UoFiddler.Plugin.Compare/Classes/SecondArt.cs index 05e09114..5bebe9db 100644 --- a/UoFiddler.Plugin.Compare/Classes/SecondArt.cs +++ b/UoFiddler.Plugin.Compare/Classes/SecondArt.cs @@ -81,7 +81,7 @@ public static bool IsValidStatic(int index) } stream.Seek(4, SeekOrigin.Current); - stream.Read(_validBuffer, 0, 4); + stream.ReadExactly(_validBuffer, 0, 4); short width = (short)(_validBuffer[0] | (_validBuffer[1] << 8)); short height = (short)(_validBuffer[2] | (_validBuffer[3] << 8)); @@ -140,7 +140,7 @@ private static unsafe Bitmap LoadStatic(Stream stream, int length) _streamBuffer = new byte[length]; } - stream.Read(_streamBuffer, 0, length); + stream.ReadExactly(_streamBuffer, 0, length); stream.Close(); fixed (byte* data = _streamBuffer) @@ -255,7 +255,7 @@ private static unsafe Bitmap LoadLand(Stream stream, int length) _streamBuffer = new byte[length]; } - stream.Read(_streamBuffer, 0, length); + stream.ReadExactly(_streamBuffer, 0, length); stream.Close(); fixed (byte* binData = _streamBuffer) { diff --git a/UoFiddler.Plugin.Compare/Classes/SecondFileIndex.cs b/UoFiddler.Plugin.Compare/Classes/SecondFileIndex.cs index e2f06ff4..8d9fcbc3 100644 --- a/UoFiddler.Plugin.Compare/Classes/SecondFileIndex.cs +++ b/UoFiddler.Plugin.Compare/Classes/SecondFileIndex.cs @@ -119,7 +119,7 @@ public SecondFileIndex(string idxFile, string mulFile, int length) GCHandle gc = GCHandle.Alloc(Index, GCHandleType.Pinned); byte[] buffer = new byte[index.Length]; - index.Read(buffer, 0, (int)index.Length); + index.ReadExactly(buffer, 0, (int)index.Length); Marshal.Copy(buffer, 0, gc.AddrOfPinnedObject(), (int)Math.Min(IdxLength, length * 12)); gc.Free(); diff --git a/UoFiddler.Plugin.Compare/Classes/SecondGump.cs b/UoFiddler.Plugin.Compare/Classes/SecondGump.cs index 82b089fa..3932f9dc 100644 --- a/UoFiddler.Plugin.Compare/Classes/SecondGump.cs +++ b/UoFiddler.Plugin.Compare/Classes/SecondGump.cs @@ -74,7 +74,7 @@ public static byte[] GetRawGump(int index, out int width, out int height) } byte[] buffer = new byte[length]; - stream.Read(buffer, 0, length); + stream.ReadExactly(buffer, 0, length); return buffer; } @@ -111,7 +111,7 @@ public static unsafe Bitmap GetGump(int index) _streamBuffer = new byte[length]; } - stream.Read(_streamBuffer, 0, length); + stream.ReadExactly(_streamBuffer, 0, length); fixed (byte* data = _streamBuffer) { diff --git a/UoFiddler.Plugin.Compare/Classes/SecondTexture.cs b/UoFiddler.Plugin.Compare/Classes/SecondTexture.cs index 2e8eb6ad..8bdc410e 100644 --- a/UoFiddler.Plugin.Compare/Classes/SecondTexture.cs +++ b/UoFiddler.Plugin.Compare/Classes/SecondTexture.cs @@ -83,7 +83,7 @@ private static unsafe Bitmap LoadTexture(Stream stream, int extra) _streamBuffer = new byte[max]; } - stream.Read(_streamBuffer, 0, max); + stream.ReadExactly(_streamBuffer, 0, max); fixed (byte* data = _streamBuffer) { From df4e1267d9cc1522ec4f673bcc36063a9bd6b6ce Mon Sep 17 00:00:00 2001 From: AsY!um- <377468+AsYlum-@users.noreply.github.com> Date: Tue, 11 Nov 2025 18:46:52 +0100 Subject: [PATCH 3/3] Update change log and version. --- UoFiddler/Forms/AboutBoxForm.resx | 5 ++++- UoFiddler/UoFiddler.csproj | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/UoFiddler/Forms/AboutBoxForm.resx b/UoFiddler/Forms/AboutBoxForm.resx index 93afcf30..9ac7264f 100644 --- a/UoFiddler/Forms/AboutBoxForm.resx +++ b/UoFiddler/Forms/AboutBoxForm.resx @@ -118,7 +118,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Version 4.17.8 + Version 4.18.0 +- Use .net 10 runtime + +Version 4.17.8 - Fix for reading older artidx.mul files that were probably edited with mulpatcher or some other tool. Version 4.17.7 diff --git a/UoFiddler/UoFiddler.csproj b/UoFiddler/UoFiddler.csproj index b5ecafe8..7fef90f7 100644 --- a/UoFiddler/UoFiddler.csproj +++ b/UoFiddler/UoFiddler.csproj @@ -9,9 +9,9 @@ UoFiddler UoFiddler Copyright © 2025 - 4.17.8 - 4.17.8 - 4.17.8 + 4.18.0 + 4.18.0 + 4.18.0 true