Skip to content

Commit

Permalink
svip插件:修复过低版本的工程文件不能转换的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yqzhishen committed Apr 28, 2022
1 parent 81bd54c commit 06b4de8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions csharp/Plugins/BinSvip/BinarySvipConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public Project Load(string path, ConverterOptions options)
var stream = new FileStream(path, FileMode.Open, FileAccess.Read);
var reader = new BinaryReader(stream);
var version = reader.ReadString() + reader.ReadString();
var model = (SingingTool.Model.AppModel) new BinaryFormatter().Deserialize(stream);
stream.Close();
reader.Close();
var model = SingingTool.Model.ProjectModelFileMgr.ReadModelFile(path, out _, out _);
return new BinarySvipDecoder().DecodeProject(version, model);
}

Expand Down Expand Up @@ -68,14 +68,14 @@ private static string FindLibrary()
throw new FileNotFoundException("未检测到已安装的 X Studio · 歌手软件。");
}
var value = key.GetValue("").ToString().Split('"')[1];
return value.Substring(0, value.Length - 18);
return Path.GetDirectoryName(value);
}

private static Assembly SingingToolResolveEventHandler(object sender, ResolveEventArgs args)
{
var path = FindLibrary();
var filename = args.Name.Split(',')[0];
return Assembly.LoadFile($@"{path}\{filename}.dll");
return Assembly.LoadFile(Path.Combine(path, filename + ".dll"));
}
}
}
2 changes: 1 addition & 1 deletion csharp/Plugins/BinSvip/Properties.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Plugin>
<Name>BinSvip</Name>
<Version>1.1.1</Version>
<Version>1.1.2</Version>
<Author>YQ之神</Author>
<HomePage>https://space.bilibili.com/102844209</HomePage>
<Descriptions>原始二进制 .svip 文件转换插件。</Descriptions>
Expand Down

0 comments on commit 06b4de8

Please sign in to comment.