itch.iohttp://itch.iohttps://itch.io/t/4025112/advsavehandler-small-tweak-for-better-linux-compatibilityAdvSaveHandler: Small tweak for better Linux compatibilityhttps://itch.io/t/4025112/advsavehandler-small-tweak-for-better-linux-compatibilityMon, 19 Aug 2024 23:49:18 GMTMon, 19 Aug 2024 23:49:18 GMTFri, 25 Jul 2025 08:09:23 GMTHello!

I am using the AdvSaveHandler plugin in conjunction with the CLI cook tool for my game Foxblade Fable, which I distribute via Itch.IO.

I primarily work on Linux, and I noticed that on Linux when launching a game from a Flatpak version of Itch.IO, rather than putting the save folder in the user's home directory Flatpak will instead redirect those paths to a temp directory (at least by default - you can manually grant home directory permissions to the Itch.IO app, but frankly I would prefer my game run out of the box without nasty surprises like losing save data)

To improve this, I ended up tweaking AdvSaveHandler myself to support the XDG base directory specification - it's an extremely simple change: instead of just using the home directory, it will instead use $XDG_DATA_HOME, or fall back to $HOME/.local/share otherwise (which the spec defines as an appropriate default for $XDG_DATA_HOME).  The change looks like this:

if (process.platform == "linux") {
    home = process.env.XDG_DATA_HOME || path.join(systeminternals.homedir(), ".local", "share");
}

Now when launching on Linux, it will either put its folder in ~/.local/share, or it will put it wherever $XDG_DATA_HOME is defined (when running under Flatpak Itch.IO for example, the save game folder is put in ~/.var/app/io.itch.itch/data)

]]>
https://itch.io/t/3243399/a-more-flexible-design-for-protecting-source-codeA more flexible design for protecting source code.https://itch.io/t/3243399/a-more-flexible-design-for-protecting-source-codeFri, 27 Oct 2023 04:50:55 GMTFri, 27 Oct 2023 04:50:55 GMTFri, 25 Jul 2025 08:07:42 GMTI hope plugin. js (this file is used to describe the loading of plug-ins in the game) is still unencrypted, which means that the MOD is allowed to exist while protecting the source code.

]]>