From c4d0caf08c5b6912df34c19a76c31a062f806250 Mon Sep 17 00:00:00 2001 From: KRWCLASSIC Date: Tue, 24 Nov 2026 19:40:24 +0100 Subject: [PATCH 1/2] Update OTAPI to Terraria 1.4.6.0 --- OTAPI.Patcher/OTAPI.Patcher.csproj | 6 +++--- OTAPI.Patcher/Resolvers/PCFileResolver.cs | 4 ++-- OTAPI.Scripts/Mods/PatchNetplayBroadcast.Server.cs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OTAPI.Patcher/OTAPI.Patcher.csproj b/OTAPI.Patcher/OTAPI.Patcher.csproj index dd32e0dfe..a79c56011 100644 --- a/OTAPI.Patcher/OTAPI.Patcher.csproj +++ b/OTAPI.Patcher/OTAPI.Patcher.csproj @@ -1,13 +1,13 @@ - + Exe net9.0 - 3.3.14 + 3.3.15 true win;osx;linux; enable - Terraria 1.4.5.8 on .NET9 + Terraria 1.4.6.0 on .NET9 diff --git a/OTAPI.Patcher/Resolvers/PCFileResolver.cs b/OTAPI.Patcher/Resolvers/PCFileResolver.cs index 86965faeb..0ab661e48 100644 --- a/OTAPI.Patcher/Resolvers/PCFileResolver.cs +++ b/OTAPI.Patcher/Resolvers/PCFileResolver.cs @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2020 DeathCradle This file is part of Open Terraria API v3 (OTAPI) @@ -28,7 +28,7 @@ public class PCFileResolver : IFileResolver { public const String TerrariaWebsite = "https://terraria.org"; - public virtual string SupportedDownloadUrl { get; } = $"{TerrariaWebsite}/api/download/pc-dedicated-server/terraria-server-1458.zip"; + public virtual string SupportedDownloadUrl { get; } = $"{TerrariaWebsite}/api/download/pc-dedicated-server/terraria-server-146.zip"; public virtual string GetUrlFromHttpResponse(string content) { diff --git a/OTAPI.Scripts/Mods/PatchNetplayBroadcast.Server.cs b/OTAPI.Scripts/Mods/PatchNetplayBroadcast.Server.cs index 1b3e45cc9..9de16f63a 100644 --- a/OTAPI.Scripts/Mods/PatchNetplayBroadcast.Server.cs +++ b/OTAPI.Scripts/Mods/PatchNetplayBroadcast.Server.cs @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2020 DeathCradle This file is part of Open Terraria API v3 (OTAPI) @@ -43,7 +43,7 @@ void PatchNetplayBroadcast(MonoModder modder) i => i.OpCode == OpCodes.Call && i.Operand is MethodReference methodReference && methodReference.Name == "Sleep" - && i.Next.OpCode == OpCodes.Br_S + && (i.Next.OpCode == OpCodes.Br_S || i.Next.OpCode == OpCodes.Br) ); BroadcastThread.Index++; From bbb8f5044418d0f459c20ee0bd39fbf4a078fdde Mon Sep 17 00:00:00 2001 From: KRWCLASSIC Date: Tue, 24 Nov 2026 20:09:12 +0100 Subject: [PATCH 2/2] Guard WindowsLaunch.Preload to Windows only --- .../Patches/Terraria.WindowsLaunch.Server.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/OTAPI.Scripts/Patches/Terraria.WindowsLaunch.Server.cs b/OTAPI.Scripts/Patches/Terraria.WindowsLaunch.Server.cs index 4de76d86d..54250e802 100644 --- a/OTAPI.Scripts/Patches/Terraria.WindowsLaunch.Server.cs +++ b/OTAPI.Scripts/Patches/Terraria.WindowsLaunch.Server.cs @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2020 DeathCradle This file is part of Open Terraria API v3 (OTAPI) @@ -18,12 +18,12 @@ You should have received a copy of the GNU General Public License */ #pragma warning disable CS0626 // Method, operator, or accessor is marked external and has no attributes on it -#if !tModLoader_V1_4 +#if !tModLoader_V1_4 using System.Runtime.InteropServices; -/// -/// @doc Improves cross platform launch checks and add extra launch features -/// +/// +/// @doc Improves cross platform launch checks and add extra launch features +/// namespace Terraria { class patch_WindowsLaunch @@ -38,6 +38,15 @@ public static bool SetConsoleCtrlHandler(WindowsLaunch.HandlerRoutine handler, b return false; } + public static extern void orig_Preload(string nativeLibName); + public static void Preload(string nativeLibName) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + orig_Preload(nativeLibName); + } + } + ///// ///// Allows consumers to override the clrjit resolution (if applied) /////