diff --git a/Pal.Client/Configuration.cs b/Pal.Client/Configuration.cs index 11499c4..ab75422 100644 --- a/Pal.Client/Configuration.cs +++ b/Pal.Client/Configuration.cs @@ -13,6 +13,7 @@ namespace Pal.Client #region Saved configuration values public bool FirstUse { get; set; } = true; public EMode Mode { get; set; } = EMode.Offline; + public string DebugAccountId { get; set; } public string AccountId { get; set; } public bool ShowTraps { get; set; } = true; diff --git a/Pal.Client/Plugin.cs b/Pal.Client/Plugin.cs index 516b9bc..b0d3d65 100644 --- a/Pal.Client/Plugin.cs +++ b/Pal.Client/Plugin.cs @@ -57,7 +57,6 @@ namespace Pal.Client var configWindow = pluginInterface.Create(); if (configWindow is not null) { - configWindow.IsOpen = true; Service.WindowSystem.AddWindow(configWindow); } diff --git a/Pal.Client/RemoteApi.cs b/Pal.Client/RemoteApi.cs index bb0ea31..091d392 100644 --- a/Pal.Client/RemoteApi.cs +++ b/Pal.Client/RemoteApi.cs @@ -43,13 +43,23 @@ namespace Pal.Client } var accountClient = new AccountService.AccountServiceClient(_channel); +#if DEBUG + string accountId = Service.Configuration.DebugAccountId; +#else string accountId = Service.Configuration.AccountId; +#endif if (string.IsNullOrEmpty(accountId)) { var createAccountReply = await accountClient.CreateAccountAsync(new CreateAccountRequest(), deadline: DateTime.UtcNow.AddSeconds(10), cancellationToken: cancellationToken); if (createAccountReply.Success) { - Service.Configuration.AccountId = accountId = createAccountReply.AccountId; + accountId = createAccountReply.AccountId; +#if DEBUG + Service.Configuration.DebugAccountId = accountId; +#else + Service.Configuration.AccountId = accountId; + +#endif Service.Configuration.Save(); } }