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

using Javascript on a browser causes local saving problems. #25

Open
ghost opened this issue Jan 13, 2016 · 5 comments
Open

using Javascript on a browser causes local saving problems. #25

ghost opened this issue Jan 13, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Jan 13, 2016

Due to internet security, Javascript is not allowed to save a file to the users system (could be a virus). The only way I can find to allow local saving is using a browsers "localStorage". The problem with this is that the file is stored in a rather hard to get to area and don't get me started on ipads either. Any kind of mobile device would be a monster to deal with.

Basically local saving is kind of spotty

@ephemerant
Copy link
Owner

I think you're overcomplicating localStorage.

See here for an example.

@ghost
Copy link
Author

ghost commented Jan 14, 2016

That's fine if you just want a short-lived temp save.

The problem is that localStorage is not permanent. If we wanted data that existed between plays there is a chance that the data would be gone.

@ghost
Copy link
Author

ghost commented Jan 14, 2016

In the way of creating an actual save file, this looks promising.
here

@ephemerant
Copy link
Owner

With that, you wouldn't be able to automatically load a file. Browsers have a lot of security restrictions. That's why, pretty much, either localStorage or an actual server is the way to go.

Firebase offers free "server" options for apps of our overhead. I'm using it right now for work -- it's pretty solid.

We could also export the game to a JavaScript desktop framework such as Electron. With that, you would have access to the file system.

@ghost
Copy link
Author

ghost commented Jan 14, 2016

Autoloading would be nice but I do not like the idea of storing save files on a server.

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

No branches or pull requests

1 participant