Skip to content

Commit b1523d2

Browse files
committed
3.0.7
1 parent 88a79d3 commit b1523d2

8 files changed

Lines changed: 64 additions & 16 deletions

File tree

Snowcloak/Configuration/Configurations/SnowcloakConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public class SnowcloakConfig : ISnowcloakConfiguration
6262
public bool ShowUploading { get; set; } = true;
6363
public bool ShowUploadingBigText { get; set; } = true;
6464
public bool ShowVisibleUsersSeparately { get; set; } = true;
65+
public bool ShowVisibleSyncshellUsersSection { get; set; }
6566
public bool ShowSyncshellBudgetDashboard { get; set; } = false;
6667
public bool ShowCompactUiPerformanceTab { get; set; } = false;
6768
public bool CompactUiSidebarCollapsed { get; set; } = false;

Snowcloak/Snowcloak.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project Sdk="Dalamud.NET.Sdk/15.0.0">
33
<PropertyGroup>
44
<AssemblyName>Snowcloak</AssemblyName>
5-
<Version>3.0.6.0</Version>
5+
<Version>3.0.7.0</Version>
66
<PackageProjectUrl>https://github.com/Eauldane/SnowcloakClient/</PackageProjectUrl>
77
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
88
<Configurations>Release;Debug</Configurations>

Snowcloak/UI/CompactUI.Registration.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ private void DrawAddCharacter()
5353
}
5454
else
5555
{
56-
if (ElezenImgui.ShowIconButton(FontAwesomeIcon.Plus, "Log in with XIVAuth"))
56+
if (ElezenImgui.ShowIconButton(FontAwesomeIcon.Plus, "Log in with XIVAuth (deprecated)"))
5757
{
5858
BeginCharacterRegistration(
5959
_registerService.XIVAuth,
60-
"Account registered. Welcome to Snowcloak!");
60+
"Account registered through XIVAuth. Welcome to Snowcloak!",
61+
"XIVAuth registration failed");
6162
}
6263

6364
if (ElezenImgui.ShowIconButton(FontAwesomeIcon.Plus, "Create standalone key"))
@@ -119,9 +120,10 @@ private void DrawAddCharacter()
119120

120121
}
121122

122-
private void BeginCharacterRegistration(Func<CancellationToken, Task<RegisterReplyDto>> registrationFunc, string successMessage)
123+
private void BeginCharacterRegistration(Func<CancellationToken, Task<RegisterReplyDto>> registrationFunc, string successMessage,
124+
string failureMessage = "Registration failed")
123125
{
124126
_secretKey = string.Empty;
125-
_characterKeyFlow.Begin(registrationFunc, successMessage, reply => _secretKey = reply.SecretKey ?? "", "Registration failed");
127+
_characterKeyFlow.Begin(registrationFunc, successMessage, reply => _secretKey = reply.SecretKey ?? "", failureMessage);
126128
}
127129
}

Snowcloak/UI/Components/GroupPanel.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,11 @@ private void DrawSyncshellList(float contentWidth, float ySize)
10871087
using (ImRaii.PushStyle(ImGuiStyleVar.FramePadding, new Vector2(ImGui.GetStyle().FramePadding.X, 7f * ImGuiHelpers.GlobalScale)))
10881088
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(ImGui.GetStyle().ItemSpacing.X, 2f * ImGuiHelpers.GlobalScale)))
10891089
{
1090+
if (_snowcloakConfig.Current.ShowVisibleSyncshellUsersSection)
1091+
{
1092+
using (ImRaii.PushId("visible-syncshell-users")) DrawVisibleSyncshellUsers();
1093+
}
1094+
10901095
foreach (var entry in groups)
10911096
{
10921097
using (ImRaii.PushId(entry.Key.Group.GID)) DrawSyncshell(entry.Key, entry.Value);
@@ -1096,4 +1101,35 @@ private void DrawSyncshellList(float contentWidth, float ySize)
10961101
PruneGroupPairRowCache(groups.Sum(g => g.Value.Count));
10971102
}
10981103

1104+
private void DrawVisibleSyncshellUsers()
1105+
{
1106+
var pairs = _pairManager.GetVisiblePairs()
1107+
.Where(pair => !pair.GroupPair.IsEmpty
1108+
&& !string.Equals(pair.UserData.UID, ApiController.UID, StringComparison.Ordinal));
1109+
1110+
pairs = _snowcloakConfig.Current.SortSyncshellsByVRAM
1111+
? pairs.OrderByDescending(pair => pair.LastAppliedApproximateVRAMBytes)
1112+
.ThenBy(pair => pair.UserData.AliasOrUID, StringComparer.OrdinalIgnoreCase)
1113+
: pairs.OrderBy(pair => pair.GetPairSortKey(), StringComparer.OrdinalIgnoreCase);
1114+
1115+
var rows = pairs.SelectMany(pair => pair.GroupPair
1116+
.OrderBy(entry => entry.Key.Group.AliasOrGID, StringComparer.OrdinalIgnoreCase)
1117+
.ThenBy(entry => entry.Key.Group.GID, StringComparer.Ordinal)
1118+
.Take(1)
1119+
.Select(membership => GetGroupPairRow(membership.Key, pair, membership.Value)))
1120+
.ToList();
1121+
1122+
ImGui.TextUnformatted(string.Format(CultureInfo.CurrentCulture, "Visible Syncshell Users ({0})", rows.Count));
1123+
ImGui.Separator();
1124+
if (rows.Count == 0)
1125+
{
1126+
ElezenImgui.ColouredText("No syncshell users are currently visible.", ImGuiColors.DalamudGrey);
1127+
}
1128+
else
1129+
{
1130+
UidDisplayHandler.RenderPairList(rows);
1131+
}
1132+
ImGui.Separator();
1133+
}
1134+
10991135
}

Snowcloak/UI/Components/InterfaceSettingsPanel.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ private void DrawNameplates()
133133
{
134134
var showCharacterNames = _configService.Current.ShowCharacterNames;
135135
var showVisibleSeparate = _configService.Current.ShowVisibleUsersSeparately;
136+
var showVisibleSyncshellUsersSection = _configService.Current.ShowVisibleSyncshellUsersSection;
136137
var showSyncshellBudgetDashboard = _configService.Current.ShowSyncshellBudgetDashboard;
137138
var showCompactUiPerformanceTab = _configService.Current.ShowCompactUiPerformanceTab;
138139
var sortSyncshellByVRAM = _configService.Current.SortSyncshellsByVRAM;
@@ -175,6 +176,12 @@ private void DrawNameplates()
175176
}
176177
ElezenImgui.DrawHelpText("This will show all currently visible users in a special 'Visible' group in the main UI.");
177178

179+
if (ImGui.Checkbox("Show visible syncshell users section", ref showVisibleSyncshellUsersSection))
180+
{
181+
_configService.Update(c => c.ShowVisibleSyncshellUsersSection = showVisibleSyncshellUsersSection);
182+
}
183+
ElezenImgui.DrawHelpText("Shows one combined list of all visible syncshell users in the syncshell panel.");
184+
178185
if (ImGui.Checkbox("Sort visible syncshell users by VRAM usage", ref sortSyncshellByVRAM))
179186
{
180187
_configService.Update(c => c.SortSyncshellsByVRAM = sortSyncshellByVRAM);

Snowcloak/UI/IntroUI.Pages.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ private void DrawServicePage()
146146

147147
ImGui.Separator();
148148
ImGui.BeginDisabled(_standaloneKeyFlow.IsRunning || _accountFlow.IsRunning || _standaloneKeyFlow.Succeeded || _secretKey.Length > 0);
149-
if (ElezenImgui.ShowIconButton(FontAwesomeIcon.Plus, "Log in with XIVAuth"))
149+
if (ElezenImgui.ShowIconButton(FontAwesomeIcon.Plus, "Log in with XIVAuth (deprecated)"))
150150
{
151151
_standaloneKeyFlow.Begin(_registerService.XIVAuth, "Account registered. Welcome to Snowcloak!",
152-
reply => _secretKey = reply.SecretKey ?? "", "Registration failed");
152+
reply => _secretKey = reply.SecretKey ?? "", "XIVAuth registration failed");
153153
}
154154
ImGui.SameLine();
155155
if (ElezenImgui.ShowIconButton(FontAwesomeIcon.Plus, "Create standalone secret key"))
@@ -206,7 +206,7 @@ private void DrawAccountSetup()
206206
{
207207
ElezenImgui.WrappedText("The preferred option is you manage your keys yourself. This option gives you full and complete control.");
208208
ElezenImgui.WrappedText("Failing that, Snowcloak accounts will generate fresh keys for your linked characters if you need it. You choose a username and password, and Snowcloak handles the rest. Passwords are hashed using state-of-the-art Argon2id algorithms. If in doubt, use a password manager to generate a random username and password.");
209-
ElezenImgui.WrappedText("XIVAuth also remains available, but is considered decrepated at this time.");
209+
ElezenImgui.WrappedText("XIVAuth remains available for compatibility, but its login method is deprecated.");
210210
}
211211

