Skip to content

Commit

Permalink
Fixed Steam errors
Browse files Browse the repository at this point in the history
- Fixed Steam switcher throwing when 403 reached instead of Steam profile XML page.
- Further fixes for Monokai spacing
  • Loading branch information
TCNOco committed Jun 27, 2023
1 parent 93ec82b commit df726a8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
20 changes: 18 additions & 2 deletions TcNo-Acc-Switcher-Server/Pages/Steam/SteamSwitcherFuncs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,27 @@ public static void PrepareProfile(string steamId, bool noCache)
{
Globals.WriteToLog("Failed to load Steam account XML. ", e);
// Issue was caused by web. Throw.
if (!File.Exists(cachedFile)) throw;
if (!File.Exists(cachedFile))
{
_ = GeneralInvocableFuncs.ShowToast("error", Lang["Toast_SteamCantLoadXml", new { steamId = su.SteamId }],
renderTo: "toastarea");
return;
}

Globals.DeleteFile(cachedFile);
Globals.WriteToLog("The issue was the local XML file. It has been deleted and re-downloaded.");

// Issue was caused by cached fil. Delete, and re-download.
profileXml.Load($"https://steamcommunity.com/profiles/{su.SteamId}?xml=1");
try
{
profileXml.Load($"https://steamcommunity.com/profiles/{su.SteamId}?xml=1");
}
catch (Exception ex)
{
Globals.WriteToLog("Failed to download profile XML info", ex);
_ = GeneralInvocableFuncs.ShowToast("error", Lang["Toast_SteamCantLoadXml", new { steamId = su.SteamId }],
renderTo: "toastarea");
}
}

if (!File.Exists(cachedFile)) profileXml.Save(cachedFile);
Expand Down
1 change: 1 addition & 0 deletions TcNo-Acc-Switcher-Server/Resources/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ Toast_NoValidSteamId: Unable to find a valid Steam ID.
Toast_FailedUpdateCheck: Failed to check for updates
Toast_UpdateVerifyFail: Can't verify updater files. Download latest version and replace files in your directory.
Toast_StartedGame: Started {program}
Toast_SteamCantLoadXml: Couldn't get XML info for {steamId}. See log for more details.
Toast_Steam_VacCleared: VAC status for accounts was cleared
Toast_Steam_CantDeleteVacCache: Could not delete 'LoginCache/Steam/VACCache/SteamVACCache.json'
Toast_NoFindSteamUserdata: Could not find Steam\\userdata folder
Expand Down
7 changes: 3 additions & 4 deletions TcNo-Acc-Switcher-Server/themes/Monokai/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,8 @@ input[type="checkbox"] + label {
}

.platform_list {
top: 28px;
min-height: 100%;
max-height: 100%;
padding: 100px;
display: flex;
flex-flow: row wrap;
justify-content: center;
Expand Down Expand Up @@ -235,10 +234,10 @@ input[type="checkbox"] + label {

.platformTable {
width: 100%;
max-height: calc(100% - 56px);
max-height: 100%;
position: relative;
display: table;
text-align: center;
padding-bottom: 3.5em;
}

use.icoGlass {
Expand Down

0 comments on commit df726a8

Please sign in to comment.