Skip to content

Commit 95c57ce

Browse files
committed
chore(deps): update to TShock v6.0.0
1 parent 3a9345d commit 95c57ce

File tree

11 files changed

+24
-23
lines changed

11 files changed

+24
-23
lines changed

Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir>
44
<CommonProjectPath>$(SolutionDir)src\VBY\Common\Common.csproj</CommonProjectPath>
55
<SharedCodePath>$(SolutionDir)src\SharedCode\</SharedCodePath>
6-
<TShockVersion>5.2.4</TShockVersion>
76
<OutToPlugin>true</OutToPlugin>
87
</PropertyGroup>
98
<PropertyGroup Condition="$([MSBuild]::IsOsPlatform('Windows'))">

Sdk/My.Plugins.Sdk/My.Plugins.Sdk.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<IsPackable>true</IsPackable>
66
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
77

8-
<TargetFramework>net6.0</TargetFramework>
8+
<TargetFramework>net9.0</TargetFramework>
99
<PackageId>My.Plugins.Sdk</PackageId>
1010
<PackageVersion>1.0.0</PackageVersion>
1111
<Authors>yu</Authors>
@@ -16,7 +16,7 @@
1616
</PropertyGroup>
1717
<ItemGroup>
1818
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-6qmf-mmc7-6c2p" />
19-
<PackageReference Include="TShock" Version="5.2.4" />
19+
<PackageReference Include="UnrealMultiple.TShock-Beta" Version="6.0.0" />
2020
</ItemGroup>
2121
<ItemGroup>
2222
<None Include="Sdk\Sdk.props;Sdk\Sdk.targets" Pack="true" PackagePath="sdk/%(Filename)%(Extension)" />

Sdk/My.Plugins.Sdk/Sdk/Sdk.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
88

99
<PropertyGroup>
10-
<TargetFramework>net6.0</TargetFramework>
10+
<TargetFramework>net9.0</TargetFramework>
1111
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
1212
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
1313
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
1414
</PropertyGroup>
1515

1616
<ItemGroup>
1717
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-6qmf-mmc7-6c2p" />
18-
<PackageReference Include="TShock" Version="$(TShockVersion)">
18+
<PackageReference Include="UnrealMultiple.TShock-Beta" Version="6.0.0">
1919
<ExcludeAssets>contentFiles</ExcludeAssets>
2020
</PackageReference>
2121
</ItemGroup>

Sdk/My.Plugins.Sdk/my.plugins.sdk.nuspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<description>custom sdk for TShock</description>
88
<readme>docs\readme.md</readme>
99
<dependencies>
10-
<group targetFramework="net6.0">
11-
<dependency id="TShock" version="5.2.0" />
10+
<group targetFramework="net9.0">
11+
<dependency id="UnrealMultiple.TShock-Beta" version="6.0.0" />
1212
</group>
1313
</dependencies>
1414
</metadata>
1515
<files>
1616
<file src="readme.md" target="docs\" />
1717
<file src="Sdk\*" target="sdk\" />
18-
<file src="lib\net6.0\*" target="lib\net6.0\" />
18+
<file src="lib\net9.0\*" target="lib\net9.0\" />
1919
</files>
2020
</package>

src/VBY/Common/Extensions/TShockExt.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ namespace TShockAPI.DB;
44

55
public static class TShockExt
66
{
7-
public static SqlTableCreator GetTableCreator(this IDbConnection db) => new(db, db.GetSqlType() == SqlType.Sqlite ? new SqliteQueryCreator() : new MysqlQueryCreator());
7+
public static SqlTableCreator GetTableCreator(this IDbConnection db) => new(db, db.GetSqlQueryBuilder());
88
}

src/VBY/GameContentModify/GameContentModify.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
using System.Text;
55

66
using Microsoft.Xna.Framework;
7-
7+
using MonoMod.RuntimeDetour.HookGen;
88
using MonoMod.RuntimeDetour;
99

1010
using Newtonsoft.Json;
1111
using Newtonsoft.Json.Linq;
1212

1313
using Terraria;
14-
using Terraria.GameContent.ItemDropRules;
1514
using Terraria.ID;
1615

