I'd like to create a save system that distinguishes whether the player is playing online on a browser (example : on itch.io) or in "desktop mode" (using the nw.exe).
- Player is online ==> I'm saving using the LocalStorage Plugin
- Player is on desktop-mode ==> I'm saving using the NWjs Plugin to write a simple text file.
The goal is to protect the desktop player from losing all his save data after using Ccleaner or another tool of this kind. I find this more comforting. I just save strings of text, so nothing big.
My question is : how do I detect if the player is playing on a web-browser or in desktop-mode ?
I thought I could use the Browser plugin to get data on the player's session (example : Browser.Name, Brower.Platform, etc...) but it doesn't seem to work as I'd like it to. The data doesn't look useful in this case. For example, running the game in preview mode on Firefox and on NWjs, Browser.Name is always "Netscape" and Browser.Platform "Win32".
Can someone kindly tell me where to look for ? =)
Thanks a bunch !