Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing for LastPlayTime in the Steam Shortcuts Parser #401

Merged
merged 3 commits into from
Feb 13, 2024
Merged

Conversation

gablm
Copy link
Member

@gablm gablm commented Feb 13, 2024

https://gist.github.com/gablm/2a79355026bde51ac4f516d347fa1cd0 has a basic explanation of the shortcuts.vdf format. Hope it finds its way to anyone trying to decipher this file in the near future.
closes #400

@gablm gablm added this to the 1.73.x milestone Feb 13, 2024
@gablm gablm self-assigned this Feb 13, 2024
Copy link

github-actions bot commented Feb 13, 2024

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Copy link
Collaborator

@Cryotechnic Cryotechnic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small fix, great work, lgtm!

Makes Qodana happy
Copy link
Member

@bagusnl bagusnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We love when companies using non-standard formats just cause~

Anyway, as been discussed in #400, merging this PR
Thank you for your work~

@bagusnl bagusnl merged commit b5fe4bc into main Feb 13, 2024
4 checks passed
@gablm gablm deleted the ssp-patch branch February 13, 2024 13:13
shatyuka added a commit that referenced this pull request Feb 14, 2024
commit c9dfe14
Author: Bagus Nur Listiyono <28079733+bagusnl@users.noreply.github.com>
Date:   Wed Feb 14 11:48:39 2024 +0000

    [Feature] Pre-Launch and Post-Exit Commands Launching (#398)

    * Update CsWinRT

    This PR adds ability to run command before and after the game exits, values are saved to `CollapseSettings_Misc` registry on each region keys.

    Command outputs recorded in the console, and it WILL NOT be interactable from the console. Also supports running GUI applications.

    2.0.6 -> 2.0.7
    https://github.com/microsoft/CsWinRT/releases/tag/2.0.7.240207.1

    * (GSP) Move all GSPs into its own folder

    Getting crowded up there on Pages main dir

    * (GLC) Introduce GameLaunchCommand Backend

    * Defer StarRail unnecesarry settings load on region load

    * Avoid unnecessary UniversalGameSettings call on GameRunningWatcher

    * (GLC) Introduce prototype in HSR GSP

    * (GLC) Fix title

    * (GLC) Backend Changes

    - Rename PostLaunch to PostExit to better reflect the function
    - Skip GLC if provided string is empty
    - Change GLC console tag color to light red
    - Adjust ErrorSender message
    - Make consoleWidth and barwidth
    available for private use
    - Move `GAME STOPPED` bar into GameRunningWatcher
    - Remove unused Window Restore inside ReadOutputLog (already available in GameRunningWatcher

    * (GLC) Localization!

    * (GLC) Frontends!

    This also fixes warnings about OneWay bindings (WMC1506) for Genshin and StarRail GSPs by implementing INotifyPropertyChanged in the Ext

    * (GLC) Fix main toggle margin and style

    * (GSP) Fix HSR Character Quality selector

    The enum is weird...

    * (GSP) HSR: Disable VSync when selecting 120FPS

    * Fix typos and CodeQA

    * (GLC) Sanitize command for escape

    Co-authored-by: Shatyuka <958182453@qq.com>

    * Remove CsWinRT as its not needed anymore

    Code generated is already on CoCreateInstance.cs

    i forgor

    * (GSP) HSR: Fix CharQual enum values

    - Also renamed the enum name to avoid confusion
    - Also clamped the values to avoid IndexOutOfRangeException

    Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>

    * [skip ci] (GSP) HSR: Adjust CharQ summary

    * (GLC) Honkai: Fix panel not collapsing when disabled

    ---------

    Co-authored-by: Shatyuka <958182453@qq.com>
    Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>

commit b5fe4bc
Author: Gabriel Lima <44784408+gablm@users.noreply.github.com>
Date:   Tue Feb 13 13:09:46 2024 +0000

    Fix parsing for ```LastPlayTime``` in the Steam Shortcuts Parser  (#401)

    * [SteamShortcutsParser] Fixes parsing of ```LastPlayTime```

    should fix #400

    https://gist.github.com/gablm/2a79355026bde51ac4f516d347fa1cd0 has a basic explanation of the shortcuts.vdf format. Hope it finds its way to anyone trying to decipher this file in the near future.

    * Force parsing of 4 bytes for ```LastPlayTime``` and ```Appid```

    there is a possibility of being a fix #400

    * Fix redundancy

    Makes Qodana happy

commit f32bd43
Author: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Date:   Sat Feb 10 20:15:15 2024 +0000

    [skip ci] Sync translation Translate en_US.json in ja_JP

    100% reviewed source file: 'en_US.json'
    on 'ja_JP'.

commit 2616e9d
Author: Bagus Nur Listiyono <28079733+bagusnl@users.noreply.github.com>
Date:   Sat Feb 10 23:36:51 2024 +0700

    [skip ci] (chore) Update versions
neon-nyan pushed a commit that referenced this pull request Feb 17, 2024
* [SteamShortcutsParser] Fixes parsing of ```LastPlayTime```

should fix #400

https://gist.github.com/gablm/2a79355026bde51ac4f516d347fa1cd0 has a basic explanation of the shortcuts.vdf format. Hope it finds its way to anyone trying to decipher this file in the near future.

* Force parsing of 4 bytes for ```LastPlayTime``` and ```Appid```

there is a possibility of being a fix #400

* Fix redundancy

Makes Qodana happy
neon-nyan added a commit that referenced this pull request Feb 23, 2024
* Initial commit

* Update ``Hi3Helper.Http`` and usages

* Update SevenZipExtractor Submodule

* Reduce progress refresh interval to 33ms

* Switch to ``GetResizedBitmapNew`` for OOBE BG Image

* Adjustment for Honkai: Star Rail Delta Patch support

* Fix Preload box displaying wrong message

* [skip ci] Update README.md

* Bump version

* Localize Delta-Patch Pre-Req. Dialog

* Update Submodules

* Fix build error due to Hi3Helper.Http changes

* [skip ci] Sync translation Translate en_US.json in id_ID

100% reviewed source file: 'en_US.json'
on 'id_ID'.

* Update submodule

EncTool

* Update submodule

Fixed SR IFix "empty" issue

* Support GI `Dynamic Character Resolution`

* [Steam shortcuts] Small fixes  (#386)

- Fixes folders not being found if the steamID ended with an 0.
- Adds/improves some logging when searching for valid userdata folders
- Changes target exe/folder to the stub executable/folder

* Fix broken steamID check and better folder logging

* Change Steam executable path to stub

* Fix formatting issue and playtime not updating when using protocols

* Copy Game Icon to Steam grid folder

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* (HSR GSP) Adjust Model registry

* Enable Steam overlay + Note about usage (#391)

* Fix broken steamID check and better folder logging

* Change Steam executable path to stub

* Fix formatting issue and playtime not updating when using protocols

* Copy Game Icon to Steam grid folder

* Enable AllowOverlay

* Note about overlay use.

* Change default values for AllowOverlay and AllowDesktopConfig

* Move logger in TryDownloadToCompletenessAsync up

* [skip ci] Fix code formatting

RegionManagement.TryDownloadToCompletenessAsync

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Fix ``StartDeltaPatchPreReqDownload`` sequence

* Fix cancellation issue on single session download not working

* Reduce refresh interval to 33ms

* [HSR] Attempt on fixing unused file not getting deleted

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Recalculate non-client area size after changing window size

* (Discord RPC) Catch SEHException on Dispose

* Merge branch 'main' of https://github.com/CollapseLauncher/Collapse

* Installation Management and HSR Repair Improvements

Hi3Helper.Http
    - Avoid globally disposed cancellation token
    - Fix single session download doesn't receive cancellation

Collapse Launcher (Installation Management)
    - Fix intermitten cancellation issue due to Hi3Helper.Http threading and disposal issues
    - Removes unnecessary override of Flush() code on HonkaiInstall class
    - Revert back the refresh interval to 100ms

Collapse Launcher (Honkai: Star Rail - Repair)
    - Fix duplicate pkg_version entries causing the file assumed as an unused file
    - Fix the streaming file still being used if the newest one from persistent folder exists
    - Make the FileStream assignment for FileType: Blocks, Audio and Video to use FileShare.Read
    - Ignore file size check while using Fast Check mode on Repair
    - [NEW] Adding support for reading multiple installed voice languages on repair

[NEW] Collapse Launcher (Honkai: Star Rail - Installation Management & Delta Patch support)
    - Adding support for updating additional audio packages if more than one voice languages are installed
    - Delta-patch mechanism is now aware to download the required files before doing integrity check and patching process
        - You might be noticed if you need to download additional files, including delta update for voice language pack
    - Reduce overhead on assigning FilePropertiesRemote class by caching the CRC (Hash) properties

Note: This commit is worth almost 21 hours of debugging and code writing :terismash:

* Fix missing NuGet

* Fix static ``Enable/DisableNonClientArea()``

* Fix carousel doesn't show if the MenuPanels.articlePanel is null

* Force GC after loading and cropping the background image

* Relocate image files

* Changes on News Carousel

- Remove unused margin binding
- Use static margin on "No news" element
- Fix derpy typo on checking null

* First iteration of OOBE Navigation

- It's now only the transitional animation for icon and title text 🗿

* Add IAssetProperty to list Cache and Repair entries

* Replace old CommunityToolkit with the new ones

Now the Markdown and DataGrid component is being provided by the new CommunityToolkit (8.0.x), replacing the unmaintained one (7.1.3)

* Use compiled RegEx on ``AppActivation`` argument splitting

* Adding more local changes

- Renaming DataTable namespace to CommunityToolkit.WinUI.Controls.Labs.*
- Move GetResizedBitmapNew, Stream2BitmapImage and Stream2Bitmap static method from MainPage to ImageLoaderHelper
- Adding Recommended CDN Selection based on lowest latency
- Adding new Loading Message ribbon design
- Adding AnimationHelper extensions to enable explicit and implicit animation triggers
- Adding Intro sequence on OOBE
- Fixed ContentDialogCollapse theme inconsistencies while switching from Light to Dark Theme or Vice Versa in realtime
- Fixed Glyph Icon on ContentDialogCollapse doesn't show while using Warning, Error and Success theme
- Adding new AppImagesFolder in LauncherConfig

* Update NuGet

* Adjust Theme Color

* Fix ``NullReferenceException`` issue on retrying other CDN

* Use the new ``LoadingMessageHelper`` widely

* Remove unused folder

* Make Loading Msg separator invisible if title or subtitle is empty

* Reorder ContentDialog and TrayIcon XAML

* Remove unused ``RotationTransition`` on ``LoadingStatusGrid``

* Use hide offset for ``LoadingStatusGrid`` initially

* Update NuGet

* Fix Titlebar's Close button not able to get focused

+ Also fixing where the old titlebar area from MainPage would still takeover after it leaves

* Fix the LoadingFrame not being able to get hidden early

* Reenable StartUpMenu's MainUI transition

* Fix ``GetElementCornerRadius`` not returning 8px Radius on Normal type

* Startup Game Description style adjustment

* Fix Loading Action style and not showing bug

* Return ``IsInitializationError=true`` on ``TryGetURLStatus`` to avoid crash

* Adding cancellation action on ``Recommended CDN Check`` routine

* Make ``ApplyAgreementButton`` rounded

* Explicitly hide L:oading action button if ``HideLoadingFrame`` is called

* Fix crash on applying light theme on startup

* Adding + Updating necessary submodules to update with upstream

* [skip ci] (chore) Update versions

* [skip ci] Sync translation Translate en_US.json in ja_JP

100% reviewed source file: 'en_US.json'
on 'ja_JP'.

* Fix parsing for ```LastPlayTime``` in the Steam Shortcuts Parser  (#401)

* [SteamShortcutsParser] Fixes parsing of ```LastPlayTime```

should fix #400

https://gist.github.com/gablm/2a79355026bde51ac4f516d347fa1cd0 has a basic explanation of the shortcuts.vdf format. Hope it finds its way to anyone trying to decipher this file in the near future.

* Force parsing of 4 bytes for ```LastPlayTime``` and ```Appid```

there is a possibility of being a fix #400

* Fix redundancy

Makes Qodana happy

* [Feature] Pre-Launch and Post-Exit Commands Launching (#398)

* Update CsWinRT

This PR adds ability to run command before and after the game exits, values are saved to `CollapseSettings_Misc` registry on each region keys.

Command outputs recorded in the console, and it WILL NOT be interactable from the console. Also supports running GUI applications.

2.0.6 -> 2.0.7
https://github.com/microsoft/CsWinRT/releases/tag/2.0.7.240207.1

* (GSP) Move all GSPs into its own folder

Getting crowded up there on Pages main dir

* (GLC) Introduce GameLaunchCommand Backend

* Defer StarRail unnecesarry settings load on region load

* Avoid unnecessary UniversalGameSettings call on GameRunningWatcher

* (GLC) Introduce prototype in HSR GSP

* (GLC) Fix title

* (GLC) Backend Changes

- Rename PostLaunch to PostExit to better reflect the function
- Skip GLC if provided string is empty
- Change GLC console tag color to light red
- Adjust ErrorSender message
- Make consoleWidth and barwidth
available for private use
- Move `GAME STOPPED` bar into GameRunningWatcher
- Remove unused Window Restore inside ReadOutputLog (already available in GameRunningWatcher

* (GLC) Localization!

* (GLC) Frontends!

This also fixes warnings about OneWay bindings (WMC1506) for Genshin and StarRail GSPs by implementing INotifyPropertyChanged in the Ext

* (GLC) Fix main toggle margin and style

* (GSP) Fix HSR Character Quality selector

The enum is weird...

* (GSP) HSR: Disable VSync when selecting 120FPS

* Fix typos and CodeQA

* (GLC) Sanitize command for escape

Co-authored-by: Shatyuka <958182453@qq.com>

* Remove CsWinRT as its not needed anymore

Code generated is already on CoCreateInstance.cs

i forgor

* (GSP) HSR: Fix CharQual enum values

- Also renamed the enum name to avoid confusion
- Also clamped the values to avoid IndexOutOfRangeException

Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>

* [skip ci] (GSP) HSR: Adjust CharQ summary

* (GLC) Honkai: Fix panel not collapsing when disabled

---------

Co-authored-by: Shatyuka <958182453@qq.com>
Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Increase playtime accuracy  (#395)

* Use DateTime to calculate playtime

- Makes variable names more consistent
- Alters the way of how playtime is calculated

* Handle negative difference between dates

- New dialog about this problem
- Localization support for the dialog
- Localization support for the playtime display

* Avoid multiplying the same values twice

* Remove unnecessary loop to update the display

* Code Review changes

- Wrap Timer into a using statement.
- Reuse process found by GameBoost module

* Revert some changes and addition of @neon-nyan simplified process finder code

* (Discord RPC) Migrate to discord-rpc-csharp (#404)

* (Discord RPC) Migrate to discord-rpc-csharp

* (Discord RPC) Fix multi-thread issue caused by `CheckRunningGameInstance`

---------

Co-authored-by: Bagus Nur Listiyono <dzakibagus@gmail.com>
Co-authored-by: Ron Friedman <9833218+Cryotechnic@users.noreply.github.com>
Co-authored-by: Shatyuka <958182453@qq.com>

* [URL Protocol] Fix Discord Rich Presence not updating. (#403)

* Fix Discord Rich Presence not being updated in certain cases

fix #402

* Qodana

* (DiscordRPC) Do not trim assembly

for now

* Disable AUMID

* Update NuGets + Submodules

JSON 8.0.1 -> 8.0.2

GitInfo 3.3.3 ->3.3.4
https://github.com/devlooped/GitInfo/releases/tag/v3.3.4

* FIx DiscordRPC ``SetActivity`` second request check issue

This caused a really rapid request from HomePage's CheckRunningGameInstance since it's requesting the same activity. Causing the RPC request flooded and makes DiscordRPC unresponsive.

* Update NuGet and ``CoCreateInstance``

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* Update NuGet

* Fix missing namespace

* Bump version and remove unused ``TrimmableAssembly`` attribute

* Update Submodules

* Add (EN) remark to agreement menu's policy title

* Revert "FIx DiscordRPC ``SetActivity`` second request check issue"

This reverts commit dbe2324.

* Update submodules

* Set ``AddElementToStackPanel`` to use ``Panel`` instead of ``StackPanel``

* Localize OOBE strings

* Update submodules

* (DiscordRPC) Allow trimming

* Protect some types/namespaces from ILTrim

* Code quality and fix build

* Qodana code quality fix (attempt: 1)

* Qodana code quality fix (attempt: 2)

* Remove unused ``T1`` Generics on ``ProgressBase`` and Qodana fixes

this is the third attempt :yaebruh:

* Fix build issue :PaimonAngry_Milkman:

* Remove nullable assignment ``??``

* Ignore ``MS-NET-LIBRARY-2019-06`` license check in Qodana

* Bring back ``CheckDependencyLicenses``

* Revert Qodana config changes

* Adding latency check refresh button + Shrink Language flyout height

* Move OOBE from prototype folder

* [skip ci] Qodana and Docs
- Fix outdated action on Qodana CI
- Ignore some licenses on license checker
- Add commit info for CommunityToolkit.Labs

* CI trigger

* (Qodana) Revert using solution

* Fix OOBE page nc area

* Fix right-aligned ComboBox popup position

* Fix build error

* Fix text doesn't get wrapped by using Grid on entire container

* Adjust vertical ``FlipView`` style and ``NewAccentButtonStyle``

* Revert ``IsDeferredScrollingEnabled`` on ``FlipView``

* Change ``LoadingMessageHelper.SetMessage`` behavior

Also adding the docs.

* (CodeQA) Wrap long codes

Also suppress some NRE warnings

* Adjust UI based on reviews

* Set the Logo Text container size if the small size is applied

* Fix animation getting stopped while it's not yet completed

* Fix build error

* Fix some non-empty news category has mascot appeared

* [skip ci] Add Rider project icon

* [skip ci] Add Jetbrains Toolbox project icon

* Wait for CDN loading to complete before ending intro sequence

---------

Co-authored-by: Ron Friedman <9833218+Cryotechnic@users.noreply.github.com>
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Co-authored-by: Bagus Nur Listiyono <dzakibagus@gmail.com>
Co-authored-by: Shatyuka <958182453@qq.com>
Co-authored-by: Gabriel Lima <44784408+gablm@users.noreply.github.com>
Co-authored-by: Bagus Nur Listiyono <28079733+bagusnl@users.noreply.github.com>
Cryotechnic added a commit that referenced this pull request Mar 1, 2024
* [skip ci] (chore) Update versions

* [skip ci] Sync translation Translate en_US.json in ja_JP

100% reviewed source file: 'en_US.json'
on 'ja_JP'.

* Fix parsing for ```LastPlayTime``` in the Steam Shortcuts Parser  (#401)

* [SteamShortcutsParser] Fixes parsing of ```LastPlayTime```

should fix #400

https://gist.github.com/gablm/2a79355026bde51ac4f516d347fa1cd0 has a basic explanation of the shortcuts.vdf format. Hope it finds its way to anyone trying to decipher this file in the near future.

* Force parsing of 4 bytes for ```LastPlayTime``` and ```Appid```

there is a possibility of being a fix #400

* Fix redundancy

Makes Qodana happy

* [Feature] Pre-Launch and Post-Exit Commands Launching (#398)

* Update CsWinRT

This PR adds ability to run command before and after the game exits, values are saved to `CollapseSettings_Misc` registry on each region keys.

Command outputs recorded in the console, and it WILL NOT be interactable from the console. Also supports running GUI applications.

2.0.6 -> 2.0.7
https://github.com/microsoft/CsWinRT/releases/tag/2.0.7.240207.1

* (GSP) Move all GSPs into its own folder

Getting crowded up there on Pages main dir

* (GLC) Introduce GameLaunchCommand Backend

* Defer StarRail unnecesarry settings load on region load

* Avoid unnecessary UniversalGameSettings call on GameRunningWatcher

* (GLC) Introduce prototype in HSR GSP

* (GLC) Fix title

* (GLC) Backend Changes

- Rename PostLaunch to PostExit to better reflect the function
- Skip GLC if provided string is empty
- Change GLC console tag color to light red
- Adjust ErrorSender message
- Make consoleWidth and barwidth
available for private use
- Move `GAME STOPPED` bar into GameRunningWatcher
- Remove unused Window Restore inside ReadOutputLog (already available in GameRunningWatcher

* (GLC) Localization!

* (GLC) Frontends!

This also fixes warnings about OneWay bindings (WMC1506) for Genshin and StarRail GSPs by implementing INotifyPropertyChanged in the Ext

* (GLC) Fix main toggle margin and style

* (GSP) Fix HSR Character Quality selector

The enum is weird...

* (GSP) HSR: Disable VSync when selecting 120FPS

* Fix typos and CodeQA

* (GLC) Sanitize command for escape

Co-authored-by: Shatyuka <958182453@qq.com>

* Remove CsWinRT as its not needed anymore

Code generated is already on CoCreateInstance.cs

i forgor

* (GSP) HSR: Fix CharQual enum values

- Also renamed the enum name to avoid confusion
- Also clamped the values to avoid IndexOutOfRangeException

Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>

* [skip ci] (GSP) HSR: Adjust CharQ summary

* (GLC) Honkai: Fix panel not collapsing when disabled

---------

Co-authored-by: Shatyuka <958182453@qq.com>
Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* [skip ci] Sync translation Translate en_US.json in fr_FR

100% reviewed source file: 'en_US.json'
on 'fr_FR'.

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Increase playtime accuracy  (#395)

* Use DateTime to calculate playtime

- Makes variable names more consistent
- Alters the way of how playtime is calculated

* Handle negative difference between dates

- New dialog about this problem
- Localization support for the dialog
- Localization support for the playtime display

* Avoid multiplying the same values twice

* Remove unnecessary loop to update the display

* Code Review changes

- Wrap Timer into a using statement.
- Reuse process found by GameBoost module

* Revert some changes and addition of @neon-nyan simplified process finder code

* (Discord RPC) Migrate to discord-rpc-csharp (#404)

* (Discord RPC) Migrate to discord-rpc-csharp

* (Discord RPC) Fix multi-thread issue caused by `CheckRunningGameInstance`

---------

Co-authored-by: Bagus Nur Listiyono <dzakibagus@gmail.com>
Co-authored-by: Ron Friedman <9833218+Cryotechnic@users.noreply.github.com>
Co-authored-by: Shatyuka <958182453@qq.com>

* [URL Protocol] Fix Discord Rich Presence not updating. (#403)

* Fix Discord Rich Presence not being updated in certain cases

fix #402

* Qodana

* (DiscordRPC) Do not trim assembly

for now

* Disable AUMID

* Update NuGets + Submodules

JSON 8.0.1 -> 8.0.2

GitInfo 3.3.3 ->3.3.4
https://github.com/devlooped/GitInfo/releases/tag/v3.3.4

* FIx DiscordRPC ``SetActivity`` second request check issue

This caused a really rapid request from HomePage's CheckRunningGameInstance since it's requesting the same activity. Causing the RPC request flooded and makes DiscordRPC unresponsive.

* Update NuGet and ``CoCreateInstance``

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Revert "FIx DiscordRPC ``SetActivity`` second request check issue"

This reverts commit dbe2324.

* Update submodules

* (DiscordRPC) Allow trimming

* Protect some types/namespaces from ILTrim

* [skip ci] Sync translation Translate en_US.json in ja_JP

100% reviewed source file: 'en_US.json'
on 'ja_JP'.

* (CDN) Add GitLab mirror

* [skip ci] Qodana and Docs
- Fix outdated action on Qodana CI
- Ignore some licenses on license checker
- Add commit info for CommunityToolkit.Labs

* [skip ci] (Qodana) Revert using solution

* (CommunityTools) Add Enka.Network for HSR Glb

Requested by @kujou-kju via Discord

* [skip ci] (Qodana) Fix troublesome dependency check

Ignore dependency that doesn't have its license attached into it

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Force no trim on CLSCTX and HRESULT

Also fix formatting

* [skip ci] Sync translation Translate en_US.json in ja_JP

100% reviewed source file: 'en_US.json'
on 'ja_JP'.

* (CodeQA) Remove unused StartPostInstallVerification

* (CodeQA) Fix FieldModifier warnings

* (CodeQA) App.xaml

- Suppress invalid warnings
- Remove redundant declarations
- nulls

* (CodeQA) CachesManagement

* (CodeQA) Core submodule

For future reference, some property in ConfigV2Store might give a warning about it being unused, either in the getter, setter, or the property itself. DO NOT REMOVE IT

* (CodeQA) Game Settings Pages

* (CodeQA) Classes pt. 1

Also updated Qodana config and add abbreviations list

* UI Changes and Runtime Improvements (Part 1) (#406)

* Initial commit

* Update ``Hi3Helper.Http`` and usages

* Update SevenZipExtractor Submodule

* Reduce progress refresh interval to 33ms

* Switch to ``GetResizedBitmapNew`` for OOBE BG Image

* Adjustment for Honkai: Star Rail Delta Patch support

* Fix Preload box displaying wrong message

* [skip ci] Update README.md

* Bump version

* Localize Delta-Patch Pre-Req. Dialog

* Update Submodules

* Fix build error due to Hi3Helper.Http changes

* [skip ci] Sync translation Translate en_US.json in id_ID

100% reviewed source file: 'en_US.json'
on 'id_ID'.

* Update submodule

EncTool

* Update submodule

Fixed SR IFix "empty" issue

* Support GI `Dynamic Character Resolution`

* [Steam shortcuts] Small fixes  (#386)

- Fixes folders not being found if the steamID ended with an 0.
- Adds/improves some logging when searching for valid userdata folders
- Changes target exe/folder to the stub executable/folder

* Fix broken steamID check and better folder logging

* Change Steam executable path to stub

* Fix formatting issue and playtime not updating when using protocols

* Copy Game Icon to Steam grid folder

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* (HSR GSP) Adjust Model registry

* Enable Steam overlay + Note about usage (#391)

* Fix broken steamID check and better folder logging

* Change Steam executable path to stub

* Fix formatting issue and playtime not updating when using protocols

* Copy Game Icon to Steam grid folder

* Enable AllowOverlay

* Note about overlay use.

* Change default values for AllowOverlay and AllowDesktopConfig

* Move logger in TryDownloadToCompletenessAsync up

* [skip ci] Fix code formatting

RegionManagement.TryDownloadToCompletenessAsync

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Fix ``StartDeltaPatchPreReqDownload`` sequence

* Fix cancellation issue on single session download not working

* Reduce refresh interval to 33ms

* [HSR] Attempt on fixing unused file not getting deleted

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Recalculate non-client area size after changing window size

* (Discord RPC) Catch SEHException on Dispose

* Merge branch 'main' of https://github.com/CollapseLauncher/Collapse

* Installation Management and HSR Repair Improvements

Hi3Helper.Http
    - Avoid globally disposed cancellation token
    - Fix single session download doesn't receive cancellation

Collapse Launcher (Installation Management)
    - Fix intermitten cancellation issue due to Hi3Helper.Http threading and disposal issues
    - Removes unnecessary override of Flush() code on HonkaiInstall class
    - Revert back the refresh interval to 100ms

Collapse Launcher (Honkai: Star Rail - Repair)
    - Fix duplicate pkg_version entries causing the file assumed as an unused file
    - Fix the streaming file still being used if the newest one from persistent folder exists
    - Make the FileStream assignment for FileType: Blocks, Audio and Video to use FileShare.Read
    - Ignore file size check while using Fast Check mode on Repair
    - [NEW] Adding support for reading multiple installed voice languages on repair

[NEW] Collapse Launcher (Honkai: Star Rail - Installation Management & Delta Patch support)
    - Adding support for updating additional audio packages if more than one voice languages are installed
    - Delta-patch mechanism is now aware to download the required files before doing integrity check and patching process
        - You might be noticed if you need to download additional files, including delta update for voice language pack
    - Reduce overhead on assigning FilePropertiesRemote class by caching the CRC (Hash) properties

Note: This commit is worth almost 21 hours of debugging and code writing :terismash:

* Fix missing NuGet

* Fix static ``Enable/DisableNonClientArea()``

* Fix carousel doesn't show if the MenuPanels.articlePanel is null

* Force GC after loading and cropping the background image

* Relocate image files

* Changes on News Carousel

- Remove unused margin binding
- Use static margin on "No news" element
- Fix derpy typo on checking null

* First iteration of OOBE Navigation

- It's now only the transitional animation for icon and title text 🗿

* Add IAssetProperty to list Cache and Repair entries

* Replace old CommunityToolkit with the new ones

Now the Markdown and DataGrid component is being provided by the new CommunityToolkit (8.0.x), replacing the unmaintained one (7.1.3)

* Use compiled RegEx on ``AppActivation`` argument splitting

* Adding more local changes

- Renaming DataTable namespace to CommunityToolkit.WinUI.Controls.Labs.*
- Move GetResizedBitmapNew, Stream2BitmapImage and Stream2Bitmap static method from MainPage to ImageLoaderHelper
- Adding Recommended CDN Selection based on lowest latency
- Adding new Loading Message ribbon design
- Adding AnimationHelper extensions to enable explicit and implicit animation triggers
- Adding Intro sequence on OOBE
- Fixed ContentDialogCollapse theme inconsistencies while switching from Light to Dark Theme or Vice Versa in realtime
- Fixed Glyph Icon on ContentDialogCollapse doesn't show while using Warning, Error and Success theme
- Adding new AppImagesFolder in LauncherConfig

* Update NuGet

* Adjust Theme Color

* Fix ``NullReferenceException`` issue on retrying other CDN

* Use the new ``LoadingMessageHelper`` widely

* Remove unused folder

* Make Loading Msg separator invisible if title or subtitle is empty

* Reorder ContentDialog and TrayIcon XAML

* Remove unused ``RotationTransition`` on ``LoadingStatusGrid``

* Use hide offset for ``LoadingStatusGrid`` initially

* Update NuGet

* Fix Titlebar's Close button not able to get focused

+ Also fixing where the old titlebar area from MainPage would still takeover after it leaves

* Fix the LoadingFrame not being able to get hidden early

* Reenable StartUpMenu's MainUI transition

* Fix ``GetElementCornerRadius`` not returning 8px Radius on Normal type

* Startup Game Description style adjustment

* Fix Loading Action style and not showing bug

* Return ``IsInitializationError=true`` on ``TryGetURLStatus`` to avoid crash

* Adding cancellation action on ``Recommended CDN Check`` routine

* Make ``ApplyAgreementButton`` rounded

* Explicitly hide L:oading action button if ``HideLoadingFrame`` is called

* Fix crash on applying light theme on startup

* Adding + Updating necessary submodules to update with upstream

* [skip ci] (chore) Update versions

* [skip ci] Sync translation Translate en_US.json in ja_JP

100% reviewed source file: 'en_US.json'
on 'ja_JP'.

* Fix parsing for ```LastPlayTime``` in the Steam Shortcuts Parser  (#401)

* [SteamShortcutsParser] Fixes parsing of ```LastPlayTime```

should fix #400

https://gist.github.com/gablm/2a79355026bde51ac4f516d347fa1cd0 has a basic explanation of the shortcuts.vdf format. Hope it finds its way to anyone trying to decipher this file in the near future.

* Force parsing of 4 bytes for ```LastPlayTime``` and ```Appid```

there is a possibility of being a fix #400

* Fix redundancy

Makes Qodana happy

* [Feature] Pre-Launch and Post-Exit Commands Launching (#398)

* Update CsWinRT

This PR adds ability to run command before and after the game exits, values are saved to `CollapseSettings_Misc` registry on each region keys.

Command outputs recorded in the console, and it WILL NOT be interactable from the console. Also supports running GUI applications.

2.0.6 -> 2.0.7
https://github.com/microsoft/CsWinRT/releases/tag/2.0.7.240207.1

* (GSP) Move all GSPs into its own folder

Getting crowded up there on Pages main dir

* (GLC) Introduce GameLaunchCommand Backend

* Defer StarRail unnecesarry settings load on region load

* Avoid unnecessary UniversalGameSettings call on GameRunningWatcher

* (GLC) Introduce prototype in HSR GSP

* (GLC) Fix title

* (GLC) Backend Changes

- Rename PostLaunch to PostExit to better reflect the function
- Skip GLC if provided string is empty
- Change GLC console tag color to light red
- Adjust ErrorSender message
- Make consoleWidth and barwidth
available for private use
- Move `GAME STOPPED` bar into GameRunningWatcher
- Remove unused Window Restore inside ReadOutputLog (already available in GameRunningWatcher

* (GLC) Localization!

* (GLC) Frontends!

This also fixes warnings about OneWay bindings (WMC1506) for Genshin and StarRail GSPs by implementing INotifyPropertyChanged in the Ext

* (GLC) Fix main toggle margin and style

* (GSP) Fix HSR Character Quality selector

The enum is weird...

* (GSP) HSR: Disable VSync when selecting 120FPS

* Fix typos and CodeQA

* (GLC) Sanitize command for escape

Co-authored-by: Shatyuka <958182453@qq.com>

* Remove CsWinRT as its not needed anymore

Code generated is already on CoCreateInstance.cs

i forgor

* (GSP) HSR: Fix CharQual enum values

- Also renamed the enum name to avoid confusion
- Also clamped the values to avoid IndexOutOfRangeException

Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>

* [skip ci] (GSP) HSR: Adjust CharQ summary

* (GLC) Honkai: Fix panel not collapsing when disabled

---------

Co-authored-by: Shatyuka <958182453@qq.com>
Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Increase playtime accuracy  (#395)

* Use DateTime to calculate playtime

- Makes variable names more consistent
- Alters the way of how playtime is calculated

* Handle negative difference between dates

- New dialog about this problem
- Localization support for the dialog
- Localization support for the playtime display

* Avoid multiplying the same values twice

* Remove unnecessary loop to update the display

* Code Review changes

- Wrap Timer into a using statement.
- Reuse process found by GameBoost module

* Revert some changes and addition of @neon-nyan simplified process finder code

* (Discord RPC) Migrate to discord-rpc-csharp (#404)

* (Discord RPC) Migrate to discord-rpc-csharp

* (Discord RPC) Fix multi-thread issue caused by `CheckRunningGameInstance`

---------

Co-authored-by: Bagus Nur Listiyono <dzakibagus@gmail.com>
Co-authored-by: Ron Friedman <9833218+Cryotechnic@users.noreply.github.com>
Co-authored-by: Shatyuka <958182453@qq.com>

* [URL Protocol] Fix Discord Rich Presence not updating. (#403)

* Fix Discord Rich Presence not being updated in certain cases

fix #402

* Qodana

* (DiscordRPC) Do not trim assembly

for now

* Disable AUMID

* Update NuGets + Submodules

JSON 8.0.1 -> 8.0.2

GitInfo 3.3.3 ->3.3.4
https://github.com/devlooped/GitInfo/releases/tag/v3.3.4

* FIx DiscordRPC ``SetActivity`` second request check issue

This caused a really rapid request from HomePage's CheckRunningGameInstance since it's requesting the same activity. Causing the RPC request flooded and makes DiscordRPC unresponsive.

* Update NuGet and ``CoCreateInstance``

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* Update NuGet

* Fix missing namespace

* Bump version and remove unused ``TrimmableAssembly`` attribute

* Update Submodules

* Add (EN) remark to agreement menu's policy title

* Revert "FIx DiscordRPC ``SetActivity`` second request check issue"

This reverts commit dbe2324.

* Update submodules

* Set ``AddElementToStackPanel`` to use ``Panel`` instead of ``StackPanel``

* Localize OOBE strings

* Update submodules

* (DiscordRPC) Allow trimming

* Protect some types/namespaces from ILTrim

* Code quality and fix build

* Qodana code quality fix (attempt: 1)

* Qodana code quality fix (attempt: 2)

* Remove unused ``T1`` Generics on ``ProgressBase`` and Qodana fixes

this is the third attempt :yaebruh:

* Fix build issue :PaimonAngry_Milkman:

* Remove nullable assignment ``??``

* Ignore ``MS-NET-LIBRARY-2019-06`` license check in Qodana

* Bring back ``CheckDependencyLicenses``

* Revert Qodana config changes

* Adding latency check refresh button + Shrink Language flyout height

* Move OOBE from prototype folder

* [skip ci] Qodana and Docs
- Fix outdated action on Qodana CI
- Ignore some licenses on license checker
- Add commit info for CommunityToolkit.Labs

* CI trigger

* (Qodana) Revert using solution

* Fix OOBE page nc area

* Fix right-aligned ComboBox popup position

* Fix build error

* Fix text doesn't get wrapped by using Grid on entire container

* Adjust vertical ``FlipView`` style and ``NewAccentButtonStyle``

* Revert ``IsDeferredScrollingEnabled`` on ``FlipView``

* Change ``LoadingMessageHelper.SetMessage`` behavior

Also adding the docs.

* (CodeQA) Wrap long codes

Also suppress some NRE warnings

* Adjust UI based on reviews

* Set the Logo Text container size if the small size is applied

* Fix animation getting stopped while it's not yet completed

* Fix build error

* Fix some non-empty news category has mascot appeared

* [skip ci] Add Rider project icon

* [skip ci] Add Jetbrains Toolbox project icon

* Wait for CDN loading to complete before ending intro sequence

---------

Co-authored-by: Ron Friedman <9833218+Cryotechnic@users.noreply.github.com>
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Co-authored-by: Bagus Nur Listiyono <dzakibagus@gmail.com>
Co-authored-by: Shatyuka <958182453@qq.com>
Co-authored-by: Gabriel Lima <44784408+gablm@users.noreply.github.com>
Co-authored-by: Bagus Nur Listiyono <28079733+bagusnl@users.noreply.github.com>

* Localize image cropper window

* (CodeQA) Classes pt. 2

* (CodeQA) Classes pt. 3

pls check ;-;

* (CodeQA) Xaml Styler

* [skip ci] Sync translation Translate en_US.json in ja_JP

100% reviewed source file: 'en_US.json'
on 'ja_JP'.

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* Add ``TryGetAbsoluteToRelativeCDNURL`` to translate absolute CDN URL paths

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Adding fix for Senadina Delta-patch

+ Update Submodule

* [skip ci] Sync translation Translate en_US.json in de_DE [Manual Sync]

75% of minimum 70% reviewed source file: 'en_US.json'
on 'de_DE'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip ci] Sync translation Translate en_US.json in zh_TW [Manual Sync]

77% of minimum 70% reviewed source file: 'en_US.json'
on 'zh_TW'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip ci] Sync translation Translate en_US.json in ko_KR [Manual Sync]

78% of minimum 70% reviewed source file: 'en_US.json'
on 'ko_KR'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip ci] Sync translation Translate en_US.json in ru_RU [Manual Sync]

95% of minimum 70% reviewed source file: 'en_US.json'
on 'ru_RU'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip ci] Sync translation Translate en_US.json in pt_PT [Manual Sync]

92% of minimum 70% reviewed source file: 'en_US.json'
on 'pt_PT'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip ci] Sync translation Translate en_US.json in id_ID [Manual Sync]

94% of minimum 70% reviewed source file: 'en_US.json'
on 'id_ID'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip ci] Sync translation Translate en_US.json in vi_VN [Manual Sync]

84% of minimum 70% reviewed source file: 'en_US.json'
on 'vi_VN'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip ci] Sync translation Translate en_US.json in th_TH [Manual Sync]

82% of minimum 70% reviewed source file: 'en_US.json'
on 'th_TH'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip ci] Sync translation Translate en_US.json in uk_UA [Manual Sync]

100% reviewed source file: 'en_US.json'
on 'uk_UA'.

* [skip ci] Sync translation Translate en_US.json in fr_FR [Manual Sync]

95% of minimum 70% reviewed source file: 'en_US.json'
on 'fr_FR'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* [skip ci] Update SECURITY.md

* Senadina Repair/Delta/Cache Compatibility Fix by @neon-nyan (#408)

* Add ``CastAs<T>()`` extension to ``IGameVersionCheck``

* Adding initial adjustment

* Implement Identifier getter

* Add temporary fix for Delta-patch

* Adjust changes based on Senadina changes

+ We are now using our backend service to provide information needed for repair process.

* Remove test codes

* Fix unexpected size and wrong file selected on CG

* ISTG, SHAAAPPHHH

+ Fix corresponding path for the language based CG

* Use new OOBE UI widely and fix some issue

* Ignore ``FBData`` on cache check

* (Qodana) Ignore "ThisAssembly.Constants" license check

Why does it suddenly lost its license file? i dunno

* (CodeQA) Fix problems in ProgressBase and HonkaiRepair::Fetch

---------

Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Lima <44784408+gablm@users.noreply.github.com>
Co-authored-by: Shatyuka <958182453@qq.com>
Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>
Co-authored-by: Ron Friedman <9833218+Cryotechnic@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: "Add to Steam" removing user's added non-Steam games
3 participants