Hello I'm creating a HTML5/CSS3/javascript card game which interacts with a node.js server and I used socket.io as the transport layer between the server and the client.
I want to save the state of the HTML page after jQuery modifications (a card is dealt or drawn, players connected...) in the server, so when the player disconnect and reconnect the server give him the saved state and he can see the state of the page as he left, or if the player disconnects another player can take his place.
So any mechanism on how to save game state with jQuery modifications will be so much appreciated. I've searched a lot but I don't seem to find a solution.
you will probably want to store your state in some sort of js object maybe something like this
var state = {
hand: [
"4H",
"7D",
"3S"
],
money: 1000
}
where the 1H would be the 4 of Hearts then you can easily store this on your back end as well as in a cookie or WebSQL or something. Hope this helps!