Skip to content
Sign upLog in
← Back to Community

Saving Data

Profile icon
DisclaimedGoat

So I am making a game, and although it is not needed, I would prefer to save the player's data. The problem isn't that I don't know how to accomplish this, but is it possible using repl?

My guess is that this website is client based on the browser, so even if I do save a file, it won't stay in existence once the player loses connection. So, to get to the point, is it possible to save data and is my guess even correct?

Thanks

Voters
Profile icon
DisclaimedGoat
Comments
hotnewtop
Profile icon
[deleted]

To my knowledge repls are run on servers. We just see the results via the browser, so yes if you write data to a file in your repl it should be still there when you login again.

Profile icon
DisclaimedGoat

@malvoliothegood
I think I understand what you are saying, and, yes, I agree. However, what I want to do it distribute the URL of the page that is just the terminal. So in my case the URL for this repl is: https://crafting-game.disclaimedgoat.repl.run/

So here is where I see the problem- once this terminal looses connection, and you need to "run again" the program. I think here is the issue, becaue I think that the previous files are copied over.
So I guess a better question would be: Is there a way to distribute a terminal environment (preferably by URL) while still able to save the data? I don't necessarily want people to see my code, but if that's not the case, then so be it lol.

Profile icon
[deleted]

@DisclaimedGoat
I see what you are getting at. Looks like you need a full stack environment that is always on.