Skip to content

Commit d308fe6

Browse files
committed
Merge branch 'upcoming' into upcoming-nuget-release
2 parents de2f95b + ec432e2 commit d308fe6

7 files changed

Lines changed: 25 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838
patch_target: p,
3939
package_path: OTAPI.PC.nupkg,
4040
},
41-
{
42-
name: Mobile,
43-
patch_target: m,
44-
package_path: OTAPI.Mobile.nupkg,
45-
},
41+
# { plugins can do this, 1.4.5 might make this better, too.
42+
# name: Mobile,
43+
# patch_target: m,
44+
# package_path: OTAPI.Mobile.nupkg,
45+
# },
4646
# { this is ultimately not supported yet, consideration in future when time permits
4747
# name: tModLoader,
4848
# patch_target: t,

OTAPI.Patcher/OTAPI.Patcher.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net9.0</TargetFramework>
6-
<Version>3.3.0</Version>
6+
<Version>3.3.1</Version>
77
<PreserveCompilationContext>true</PreserveCompilationContext>
88
<RuntimeIdentifiers>win;osx;linux;</RuntimeIdentifiers>
99
<Nullable>enable</Nullable>

OTAPI.Patcher/Resolvers/PCFileResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class PCFileResolver : IFileResolver
2828
{
2929
public const String TerrariaWebsite = "https://terraria.org";
3030

31-
public virtual string SupportedDownloadUrl { get; } = $"{TerrariaWebsite}/api/download/pc-dedicated-server/terraria-server-1449.zip";
31+
public virtual string SupportedDownloadUrl { get; } = $"{TerrariaWebsite}/api/download/pc-dedicated-server/terraria-server-1450.zip";
3232

3333
public virtual string GetUrlFromHttpResponse(string content)
3434
{

OTAPI.Scripts/Patches/PatchNpcStrikeArgs.Server.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,18 @@ static void PatchNpcStrikeArgs(ModFwModder modder)
7373
switch (methodName.Replace(HookEmitter.HookMethodNamePrefix, ""))
7474
{
7575
case "MessageBuffer.GetData":
76+
// order matters with this logic...
77+
var hasWhoAmI = instr.Previous.OpCode == OpCodes.Ldfld &&
78+
instr.Previous.Operand is FieldReference fieldReference &&
79+
fieldReference.Name == "whoAmI";
80+
7681
var playerRef = Instruction.Create(OpCodes.Ldsfld, modder.Module.ImportReference(modder.GetFieldDefinition(() => Terraria.Main.player)));
7782
body.GetILProcessor().InsertBefore(instr, playerRef);
7883
body.GetILProcessor().InsertBefore(instr,
7984
new { OpCodes.Ldarg_0 },
8085
new { OpCodes.Ldfld, Operand = modder.Module.ImportReference(modder.GetFieldDefinition(() => (new Terraria.MessageBuffer()).whoAmI)) },
8186
new { OpCodes.Ldelem_Ref }
82-
);
83-
84-
var hasWhoAmI = instr.Previous.OpCode == OpCodes.Ldfld &&
85-
instr.Previous.Operand is FieldReference fieldReference &&
86-
fieldReference.Name == "whoAmI";
87+
);
8788
if (hasWhoAmI) { // 145+
8889
// rewire the branching
8990
var brs = instr.Previous(x => x.OpCode == OpCodes.Br_S);

OTAPI.Scripts/Shims/Xna/Graphics/GraphicsResource.Server.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ public void Dispose()
3232
public GraphicsDevice GraphicsDevice { get; set; }
3333

3434
public bool IsDisposed { get; set; }
35+
public string Name { get; set; }
36+
public object Tag { get; set; }
3537
}
3638
}

OTAPI.Scripts/Shims/Xna/Graphics/Texture2D.Server.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
1616
You should have received a copy of the GNU General Public License
1717
along with this program. If not, see <http://www.gnu.org/licenses/>.
18-
*/
19-
#pragma warning disable CS0436 // Type conflicts with imported type
20-
18+
*/
19+
#pragma warning disable CS0436 // Type conflicts with imported type
20+
2121
using System;
2222
using System.Runtime.InteropServices;
2323

@@ -35,6 +35,8 @@ public class Texture2D : Texture
3535
public int Height { get; set; }
3636

3737
public int Width { get; set; }
38+
39+
public Rectangle Bounds => new (0, 0, Width, Height);
3840

3941
public Texture2D (
4042
GraphicsDevice graphicsDevice,

OTAPI.Scripts/Shims/Xna/Input/KeyboardState.Server.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ public bool IsKeyDown(Keys key)
2929
return false;
3030
}
3131

32+
public bool IsKeyUp(Keys key)
33+
{
34+
return false;
35+
}
36+
3237
public Keys[] GetPressedKeys() { return Empty; }
3338
}
3439
}

0 commit comments

Comments
 (0)