mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-13 14:54:15 +01:00
fix some shit maybe
This commit is contained in:
parent
505d50a547
commit
6ed4e06eb1
2 changed files with 13 additions and 6 deletions
|
|
@ -54,9 +54,9 @@ public record CharacterDataCreatedMessage(CharacterData CharacterData) : SameThr
|
||||||
public record CharacterDataAnalyzedMessage : MessageBase;
|
public record CharacterDataAnalyzedMessage : MessageBase;
|
||||||
public record PenumbraStartRedrawMessage(IntPtr Address) : MessageBase;
|
public record PenumbraStartRedrawMessage(IntPtr Address) : MessageBase;
|
||||||
public record PenumbraEndRedrawMessage(IntPtr Address) : MessageBase;
|
public record PenumbraEndRedrawMessage(IntPtr Address) : MessageBase;
|
||||||
public record HubReconnectingMessage(Exception? Exception) : MessageBase;
|
public record HubReconnectingMessage(Exception? Exception) : SameThreadMessage;
|
||||||
public record HubReconnectedMessage(string? Arg) : MessageBase;
|
public record HubReconnectedMessage(string? Arg) : SameThreadMessage;
|
||||||
public record HubClosedMessage(Exception? Exception) : MessageBase;
|
public record HubClosedMessage(Exception? Exception) : SameThreadMessage;
|
||||||
public record DownloadReadyMessage(Guid RequestId) : MessageBase;
|
public record DownloadReadyMessage(Guid RequestId) : MessageBase;
|
||||||
public record DownloadStartedMessage(GameObjectHandler DownloadId, Dictionary<string, FileDownloadStatus> DownloadStatus) : MessageBase;
|
public record DownloadStartedMessage(GameObjectHandler DownloadId, Dictionary<string, FileDownloadStatus> DownloadStatus) : MessageBase;
|
||||||
public record DownloadFinishedMessage(GameObjectHandler DownloadId) : MessageBase;
|
public record DownloadFinishedMessage(GameObjectHandler DownloadId) : MessageBase;
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
||||||
Mediator.Subscribe<DalamudLoginMessage>(this, (_) => DalamudUtilOnLogIn());
|
Mediator.Subscribe<DalamudLoginMessage>(this, (_) => DalamudUtilOnLogIn());
|
||||||
Mediator.Subscribe<DalamudLogoutMessage>(this, (_) => DalamudUtilOnLogOut());
|
Mediator.Subscribe<DalamudLogoutMessage>(this, (_) => DalamudUtilOnLogOut());
|
||||||
Mediator.Subscribe<HubClosedMessage>(this, (msg) => MareHubOnClosed(msg.Exception));
|
Mediator.Subscribe<HubClosedMessage>(this, (msg) => MareHubOnClosed(msg.Exception));
|
||||||
Mediator.Subscribe<HubReconnectedMessage>(this, (msg) => _ = Task.Run(MareHubOnReconnected));
|
Mediator.Subscribe<HubReconnectedMessage>(this, async (msg) => await MareHubOnReconnected().ConfigureAwait(false));
|
||||||
Mediator.Subscribe<HubReconnectingMessage>(this, (msg) => MareHubOnReconnecting(msg.Exception));
|
Mediator.Subscribe<HubReconnectingMessage>(this, (msg) => MareHubOnReconnecting(msg.Exception));
|
||||||
Mediator.Subscribe<CyclePauseMessage>(this, (msg) => _ = CyclePause(msg.UserData));
|
Mediator.Subscribe<CyclePauseMessage>(this, (msg) => _ = CyclePause(msg.UserData));
|
||||||
|
|
||||||
|
|
@ -187,7 +187,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
||||||
$"Your client is outdated ({currentClientVer.Major}.{currentClientVer.Minor}.{currentClientVer.Build}), current is: " +
|
$"Your client is outdated ({currentClientVer.Major}.{currentClientVer.Minor}.{currentClientVer.Build}), current is: " +
|
||||||
$"{_connectionDto.CurrentClientVersion.Major}.{_connectionDto.CurrentClientVersion.Minor}.{_connectionDto.CurrentClientVersion.Build}. " +
|
$"{_connectionDto.CurrentClientVersion.Major}.{_connectionDto.CurrentClientVersion.Minor}.{_connectionDto.CurrentClientVersion.Build}. " +
|
||||||
$"Please keep your Mare Synchronos client up-to-date.",
|
$"Please keep your Mare Synchronos client up-to-date.",
|
||||||
Dalamud.Interface.Internal.Notifications.NotificationType.Error));
|
Dalamud.Interface.Internal.Notifications.NotificationType.Warning));
|
||||||
}
|
}
|
||||||
|
|
||||||
await LoadIninitialPairs().ConfigureAwait(false);
|
await LoadIninitialPairs().ConfigureAwait(false);
|
||||||
|
|
@ -370,13 +370,13 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
InitializeApiHooks();
|
InitializeApiHooks();
|
||||||
await LoadIninitialPairs().ConfigureAwait(false);
|
|
||||||
_connectionDto = await GetConnectionDto().ConfigureAwait(false);
|
_connectionDto = await GetConnectionDto().ConfigureAwait(false);
|
||||||
if (_connectionDto.ServerVersion != IMareHub.ApiVersion)
|
if (_connectionDto.ServerVersion != IMareHub.ApiVersion)
|
||||||
{
|
{
|
||||||
await StopConnection(ServerState.VersionMisMatch).ConfigureAwait(false);
|
await StopConnection(ServerState.VersionMisMatch).ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
await LoadIninitialPairs().ConfigureAwait(false);
|
||||||
await LoadOnlinePairs().ConfigureAwait(false);
|
await LoadOnlinePairs().ConfigureAwait(false);
|
||||||
ServerState = ServerState.Connected;
|
ServerState = ServerState.Connected;
|
||||||
}
|
}
|
||||||
|
|
@ -418,6 +418,13 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
||||||
await StopConnection(ServerState.Unauthorized).ConfigureAwait(false);
|
await StopConnection(ServerState.Unauthorized).ConfigureAwait(false);
|
||||||
requireReconnect = true;
|
requireReconnect = true;
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogWarning(ex, "Could not refresh token, forcing reconnect");
|
||||||
|
_doNotNotifyOnNextInfo = true;
|
||||||
|
await CreateConnections().ConfigureAwait(false);
|
||||||
|
requireReconnect = true;
|
||||||
|
}
|
||||||
|
|
||||||
return requireReconnect;
|
return requireReconnect;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue