Skip to content

Commit df726a8

Browse files
committed
Fixed Steam errors
- Fixed Steam switcher throwing when 403 reached instead of Steam profile XML page. - Further fixes for Monokai spacing
1 parent 93ec82b commit df726a8

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

TcNo-Acc-Switcher-Server/Pages/Steam/SteamSwitcherFuncs.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,11 +561,27 @@ public static void PrepareProfile(string steamId, bool noCache)
561561
{
562562
Globals.WriteToLog("Failed to load Steam account XML. ", e);
563563
// Issue was caused by web. Throw.
564-
if (!File.Exists(cachedFile)) throw;
564+
if (!File.Exists(cachedFile))
565+
{
566+
_ = GeneralInvocableFuncs.ShowToast("error", Lang["Toast_SteamCantLoadXml", new { steamId = su.SteamId }],
567+
renderTo: "toastarea");
568+
return;
569+
}
570+
565571
Globals.DeleteFile(cachedFile);
566572
Globals.WriteToLog("The issue was the local XML file. It has been deleted and re-downloaded.");
573+
567574
// Issue was caused by cached fil. Delete, and re-download.
568-
profileXml.Load($"https://steamcommunity.com/profiles/{su.SteamId}?xml=1");
575+
try
576+
{
577+
profileXml.Load($"https://steamcommunity.com/profiles/{su.SteamId}?xml=1");
578+
}
579+
catch (Exception ex)
580+
{
581+
Globals.WriteToLog("Failed to download profile XML info", ex);
582+
_ = GeneralInvocableFuncs.ShowToast("error", Lang["Toast_SteamCantLoadXml", new { steamId = su.SteamId }],
583+
renderTo: "toastarea");
584+
}
569585
}
570586

571587
if (!File.Exists(cachedFile)) profileXml.Save(cachedFile);

TcNo-Acc-Switcher-Server/Resources/en-US.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ Toast_NoValidSteamId: Unable to find a valid Steam ID.
192192
Toast_FailedUpdateCheck: Failed to check for updates
193193
Toast_UpdateVerifyFail: Can't verify updater files. Download latest version and replace files in your directory.
194194
Toast_StartedGame: Started {program}
195+
Toast_SteamCantLoadXml: Couldn't get XML info for {steamId}. See log for more details.
195196
Toast_Steam_VacCleared: VAC status for accounts was cleared
196197
Toast_Steam_CantDeleteVacCache: Could not delete 'LoginCache/Steam/VACCache/SteamVACCache.json'
197198
Toast_NoFindSteamUserdata: Could not find Steam\\userdata folder

TcNo-Acc-Switcher-Server/themes/Monokai/style.scss

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,8 @@ input[type="checkbox"] + label {
183183
}
184184

185185
.platform_list {
186-
top: 28px;
186+
min-height: 100%;
187187
max-height: 100%;
188-
padding: 100px;
189188
display: flex;
190189
flex-flow: row wrap;
191190
justify-content: center;
@@ -235,10 +234,10 @@ input[type="checkbox"] + label {
235234

236235
.platformTable {
237236
width: 100%;
238-
max-height: calc(100% - 56px);
237+
max-height: 100%;
239238
position: relative;
240-
display: table;
241239
text-align: center;
240+
padding-bottom: 3.5em;
242241
}
243242

244243
use.icoGlass {

0 commit comments

Comments
 (0)