Skip to content

Commit

Permalink
Merge pull request #385 from Controllerdestiny/main
Browse files Browse the repository at this point in the history
更新: AutoPluginManager
  • Loading branch information
Controllerdestiny authored Aug 11, 2024
2 parents 19492a2 + 063549d commit 141e343
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/plugins_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 插件发布

on:
push:
branches: [ "master","cai", "main"]
branches: [ "master","cai"]

jobs:
Build:
Expand Down
6 changes: 3 additions & 3 deletions AutoPluginManager/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Plugin : TerrariaPlugin
{
public override string Name => "AutoPluginManager";

public override Version Version => new(2, 0, 0, 1);
public override Version Version => new(2, 0, 0, 2);

public override string Author => "少司命,Cai";

Expand Down Expand Up @@ -303,7 +303,7 @@ private static void InstallPlugin(List<PluginVersionInfo> plugininfos)
{
foreach (var info in plugininfos)
{
string sourcePath = Path.Combine(TempSaveDir, "Plugins", info.Path);
string sourcePath = Path.Combine(TempSaveDir, "Plugins", "Plugins", info.Path);
string destinationPath = Path.Combine(ServerApi.ServerPluginsDirectoryPath, info.Path);
File.Copy(sourcePath, destinationPath, true);
//热添加插件emmm
Expand All @@ -318,7 +318,7 @@ private static List<PluginUpdateInfo> UpdatePlugin(List<PluginUpdateInfo> plugin
for (int i = pluginUpdateInfos.Count - 1; i >= 0; i--)
{
var pluginUpdateInfo = pluginUpdateInfos[i];
string sourcePath = Path.Combine(TempSaveDir, "Plugins", pluginUpdateInfo.RemotePath);
string sourcePath = Path.Combine(TempSaveDir, "Plugins", "Plugins", pluginUpdateInfo.RemotePath);
string destinationPath = Path.Combine(ServerApi.ServerPluginsDirectoryPath, pluginUpdateInfo.LocalPath);
// 确保目标目录存在
string destinationDirectory = Path.GetDirectoryName(destinationPath)!;
Expand Down
13 changes: 13 additions & 0 deletions Economics.Skill/Economics.Skill.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,17 @@
<ProjectReference Include="..\Economics.RPG\Economics.RPG.csproj" />
<ProjectReference Include="..\EconomicsAPI\EconomicsAPI.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="lib\" />
</ItemGroup>

<ItemGroup>
<Reference Include="Acornima">
<HintPath>lib\Acornima.dll</HintPath>
</Reference>
<Reference Include="Jint">
<HintPath>lib\Jint.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions Economics.Skill/Skill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Economics.Skill.Setting;
using EconomicsAPI.Configured;
using EconomicsAPI.EventArgs.PlayerEventArgs;
using Jint;
using System.Reflection;
using Terraria;
using TerrariaApi.Server;
Expand All @@ -22,6 +23,8 @@ public class Skill : TerrariaPlugin

public override Version Version => new(1, 2, 1, 0);

public static readonly Engine Script = new();

internal static string PATH = Path.Combine(EconomicsAPI.Economics.SaveDirPath, "Skill.json");

public long TimerCount;
Expand All @@ -32,6 +35,7 @@ public class Skill : TerrariaPlugin

public Skill(Main game) : base(game)
{

}

public override void Initialize()
Expand Down
Binary file added Economics.Skill/lib/Acornima.dll
Binary file not shown.
Binary file added Economics.Skill/lib/Jint.dll
Binary file not shown.

0 comments on commit 141e343

Please sign in to comment.