I need mrangel to slap me.

@mrangel

I need to be shoved in the right direction.

I have a game running on an ASP.NET server, but there is no save feature because not logged into this site on that server (of course).

I found the code in player.js with AJAX using this site as the url to save a game. It seems like I remember you (mrangel) posting about the way you'd handle saving a game to local storage (or something like that?), except the Quest desktop doesn't interact with local storage.

Well, I'm currently working outside of the constraints of the desktop version, but I can't find that post for the life of me. Am I imagining that post?

NOTE: I don't even want to host a game on a private server. It's just that someone asks how to do so once or twice a year, and I was bored, and I learned (with help) to get a game running on smarterASP as well as in Windows Server, but saving doesn't work, and that sucks, and sorry about the run-on sentence.


https://textadventures.co.uk/forum/quest/topic/u59xp2igwkc0wjmefwonkq/hosting-a-quest-5-game-on-an-asp-net-server


I think I just need to learn how AJAX works.

Any help would be greatly appreciated! (I'm not requesting details, just the general sort of stuff I need to know about AJAX and/or whatever pertains to this.)


I don't know where that post is; I often lose track of which thread has which answers in.

I would have expected that saving would be included in the existing server code, so you would just have to change the apiRoot URL at the top of WebPlayer/player.js … I can't really look into that further, because I don't know ASP at all.

My LocalStorage suggestion was for an in-game save system, which means that the UI initialisation script would be responsible for grabbing your save state out of localstorage and sending it to the server, where a function would then decode it and restore that state. This would be quite inefficient, and would need to be implemented into each game; it could be added to most of my games, but there are some cases it couldn't handle (for example, it can't deal with firsttime scripts, and the save function would need to be manually modified in the case of any game that creates objects from a type)


you would just have to change the apiRoot URL at the top of WebPlayer/player.jsf

That was the first thing I tried. It didn't even change the value of apiRoot.

Anyway, this tells me that I'm looking into the same thing you'd look into. So, that means I'm probably on the right track!

My LocalStorage suggestion was for an in-game save system, [ . . . ] This would be quite inefficient, and would need to be implemented into each game

Ah. That wouldn't really apply to what I'm trying to do (as I'm sure you already know).


I don't know ASP at all.

I gotcha.

You reply helped me more than you know. You pointed at what I was looking at, so I'm on the right track.

Thank you!


It didn't even change the value of apiRoot.

Ah, looks like that variable is overwritten by the value of the BaseURI value from the application's configuration file (wherever that is), or "http://textadventures.co.uk/" if it's not set. This default is unfortunately hardcoded in half a dozen different places; but I assume that changing the configuration file should help.


Can I slap you??


You already did, XM.

You already did.


Log in to post a reply.

Support

Forums