Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions OTAPI.Patcher/OTAPI.Patcher.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<Version>3.3.14</Version>
<Version>3.3.15</Version>
<PreserveCompilationContext>true</PreserveCompilationContext>
<RuntimeIdentifiers>win;osx;linux;</RuntimeIdentifiers>
<Nullable>enable</Nullable>
<PackageReleaseNotes>Terraria 1.4.5.8 on .NET9</PackageReleaseNotes>
<PackageReleaseNotes>Terraria 1.4.6.0 on .NET9</PackageReleaseNotes>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ModFramework.Modules.ClearScript" Version="1.1.15" />
Expand Down
4 changes: 2 additions & 2 deletions OTAPI.Patcher/Resolvers/PCFileResolver.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
Copyright (C) 2020 DeathCradle

This file is part of Open Terraria API v3 (OTAPI)
Expand Down Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions OTAPI.Scripts/Mods/PatchNetplayBroadcast.Server.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
Copyright (C) 2020 DeathCradle

This file is part of Open Terraria API v3 (OTAPI)
Expand Down Expand Up @@ -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++;
Expand Down
19 changes: 14 additions & 5 deletions OTAPI.Scripts/Patches/Terraria.WindowsLaunch.Server.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
Copyright (C) 2020 DeathCradle

This file is part of Open Terraria API v3 (OTAPI)
Expand All @@ -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;

/// <summary>
/// @doc Improves cross platform launch checks and add extra launch features
/// </summary>
/// <summary>
/// @doc Improves cross platform launch checks and add extra launch features
/// </summary>
namespace Terraria
{
class patch_WindowsLaunch
Expand All @@ -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);
}
}

///// <summary>
///// Allows consumers to override the clrjit resolution (if applied)
///// </summary>
Expand Down