mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-14 02:14:15 +01:00
attempt to gracefully reconnect, do not send notification for player on connect, do not check other players on framework update thread, delay palette+ sending data
This commit is contained in:
parent
680c5f4712
commit
fc3ad1f7f8
6 changed files with 58 additions and 24 deletions
|
|
@ -294,7 +294,7 @@ public partial class ApiController : MediatorSubscriberBase, IDisposable, IMareH
|
|||
|
||||
foreach (var entry in await UserGetOnlinePairs().ConfigureAwait(false))
|
||||
{
|
||||
_pairManager.MarkPairOnline(entry, this, false);
|
||||
_pairManager.MarkPairOnline(entry, this, sendNotif: false);
|
||||
}
|
||||
|
||||
_healthCheckTokenSource?.Cancel();
|
||||
|
|
@ -323,7 +323,7 @@ public partial class ApiController : MediatorSubscriberBase, IDisposable, IMareH
|
|||
options.Headers.Add("Authorization", "Bearer " + _serverManager.GetToken());
|
||||
options.Transports = HttpTransportType.WebSockets | HttpTransportType.ServerSentEvents | HttpTransportType.LongPolling;
|
||||
})
|
||||
.WithAutomaticReconnect(new ForeverRetryPolicy())
|
||||
.WithAutomaticReconnect(new ForeverRetryPolicy(Mediator))
|
||||
.ConfigureLogging(a =>
|
||||
{
|
||||
a.ClearProviders().AddProvider(new DalamudLoggingProvider());
|
||||
|
|
@ -347,15 +347,10 @@ public partial class ApiController : MediatorSubscriberBase, IDisposable, IMareH
|
|||
|
||||
private Task MareHubOnReconnecting(Exception? arg)
|
||||
{
|
||||
_connectionDto = null;
|
||||
_healthCheckTokenSource?.Cancel();
|
||||
ServerState = ServerState.Reconnecting;
|
||||
Mediator.Publish(new NotificationMessage("Connection lost", "Connection lost to " + _serverManager.CurrentServer!.ServerName, NotificationType.Error, 5000));
|
||||
Logger.Warn("Connection closed... Reconnecting");
|
||||
Logger.Warn(arg?.Message ?? string.Empty);
|
||||
Logger.Warn(arg?.StackTrace ?? string.Empty);
|
||||
Mediator.Publish(new DisconnectedMessage());
|
||||
_pairManager.ClearPairs();
|
||||
Mediator.Publish(new NotificationMessage("Connection lost", "Connection lost to " + _serverManager.CurrentServer!.ServerName, NotificationType.Warning, 5000));
|
||||
Logger.Warn("Connection closed... Reconnecting", arg);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue