Skip to content

Commit

Permalink
fix: 修复入口点问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Dissectum committed Sep 23, 2023
1 parent e420c9b commit 73d97e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/MBA.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ static bool SetConfig()
_ = SetGameServer();
}
while (!Config.Game.LanguageServer.IsValid());
Config.Game.PackageEntry = Config.Game.LanguageServer.GetPackageName();
Console.WriteLine();
return ret;
}
Expand Down
20 changes: 10 additions & 10 deletions src/MBA.Core/Enums/GameLanguageServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ public enum GameLanguageServer

public static class GameLanguageServerExtensions
{
private static readonly string JapanesePackageEntry = string.Empty;
private static readonly string GlobalPackageEntry = Encoding.UTF8.GetString(Convert.FromBase64String("Y29tLm5leG9uLmJsdWVhcmNoaXZlL2NvbS5uZXhvbi5ibHVlYXJjaGl2ZS5NeFVuaXR5UGxheWVyQWN0aXZpdHk="));
private static readonly string YoStarCNPackageEntry = Encoding.UTF8.GetString(Convert.FromBase64String("Y29tLlJvYW1pbmdTdGFyLkJsdWVBcmNoaXZlL2NvbS55b3N0YXIuc2RrLmJyaWRnZS5Zb1N0YXJVbml0eVBsYXllckFjdGl2aXR5"));
private static readonly string BilibiliPackageEntry = Encoding.UTF8.GetString(Convert.FromBase64String("Y29tLlJvYW1pbmdTdGFyLkJsdWVBcmNoaXZlLmJpbGliaWxpL2NvbS55b3N0YXIuc2RrLmJyaWRnZS5Zb1N0YXJVbml0eVBsYXllckFjdGl2aXR5"));

public static string GetPackageName(this G type)
=> type.IsValidJP() ? JapanesePackageEntry
: type.IsValidGL() ? GlobalPackageEntry
: type.IsYoStarCN() ? YoStarCNPackageEntry
: type.IsBilibili() ? BilibiliPackageEntry
private static readonly string _packageEntryJapanese = Encoding.UTF8.GetString(Convert.FromBase64String("Y29tLllvc3RhckpQLkJsdWVBcmNoaXZlL2NvbS55b3N0YXJqcC5ibHVlYXJjaGl2ZS5NeFVuaXR5UGxheWVyQWN0aXZpdHk="));
private static readonly string _packageEntryGlobal = Encoding.UTF8.GetString(Convert.FromBase64String("Y29tLm5leG9uLmJsdWVhcmNoaXZlL2NvbS5uZXhvbi5ibHVlYXJjaGl2ZS5NeFVuaXR5UGxheWVyQWN0aXZpdHk="));
private static readonly string _packageEntryYoStarCN = Encoding.UTF8.GetString(Convert.FromBase64String("Y29tLlJvYW1pbmdTdGFyLkJsdWVBcmNoaXZlL2NvbS55b3N0YXIuc3VwZXJzZGsuYWN0aXZpdHkuWW9TdGFyU3BsYXNoQWN0aXZpdHk="));
private static readonly string _packageEntryBilibili = Encoding.UTF8.GetString(Convert.FromBase64String("Y29tLlJvYW1pbmdTdGFyLkJsdWVBcmNoaXZlLmJpbGliaWxpL2NvbS55b3N0YXIuc3VwZXJzZGsuYWN0aXZpdHkuWW9TdGFyU3BsYXNoQWN0aXZpdHk="));

public static string GetPackageEntry(this G type)
=> type.IsValidJP() ? _packageEntryJapanese
: type.IsValidGL() ? _packageEntryGlobal
: type.IsYoStarCN() ? _packageEntryYoStarCN
: type.IsBilibili() ? _packageEntryBilibili
: ConfigManager.Config.Game.PackageEntry;

public static G GetLanguage(this G type)
Expand Down
2 changes: 1 addition & 1 deletion src/MBA.Core/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private MaaObject GetMaa()
GlobalInfo.ScreenshotHeight);
maa.Controller.SetOption(
ControllerOption.DefaultAppPackageEntry,
Config.Game.PackageEntry);
Config.Game.LanguageServer.GetPackageEntry());

return maa;
}
Expand Down

0 comments on commit 73d97e5

Please sign in to comment.