xarn wrote:
Basically, I've not the slightest idea how this is meant to work, especially about the networking.
It works the same way as any other website (web application) does and the way browsers work, using a stateless protocol. Servers and clients are only connected for the time it takes to transfer information and then they forget about one another.
xarn wrote:
So, let's say player A moves a card. How exactly will player B be notified of this?
I understand that you can call an URL when player A makes an action to notify the server ...but how will the server notify player B?
A web server never, ever, notifies a client. It is the client that, from time to time, asks for more data and it's always the client that starts the connection, the server doesn't even know that clients exist.
So in the scenario you mentioned would go, roughly like the following:
1) player A moves the card and when finished tells the server where the new card position is;
2) the server updates its game state to place the card in another position;
3) when player B requests updates, the server sends all the updates that were made after the last update call;
4) player B's browser updates its interface to reflect any received change;
xarn wrote:
Do you plan to make some continuous polling of the server to check if there were changes?
That's the all ideia behind AJAX
, not the continuous part, but being able to request information to the server without reloading the all page. The clients will just have a function executed every few seconds that will ask the server for game state updates.
Again, this is the basis for HTTP communication and the way browsers and web servers work.
Rejoice! For very bad things are about to happen.