212212
_accountFlow.Draw(new PasswordAccountFlowOptions

Snowcloak/UI/SettingsUi.ServerConfiguration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ private void DrawSecretKeyTab(ServerStorage selectedServer, string playerName, u
218218
var xivAuthPrompt = selectedServer.AccountLinked
219219
? "Your current character is not linked to a working account key. Create and assign a new account UID to receive a server-generated key."
220220
: invalidSecretKey
221-
? "Your current character's secret key appears to be invalid. Sign in with a Snowcloak account below to restore account keys, log in with XIVAuth to replace and assign a working key automatically, or create a standalone key."
222-
: "Your current character is not linked to a secret key. Sign in with a Snowcloak account below to restore account keys, log in with XIVAuth to add and assign one automatically, or create a standalone key.";
221+
? "Your current character's secret key appears to be invalid. Sign in with a Snowcloak account below to restore account keys, use XIVAuth to replace and assign a working key automatically, or create a standalone key."
222+
: "Your current character is not linked to a secret key. Sign in with a Snowcloak account below to restore account keys, use XIVAuth to add and assign one automatically, or create a standalone key.";
223223
ElezenImgui.ColouredWrappedText(xivAuthPrompt, ImGuiColors.DalamudYellow);
224224

225225
if (selectedServer.AccountLinked && selectedServer == _serverConfigurationManager.CurrentServer)
@@ -230,7 +230,7 @@ private void DrawSecretKeyTab(ServerStorage selectedServer, string playerName, u
230230
{
231231
using (ImRaii.Disabled(_characterKeyAssignmentFlow.IsRunning))
232232
{
233-
if (ElezenImgui.ShowIconButton(FontAwesomeIcon.Plus, "Log in with XIVAuth"))
233+
if (ElezenImgui.ShowIconButton(FontAwesomeIcon.Plus, "Log in with XIVAuth (deprecated)"))
234234
{
235235
_characterKeyAssignmentFlow.Begin(selectedServer, playerName, playerWorldId, removeInvalidSecretKey,
236236
invalidSecretKeyIdx, _registerService.XIVAuth,

Snowcloak/WebAPI/AccountRegistrationService.Registration.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ public async Task<RegisterReplyDto> XIVAuth(CancellationToken token)
2727
using var startResponse = await _httpClient.PostAsJsonAsync(startUri, startPayload, token).ConfigureAwait(false);
2828
if (!startResponse.IsSuccessStatusCode)
2929
{
30-
return new RegisterReplyDto { Success = false, ErrorMessage = await ReadErrorAsync(startResponse, token).ConfigureAwait(false) };
30+
return new RegisterReplyDto { Success = false, ErrorMessage = "XIVAuth is deprecated. " + await ReadErrorAsync(startResponse, token).ConfigureAwait(false) };
3131
}
3232

3333
var start = await startResponse.Content.ReadFromJsonAsync<XivAuthRegisterStartReplyDto>(token).ConfigureAwait(false);
3434
if (start == null || string.IsNullOrWhiteSpace(start.SessionId) || string.IsNullOrWhiteSpace(start.AuthorizationUrl))
3535
{
36-
return new RegisterReplyDto { Success = false, ErrorMessage = "Malformed registration response." };
36+
return new RegisterReplyDto { Success = false, ErrorMessage = "XIVAuth is deprecated. Malformed registration response." };
3737
}
3838

3939
Util.OpenLink(start.AuthorizationUrl);
@@ -46,7 +46,7 @@ public async Task<RegisterReplyDto> XIVAuth(CancellationToken token)
4646
using var pollResponse = await _httpClient.GetAsync(pollUri, token).ConfigureAwait(false);
4747
if (!pollResponse.IsSuccessStatusCode)
4848
{
49-
return new RegisterReplyDto { Success = false, ErrorMessage = $"Registration polling failed ({(int)pollResponse.StatusCode})." };
49+
return new RegisterReplyDto { Success = false, ErrorMessage = $"XIVAuth is deprecated. Registration polling failed ({(int)pollResponse.StatusCode})." };
5050
}
5151

5252
var poll = await pollResponse.Content.ReadFromJsonAsync<XivAuthRegisterPollReplyDto>(token).ConfigureAwait(false) ?? new XivAuthRegisterPollReplyDto();
@@ -64,15 +64,17 @@ public async Task<RegisterReplyDto> XIVAuth(CancellationToken token)
6464
return new RegisterReplyDto
6565
{
6666
Success = false,
67-
ErrorMessage = string.IsNullOrWhiteSpace(poll.ErrorMessage) ? "XIVAuth registration failed. Please try again." : poll.ErrorMessage
67+
ErrorMessage = string.IsNullOrWhiteSpace(poll.ErrorMessage)
68+
? "XIVAuth is deprecated. Registration failed. Please try again."
69+
: "XIVAuth is deprecated. " + poll.ErrorMessage
6870
};
6971
}
7072

7173
return new RegisterReplyDto
7274
{
7375
Success = false,
7476
ErrorMessage =
75-
"Timed out waiting for authorisation. Please try again, and complete the process within 10 minutes."
77+
"XIVAuth is deprecated. Timed out waiting for authorisation. Please try again, and complete the process within 10 minutes."
7678
};
7779
}
7880

0 commit comments

Comments
 (0)