This commit is contained in:
Stanley Dimant
2023-03-20 11:06:25 +01:00
34 changed files with 1496 additions and 739 deletions

View File

@@ -55,6 +55,12 @@ public sealed class CommandManagerService : IDisposable
if (string.Equals(splitArgs[0], "toggle", StringComparison.OrdinalIgnoreCase))
{
if (_apiController.ServerState == WebAPI.SignalR.Utils.ServerState.Disconnecting)
{
_mediator.Publish(new NotificationMessage("Mare disconnecting", "Cannot use /toggle while Mare Synchronos is still disconnecting",
Dalamud.Interface.Internal.Notifications.NotificationType.Error));
}
if (_serverConfigurationManager.CurrentServer == null) return;
var fullPause = splitArgs.Length > 1 ? splitArgs[1] switch
{

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,6 @@
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Interface.Internal.Notifications;
using MareSynchronos.API.Data;
using MareSynchronos.API.Dto;
using MareSynchronos.PlayerData.Handlers;
using MareSynchronos.WebAPI.Files.Models;
@@ -54,5 +55,6 @@ public record DownloadStartedMessage(GameObjectHandler DownloadId, Dictionary<st
public record DownloadFinishedMessage(GameObjectHandler DownloadId) : IMessage;
public record UiToggleMessage(Type UiType) : IMessage;
public record PlayerUploadingMessage(GameObjectHandler Handler, bool IsUploading) : IMessage;
public record ClearProfileDataMessage(UserData? UserData = null) : IMessage;
#pragma warning restore MA0048 // File name must match type name

View File

@@ -23,17 +23,29 @@ public class ServerConfigurationManager
_serverTagConfig = serverTagConfig;
_notesConfig = notesConfig;
_dalamudUtil = dalamudUtil;
if (_configService.Current.CurrentServer < 0)
{
_configService.Current.CurrentServer = 0;
_configService.Save();
}
}
public string CurrentApiUrl => CurrentServer.ServerUri;
public ServerStorage CurrentServer => _configService.Current.ServerStorage[CurrentServerIndex];
public int CurrentServerIndex => _configService.Current.CurrentServer;
public int CurrentServerIndex
{
set
{
_configService.Current.CurrentServer = value;
_configService.Save();
}
get
{
if (_configService.Current.CurrentServer < 0)
{
_configService.Current.CurrentServer = 0;
_configService.Save();
}
return _configService.Current.CurrentServer;
}
}
public string? GetSecretKey(int serverIdx = -1)
{