Skip to content

Commit

Permalink
🐛 修复战网账号切换对旧版本数据支持问题
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbadmin committed Nov 30, 2024
1 parent 07f1a9f commit 35641d5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@
CommandParameter="{Binding Data.AssemblyLocation}"
Content="{Binding Path=Res.Plugin_OpenFolder, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
IsClickEnabled="True" />
<ui:SettingsExpanderItem
ActionIconSource="Open"
Command="{Binding $parent[spp:Settings_Plugin].((spp:SettingsPageViewModel)DataContext).OpenPluginCacheDirectory_Click}"
CommandParameter="{Binding Data.AppDataDirectory}"
Content="{Binding Path=Res.Plugin_OpenAppDataFolder, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
IsClickEnabled="True" />
<ui:SettingsExpanderItem
ActionIconSource="Open"
Command="{Binding $parent[spp:Settings_Plugin].((spp:SettingsPageViewModel)DataContext).OpenPluginCacheDirectory_Click}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ async ValueTask<bool> BasicCopyInAccount(string accId, PlatformAccount platform)
var selector = accFile.Split("::")[2];
if (!JTokenHelper.ReplaceVarInJsonFile(path, selector, jToken))
{
Toast.Show(ToastIcon.Error, AppResources.Error_ModifyJsonFileFailed);
//Toast.Show(ToastIcon.Error, AppResources.Error_ModifyJsonFileFailed);
Log.Error(nameof(BasicPlatformSwitcher), $"Failed to modify JSON file: {path}");
//return false;
}
continue;
Expand Down Expand Up @@ -179,7 +180,7 @@ async ValueTask<bool> ClearCurrentLoginUserCore(PlatformAccount platform)
{
var path = uniqueIdFile.Split("::")[0];
var selector = uniqueIdFile.Split("::")[1];
JTokenHelper.ReplaceVarInJsonFile(path, selector, "");
JTokenHelper.ReplaceVarInJsonFile(path, selector, string.Empty);
}

if (platform.UniqueIdType != UniqueIdType.CREATE_ID_FILE) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@
"PlatformIds": [ "b", "bnet", "battlenet", "blizzard" ],
"DefaultExePath": "%ProgramFiles(x86)%\\Battle.net\\Battle.net.exe",
"ExesToEnd": [ "Battle.net" ],
"ClearPaths": [ "SAME_AS_LOGIN_FILES" ],
"ClearPaths": [
"JSON_SELECT_FIRST,::%AppData%\\Battle.net\\Battle.net.config::$.Client.SavedAccountNames",
"%AppData%\\Battle.net\\WattToolkit.id"
],
"LoginFiles": {
"JSON_SELECT_FIRST,::%AppData%\\Battle.net\\Battle.net.config::$.Client.SavedAccountNames": "email.json",
"JSON_SELECT_FIRST,::%AppData%\\Battle.net\\Battle.net.config::$..Services.LastLoginRegion": "LastLoginRegion",
Expand Down
9 changes: 9 additions & 0 deletions src/BD.WTTS.Client/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/BD.WTTS.Client/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2267,6 +2267,9 @@
</data>
<data name="Plugin_OpenCacheFolder" xml:space="preserve">
<value>打开插件缓存文件夹</value>
</data>
<data name="Plugin_OpenAppDataFolder" xml:space="preserve">
<value>打开插件 AppData 文件夹</value>
</data>
<data name="Plugin_OpenFolder" xml:space="preserve">
<value>打开插件文件夹</value>
Expand Down

0 comments on commit 35641d5

Please sign in to comment.