1716
using TerrariaApi.Server;
@@ -49,6 +48,7 @@ private static void OnPostLoad(MainConfigInfo info, TSPlayer? player, bool first
4948
if (ReplaceMain.TownNPCIDIndexMap.TryGetValue(type, out var index))
5049
{
5150
list.Add(index);
51+
5252
}
5353
else
5454
{
@@ -94,8 +94,8 @@ private static void OnPostLoad(MainConfigInfo info, TSPlayer? player, bool first
9494
}
9595
});
9696
#pragma warning restore format
97-
private static readonly List<Detour> Detours = new();
98-
internal static readonly ReadOnlyDictionary<string, Detour> NamedDetours = new(new Dictionary<string, Detour>()
97+
private static readonly List<Hook> Detours = new();
98+
internal static readonly ReadOnlyDictionary<string, Hook> NamedDetours = new(new Dictionary<string, Hook>()
9999
{
100100
{ DetourNames.Item_CheckLavaDeath, Utils.GetDetour(ReplaceItem.CheckLavaDeath) },
101101
{ DetourNames.Item_MechSpawn, Utils.GetDetour(ReplaceItem.MechSpawn) },

src/VBY/GameContentModify/GameContentModify.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Import Project="..\..\..\Sdk\My.Plugins.Sdk\Sdk\Sdk.props"/>
44

55
<PropertyGroup>
6-
<Version>1.10.0.0</Version>
6+
<Version>1.10.0.1</Version>
77
<OutToPluginLoader>true</OutToPluginLoader>
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
99
<LangVersion>12.0</LangVersion>

src/VBY/GameContentModify/Utils.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@ public static void SetEmpty(this Chest chest)
4242
chest.item[i] = new Item();
4343
}
4444
}
45-
public static Detour GetNameDetour(Type targetMethodDeclaringType, Delegate replaceMethod, bool manualApply = true) => new Detour(targetMethodDeclaringType.GetMethod(replaceMethod.Method.Name), replaceMethod.Method, new DetourConfig() { ManualApply = manualApply });
46-
public static Detour GetNameDetour(Type targetMethodDeclaringType, MethodInfo replaceMethod, bool manualApply = true) => new Detour(targetMethodDeclaringType.GetMethod(replaceMethod.Name), replaceMethod, new DetourConfig() { ManualApply = manualApply });
47-
public static Detour GetDetour(Delegate method, bool manualApply = true)
45+
public static Hook GetNameDetour(Type targetMethodDeclaringType, Delegate replaceMethod, bool manualApply = true) => new Hook(targetMethodDeclaringType.GetMethod(replaceMethod.Method.Name), replaceMethod.Method);
46+
public static Hook GetNameDetour(Type targetMethodDeclaringType, MethodInfo replaceMethod, bool manualApply = true) => new Hook(targetMethodDeclaringType.GetMethod(replaceMethod.Name), replaceMethod);
47+
public static Hook GetDetour(Delegate method, bool manualApply = true)
4848
{
4949
return GetNameDetour(method.Method.DeclaringType!.GetCustomAttribute<ReplaceTypeAttribute>()!.Type, method, manualApply);
5050
}
51-
public static Detour GetParamDetour(Delegate method, bool manualApply = true)
51+
public static Hook GetParamDetour(Delegate method, bool manualApply = true)
5252
{
5353
var methodType = method.Method.DeclaringType!.GetCustomAttribute<ReplaceTypeAttribute>()!.Type;
54-
return new Detour(methodType.GetMethod(method.Method.Name, method.Method.GetParameters().Select(x => x.ParameterType).ToArray()), method.Method, new DetourConfig() { ManualApply = manualApply });
54+
return new Hook(methodType.GetMethod(method.Method.Name, method.Method.GetParameters().Select(x => x.ParameterType).ToArray())!, method.Method);
5555
}
56-
public static Detour GetParamDetour(Type targetMethodDeclaringType, MethodInfo method, bool manualApply = true)
56+
public static Hook GetParamDetour(Type targetMethodDeclaringType, MethodInfo method, bool manualApply = true)
5757
{
58-
return new Detour(targetMethodDeclaringType.GetMethod(method.Name, method.GetParameters().Select(x => x.ParameterType).ToArray()), method, new DetourConfig() { ManualApply = manualApply });
58+
return new Hook(targetMethodDeclaringType.GetMethod(method.Name, method.GetParameters().Select(x => x.ParameterType).ToArray())!, method);
5959
}
6060
public static void Deconstruct(this Chest chest, out int x, out int y)
6161
{

src/VBY/OtherCommand/OtherCommand.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<PropertyGroup>
66
<OutToPluginLoader>true</OutToPluginLoader>
7-
<Version>1.1.1.0</Version>
7+
<Version>1.1.1.1</Version>
88
</PropertyGroup>
99
<Import Project="..\..\..\Sdk\My.Plugins.Sdk\Sdk\Sdk.targets"/>
1010
</Project>

src/VBY/PluginLoader/PluginLoader.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public class PluginLoader : TerrariaPlugin
2121
{
2222
public override string Author => "yu";
2323
public override string Name => "VBY.PluginLoader";
24+
25+
public override Version Version => new(1, 0);
2426

2527
#pragma warning disable IDE0044 // 添加只读修饰符
2628
#pragma warning disable CS8618 // 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑声明为可以为 null。

0 commit comments

Comments
 (0)