preliminary api10 update

This commit is contained in:
Stanley Dimant
2024-07-17 00:35:28 +02:00
parent 8c56c91374
commit b9cf7eb6fa
34 changed files with 163 additions and 137 deletions

View File

@@ -1,8 +1,8 @@
using Dalamud.Interface.Internal.Notifications;
using MareSynchronos.API.Data.Enum;
using MareSynchronos.API.Data.Enum;
using MareSynchronos.API.Dto;
using MareSynchronos.API.Dto.Group;
using MareSynchronos.API.Dto.User;
using MareSynchronos.MareConfiguration.Models;
using MareSynchronos.Services.Mediator;
using Microsoft.AspNetCore.SignalR.Client;
using Microsoft.Extensions.Logging;

View File

@@ -5,6 +5,7 @@ using MareSynchronos.API.Dto;
using MareSynchronos.API.Dto.User;
using MareSynchronos.API.SignalR;
using MareSynchronos.MareConfiguration;
using MareSynchronos.MareConfiguration.Models;
using MareSynchronos.PlayerData.Pairs;
using MareSynchronos.Services;
using MareSynchronos.Services.Mediator;
@@ -193,7 +194,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
$"Your client is outdated ({currentClientVer.Major}.{currentClientVer.Minor}.{currentClientVer.Build}), current is: " +
$"{_connectionDto.CurrentClientVersion.Major}.{_connectionDto.CurrentClientVersion.Minor}.{_connectionDto.CurrentClientVersion.Build}. " +
$"This client version is incompatible and will not be able to connect. Please update your Mare Synchronos client.",
Dalamud.Interface.Internal.Notifications.NotificationType.Error));
NotificationType.Error));
}
await StopConnection(ServerState.VersionMisMatch).ConfigureAwait(false);
return;
@@ -205,7 +206,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
$"Your client is outdated ({currentClientVer.Major}.{currentClientVer.Minor}.{currentClientVer.Build}), current is: " +
$"{_connectionDto.CurrentClientVersion.Major}.{_connectionDto.CurrentClientVersion.Minor}.{_connectionDto.CurrentClientVersion.Build}. " +
$"Please keep your Mare Synchronos client up-to-date.",
Dalamud.Interface.Internal.Notifications.NotificationType.Warning));
NotificationType.Warning));
}
if (_dalamudUtil.HasModifiedGameFiles)
@@ -215,7 +216,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
Mediator.Publish(new NotificationMessage("Modified Game Files detected",
"Mare has detected modified game files in your FFXIV installation. You will be able to connect, but the synchronization functionality might be (partially) broken. " +
"Exit the game and repair it through XIVLauncher to get rid of this message.",
Dalamud.Interface.Internal.Notifications.NotificationType.Error, TimeSpan.FromSeconds(15)));
NotificationType.Error, TimeSpan.FromSeconds(15)));
}
await LoadIninitialPairs().ConfigureAwait(false);

View File

@@ -1,4 +1,5 @@
using MareSynchronos.API.Routes;
using MareSynchronos.MareConfiguration.Models;
using MareSynchronos.Services;
using MareSynchronos.Services.Mediator;
using MareSynchronos.Services.ServerConfiguration;
@@ -99,10 +100,10 @@ public sealed class TokenProvider : IDisposable, IMediatorSubscriber
{
if (isRenewal)
Mediator.Publish(new NotificationMessage("Error refreshing token", "Your authentication token could not be renewed. Try reconnecting to Mare manually.",
Dalamud.Interface.Internal.Notifications.NotificationType.Error));
NotificationType.Error));
else
Mediator.Publish(new NotificationMessage("Error generating token", "Your authentication token could not be generated. Check Mares main UI to see the error message.",
Dalamud.Interface.Internal.Notifications.NotificationType.Error));
NotificationType.Error));
Mediator.Publish(new DisconnectedMessage());
throw new MareAuthFailureException(response);
}
@@ -124,7 +125,7 @@ public sealed class TokenProvider : IDisposable, IMediatorSubscriber
Mediator.Publish(new NotificationMessage("Invalid system clock", "The clock of your computer is invalid. " +
"Mare will not function properly if the time zone is not set correctly. " +
"Please set your computers time zone correctly and keep your clock synchronized with the internet.",
Dalamud.Interface.Internal.Notifications.NotificationType.Error));
NotificationType.Error));
throw new InvalidOperationException($"JwtToken is behind DateTime.UtcNow, DateTime.UtcNow is possibly wrong. DateTime.UtcNow is {DateTime.UtcNow}, JwtToken.ValidTo is {jwtToken.ValidTo}");
}
return response;

View File

@@ -1,4 +1,4 @@
using Dalamud.Interface.Internal.Notifications;
using MareSynchronos.MareConfiguration.Models;
using MareSynchronos.Services.Mediator;
using Microsoft.AspNetCore.SignalR.Client;