push client 0.3.0
This commit is contained in:
@@ -79,7 +79,7 @@ namespace MareSynchronos
|
||||
public Dictionary<string, Dictionary<string, string>> UidServerComments { get; set; } = new();
|
||||
|
||||
public Dictionary<string, string> UidComments { get; set; } = new();
|
||||
public int Version { get; set; } = 4;
|
||||
public int Version { get; set; } = 5;
|
||||
|
||||
public bool ShowTransferWindow { get; set; } = true;
|
||||
|
||||
@@ -195,6 +195,18 @@ namespace MareSynchronos
|
||||
Version = 4;
|
||||
Save();
|
||||
}
|
||||
|
||||
if (Version == 4)
|
||||
{
|
||||
Logger.Debug("Migrating Configuration from V4 to V5");
|
||||
|
||||
ApiUri = ApiUri.Replace("wss://v2202207178628194299.powersrv.de:6872", "wss://maresynchronos.com");
|
||||
ClientSecret.Remove("wss://v2202207178628194299.powersrv.de:6872");
|
||||
UidServerComments.Remove("wss://v2202207178628194299.powersrv.de:6872");
|
||||
|
||||
Version = 5;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<Authors></Authors>
|
||||
<Company></Company>
|
||||
<Version>0.2.14.0</Version>
|
||||
<Version>0.3.0</Version>
|
||||
<Description></Description>
|
||||
<Copyright></Copyright>
|
||||
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>
|
||||
|
||||
@@ -239,50 +239,26 @@ namespace MareSynchronos.UI
|
||||
ImGui.TextUnformatted("Service Registration");
|
||||
if (_uiShared.UidFontBuilt) ImGui.PopFont();
|
||||
ImGui.Separator();
|
||||
if (_pluginConfiguration.ClientSecret.ContainsKey(_pluginConfiguration.ApiUri) && _uiShared.ShowClientSecret)
|
||||
{
|
||||
ImGui.SetWindowFontScale(2f);
|
||||
UiShared.ColorTextWrapped("DO NOT GIVE THIS KEY TO OTHER PEOPLE.", ImGuiColors.DalamudYellow);
|
||||
ImGui.SetWindowFontScale(1f);
|
||||
ImGui.Separator();
|
||||
UiShared.TextWrapped(_pluginConfiguration.ClientSecret[_pluginConfiguration.ApiUri]);
|
||||
ImGui.Separator();
|
||||
if (ImGui.Button("Copy secret key to clipboard"))
|
||||
{
|
||||
ImGui.SetClipboardText(_pluginConfiguration.ClientSecret[_pluginConfiguration.ApiUri]);
|
||||
}
|
||||
UiShared.ColorTextWrapped("This is the only time you will be able to see this key in the UI. You can copy it to make a backup somewhere.", ImGuiColors.DalamudYellow);
|
||||
ImGui.Separator();
|
||||
UiShared.ColorTextWrapped("You are now ready to go. Press Finish to finalize the settings and open the Mare Synchronos main UI.", ImGuiColors.ParsedGreen);
|
||||
ImGui.Separator();
|
||||
if (ImGui.Button("Finish##finishIntro"))
|
||||
{
|
||||
SwitchToMainUi?.Invoke();
|
||||
IsOpen = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UiShared.TextWrapped("Registrations are currently closed. Join the Mare Synchronos server Discord for further information.");
|
||||
UiShared.TextWrapped("To be able to use Mare Synchronos you will have to register an account.");
|
||||
UiShared.TextWrapped("For the official Mare Synchronos Servers the account creation will be handled on the official Mare Synchronos Discord. Due to security risks for the server, there is no way to handle this senisibly otherwise.");
|
||||
UiShared.TextWrapped("If you want to register at the main server \"" + WebAPI.ApiController.MainServer + "\" join the Discord and follow the instructions as described in #registration.");
|
||||
|
||||
if (ImGui.Button("Mare Synchronos Discord"))
|
||||
if (ImGui.Button("Join the Mare Synchronos Discord"))
|
||||
{
|
||||
Util.OpenLink("https://discord.gg/mpNdkrTRjW");
|
||||
}
|
||||
|
||||
UiShared.TextWrapped("I'm sorry for the inconvenience caused, however the main service suffered from a DDoS-like attack a short time ago. I am currently working hard on implementing measures to avoid such issues in the future.");
|
||||
UiShared.TextWrapped("You can close this window for now.");
|
||||
UiShared.TextWrapped("For all other non official services you will have to contact the appropriate service provider how to obtain a secret key.");
|
||||
|
||||
ImGui.Separator();
|
||||
|
||||
UiShared.TextWrapped("If you made an account before (AND ONLY THEN) you can connect to the service using the tools provided below.");
|
||||
UiShared.TextWrapped("Once you have received a secret key you can connect to the service using the tools provided below.");
|
||||
|
||||
_uiShared.DrawServiceSelection(() =>
|
||||
{
|
||||
SwitchToMainUi?.Invoke();
|
||||
IsOpen = false;
|
||||
}, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -466,7 +466,7 @@ namespace MareSynchronos.UI
|
||||
|
||||
if (marePaused)
|
||||
{
|
||||
_uiShared.DrawServiceSelection(() => SwitchToIntroUi?.Invoke());
|
||||
_uiShared.DrawServiceSelection(() => { });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ namespace MareSynchronos.UI
|
||||
private readonly DalamudPluginInterface _pluginInterface;
|
||||
private readonly Dalamud.Localization _localization;
|
||||
public long FileCacheSize => _fileCacheManager.FileCacheSize;
|
||||
public bool ShowClientSecret = true;
|
||||
public string PlayerName => _dalamudUtil.PlayerName;
|
||||
public bool HasValidPenumbraModPath => !(_ipcManager.PenumbraModDirectory() ?? string.Empty).IsNullOrEmpty() && Directory.Exists(_ipcManager.PenumbraModDirectory());
|
||||
public bool EditTrackerPosition { get; set; }
|
||||
@@ -155,7 +154,7 @@ namespace MareSynchronos.UI
|
||||
}
|
||||
}
|
||||
|
||||
public void PrintServerState(bool isIntroUi = false)
|
||||
public void PrintServerState()
|
||||
{
|
||||
var serverName = _apiController.ServerDictionary.ContainsKey(_pluginConfiguration.ApiUri)
|
||||
? _apiController.ServerDictionary[_pluginConfiguration.ApiUri]
|
||||
@@ -262,7 +261,7 @@ namespace MareSynchronos.UI
|
||||
private bool _cacheDirectoryHasOtherFilesThanCache = false;
|
||||
private bool _cacheDirectoryIsValidPath = true;
|
||||
|
||||
public void DrawServiceSelection(Action? callBackOnExit = null, bool isIntroUi = false)
|
||||
public void DrawServiceSelection(Action? callBackOnExit = null)
|
||||
{
|
||||
string[] comboEntries = _apiController.ServerDictionary.Values.ToArray();
|
||||
_serverSelectionIndex = Array.IndexOf(_apiController.ServerDictionary.Keys.ToArray(), _pluginConfiguration.ApiUri);
|
||||
@@ -322,7 +321,7 @@ namespace MareSynchronos.UI
|
||||
ImGui.TreePop();
|
||||
}
|
||||
|
||||
PrintServerState(isIntroUi);
|
||||
PrintServerState();
|
||||
|
||||
if (!_apiController.ServerAlive && (_pluginConfiguration.ClientSecret.ContainsKey(_pluginConfiguration.ApiUri) && !_pluginConfiguration.ClientSecret[_pluginConfiguration.ApiUri].IsNullOrEmpty()))
|
||||
{
|
||||
@@ -338,7 +337,7 @@ namespace MareSynchronos.UI
|
||||
|
||||
string checkboxText = _pluginConfiguration.ClientSecret.ContainsKey(_pluginConfiguration.ApiUri)
|
||||
? "I want to switch accounts"
|
||||
: "I already have an account";
|
||||
: "I have an account";
|
||||
ImGui.Checkbox(checkboxText, ref _enterSecretKey);
|
||||
|
||||
if (_enterSecretKey)
|
||||
@@ -348,26 +347,13 @@ namespace MareSynchronos.UI
|
||||
{
|
||||
ColorTextWrapped("IF YOU HAVE NEVER MADE AN ACCOUNT BEFORE DO NOT ENTER ANYTHING HERE", ImGuiColors.DalamudYellow);
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.Text("If you made a mistake before or your account was deleted you can use this to re-register: ");
|
||||
ImGui.SameLine();
|
||||
if (ImGui.Button("Register##Reregister"))
|
||||
{
|
||||
_pluginConfiguration.FullPause = false;
|
||||
_pluginConfiguration.Save();
|
||||
Task.Run(() => _apiController.Register(isIntroUi));
|
||||
ShowClientSecret = true;
|
||||
callBackOnExit?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.SetNextItemWidth(400);
|
||||
ImGui.InputText("Enter Secret Key", ref _secretKey, 255);
|
||||
ImGui.SameLine();
|
||||
if (_secretKey.Length > 0 && _secretKey.Length != 64)
|
||||
{
|
||||
UiShared.ColorTextWrapped("Your secret key must be exactly 64 characters long. If try to enter your UID here, this is incorrect." +
|
||||
ColorTextWrapped("Your secret key must be exactly 64 characters long. If try to enter your UID here, this is incorrect." +
|
||||
" Don't enter anything but a prior acquired secret key here.", ImGuiColors.DalamudRed);
|
||||
}
|
||||
else if (_secretKey.Length == 64)
|
||||
@@ -378,7 +364,6 @@ namespace MareSynchronos.UI
|
||||
_pluginConfiguration.Save();
|
||||
_secretKey = string.Empty;
|
||||
Task.Run(_apiController.CreateConnections);
|
||||
ShowClientSecret = false;
|
||||
_enterSecretKey = false;
|
||||
callBackOnExit?.Invoke();
|
||||
}
|
||||
|
||||
@@ -17,21 +17,6 @@ namespace MareSynchronos.WebAPI
|
||||
await CreateConnections();
|
||||
}
|
||||
|
||||
public async Task Register(bool isIntroUi = false)
|
||||
{
|
||||
if (!ServerAlive) return;
|
||||
Logger.Debug("Registering at service " + ApiUri);
|
||||
//var response = await _mareHub!.InvokeAsync<string>(Api.InvokeUserRegister);
|
||||
//_pluginConfiguration.ClientSecret[ApiUri] = response;
|
||||
_pluginConfiguration.Save();
|
||||
if (!isIntroUi)
|
||||
{
|
||||
RegisterFinalized?.Invoke();
|
||||
}
|
||||
|
||||
await CreateConnections();
|
||||
}
|
||||
|
||||
public async Task<List<string>> GetOnlineCharacters()
|
||||
{
|
||||
return await _mareHub!.InvokeAsync<List<string>>(Api.InvokeUserGetOnlineCharacters);
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace MareSynchronos.WebAPI
|
||||
public partial class ApiController : IDisposable
|
||||
{
|
||||
public const string MainServer = "Lunae Crescere Incipientis (Central Server EU)";
|
||||
public const string MainServiceUri = "wss://v2202207178628194299.powersrv.de:6872";
|
||||
public const string MainServiceUri = "wss://maresynchronos.com";
|
||||
|
||||
public readonly int[] SupportedServerVersions = { Api.Version };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user