forked from Eauldane/SnowcloakClient
Compare commits
13 Commits
c39229a28b
...
0.2.3
Author | SHA1 | Date | |
---|---|---|---|
f0cef81b5e | |||
d8160effd0
|
|||
18da07763c
|
|||
3c448f2290
|
|||
cadc7e223f | |||
e1baca7940 | |||
c2e0cf65a8 | |||
a3d0408d6f | |||
9ca6931bb8 | |||
f22eff1f72 | |||
11e097d696 | |||
f7ecb45774 | |||
00a7328e3a |
@@ -7,6 +7,7 @@ namespace MareSynchronos.MareConfiguration.Configurations;
|
|||||||
[Serializable]
|
[Serializable]
|
||||||
public class MareConfig : IMareConfiguration
|
public class MareConfig : IMareConfiguration
|
||||||
{
|
{
|
||||||
|
public bool SortSyncshellsByVRAM { get; set; } = false;
|
||||||
public int ExpectedTOSVersion = 2;
|
public int ExpectedTOSVersion = 2;
|
||||||
public int AcceptedTOSVersion { get; set; } = 0;
|
public int AcceptedTOSVersion { get; set; } = 0;
|
||||||
public bool AcceptedAgreement { get; set; } = false;
|
public bool AcceptedAgreement { get; set; } = false;
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
<Project Sdk="Dalamud.NET.Sdk/13.0.0">
|
<Project Sdk="Dalamud.NET.Sdk/13.0.0">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AssemblyName>Snowcloak</AssemblyName>
|
<AssemblyName>Snowcloak</AssemblyName>
|
||||||
<Version>0.2.1</Version>
|
<Version>0.2.2</Version>
|
||||||
<PackageProjectUrl>https://github.com/Eauldane/SnowcloakClient/</PackageProjectUrl>
|
<PackageProjectUrl>https://git.snowcloak-sync.com/Eauldane/SnowcloakClient/</PackageProjectUrl>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -14,10 +14,12 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Chaos.NaCl.Standard" Version="1.0.0" />
|
<PackageReference Include="Chaos.NaCl.Standard" Version="1.0.0" />
|
||||||
<PackageReference Include="Downloader" Version="3.3.4" />
|
<PackageReference Include="Downloader" Version="4.0.3" />
|
||||||
<PackageReference Include="K4os.Compression.LZ4.Legacy" Version="1.3.8" />
|
<PackageReference Include="K4os.Compression.LZ4.Legacy" Version="1.3.8" />
|
||||||
<PackageReference Include="K4os.Compression.LZ4.Streams" Version="1.3.8" />
|
<PackageReference Include="K4os.Compression.LZ4.Streams" Version="1.3.8" />
|
||||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.212">
|
<PackageReference Include="MessagePack" Version="3.1.4" />
|
||||||
|
<PackageReference Include="MessagePack.Annotations" Version="3.1.4" />
|
||||||
|
<PackageReference Include="Meziantou.Analyzer" Version="2.0.213">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
@@ -29,6 +31,8 @@
|
|||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.14.0" />
|
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.14.0" />
|
||||||
|
<PackageReference Update="DalamudPackager" Version="13.1.0" />
|
||||||
|
<PackageReference Include="System.IO.Pipelines" Version="9.0.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="Exists('.\Penumbra.Api\Penumbra.Api.csproj')">
|
<ItemGroup Condition="Exists('.\Penumbra.Api\Penumbra.Api.csproj')">
|
||||||
|
@@ -235,11 +235,17 @@ public class Pair : DisposableMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
string? noteOrName = GetNoteOrName();
|
string? noteOrName = GetNoteOrName();
|
||||||
|
|
||||||
if (noteOrName != null)
|
if (_mareConfig.Current.SortSyncshellsByVRAM)
|
||||||
|
{
|
||||||
|
return($"0{LastAppliedApproximateVRAMBytes}");
|
||||||
|
}
|
||||||
|
else if (noteOrName != null) {
|
||||||
return $"0{noteOrName}";
|
return $"0{noteOrName}";
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
return $"9{UserData.AliasOrUID}";
|
return $"9{UserData.AliasOrUID}";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string GetPlayerNameHash()
|
public string GetPlayerNameHash()
|
||||||
{
|
{
|
||||||
|
@@ -9,6 +9,6 @@
|
|||||||
"customization"
|
"customization"
|
||||||
],
|
],
|
||||||
"IconUrl": "https://raw.githubusercontent.com/Eauldane/SnowcloakClient/refs/heads/main/MareSynchronos/images/logo.png",
|
"IconUrl": "https://raw.githubusercontent.com/Eauldane/SnowcloakClient/refs/heads/main/MareSynchronos/images/logo.png",
|
||||||
"RepoUrl": "https://github.com/Eauldane/SnowcloakClient",
|
"RepoUrl": "https://git.snowcloak-sync.com/Eauldane/SnowcloakClient",
|
||||||
"CanUnloadAsync": true
|
"CanUnloadAsync": true
|
||||||
}
|
}
|
||||||
|
@@ -20,6 +20,7 @@ public class DrawGroupPair : DrawPairBase
|
|||||||
private readonly GroupPairFullInfoDto _fullInfoDto;
|
private readonly GroupPairFullInfoDto _fullInfoDto;
|
||||||
private readonly GroupFullInfoDto _group;
|
private readonly GroupFullInfoDto _group;
|
||||||
private readonly CharaDataManager _charaDataManager;
|
private readonly CharaDataManager _charaDataManager;
|
||||||
|
public long VRAMUsage { get; set; }
|
||||||
|
|
||||||
public DrawGroupPair(string id, Pair entry, ApiController apiController,
|
public DrawGroupPair(string id, Pair entry, ApiController apiController,
|
||||||
MareMediator mareMediator, GroupFullInfoDto group, GroupPairFullInfoDto fullInfoDto,
|
MareMediator mareMediator, GroupFullInfoDto group, GroupPairFullInfoDto fullInfoDto,
|
||||||
@@ -80,6 +81,7 @@ public class DrawGroupPair : DrawPairBase
|
|||||||
}
|
}
|
||||||
if (_pair.LastAppliedDataBytes >= 0)
|
if (_pair.LastAppliedDataBytes >= 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
presenceText += UiSharedService.TooltipSeparator;
|
presenceText += UiSharedService.TooltipSeparator;
|
||||||
presenceText += ((!_pair.IsVisible) ? "(Last) " : string.Empty) + "Mods Info" + Environment.NewLine;
|
presenceText += ((!_pair.IsVisible) ? "(Last) " : string.Empty) + "Mods Info" + Environment.NewLine;
|
||||||
presenceText += "Files Size: " + UiSharedService.ByteToString(_pair.LastAppliedDataBytes, true);
|
presenceText += "Files Size: " + UiSharedService.ByteToString(_pair.LastAppliedDataBytes, true);
|
||||||
@@ -127,6 +129,9 @@ public class DrawGroupPair : DrawPairBase
|
|||||||
|
|
||||||
protected override float DrawRightSide(float textPosY, float originalY)
|
protected override float DrawRightSide(float textPosY, float originalY)
|
||||||
{
|
{
|
||||||
|
var pauseIcon = _pair.IsPaused ? FontAwesomeIcon.Play : FontAwesomeIcon.Pause;
|
||||||
|
var pauseIconSize = _uiSharedService.GetIconButtonSize(pauseIcon);
|
||||||
|
var spacingX = ImGui.GetStyle().ItemSpacing.X;
|
||||||
var entryUID = _fullInfoDto.UserAliasOrUID;
|
var entryUID = _fullInfoDto.UserAliasOrUID;
|
||||||
var entryIsMod = _fullInfoDto.GroupPairStatusInfo.IsModerator();
|
var entryIsMod = _fullInfoDto.GroupPairStatusInfo.IsModerator();
|
||||||
var entryIsOwner = string.Equals(_pair.UserData.UID, _group.OwnerUID, StringComparison.Ordinal);
|
var entryIsOwner = string.Equals(_pair.UserData.UID, _group.OwnerUID, StringComparison.Ordinal);
|
||||||
@@ -145,19 +150,27 @@ public class DrawGroupPair : DrawPairBase
|
|||||||
bool showInfo = (individualAnimDisabled || individualSoundsDisabled || animDisabled || soundsDisabled);
|
bool showInfo = (individualAnimDisabled || individualSoundsDisabled || animDisabled || soundsDisabled);
|
||||||
bool showPlus = _pair.UserPair == null;
|
bool showPlus = _pair.UserPair == null;
|
||||||
bool showBars = (userIsOwner || (userIsModerator && !entryIsMod && !entryIsOwner)) || !_pair.IsPaused;
|
bool showBars = (userIsOwner || (userIsModerator && !entryIsMod && !entryIsOwner)) || !_pair.IsPaused;
|
||||||
|
bool showPause = true;
|
||||||
var spacing = ImGui.GetStyle().ItemSpacing.X;
|
var spacing = ImGui.GetStyle().ItemSpacing.X;
|
||||||
var permIcon = (individualAnimDisabled || individualSoundsDisabled || individualVFXDisabled) ? FontAwesomeIcon.ExclamationTriangle
|
var permIcon = (individualAnimDisabled || individualSoundsDisabled || individualVFXDisabled) ? FontAwesomeIcon.ExclamationTriangle
|
||||||
: ((soundsDisabled || animDisabled || vfxDisabled) ? FontAwesomeIcon.InfoCircle : FontAwesomeIcon.None);
|
: ((soundsDisabled || animDisabled || vfxDisabled) ? FontAwesomeIcon.InfoCircle : FontAwesomeIcon.None);
|
||||||
var runningIconWidth = _uiSharedService.GetIconButtonSize(FontAwesomeIcon.Running).X;
|
var runningIconWidth = _uiSharedService.GetIconButtonSize(FontAwesomeIcon.Running).X;
|
||||||
var infoIconWidth = UiSharedService.GetIconSize(permIcon).X;
|
var infoIconWidth = UiSharedService.GetIconSize(permIcon).X;
|
||||||
var plusButtonWidth = _uiSharedService.GetIconButtonSize(FontAwesomeIcon.Plus).X;
|
var plusButtonWidth = _uiSharedService.GetIconButtonSize(FontAwesomeIcon.Plus).X;
|
||||||
|
var pauseButtonWidth = _uiSharedService.GetIconButtonSize(FontAwesomeIcon.Plus).X;
|
||||||
|
|
||||||
var barButtonWidth = _uiSharedService.GetIconButtonSize(FontAwesomeIcon.Bars).X;
|
var barButtonWidth = _uiSharedService.GetIconButtonSize(FontAwesomeIcon.Bars).X;
|
||||||
|
var barButtonSize = _uiSharedService.GetIconButtonSize(FontAwesomeIcon.Bars);
|
||||||
|
|
||||||
|
var windowEndX = ImGui.GetWindowContentRegionMin().X + UiSharedService.GetWindowContentRegionWidth();
|
||||||
|
var rightSidePos = windowEndX - barButtonSize.X;
|
||||||
|
|
||||||
|
|
||||||
var pos = ImGui.GetWindowContentRegionMin().X + UiSharedService.GetWindowContentRegionWidth() + spacing
|
var pos = ImGui.GetWindowContentRegionMin().X + UiSharedService.GetWindowContentRegionWidth() + spacing
|
||||||
- (showShared ? (runningIconWidth + spacing) : 0)
|
- (showShared ? (runningIconWidth + spacing) : 0)
|
||||||
- (showInfo ? (infoIconWidth + spacing) : 0)
|
- (showInfo ? (infoIconWidth + spacing) : 0)
|
||||||
- (showPlus ? (plusButtonWidth + spacing) : 0)
|
- (showPlus ? (plusButtonWidth + spacing) : 0)
|
||||||
|
- (showPause ? (pauseButtonWidth + spacing) : 0)
|
||||||
- (showBars ? (barButtonWidth + spacing) : 0);
|
- (showBars ? (barButtonWidth + spacing) : 0);
|
||||||
|
|
||||||
ImGui.SameLine(pos);
|
ImGui.SameLine(pos);
|
||||||
@@ -264,6 +277,7 @@ public class DrawGroupPair : DrawPairBase
|
|||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (showPlus)
|
if (showPlus)
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(originalY);
|
ImGui.SetCursorPosY(originalY);
|
||||||
@@ -275,7 +289,25 @@ public class DrawGroupPair : DrawPairBase
|
|||||||
UiSharedService.AttachToolTip("Pair with " + entryUID + " individually");
|
UiSharedService.AttachToolTip("Pair with " + entryUID + " individually");
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
}
|
}
|
||||||
|
if (showPause)
|
||||||
|
{
|
||||||
|
//rightSidePos -= pauseIconSize.X + spacingX;
|
||||||
|
ImGui.SetCursorPosY(originalY);
|
||||||
|
|
||||||
|
if (_uiSharedService.IconButton(pauseIcon))
|
||||||
|
{
|
||||||
|
var perm = _pair.UserPair!.OwnPermissions;
|
||||||
|
perm.SetPaused(!perm.IsPaused());
|
||||||
|
_ = _apiController.UserSetPairPermissions(new(_pair.UserData, perm));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
UiSharedService.AttachToolTip(!_fullInfoDto.GroupUserPermissions.IsPaused()
|
||||||
|
? "Pause pairing with " + entryUID
|
||||||
|
: "Resume pairing with " + entryUID);
|
||||||
|
ImGui.SameLine();
|
||||||
|
|
||||||
|
}
|
||||||
if (showBars)
|
if (showBars)
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(originalY);
|
ImGui.SetCursorPosY(originalY);
|
||||||
@@ -285,7 +317,6 @@ public class DrawGroupPair : DrawPairBase
|
|||||||
ImGui.OpenPopup("Popup");
|
ImGui.OpenPopup("Popup");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.BeginPopup("Popup"))
|
if (ImGui.BeginPopup("Popup"))
|
||||||
{
|
{
|
||||||
if ((userIsModerator || userIsOwner) && !(entryIsMod || entryIsOwner))
|
if ((userIsModerator || userIsOwner) && !(entryIsMod || entryIsOwner))
|
||||||
|
@@ -19,6 +19,7 @@ public class DrawUserPair : DrawPairBase
|
|||||||
protected readonly MareMediator _mediator;
|
protected readonly MareMediator _mediator;
|
||||||
private readonly SelectGroupForPairUi _selectGroupForPairUi;
|
private readonly SelectGroupForPairUi _selectGroupForPairUi;
|
||||||
private readonly CharaDataManager _charaDataManager;
|
private readonly CharaDataManager _charaDataManager;
|
||||||
|
public long VramUsage { get; set; }
|
||||||
|
|
||||||
public DrawUserPair(string id, Pair entry, UidDisplayHandler displayHandler, ApiController apiController,
|
public DrawUserPair(string id, Pair entry, UidDisplayHandler displayHandler, ApiController apiController,
|
||||||
MareMediator mareMediator, SelectGroupForPairUi selectGroupForPairUi,
|
MareMediator mareMediator, SelectGroupForPairUi selectGroupForPairUi,
|
||||||
@@ -84,6 +85,7 @@ public class DrawUserPair : DrawPairBase
|
|||||||
visibleTooltip += "Files Size: " + UiSharedService.ByteToString(_pair.LastAppliedDataBytes, true);
|
visibleTooltip += "Files Size: " + UiSharedService.ByteToString(_pair.LastAppliedDataBytes, true);
|
||||||
if (_pair.LastAppliedApproximateVRAMBytes >= 0)
|
if (_pair.LastAppliedApproximateVRAMBytes >= 0)
|
||||||
{
|
{
|
||||||
|
VramUsage = _pair.LastAppliedApproximateVRAMBytes;
|
||||||
visibleTooltip += Environment.NewLine + "Approx. VRAM Usage: " + UiSharedService.ByteToString(_pair.LastAppliedApproximateVRAMBytes, true);
|
visibleTooltip += Environment.NewLine + "Approx. VRAM Usage: " + UiSharedService.ByteToString(_pair.LastAppliedApproximateVRAMBytes, true);
|
||||||
}
|
}
|
||||||
if (_pair.LastAppliedDataTris >= 0)
|
if (_pair.LastAppliedDataTris >= 0)
|
||||||
@@ -97,6 +99,8 @@ public class DrawUserPair : DrawPairBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected override float DrawRightSide(float textPosY, float originalY)
|
protected override float DrawRightSide(float textPosY, float originalY)
|
||||||
{
|
{
|
||||||
var pauseIcon = _pair.UserPair!.OwnPermissions.IsPaused() ? FontAwesomeIcon.Play : FontAwesomeIcon.Pause;
|
var pauseIcon = _pair.UserPair!.OwnPermissions.IsPaused() ? FontAwesomeIcon.Play : FontAwesomeIcon.Pause;
|
||||||
|
@@ -427,12 +427,13 @@ internal sealed class GroupPanel
|
|||||||
var visibleUsers = new List<DrawGroupPair>();
|
var visibleUsers = new List<DrawGroupPair>();
|
||||||
var onlineUsers = new List<DrawGroupPair>();
|
var onlineUsers = new List<DrawGroupPair>();
|
||||||
var offlineUsers = new List<DrawGroupPair>();
|
var offlineUsers = new List<DrawGroupPair>();
|
||||||
|
|
||||||
|
|
||||||
foreach (var pair in sortedPairs)
|
foreach (var pair in sortedPairs)
|
||||||
{
|
{
|
||||||
var drawPair = new DrawGroupPair(
|
var drawPair = new DrawGroupPair(
|
||||||
groupDto.GID + pair.UserData.UID, pair,
|
groupDto.GID + pair.UserData.UID, pair,
|
||||||
ApiController, _mainUi.Mediator, groupDto,
|
ApiController, _mainUi.Mediator, groupDto,
|
||||||
pair.GroupPair.Single(
|
pair.GroupPair.Single(
|
||||||
g => GroupDataComparer.Instance.Equals(g.Key.Group, groupDto.Group)
|
g => GroupDataComparer.Instance.Equals(g.Key.Group, groupDto.Group)
|
||||||
).Value,
|
).Value,
|
||||||
@@ -453,6 +454,8 @@ internal sealed class GroupPanel
|
|||||||
ImGui.TextUnformatted("Visible");
|
ImGui.TextUnformatted("Visible");
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
_uidDisplayHandler.RenderPairList(visibleUsers);
|
_uidDisplayHandler.RenderPairList(visibleUsers);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (onlineUsers.Count > 0)
|
if (onlineUsers.Count > 0)
|
||||||
|
@@ -956,6 +956,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
_uiShared.BigText("UI");
|
_uiShared.BigText("UI");
|
||||||
var showCharacterNames = _configService.Current.ShowCharacterNames;
|
var showCharacterNames = _configService.Current.ShowCharacterNames;
|
||||||
var showVisibleSeparate = _configService.Current.ShowVisibleUsersSeparately;
|
var showVisibleSeparate = _configService.Current.ShowVisibleUsersSeparately;
|
||||||
|
var sortSyncshellByVRAM = _configService.Current.SortSyncshellsByVRAM;
|
||||||
var showOfflineSeparate = _configService.Current.ShowOfflineUsersSeparately;
|
var showOfflineSeparate = _configService.Current.ShowOfflineUsersSeparately;
|
||||||
var showProfiles = _configService.Current.ProfilesShow;
|
var showProfiles = _configService.Current.ProfilesShow;
|
||||||
var showNsfwProfiles = _configService.Current.ProfilesAllowNsfw;
|
var showNsfwProfiles = _configService.Current.ProfilesAllowNsfw;
|
||||||
@@ -1074,7 +1075,14 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
_configService.Save();
|
_configService.Save();
|
||||||
}
|
}
|
||||||
_uiShared.DrawHelpText("This will show all currently visible users in a special 'Visible' group in the main UI.");
|
_uiShared.DrawHelpText("This will show all currently visible users in a special 'Visible' group in the main UI.");
|
||||||
|
if (ImGui.Checkbox("Sort visible syncshell users by VRAM usage", ref sortSyncshellByVRAM))
|
||||||
|
{
|
||||||
|
_configService.Current.SortSyncshellsByVRAM = sortSyncshellByVRAM;
|
||||||
|
_logger.LogWarning("Changing value: {sortSyncshellsByVRAM}", sortSyncshellByVRAM);
|
||||||
|
|
||||||
|
_configService.Save();
|
||||||
|
}
|
||||||
|
_uiShared.DrawHelpText("This will put users using the most VRAM in a syncshell at the top of the list.");
|
||||||
if (ImGui.Checkbox("Show separate Offline group", ref showOfflineSeparate))
|
if (ImGui.Checkbox("Show separate Offline group", ref showOfflineSeparate))
|
||||||
{
|
{
|
||||||
_configService.Current.ShowOfflineUsersSeparately = showOfflineSeparate;
|
_configService.Current.ShowOfflineUsersSeparately = showOfflineSeparate;
|
||||||
|
@@ -183,6 +183,8 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
|||||||
|
|
||||||
_connectionDto = await GetConnectionDto().ConfigureAwait(false);
|
_connectionDto = await GetConnectionDto().ConfigureAwait(false);
|
||||||
|
|
||||||
|
await CheckClientHealth().ConfigureAwait(false);
|
||||||
|
|
||||||
ServerState = ServerState.Connected;
|
ServerState = ServerState.Connected;
|
||||||
|
|
||||||
var currentClientVer = Assembly.GetExecutingAssembly().GetName().Version!;
|
var currentClientVer = Assembly.GetExecutingAssembly().GetName().Version!;
|
||||||
@@ -308,14 +310,24 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
|||||||
_ = Task.Run(async () => await StopConnection(ServerState.Disconnected).ConfigureAwait(false));
|
_ = Task.Run(async () => await StopConnection(ServerState.Disconnected).ConfigureAwait(false));
|
||||||
_connectionCancellationTokenSource?.Cancel();
|
_connectionCancellationTokenSource?.Cancel();
|
||||||
}
|
}
|
||||||
|
private int _unhealthy = 0;
|
||||||
private async Task ClientHealthCheck(CancellationToken ct)
|
private async Task ClientHealthCheck(CancellationToken ct)
|
||||||
{
|
{
|
||||||
while (!ct.IsCancellationRequested && _mareHub != null)
|
while (!ct.IsCancellationRequested && _mareHub != null)
|
||||||
{
|
{
|
||||||
await Task.Delay(TimeSpan.FromSeconds(30), ct).ConfigureAwait(false);
|
await Task.Delay(TimeSpan.FromSeconds(30), ct).ConfigureAwait(false);
|
||||||
Logger.LogDebug("Checking Client Health State");
|
var healthy = await CheckClientHealth().ConfigureAwait(false);
|
||||||
_ = await CheckClientHealth().ConfigureAwait(false);
|
if (!healthy || _mareHub.State != HubConnectionState.Connected)
|
||||||
|
{
|
||||||
|
_unhealthy++;
|
||||||
|
if (_unhealthy > 0)
|
||||||
|
{
|
||||||
|
Logger.LogWarning("Health check failed, forcing reconnect. ClientHealth: {0} HubConnected: {1}", healthy, _mareHub.State != HubConnectionState.Connected);
|
||||||
|
await ForceResetConnection().ConfigureAwait(false);
|
||||||
|
_unhealthy = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else _unhealthy = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,7 +403,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
|||||||
{
|
{
|
||||||
var users = await GroupsGetUsersInGroup(group).ConfigureAwait(false);
|
var users = await GroupsGetUsersInGroup(group).ConfigureAwait(false);
|
||||||
foreach (var user in users)
|
foreach (var user in users)
|
||||||
{
|
{
|
||||||
Logger.LogDebug("Group Pair: {user}", user);
|
Logger.LogDebug("Group Pair: {user}", user);
|
||||||
_pairManager.AddGroupPair(user);
|
_pairManager.AddGroupPair(user);
|
||||||
}
|
}
|
||||||
@@ -478,5 +490,30 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
|||||||
|
|
||||||
ServerState = state;
|
ServerState = state;
|
||||||
}
|
}
|
||||||
|
//Because this plugin really likes to bug out with connections, lets "fix" it....
|
||||||
|
public async Task ForceResetConnection()
|
||||||
|
{
|
||||||
|
if (!_initialized) return;
|
||||||
|
Logger.LogInformation("ForceReconnect called");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await StopConnection(ServerState.Disconnected).ConfigureAwait(false);
|
||||||
|
|
||||||
|
// Cancel any ongoing health checks to prevent conflicts
|
||||||
|
_healthCheckTokenSource?.Cancel();
|
||||||
|
_healthCheckTokenSource?.Dispose();
|
||||||
|
_healthCheckTokenSource = null;
|
||||||
|
|
||||||
|
await CreateConnections().ConfigureAwait(false);
|
||||||
|
|
||||||
|
Logger.LogInformation("ForceReconnect completed successfully");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogError(ex, "Failure during ForceReconnect, disconnecting");
|
||||||
|
await StopConnection(ServerState.Disconnected).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#pragma warning restore MA0040
|
#pragma warning restore MA0040
|
BIN
MareSynchronos/images/logo.png
Normal file
BIN
MareSynchronos/images/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 68 KiB |
@@ -10,9 +10,9 @@
|
|||||||
},
|
},
|
||||||
"DalamudPackager": {
|
"DalamudPackager": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[13.0.0, )",
|
"requested": "[13.1.0, )",
|
||||||
"resolved": "13.0.0",
|
"resolved": "13.1.0",
|
||||||
"contentHash": "Mb3cUDSK/vDPQ8gQIeuCw03EMYrej1B4J44a1AvIJ9C759p9XeqdU9Hg4WgOmlnlPe0G7ILTD32PKSUpkQNa8w=="
|
"contentHash": "XdoNhJGyFby5M/sdcRhnc5xTop9PHy+H50PTWpzLhJugjB19EDBiHD/AsiDF66RETM+0qKUdJBZrNuebn7qswQ=="
|
||||||
},
|
},
|
||||||
"DotNet.ReproducibleBuilds": {
|
"DotNet.ReproducibleBuilds": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
@@ -22,11 +22,11 @@
|
|||||||
},
|
},
|
||||||
"Downloader": {
|
"Downloader": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[3.3.4, )",
|
"requested": "[4.0.3, )",
|
||||||
"resolved": "3.3.4",
|
"resolved": "4.0.3",
|
||||||
"contentHash": "/M/c80e1L0WW1XrLSSiQhgFxk8rrfbpWiWDn2CeBg1tPD393Neo+v184yG/ThyhE9rrNp36yCrugiCmEbRf+VQ==",
|
"contentHash": "Vg1+UqPDstpMw2CKXV9XvB8jKHC95KQfbqPxQXvOMRMFnTov4Ixvvw6GZV5DXLnKuL2sfnmVYX9CaQtcURia1Q==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.Extensions.Logging.Abstractions": "8.0.1"
|
"Microsoft.Extensions.Logging.Abstractions": "8.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Glamourer.Api": {
|
"Glamourer.Api": {
|
||||||
@@ -55,11 +55,28 @@
|
|||||||
"System.IO.Pipelines": "6.0.3"
|
"System.IO.Pipelines": "6.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"MessagePack": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[3.1.4, )",
|
||||||
|
"resolved": "3.1.4",
|
||||||
|
"contentHash": "BH0wlHWmVoZpbAPyyt2Awbq30C+ZsS3eHSkYdnyUAbqVJ22fAJDzn2xTieBeoT5QlcBzp61vHcv878YJGfi3mg==",
|
||||||
|
"dependencies": {
|
||||||
|
"MessagePack.Annotations": "3.1.4",
|
||||||
|
"MessagePackAnalyzer": "3.1.4",
|
||||||
|
"Microsoft.NET.StringTools": "17.11.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MessagePack.Annotations": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[3.1.4, )",
|
||||||
|
"resolved": "3.1.4",
|
||||||
|
"contentHash": "aVWrDAkCdqxwQsz/q0ldPh2EFn48M99YUzE9OvZjMq2RNLKz4o2z88iGFvSvbMqOWRweRvKPHBJZe22PRqzslQ=="
|
||||||
|
},
|
||||||
"Meziantou.Analyzer": {
|
"Meziantou.Analyzer": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[2.0.212, )",
|
"requested": "[2.0.213, )",
|
||||||
"resolved": "2.0.212",
|
"resolved": "2.0.213",
|
||||||
"contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ=="
|
"contentHash": "LHnFGBqhlBjbf8Uo4OIzGM0llRxFrIMuo/hP9oHq+aldS+28G4LqG12LK0co9b+S0yj1Vbf0rclDHN0Ji2DTkA=="
|
||||||
},
|
},
|
||||||
"Microsoft.AspNetCore.SignalR.Client": {
|
"Microsoft.AspNetCore.SignalR.Client": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
@@ -133,6 +150,12 @@
|
|||||||
"Microsoft.IdentityModel.Tokens": "8.14.0"
|
"Microsoft.IdentityModel.Tokens": "8.14.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"System.IO.Pipelines": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[9.0.8, )",
|
||||||
|
"resolved": "9.0.8",
|
||||||
|
"contentHash": "6vPmJt73mgUo1gzc/OcXlJvClz/2jxZ4TQPRfriVaLoGRH2mye530D9WHJYbFQRNMxF3PWCoeofsFdCyN7fLzA=="
|
||||||
|
},
|
||||||
"K4os.Compression.LZ4": {
|
"K4os.Compression.LZ4": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "1.3.8",
|
"resolved": "1.3.8",
|
||||||
@@ -143,19 +166,10 @@
|
|||||||
"resolved": "1.0.8",
|
"resolved": "1.0.8",
|
||||||
"contentHash": "Wp2F7BamQ2Q/7Hk834nV9vRQapgcr8kgv9Jvfm8J3D0IhDqZMMl+a2yxUq5ltJitvXvQfB8W6K4F4fCbw/P6YQ=="
|
"contentHash": "Wp2F7BamQ2Q/7Hk834nV9vRQapgcr8kgv9Jvfm8J3D0IhDqZMMl+a2yxUq5ltJitvXvQfB8W6K4F4fCbw/P6YQ=="
|
||||||
},
|
},
|
||||||
"MessagePack": {
|
"MessagePackAnalyzer": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "2.5.187",
|
"resolved": "3.1.4",
|
||||||
"contentHash": "uW4j8m4Nc+2Mk5n6arOChavJ9bLjkis0qWASOj2h2OwmfINuzYv+mjCHUymrYhmyyKTu3N+ObtTXAY4uQ7jIhg==",
|
"contentHash": "CTaSsN/liJ7MhLCAB7Z4ZLBNuVGCq9lt2BT/cbrc9vzGv89yK3CqIA+z9T19a11eQYl9etZHL6MQJgCqECRVpg=="
|
||||||
"dependencies": {
|
|
||||||
"MessagePack.Annotations": "2.5.187",
|
|
||||||
"Microsoft.NET.StringTools": "17.6.3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"MessagePack.Annotations": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "2.5.198",
|
|
||||||
"contentHash": "3U9OvqQGTra+Mz1k1zfNAScSdNHobnqtQ51qdMGUZppkNDZJl0X/igq6Qz5zDBLEZoYqZrFtZwFx6wBJHHI8BA=="
|
|
||||||
},
|
},
|
||||||
"Microsoft.AspNetCore.Connections.Abstractions": {
|
"Microsoft.AspNetCore.Connections.Abstractions": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
@@ -499,19 +513,14 @@
|
|||||||
},
|
},
|
||||||
"Microsoft.NET.StringTools": {
|
"Microsoft.NET.StringTools": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "17.6.3",
|
"resolved": "17.11.4",
|
||||||
"contentHash": "N0ZIanl1QCgvUumEL1laasU0a7sOE5ZwLZVTn0pAePnfhq8P7SvTjF8Axq+CnavuQkmdQpGNXQ1efZtu5kDFbA=="
|
"contentHash": "mudqUHhNpeqIdJoUx2YDWZO/I9uEDYVowan89R6wsomfnUJQk6HteoQTlNjZDixhT2B4IXMkMtgZtoceIjLRmA=="
|
||||||
},
|
},
|
||||||
"System.Diagnostics.EventLog": {
|
"System.Diagnostics.EventLog": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "9.0.8",
|
"resolved": "9.0.8",
|
||||||
"contentHash": "gebRF3JLLJ76jz1CQpvwezNapZUjFq20JQsaGHzBH0DzlkHBLpdhwkOei9usiOkIGMwU/L0ALWpNe1JE+5/itw=="
|
"contentHash": "gebRF3JLLJ76jz1CQpvwezNapZUjFq20JQsaGHzBH0DzlkHBLpdhwkOei9usiOkIGMwU/L0ALWpNe1JE+5/itw=="
|
||||||
},
|
},
|
||||||
"System.IO.Pipelines": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "6.0.3",
|
|
||||||
"contentHash": "ryTgF+iFkpGZY1vRQhfCzX0xTdlV3pyaTTqRu2ETbEv+HlV7O6y7hyQURnghNIXvctl5DuZ//Dpks6HdL/Txgw=="
|
|
||||||
},
|
|
||||||
"System.Net.ServerSentEvents": {
|
"System.Net.ServerSentEvents": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "9.0.8",
|
"resolved": "9.0.8",
|
||||||
@@ -525,7 +534,7 @@
|
|||||||
"maresynchronos.api": {
|
"maresynchronos.api": {
|
||||||
"type": "Project",
|
"type": "Project",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"MessagePack.Annotations": "[2.5.198, )"
|
"MessagePack.Annotations": "[2.5.129, )"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user